diff --git a/UPGRADE b/UPGRADE index e2960a4d..0e36cfe0 100644 --- a/UPGRADE +++ b/UPGRADE @@ -464,6 +464,11 @@ OTHER CHANGES: 109. Added the add-a-new-lead link to the admin interface +110. Added ability for an agent to search for a lead in the agent interface + while paused. This feature can be enabled per campaign and per user. + Searches can optionally be restricted to campaign lists or only one + list. All search queries are logged. + diff --git a/bin/ADMIN_archive_log_tables.pl b/bin/ADMIN_archive_log_tables.pl index e335ebb8..25f02273 100644 --- a/bin/ADMIN_archive_log_tables.pl +++ b/bin/ADMIN_archive_log_tables.pl @@ -20,7 +20,7 @@ # Based on perl scripts in ViciDial from Matt Florell and post: # http://www.vicidial.org/VICIDIALforum/viewtopic.php?p=22506&sid=ca5347cffa6f6382f56ce3db9fb3d068#22506 # -# Copyright (C) 2010 I. Taushanov, Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 I. Taushanov, Matt Florell LICENSE: AGPLv2 # # CHANGES # 90615-1701 - First version @@ -28,6 +28,7 @@ # 100103-2052 - Formatting fixes, name change, added initial table counts and added archive tables to official SQL files # 100109-1018 - Added vicidial_carrier_log archiving # 100328-1008 - Added --months CLI option +# 110218-1200 - Added notes and search log archiving # ### begin parsing run-time options ### @@ -97,7 +98,8 @@ $del_time = "$year-$mon-$mday 01:00:00"; if (!$Q) {print "\n\n-- ADMIN_archive_log_tables.pl --\n\n";} if (!$Q) {print "This program is designed to put all records from call_log, vicidial_log,\n";} -if (!$Q) {print "server_performance, vicidial_agent_log and vicidial_carrier_log in relevant\n";} +if (!$Q) {print "server_performance, vicidial_agent_log, vicidial_carrier_log, \n";} +if (!$Q) {print "vicidial_call_notes and vicidial_lead_search_log in relevant\n";} if (!$Q) {print "_archive tables and delete records in original tables older than\n";} if (!$Q) {print "$CLImonths months ( $del_time ) from current date \n\n";} @@ -382,6 +384,108 @@ if (!$T) } + + ##### vicidial_call_notes + $stmtA = "SELECT count(*) from vicidial_call_notes;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_call_notes_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_call_notes_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_call_notes_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_call_notes table... ($vicidial_call_notes_count|$vicidial_call_notes_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_call_notes_archive SELECT * from vicidial_call_notes;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows inserted into vicidial_call_notes_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_call_notes WHERE call_date < '$del_time';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows deleted from vicidial_call_notes table \n";} + + $stmtA = "optimize table vicidial_call_notes;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table vicidial_call_notes_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + + + ##### vicidial_lead_search_log + $stmtA = "SELECT count(*) from vicidial_lead_search_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_lead_search_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_lead_search_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vicidial_lead_search_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_lead_search_log table... ($vicidial_lead_search_log_count|$vicidial_lead_search_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_lead_search_log_archive SELECT * from vicidial_lead_search_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows inserted into vicidial_lead_search_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + $stmtA = "DELETE FROM vicidial_lead_search_log WHERE event_date < '$del_time';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows = $sthA->rows; + if (!$Q) {print "$sthArows rows deleted from vicidial_lead_search_log table \n";} + + $stmtA = "optimize table vicidial_lead_search_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table vicidial_lead_search_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + #$dbhA->disconnect(); #print "$del_time\n\n"; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 97453a58..701a8db7 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -564,7 +564,8 @@ callcard_admin ENUM('1','0') default '0', agent_choose_blended ENUM('0','1') default '1', realtime_block_user_info ENUM('0','1') default '0', custom_fields_modify ENUM('0','1') default '0', -force_change_password ENUM('Y','N') default 'N' +force_change_password ENUM('Y','N') default 'N', +agent_lead_search_override ENUM('NOT_ACTIVE','ENABLED','DISABLED') default 'NOT_ACTIVE' ); CREATE UNIQUE INDEX user ON vicidial_users (user); @@ -785,7 +786,9 @@ display_leads_count ENUM('Y','N') default 'N', lead_order_randomize ENUM('Y','N') default 'N', lead_order_secondary ENUM('LEAD_ASCEND','LEAD_DESCEND','CALLTIME_ASCEND','CALLTIME_DESCEND') default 'LEAD_ASCEND', per_call_notes ENUM('ENABLED','DISABLED') default 'DISABLED', -my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED' +my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED', +agent_lead_search ENUM('ENABLED','DISABLED') default 'DISABLED', +agent_lead_search_method ENUM('SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST') default 'CAMPLISTS_ALL' ); CREATE TABLE vicidial_lists ( @@ -2276,6 +2279,18 @@ external_dial VARCHAR(100) default '', index (user) ); +CREATE TABLE vicidial_lead_search_log ( +search_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +user VARCHAR(20) NOT NULL, +event_date DATETIME NOT NULL, +source VARCHAR(10) default '', +search_query TEXT, +results INT(9) UNSIGNED default '0', +seconds MEDIUMINT(7) UNSIGNED default '0', +index (user), +index (event_date) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2422,7 +2437,10 @@ CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log; CREATE TABLE vicidial_call_notes_archive LIKE vicidial_call_notes; ALTER TABLE vicidial_call_notes_archive MODIFY notesid INT(9) UNSIGNED NOT NULL; -UPDATE system_settings SET db_schema_version='1260',db_schema_update_date=NOW(); +CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log; +ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL; + +UPDATE system_settings SET db_schema_version='1261',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.4.sql b/extras/upgrade_2.4.sql index b6d181fc..e947d790 100644 --- a/extras/upgrade_2.4.sql +++ b/extras/upgrade_2.4.sql @@ -663,3 +663,26 @@ ALTER TABLE vicidial_campaigns ADD per_call_notes ENUM('ENABLED','DISABLED') def ALTER TABLE vicidial_campaigns ADD my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED'; UPDATE system_settings SET db_schema_version='1260',db_schema_update_date=NOW(); + +ALTER TABLE vicidial_campaigns ADD agent_lead_search ENUM('ENABLED','DISABLED') default 'DISABLED'; +ALTER TABLE vicidial_campaigns MODIFY agent_lead_search_method ENUM('SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST') default 'CAMPLISTS_ALL'; + +ALTER TABLE vicidial_users ADD agent_lead_search_override ENUM('NOT_ACTIVE','ENABLED','DISABLED') default 'NOT_ACTIVE'; + +CREATE TABLE vicidial_lead_search_log ( +search_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +user VARCHAR(20) NOT NULL, +event_date DATETIME NOT NULL, +source VARCHAR(10) default '', +search_query TEXT, +results INT(9) UNSIGNED default '0', +seconds MEDIUMINT(7) UNSIGNED default '0', +index (user), +index (event_date) +); + +CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log; +ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL; + +UPDATE system_settings SET db_schema_version='1261',db_schema_update_date=NOW(); + diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 38e4bf1d..d0e43292 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -514,6 +514,13 @@ If List Order Randomize is enabled, this option will be ignored|| ERROR: Lead not added, please go back and look at what you entered|| Lead has been added|| Add A New Lead|| +Agent Lead Search Override|| +This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE|| +Agent Lead Search|| +Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED|| +Agent Lead Search Method|| +If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL|| +LEAD SEARCHES FOR THIS TIME PERIOD|| AST_LISTS_campaign_stats.php @@ -542,6 +549,20 @@ view notes|| CALL NOTES LOG|| Close Call Notes|| CALL LOG FOR THIS LEAD|| +SEARCH FOR A LEAD|| +SEARCH RESULTS|| +YOU MUST BE PAUSED TO SEARCH FOR A LEAD|| +Notes: when doing a search for a lead, the phone number, lead ID or|| +are the best fields to use|| +Using the other fields may be slower. Lead searching does not allow for wildcard or partial search terms|| +Lead search requests are all logged in the system|| +Main Phone Number|| +Alternate Phone Number|| +Address3 Phone Number|| +No results found|| +Results Found:|| +No calls found|| +reset form|| ############################################################ MANAGER Manual diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index c92904b4..eb18b9dc 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -272,12 +272,13 @@ # 110212-2103 - Added support for custom scheduled callback statuses # 110214-2320 - Added support for lead_order_secondary option # 110215-1125 - Added support for call_notes +# 110218-1519 - Added support for agent lead search # -$version = '2.4-177'; -$build = '110215-1125'; +$version = '2.4-178'; +$build = '110218-1519'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=365; +$mysql_log_count=385; $one_mysql_log=0; require("dbconnect.php"); @@ -470,6 +471,8 @@ if (isset($_GET["CallBackLeadStatus"])) {$CallBackLeadStatus=$_GET["CallBackL elseif (isset($_POST["CallBackLeadStatus"])) {$CallBackLeadStatus=$_POST["CallBackLeadStatus"];} if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} +if (isset($_GET["search"])) {$search=$_GET["search"];} + elseif (isset($_POST["search"])) {$search=$_POST["search"];} header ("Content-type: text/html; charset=utf-8"); @@ -1144,7 +1147,9 @@ if ($ACTION == 'manDiaLnextCaLL') { $MT[0]=''; $row=''; $rowx=''; + $override_dial_number=''; $channel_live=1; + $lead_id = ereg_replace("[^0-9]","",$lead_id); if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) { $channel_live=0; @@ -1195,6 +1200,15 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);} } + ### check if this is a specific lead call, if it is, skip the grabbing of a new lead + elseif (strlen($lead_id)>0) + { + $affected_rows=1; + $CBleadIDset=1; + + if (strlen($phone_number) > 5) + {$override_dial_number = $phone_number;} + } else { if (strlen($phone_number)>3) @@ -1997,6 +2011,13 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + if ( (strlen($agent_dialed_type) < 3) or (strlen($agent_dialed_number) < 6) ) + { + $agent_dialed_number = $phone_number; + if (strlen($agent_dialed_type) < 3) + {$agent_dialed_type = 'MAIN';} + } + ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); @@ -2020,7 +2041,7 @@ if ($ACTION == 'manDiaLnextCaLL') # DATETIME|campaign|lead_id|phone_number|user|type # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M $fp = fopen ("./xfer_log.txt", "a"); - fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID||$province\n"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$agent_dialed_number|$user|M|$MqueryCID||$province\n"); fclose($fp); } @@ -2033,7 +2054,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00366',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -2045,7 +2066,7 @@ if ($ACTION == 'manDiaLnextCaLL') { $stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00367',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -2197,9 +2218,9 @@ if ($ACTION == 'manDiaLnextCaLL') ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) - {$Ndialstring = "$Local_out_prefix$phone_number";} + {$Ndialstring = "$Local_out_prefix$agent_dialed_number";} else - {$Ndialstring = "$Local_out_prefix$phone_code$phone_number";} + {$Ndialstring = "$Local_out_prefix$phone_code$agent_dialed_number";} if ( ($usegroupalias > 0) and (strlen($account)>1) ) { @@ -2217,7 +2238,7 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);} - $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')"; + $stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$agent_dialed_number','$NOW_TIME','OUT')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2279,7 +2300,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($agent_dialed_number > 0) { - $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$agent_dialed_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2317,7 +2338,7 @@ if ($ACTION == 'manDiaLnextCaLL') $affected_rows = mysql_affected_rows($linkB); # CALLOUTBOUND (formerly ENTERQUEUE) - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$phone_number',serverid='$queuemetrics_log_id';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2485,8 +2506,8 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcallback_time . "\n"; $LeaD_InfO .= $CBuser . "\n"; $LeaD_InfO .= $CBcomments . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $agent_dialed_number . "\n"; + $LeaD_InfO .= $agent_dialed_type . "\n"; $LeaD_InfO .= $source_id . "\n"; $LeaD_InfO .= $rank . "\n"; $LeaD_InfO .= $owner . "\n"; @@ -4355,7 +4376,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00368',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -4367,7 +4388,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00369',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -5073,7 +5094,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00370',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -5085,7 +5106,7 @@ if ($ACTION == 'VDADcheckINCOMING') { $stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';"; $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00371',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $cb_record_ct = mysql_num_rows($rslt); if ($cb_record_ct > 0) @@ -5965,7 +5986,7 @@ if ($ACTION == 'updateDISPO') $stmt = "SELECT campaign_id,closecallid from vicidial_closer_log where uniqueid='$uniqueid' and user='$user' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00372',$user,$server_ip,$session_name,$one_mysql_log);} $VDCL_cn_ct = mysql_num_rows($rslt); if ($VDCL_cn_ct > 0) { @@ -5980,7 +6001,7 @@ if ($ACTION == 'updateDISPO') $stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$NOW_TIME',call_notes='" . mysql_real_escape_string($call_notes) . "';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00373',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysql_affected_rows($link); $notesid = mysql_insert_id($link); } @@ -7923,7 +7944,7 @@ if ($ACTION == 'CALLLOGview') echo " $ALLalt_dial[$i] \n"; echo " $ALLhangup_reason[$i] \n"; echo " INFO \n"; - echo " DIAL \n"; + echo " DIAL \n"; echo "\n"; } @@ -7934,6 +7955,286 @@ if ($ACTION == 'CALLLOGview') } +################################################################################ +### SEARCHRESULTSview - display search results for lead search +################################################################################ +if ($ACTION == 'SEARCHRESULTSview') + { + if (strlen($stage) < 3) + {$stage = '670';} + + $stmt="select agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00374',$user,$server_ip,$session_name,$one_mysql_log);} + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + if ($camps_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $agent_lead_search_method = $row[0]; + $manual_dial_list_id = $row[1]; + + $searchSQL=''; + $searchmethodSQL=''; + + $lead_id=ereg_replace("[^0-9]","",$lead_id); + $vendor_lead_code = ereg_replace("'|\"|\\\\|;","",$vendor_lead_code); + $last_name = ereg_replace("'|\"|\\\\|;","",$last_name); + $first_name = ereg_replace("'|\"|\\\\|;","",$first_name); + $city = ereg_replace("'|\"|\\\\|;","",$city); + $state = ereg_replace("'|\"|\\\\|;","",$state); + $postal_code = ereg_replace("'|\"|\\\\|;","",$postal_code); + + if (strlen($lead_id) > 0) + { + ### lead ID entered, search by this + $searchSQL = "lead_id='$lead_id'"; + } + elseif (strlen($vendor_lead_code) > 0) + { + ### vendor ID entered, search by this + $searchSQL = "vendor_lead_code='$vendor_lead_code'"; + } + elseif ( (strlen($phone_number) >= 6) and (strlen($search) > 2) ) + { + ### phone number entered, search by this + if (preg_match('/MAIN/',$search)) + {$searchSQL = "phone_number='$phone_number'";} + if (preg_match('/ALT/',$search)) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " or ";} + $searchSQL .= "alt_phone='$phone_number'"; + } + if (preg_match('/ADDR3/',$search)) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " or ";} + $searchSQL .= "address3='$phone_number'"; + } + } + elseif (strlen($last_name) > 0) + { + ### last name entered, search by this and other fields + $searchSQL = "last_name='$last_name'"; + if (strlen($first_name) > 0) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " and ";} + $searchSQL .= "first_name='$first_name'"; + } + if (strlen($city) > 0) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " and ";} + $searchSQL .= "city='$city'"; + } + if (strlen($state) > 0) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " and ";} + $searchSQL .= "state='$state'"; + } + if (strlen($postal_code) > 0) + { + if (strlen($searchSQL) > 10) + {$searchSQL .= " and ";} + $searchSQL .= "postal_code='$postal_code'"; + } + } + else + { + echo "ERROR: You must enter in search terms, one of these must be populated: lead ID, vendor ID, phone number, last name\n"; + echo "

"; + echo "Go Back"; + echo ""; + exit; + } + + ### limit results to specified search method + # 'SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST' + if ($agent_lead_search_method == 'SYSTEM') + {$searchmethodSQL='';} + if ($agent_lead_search_method == 'LIST') + {$searchmethodSQL=" and list_id='$manual_dial_list_id'";} + if ($agent_lead_search_method == 'CAMPLISTS_ALL') + { + $stmt="SELECT list_id from vicidial_lists where campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00375',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + $searchmethodSQL=" and list_id IN($camp_lists)"; + } + if ($agent_lead_search_method == 'CAMPAIGNLISTS') + { + $stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign' and active='Y';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00376',$user,$server_ip,$session_name,$one_mysql_log);} + $lists_to_parse = mysql_num_rows($rslt); + $camp_lists=''; + $o=0; + while ($lists_to_parse > $o) + { + $rowx=mysql_fetch_row($rslt); + $camp_lists .= "'$rowx[0]',"; + $o++; + } + $camp_lists = eregi_replace(".$","",$camp_lists); + $searchmethodSQL=" and list_id IN($camp_lists)"; + } + + + ##### BEGIN search queries and output ##### + $stmt="select count(*) from vicidial_list where $searchSQL $searchmethodSQL;"; + + ### LOG INSERTION Search Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$user', source='agent', results='0', search_query=\"$SQL_log\";"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00377',$user,$server_ip,$session_name,$one_mysql_log);} + $search_log_id = mysql_insert_id($link); + + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00378',$user,$server_ip,$session_name,$one_mysql_log);} + $counts_to_print = mysql_num_rows($rslt); + if ($counts_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $search_result_count = $row[0]; + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $StarTtime); + + $stmtL="UPDATE vicidial_lead_search_log set results='$search_result_count',seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00379',$user,$server_ip,$session_name,$one_mysql_log);} + + + echo "
\n"; + echo ""; + echo "Results Found: $search_result_count"; + echo "\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if ($search_result_count) + { + $stmt="select first_name,last_name,phone_code,phone_number,status,last_local_call_time,lead_id,city,state,postal_code from vicidial_list where $searchSQL $searchmethodSQL order by last_local_call_time desc limit 1000;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00380',$user,$server_ip,$session_name,$one_mysql_log);} + $out_logs_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} + + $g=0; + $u=0; + while ($out_logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLname[$g] = "$row[0] $row[1]"; + $ALLphone_code[$g] = $row[2]; + $ALLphone_number[$g] = $row[3]; + $ALLstatus[$g] = $row[4]; + $ALLcall_date[$g] = $row[5]; + $ALLlead_id[$g] = $row[6]; + $ALLcity[$g] = $row[7]; + $ALLstate[$g] = $row[8]; + $ALLpostal_code[$g] = $row[9]; + + $g++; + $u++; + } + + if ($g < 1) + {echo "";} + + $u=0; + while ($g > $u) + { + $sort_split = explode("-----",$ALLsort[$u]); + $i = $sort_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + $end_process_time = date("U"); + $search_seconds = ($end_process_time - $StarTtime); + + $stmtL="UPDATE vicidial_lead_search_log set seconds='$search_seconds' where search_log_id='$search_log_id';"; + if ($DB) {echo "|$stmtL|\n";} + $rslt=mysql_query($stmtL, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00381',$user,$server_ip,$session_name,$one_mysql_log);} + } + else + {echo "";} + + echo "
  #     NAME     PHONE     STATUS     LAST CALL     CITY     STATE     ZIP     INFO     DIAL  
No results found
$u$ALLname[$i] $ALLphone_code[$i] $ALLphone_number[$i] $ALLstatus[$i] $ALLcall_date[$i] $ALLcity[$i] $ALLstate[$i] $ALLpostal_code[$i] INFO DIAL
No results found
"; + echo "
"; + echo "Go Back"; + echo "
"; + } + else + { + echo "ERROR: There was a problem with your search terms\n"; + echo "

"; + echo "Go Back"; + echo ""; + exit; + } + ##### END search queries and output ##### + } + else + { + echo "ERROR: Campaign not found\n"; + echo "

"; + echo "Go Back"; + echo ""; + exit; + } + } + + ################################################################################ ### LEADINFOview - display the information for a lead ################################################################################ @@ -7996,7 +8297,7 @@ if ($ACTION == 'LEADINFOview') $info_to_print = mysql_num_rows($rslt); if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} - if ($info_to_print > 0) + if ($info_to_print > 0) { $row=mysql_fetch_row($rslt); echo "Status:   $row[0]"; @@ -8005,7 +8306,7 @@ if ($ACTION == 'LEADINFOview') echo "Timezone:   $row[3]"; echo "Called Since Last Reset:   $row[4]"; echo "$label_phone_code:   $row[5]"; - echo "$label_phone_number:   $row[6] -         DIAL"; + echo "$label_phone_number:   $row[6] -         DIAL"; echo "$label_title:   $row[7]"; echo "$label_first_name:   $row[8]"; echo "$label_middle_initial:   $row[9]"; @@ -8019,7 +8320,7 @@ if ($ACTION == 'LEADINFOview') echo "$label_postal_code:   $row[17]"; echo "Country:   $row[18]"; echo "$label_gender:   $row[19]"; - echo "$label_alt_phone:   $row[20] -         DIAL"; + echo "$label_alt_phone:   $row[20] -         DIAL"; echo "$label_email:   $row[21]"; echo "$label_security_phrase:   $row[22]"; echo "$label_comments:   $row[23]"; @@ -8028,6 +8329,64 @@ if ($ACTION == 'LEADINFOview') # echo "Rank:   $row[26]"; # echo "Owner:   $row[27]"; # echo "Entry List ID:   $row[28]"; + + $entry_list_id = $row[28]; + $CFoutput=''; + $stmt="SHOW TABLES LIKE \"custom_$entry_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00382',$user,$server_ip,$session_name,$one_mysql_log);} + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from custom_$entry_list_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00383',$user,$server_ip,$session_name,$one_mysql_log);} + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $select_SQL=''; + $stmt="SHOW COLUMNS FROM custom_$entry_list_id where Field != 'lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00384',$user,$server_ip,$session_name,$one_mysql_log);} + $fields_to_print = mysql_num_rows($rslt); + $select_SQL=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $select_SQL .= "$rowx[0],"; + $A_field_name[$o] = $rowx[0]; + $o++; + } + $select_SQL = preg_replace("/.$/",'',$select_SQL); + if (strlen($select_SQL) > 0) + { + $stmt="SELECT $select_SQL FROM custom_$entry_list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00385',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysql_fetch_row($rslt); + $o=0; + while ($fields_to_print > $o) + { + $A_field_value = trim("$row[$o]"); + + echo "$A_field_name[$o]:   $A_field_value"; + + $o++; + } + } + } + } + } } echo ""; @@ -8107,6 +8466,178 @@ if ($ACTION == 'LEADINFOview') $in_logs_to_print = mysql_num_rows($rslt); if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";} + $u=0; + while ($in_logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = ($row[3] - $row[9]); + if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;} + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLuniqueid[$g] = $row[10]; + $ALLclosecallid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLalt_dial[$g] = "MAIN"; + $ALLin_out[$g] = "IN"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $in_notes_to_print = mysql_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $users_to_print = mysql_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + + $g++; + $u++; + } + + if ($g > 0) + {sort($ALLsort, SORT_NUMERIC);} + else + {echo "No calls found";} + + $u=0; + while ($g > $u) + { + $sort_split = explode("-----",$ALLsort[$u]); + $i = $sort_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo "$u"; + echo "$ALLcall_date[$i]"; + echo " $ALLuser[$i]\n"; + echo " $ALLlength_in_sec[$i]\n"; + echo " $ALLstatus[$i]\n"; + echo " $ALLphone_code[$i] $ALLphone_number[$i] \n"; + echo " $ALLcampaign_id[$i] \n"; + echo " $ALLin_out[$i] \n"; + echo " $ALLalt_dial[$i] \n"; + echo " $ALLhangup_reason[$i] \n"; + echo ""; + echo ""; + echo " $Allcall_notes[$i] "; + echo "\n"; + } + + echo ""; + echo "
"; + + echo "Close Info Box"; + echo ""; + } + } + + +################################################################################ +### CALLNOTESview - display all notes for a specific lead +################################################################################ +if ($ACTION == 'CALLNOTESview') + { + if (strlen($stage) < 3) + {$stage = '670';} + + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +# echo ""; +# echo ""; + echo ""; + + if (strlen($lead_id) > 0) + { + $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $out_logs_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} + + $g=0; + $u=0; + while ($out_logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = $row[3]; + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLalt_dial[$g] = $row[9]; + $ALLuniqueid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLin_out[$g] = "OUT-AUTO"; + if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $out_notes_to_print = mysql_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $users_to_print = mysql_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysql_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + + $g++; + $u++; + } + + $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $in_logs_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";} + $u=0; while ($in_logs_to_print > $u) { @@ -8186,176 +8717,6 @@ if ($ACTION == 'LEADINFOview') echo ""; echo "\n"; } - - echo "
  #     DATE/TIME     AGENT     LENGTH     STATUS     PHONE     CAMPAIGN     IN/OUT     ALT     HANGUP  
  FULL NAME  
$Allcall_notes[$i]
"; - echo "
"; - - echo "Close Info Box"; - echo "
"; - } - } - - -################################################################################ -### CALLNOTESview - display all notes for a specific lead -################################################################################ -if ($ACTION == 'CALLNOTESview') - { - if (strlen($stage) < 3) - {$stage = '670';} - - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -# echo ""; -# echo ""; - echo ""; - - - $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $out_logs_to_print = mysql_num_rows($rslt); - if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} - - $g=0; - $u=0; - while ($out_logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - $ALLsort[$g] = "$row[0]-----$g"; - $ALLstart_epoch[$g] = $row[0]; - $ALLcall_date[$g] = $row[1]; - $ALLcampaign_id[$g] = $row[2]; - $ALLlength_in_sec[$g] = $row[3]; - $ALLstatus[$g] = $row[4]; - $ALLphone_code[$g] = $row[5]; - $ALLphone_number[$g] = $row[6]; - $ALLlead_id[$g] = $row[7]; - $ALLhangup_reason[$g] = $row[8]; - $ALLalt_dial[$g] = $row[9]; - $ALLuniqueid[$g] = $row[11]; - $ALLuser[$g] = $row[12]; - $ALLin_out[$g] = "OUT-AUTO"; - if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} - - $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';"; - $rsltA=mysql_query($stmtA, $link); - $out_notes_to_print = mysql_num_rows($rslt); - if ($out_notes_to_print > 0) - { - $rowA=mysql_fetch_row($rsltA); - $Allcall_notes[$g] = $rowA[0]; - if (strlen($Allcall_notes[$g]) > 0) - {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} - } - $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; - $rsltA=mysql_query($stmtA, $link); - $users_to_print = mysql_num_rows($rslt); - if ($users_to_print > 0) - { - $rowA=mysql_fetch_row($rsltA); - $ALLuser[$g] .= " - $rowA[0]"; - } - - $Allcounter[$g] = $g; - - $g++; - $u++; - } - - $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $in_logs_to_print = mysql_num_rows($rslt); - if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";} - - $u=0; - while ($in_logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - $ALLsort[$g] = "$row[0]-----$g"; - $ALLstart_epoch[$g] = $row[0]; - $ALLcall_date[$g] = $row[1]; - $ALLcampaign_id[$g] = $row[2]; - $ALLlength_in_sec[$g] = ($row[3] - $row[9]); - if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;} - $ALLstatus[$g] = $row[4]; - $ALLphone_code[$g] = $row[5]; - $ALLphone_number[$g] = $row[6]; - $ALLlead_id[$g] = $row[7]; - $ALLhangup_reason[$g] = $row[8]; - $ALLuniqueid[$g] = $row[10]; - $ALLclosecallid[$g] = $row[11]; - $ALLuser[$g] = $row[12]; - $ALLalt_dial[$g] = "MAIN"; - $ALLin_out[$g] = "IN"; - - $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';"; - $rsltA=mysql_query($stmtA, $link); - $in_notes_to_print = mysql_num_rows($rslt); - if ($in_notes_to_print > 0) - { - $rowA=mysql_fetch_row($rsltA); - $Allcall_notes[$g] = $rowA[0]; - if (strlen($Allcall_notes[$g]) > 0) - {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} - } - $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; - $rsltA=mysql_query($stmtA, $link); - $users_to_print = mysql_num_rows($rslt); - if ($users_to_print > 0) - { - $rowA=mysql_fetch_row($rsltA); - $ALLuser[$g] .= " - $rowA[0]"; - } - - $Allcounter[$g] = $g; - - $g++; - $u++; - } - - if ($g > 0) - {sort($ALLsort, SORT_NUMERIC);} - else - {echo "";} - - $u=0; - while ($g > $u) - { - $sort_split = explode("-----",$ALLsort[$u]); - $i = $sort_split[1]; - - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; } echo "
  #     DATE/TIME     AGENT     LENGTH     STATUS     PHONE     CAMPAIGN     IN/OUT     ALT     HANGUP  
  FULL NAME  
No calls on this day
$u$ALLcall_date[$i] $ALLuser[$i] $ALLlength_in_sec[$i] $ALLstatus[$i] $ALLphone_code[$i] $ALLphone_number[$i] $ALLcampaign_id[$i] $ALLin_out[$i] $ALLalt_dial[$i] $ALLhangup_reason[$i]
$Allcall_notes[$i]
"; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index a0c924b4..0381d794 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -334,10 +334,11 @@ # 110208-1202 - Made scheduled callbacks notice move when on script/form tabs # 110212-2206 - Added scheduled callback custom statuses compatibility # 110215-1412 - Added my_callback_option and per_call_notes options +# 110218-1522 - Added agent_lead_search feature # -$version = '2.4-311'; -$build = '110215-1412'; +$version = '2.4-312'; +$build = '110218-1522'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=69; $one_mysql_log=0; @@ -972,7 +973,7 @@ else $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -1002,6 +1003,7 @@ else $VU_custom_five = $row[23]; $VU_agent_call_log_view_override = $row[24]; $VU_agent_choose_blended = $row[25]; + $VU_agent_lead_search_override = $row[26]; if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';} @@ -1308,7 +1310,7 @@ else $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the campaign settings - $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1399,8 +1401,11 @@ else $manual_dial_call_time_check = $row[83]; $my_callback_option = $row[84]; $per_call_notes = $row[85]; + $agent_lead_search = $row[86]; + $agent_lead_search_method = $row[87]; - + if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'DISABLED') ) + {$agent_lead_search = $VU_agent_lead_search_override;} $AllowManualQueueCalls=1; $AllowManualQueueCallsChoice=0; if ($api_manual_dial == 'QUEUE') @@ -1408,7 +1413,6 @@ else $AllowManualQueueCalls=0; $AllowManualQueueCallsChoice=1; } - if ($manual_preview_dial == 'DISABLED') {$manual_dial_preview = 0;} if ($manual_dial_override == 'ALLOW_ALL') @@ -3229,6 +3233,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBlinkCONTENT=''; var my_callback_option=''; var per_call_notes=''; + var agent_lead_search=''; + var agent_lead_search_method=''; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -5237,7 +5243,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // ################################################################################ // Open page to enter details for a new manual dial lead - function NeWManuaLDiaLCalL(TVfast,TVphone_code,TVphone_number) + function NeWManuaLDiaLCalL(TVfast,TVphone_code,TVphone_number,TVlead_id,TVtype) { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { @@ -5254,9 +5260,23 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (TVfast=='CALLLOG') { hideDiv('CalLLoGDisplaYBox'); + hideDiv('SearcHForMDisplaYBox'); + hideDiv('SearcHResultSDisplaYBox'); hideDiv('LeaDInfOBox'); document.vicidial_form.MDDiaLCodE.value = TVphone_code; document.vicidial_form.MDPhonENumbeR.value = TVphone_number; + document.vicidial_form.MDLeadID.value = TVlead_id; + document.vicidial_form.MDType.value = TVtype; + } + if (TVfast=='LEADSEARCH') + { + hideDiv('SearcHForMDisplaYBox'); + hideDiv('SearcHResultSDisplaYBox'); + hideDiv('LeaDInfOBox'); + document.vicidial_form.MDDiaLCodE.value = TVphone_code; + document.vicidial_form.MDPhonENumbeR.value = TVphone_number; + document.vicidial_form.MDLeadID.value = TVlead_id; + document.vicidial_form.MDType.value = TVtype; } if (agent_allow_group_alias == 'Y') { @@ -5264,6 +5284,15 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.getElementById("ManuaLDiaLGrouP").innerHTML = "Click Here to Choose a Group Alias"; } showDiv('NeWManuaLDiaLBox'); + + document.vicidial_form.search_phone_number.value=''; + document.vicidial_form.search_lead_id.value=''; + document.vicidial_form.search_vendor_lead_code.value=''; + document.vicidial_form.search_first_name.value=''; + document.vicidial_form.search_last_name.value=''; + document.vicidial_form.search_city.value=''; + document.vicidial_form.search_state.value=''; + document.vicidial_form.search_postal_code.value=''; } } } @@ -5279,6 +5308,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var sending_group_alias = 0; var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; + var MDLeadIDform = document.vicidial_form.MDLeadID.value; + var MDTypeform = document.vicidial_form.MDType.value; var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; var MDLookuPLeaD = 'new'; @@ -5320,11 +5351,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (active_group_alias.length > 1) {var sending_group_alias = 1;} - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias); + ManualDialNext("",MDLeadIDform,MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias,MDTypeform); } document.vicidial_form.MDPhonENumbeR.value = ''; document.vicidial_form.MDDiaLOverridE.value = ''; + document.vicidial_form.MDLeadID.value = ''; + document.vicidial_form.MDType.value = ''; } // ################################################################################ @@ -5803,7 +5836,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // ################################################################################ // Send the Manual Dial Next Number request - function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias) + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias,mdtype) { inOUT = 'OUT'; all_record = 'NO'; @@ -5844,6 +5877,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var man_status = "Waiting for Ring..."; } + if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') ) + { + agent_dialed_type = mdtype; + agent_dialed_number = mdnPhonENumbeR; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -6004,8 +6042,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) timer_action_seconds = campaign_timer_action_seconds; timer_action_destination = campaign_timer_action_destination; - lead_dial_number = document.vicidial_form.phone_number.value; - var dispnum = document.vicidial_form.phone_number.value; + lead_dial_number = dialed_number; + var dispnum = dialed_number; var status_display_number = phone_number_format(dispnum); document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; @@ -7912,6 +7950,21 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } } +// ################################################################################ +// Open lead search form panel + function OpeNSearcHForMDisplaYBox() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) + { + alert("YOU MUST BE PAUSED TO SEARCH FOR A LEAD"); + } + else + { + HidEGenDerPulldown(); + showDiv('SearcHForMDisplaYBox'); + WaitingForNextStep=1; + } + } // ################################################################################ // Generate the Presets Chooser span content @@ -8230,6 +8283,18 @@ function set_length(SLnumber,SLlength_goal,SLdirection) APIManualDialQueue_last=0; document.vicidial_form.FORM_LOADED.value = '0'; CallBackLeadStatus = ''; + document.vicidial_form.search_phone_number.value=''; + document.vicidial_form.search_lead_id.value=''; + document.vicidial_form.search_vendor_lead_code.value=''; + document.vicidial_form.search_first_name.value=''; + document.vicidial_form.search_last_name.value=''; + document.vicidial_form.search_city.value=''; + document.vicidial_form.search_state.value=''; + document.vicidial_form.search_postal_code.value=''; + document.vicidial_form.MDPhonENumbeR.value = ''; + document.vicidial_form.MDDiaLOverridE.value = ''; + document.vicidial_form.MDLeadID.value = ''; + document.vicidial_form.MDType.value = ''; if (manual_dial_in_progress==1) { @@ -10196,6 +10261,94 @@ function phone_number_format(formatphone) { +// ################################################################################ +// Gather and display lead search data + function LeadSearchSubmit() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) + { + alert("YOU MUST BE PAUSED TO SEARCH FOR A LEAD"); + } + else + { + showDiv('SearcHResultSDisplaYBox'); + + document.getElementById('SearcHResultSSpan').innerHTML = "Searching...\n"; + + var phone_search_fields = ''; + if (document.vicidial_form.search_main_phone.checked==true) + {phone_search_fields = phone_search_fields + "MAIN_";} + if (document.vicidial_form.search_alt_phone.checked==true) + {phone_search_fields = phone_search_fields + "ALT_";} + if (document.vicidial_form.search_addr3_phone.checked==true) + {phone_search_fields = phone_search_fields + "ADDR3_";} + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + LSview_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=SEARCHRESULTSview&format=text&user=" + user + "&pass=" + pass + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&phone_number=" + document.vicidial_form.search_phone_number.value + "&lead_id=" + document.vicidial_form.search_lead_id.value + "&vendor_lead_code=" + document.vicidial_form.search_vendor_lead_code.value + "&first_name=" + document.vicidial_form.search_first_name.value + "&last_name=" + document.vicidial_form.search_last_name.value + "&city=" + document.vicidial_form.search_city.value + "&state=" + document.vicidial_form.search_state.value + "&postal_code=" + document.vicidial_form.search_postal_code.value + "&search=" + phone_search_fields + "&campaign=" + campaign + "&stage="; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(LSview_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + document.getElementById('SearcHResultSSpan').innerHTML = xmlhttp.responseText + "\n"; + } + } + delete xmlhttp; + } + } + } + + +// ################################################################################ +// Reset lead search form + function LeadSearchReset() + { + document.vicidial_form.search_phone_number.value=''; + document.vicidial_form.search_lead_id.value=''; + document.vicidial_form.search_vendor_lead_code.value=''; + document.vicidial_form.search_first_name.value=''; + document.vicidial_form.search_last_name.value=''; + document.vicidial_form.search_city.value=''; + document.vicidial_form.search_state.value=''; + document.vicidial_form.search_postal_code.value=''; + } + + +// ################################################################################ +// Hide manual dial form + function ManualDialHide() + { + hideDiv('NeWManuaLDiaLBox'); + document.vicidial_form.MDPhonENumbeR.value = ''; + document.vicidial_form.MDDiaLOverridE.value = ''; + document.vicidial_form.MDLeadID.value = ''; + document.vicidial_form.MDType.value = ''; + } + + // ################################################################################ // Refresh the lead notes display function VieWNotesLoG(logframe) @@ -10641,6 +10794,8 @@ else hideDiv('TimerSpan'); hideDiv('CalLLoGDisplaYBox'); hideDiv('CalLNotesDisplaYBox'); + hideDiv('SearcHForMDisplaYBox'); + hideDiv('SearcHResultSDisplaYBox'); hideDiv('LeaDInfOBox'); hideDiv('agentdirectlink'); hideDiv('blind_monitor_notice_span'); @@ -11691,7 +11846,12 @@ $zi=2;   Customer Time:                         Channel: - Customer Information: + Customer Information:         + LEAD SEARCH
";} + ?> + @@ -12359,6 +12519,8 @@ Available Agents Transfer:
Phone Number:   (digits only) + + Search Existing Leads: @@ -12380,7 +12542,7 @@ Available Agents Transfer:
Preview Call                 - Go Back + Go Back @@ -12432,78 +12594,141 @@ Available Agents Transfer:
-
AGENT CALL LOG:
+
      AGENT CALL LOG:             close [X]

\n";} + {echo "

\n";} ?>
Call log List
-

  -
+

  +
+
+ + +
      SEARCH FOR A LEAD:             close [X]
+
\n";} + ?> +

+ Notes: when doing a search for a lead, the phone number, lead ID or are the best fields to use.
Using the other fields may be slower. Lead searching does not allow for wildcard or partial search terms.
Lead search requests are all logged in the system. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone Number:
Phone Number Fields: + Main Phone Number + Alternate Phone Number + Address3 Phone Number +
Lead ID:
:
:
:
:
:
:

SUBMIT SEARCH             reset form
+

  +
+
+ + +
      SEARCH RESULTS:             close [X]
+
\n";} + ?> +
Search Results
+

  +
-
CALL NOTES LOG:
+
      CALL NOTES LOG:             close [X]

\n";} + {echo "

\n";} ?>
Call Notes List
-

  -
+

  +
-
Customer Information:
+
      Customer Information:             close [X] +

\n";} + {echo "

\n";} ?> Lead Info -

  -
+

  +
-
SELECT A PAUSE CODE :
+
SELECT A PAUSE CODE :

\n";} + {echo "

\n";} ?> Pause Code Selection - -

  -
+ +

  +
-
SELECT A PRESET :
+
SELECT A PRESET :

\n";} + {echo "

\n";} ?> Presets Selection - -
+ +
-
SELECT A GROUP ALIAS :
+
SELECT A GROUP ALIAS :

\n";} + {echo "

\n";} ?> Group Alias Selection - -

  -
+ +

  +
-
ALERT :
-     -

Go Back -
+
ALERT :
+     +

Go Back +
diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index 1dd78aa7..ec775908 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -71,10 +71,11 @@ # 101024-0832 - Added Agent time stats option and agents-in-dispo counter # 101109-1448 - Added Auto Hopper Level display (MikeC) # 101216-1358 - Added functions to work with new realtime_report.php script +# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries # -$version = '2.4-62'; -$build = '101216-1358'; +$version = '2.4-63'; +$build = '110218-1037'; header ("Content-type: text/html; charset=utf-8"); @@ -2475,7 +2476,8 @@ $calls_to_list = mysql_num_rows($rslt); { if (!ereg("N",$agent_pause_codes_active)) { - $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmtC="select sub_status from vicidial_agent_log where event_time > \"$twentyfour_hours_ago\" and user='$Luser' order by agent_log_id desc limit 1;"; $rsltC=mysql_query($stmtC,$link); $rowC=mysql_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index d86a739a..41f7d155 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1508,6 +1508,10 @@ if (isset($_GET["per_call_notes"])) {$per_call_notes=$_GET["per_call_notes"]; elseif (isset($_POST["per_call_notes"])) {$per_call_notes=$_POST["per_call_notes"];} if (isset($_GET["my_callback_option"])) {$my_callback_option=$_GET["my_callback_option"];} elseif (isset($_POST["my_callback_option"])) {$my_callback_option=$_POST["my_callback_option"];} +if (isset($_GET["agent_lead_search"])) {$agent_lead_search=$_GET["agent_lead_search"];} + elseif (isset($_POST["agent_lead_search"])) {$agent_lead_search=$_POST["agent_lead_search"];} +if (isset($_GET["agent_lead_search_method"])) {$agent_lead_search_method=$_GET["agent_lead_search_method"];} + elseif (isset($_POST["agent_lead_search_method"])) {$agent_lead_search_method=$_POST["agent_lead_search_method"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -2092,6 +2096,8 @@ if ($non_latin < 1) $api_manual_dial = ereg_replace("[^-_0-9a-zA-Z]","",$api_manual_dial); $manual_dial_call_time_check = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_call_time_check); $lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); + $agent_lead_search = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search); + $agent_lead_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$agent_lead_search_method); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -2644,12 +2650,13 @@ else # 110212-2048 - Added Scheduled Callback as status flag to allow for custom scheduled callback statuses # 110214-0001 - Added campaign settings for lead_order_secondary, per_call_notes and my_callback_option # 110215-1721 - Added add-a-new-lead link to the lists submenu +# 110215-2135 - Added agent_lead_search options to user and campaign # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-300'; -$build = '110215-1721'; +$admin_version = '2.4-301'; +$build = '110215-2135'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3823,6 +3830,11 @@ if ($ADD==99999)
Agent Call Log View Override - This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED. +
+ +
+ Agent Lead Search Override - This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE. +

@@ -4575,6 +4587,16 @@ if ($ADD==99999)
Call Notes Per Call - Setting this option to ENABLED will allow agents to enter in notes for every call they handle in the agent interface. The notes entry field will appear below the Comments field in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for a lead at any time. Default is DISABLED. +
+
+
+ Agent Lead Search - Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED. + +
+
+
+ Agent Lead Search Method - If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL. +

@@ -9958,7 +9980,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user=\"$source_user_id\";"; + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -10290,7 +10312,7 @@ if ($ADD==20) { echo "
CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -12306,7 +12328,7 @@ if ($ADD=="4A") } echo "
USER MODIFIED - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password',agent_lead_search_override='$agent_lead_search' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12549,7 +12571,7 @@ if ($ADD=="4B") } echo "
USER MODIFIED - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',agent_choose_blended='$agent_choose_blended' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',agent_choose_blended='$agent_choose_blended',agent_lead_search_override='$agent_lead_search' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13144,7 +13166,7 @@ if ($ADD==41) if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) {$hopper_level='100';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -17903,7 +17925,7 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -18259,7 +18283,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; @@ -18431,6 +18455,8 @@ if ($ADD==31) $lead_order_secondary = $row[170]; $per_call_notes = $row[171]; $my_callback_option = $row[172]; + $agent_lead_search = $row[173]; + $agent_lead_search_method = $row[174]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -19059,6 +19085,10 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; echo ""; - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user='$user';"; + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -17987,6 +18009,7 @@ if ($ADD==3) $realtime_block_user_info = $row[80]; $custom_fields_modify = $row[81]; $force_change_password = $row[82]; + $agent_lead_search_override = $row[83]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -18090,6 +18113,7 @@ if ($ADD==3) echo "
Agent Shift Enforcement Override: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Agent Call Log View Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
Agent Lead Search Override: $NWB#vicidial_users-agent_lead_search_override$NWE
Alert Enabled: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
Call Notes Per Call: $NWB#vicidial_campaigns-per_call_notes$NWE
Agent Lead Search: $NWB#vicidial_campaigns-agent_lead_search$NWE
Agent Lead Search Method: $NWB#vicidial_campaigns-agent_lead_search_method$NWE
Script:


\n"; } +if ($did < 1) + { + ##### vicidial lead searches for this time period ##### + + echo "LEAD SEARCHES FOR THIS TIME PERIOD: (10000 record limit)\n"; + echo "\n"; + echo "\n"; + + $stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]); + $row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]); + + while (strlen($row[4]) > 100) + {$row[4] = preg_replace("/.$/",'',$row[4]);} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
# DATE/TIME   TYPE   RESULTS   SEC   QUERY
$u$row[0] $row[1] $row[2] $row[3] $row[4]


\n"; + } + $ENDtime = date("U");