diff --git a/bin/ADMIN_archive_log_tables.pl b/bin/ADMIN_archive_log_tables.pl index 08b6ad5a..b17a438d 100644 --- a/bin/ADMIN_archive_log_tables.pl +++ b/bin/ADMIN_archive_log_tables.pl @@ -70,6 +70,7 @@ # 230507-0804 - Added vicidial_latency_gaps archiving # 231028-0810 - Added --url-log-only and --url-log-days=x options for purging of vicidial_url_log table only # 231117-1914 - Added vicidial_3way_press_log archiving +# 231126-2227 - Added vicidial_hci_log archiving # $CALC_TEST=0; @@ -3498,6 +3499,59 @@ if (!$T) } + ##### vicidial_hci_log + $stmtA = "SELECT count(*) from vicidial_hci_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_hci_log_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_hci_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_hci_log_archive_count = $aryA[0]; + } + $sthA->finish(); + + if (!$Q) {print "\nProcessing vicidial_hci_log table... ($vicidial_hci_log_count|$vicidial_hci_log_archive_count)\n";} + $stmtA = "INSERT IGNORE INTO vicidial_hci_log_archive SELECT * from vicidial_hci_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_hci_log_archive table \n";} + + $rv = $sthA->err(); + if (!$rv) + { + if ($wipe_all > 0) + {$stmtA = "DELETE FROM vicidial_hci_log;";} + else + {$stmtA = "DELETE FROM vicidial_hci_log 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_hci_log table \n";} + + $stmtA = "optimize table vicidial_hci_log;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + + $stmtA = "optimize table vicidial_hci_log_archive;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + } + + ##### vicidial_call_notes $stmtA = "SELECT count(*) from vicidial_call_notes;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index 60c3975a..bf51e949 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -168,9 +168,10 @@ # 230609-1137 - Added VIDPROMPTSPECIAL call menu In-Group dialplan entries # 230909-0846 - Added purging of vicidial_khomp_log records older than 7 days # 230925-1454 - Added -recmon settings +# 231136-2158 - Added hopper_hold_inserts HCI lead reservations clearing for old reservations # -$build = '230925-1454'; +$build = '231136-2158'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -488,7 +489,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA ##### Get the settings from system_settings ##### -$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id FROM system_settings;"; +$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports,enable_drop_lists,expired_lists_inactive,sip_event_logging,call_quota_lead_ranking,inbound_answer_config,log_latency_gaps,demographic_quotas,weekday_resets,highest_lead_id,hopper_hold_inserts FROM system_settings;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -519,6 +520,7 @@ if ($sthArows > 0) $SSdemographic_quotas = $aryA[20]; $SSweekday_resets = $aryA[21]; $SShighest_lead_id = $aryA[22]; + $SShopper_hold_inserts = $aryA[23]; } $sthA->finish(); if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";} @@ -5691,6 +5693,53 @@ if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_se +################################################################################ +##### START HCI lead reserve RQUEUE clearing for reservations longer than 5 minutes +################################################################################ +# only run this on active voicemail server +if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) && ($SShopper_hold_inserts > 0) ) + { + ##### gather vicidial_live_agents_details ##### + $stmtA = "SELECT lead_id,user FROM vicidial_hci_reserve where reserve_date < \"$FMSQLdate\";"; + if ($DBX) {print "$stmtA\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $VLADlead_id[$i] = $aryA[0]; + $VLADuser[$i] = $aryA[1]; + $i++; + } + $sthA->finish(); + + if ($DB) {print " old vicidial_hci_reserve entries to clear: $i\n";} + + $i=0; + while ($sthArows > $i) + { + $VALLmin_count_latency=0; $VALLmin_max_latency=0; $VALLmin_avg_latency=0; + $stmtA = "UPDATE vicidial_hopper SET status='RHOLD',user='' where lead_id='$VLADlead_id[$i]' and status='RQUEUE';"; + if ($DBX) {print "$stmtA\n";} + $affected_rows = $dbhA->do($stmtA) or die "Couldn't execute query: |$stmtA|\n"; + if ($DBX) {print "vicidial_live_agents_details update query: |$affected_rows|$stmtA|\n";} + + $i++; + } + + $stmtA = "DELETE FROM vicidial_hci_reserve where reserve_date < \"$FMSQLdate\""; + $affected_rows = $dbhA->do($stmtA) or die "Couldn't execute query: |$stmtA|\n"; + if ($DBX) {print "vicidial_hci_reserve delete query: |$affected_rows|$stmtA|\n";} + } +################################################################################ +##### END HCI lead reserve RQUEUE clearing for reservations longer than 5 minutes +################################################################################ + + + + ################################################################################ ##### START launch Demographic Quotas process, if enabled on any active campaigns ################################################################################ diff --git a/bin/AST_VDadapt.pl b/bin/AST_VDadapt.pl index 91ef051c..33722ae3 100644 --- a/bin/AST_VDadapt.pl +++ b/bin/AST_VDadapt.pl @@ -561,7 +561,7 @@ while ($master_loop < $CLIloops) $hopper_ready_count=0; $agents_loggedin_count=0; ### Find out how many leads are in the hopper from a specific campaign - $stmtA = "SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD');"; + $stmtA = "SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD','RQUEUE');"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; diff --git a/bin/AST_VDdemographic_quotas.pl b/bin/AST_VDdemographic_quotas.pl index 12176356..70552e9f 100644 --- a/bin/AST_VDdemographic_quotas.pl +++ b/bin/AST_VDdemographic_quotas.pl @@ -1087,7 +1087,7 @@ foreach(@campaign_id) if ($DBX) {print "DQ List AUTO Resets enabled, checking hopper count: $demographic_quotas_list_resets[$i] \n";} $hopper_begin_output .= "DQ List AUTO Resets enabled, checking hopper count: $demographic_quotas_list_resets[$i] \n"; $hopper_leads=0; - $stmtA="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD');"; + $stmtA="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD','RQUEUE');"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1524,7 +1524,7 @@ foreach(@campaign_id) if ($ranked_leads > 0) { $hopper_leads=0; - $stmtA="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD');"; + $stmtA="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD','RQUEUE');"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; diff --git a/bin/AST_VDhopper.pl b/bin/AST_VDhopper.pl index 854c7e29..09cf222a 100644 --- a/bin/AST_VDhopper.pl +++ b/bin/AST_VDhopper.pl @@ -108,6 +108,7 @@ # 220822-0938 - Change DNC check queries to put phone_number in double-quotes instead of single-quotes # 230428-2017 - Added demographic_quotas code # 231116-0821 - Added hopper_hold_inserts system and campaign settings options +# 231126-1748 - Added RQUEUE hopper status # # constants @@ -1414,7 +1415,7 @@ while ($sthArows > $rec_count) { if ($DB) { print "---------------Auto Trim Hopper Enabled For $campaign_id[$rec_count]---------------------\n"; } - $stmtB = "SELECT COUNT(*) FROM $vicidial_hopper WHERE campaign_id='$campaign_id[$rec_count]' and status IN ('READY','RHOLD') and source IN('S','N');"; + $stmtB = "SELECT COUNT(*) FROM $vicidial_hopper WHERE campaign_id='$campaign_id[$rec_count]' and status IN ('READY','RHOLD','RQUEUE') and source IN('S','N');"; $sthB = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr; $sthB->execute or die "executing: $stmtB ", $dbhA->errstr; @aryLead = $sthB->fetchrow_array; @@ -1430,7 +1431,7 @@ while ($sthArows > $rec_count) if ( $camp_leads > ( 2 * $hopper_level[$rec_count] ) ) { $num_to_delete = $camp_leads - 2 * $hopper_level[$rec_count]; - $stmtB = "DELETE FROM $vicidial_hopper WHERE campaign_id='$campaign_id[$rec_count]' AND source='S' AND status IN ('READY','RHOLD') LIMIT $num_to_delete"; + $stmtB = "DELETE FROM $vicidial_hopper WHERE campaign_id='$campaign_id[$rec_count]' AND source='S' AND status IN ('READY','RHOLD','RQUEUE') LIMIT $num_to_delete"; $affected_rows = $dbhA->do($stmtB); if ($DB) @@ -2212,7 +2213,7 @@ foreach(@campaign_id) ### Find out how many leads are READY in the hopper from a specific campaign $hopper_ready_count=0; - $stmtA = "SELECT count(*) from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD');"; + $stmtA = "SELECT count(*) from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('READY','RHOLD','RQUEUE');"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; diff --git a/docs/HCI_Human_Call_Indicator_screen.txt b/docs/HCI_Human_Call_Indicator_screen.txt new file mode 100644 index 00000000..d745a9e4 --- /dev/null +++ b/docs/HCI_Human_Call_Indicator_screen.txt @@ -0,0 +1,131 @@ +HUMAN CALL INDICATOR(HCI) DOC Started: 2023-11-08 Updated: 2023-11-27 + + +This document will go over how to set up the Human Call Indicator screen on your system, with Hopper Hold Inserts for campaigns. + +NOTE: This requires svn/trunk revision 3779 or higher!!! + + + +What is an Human Call Indicator screen? + +The purpose of this feature is to allow a user to log into the HCI screen to manually click on a button and then confirm their choice to enable the initiation of a phone call by the system. This confirmation of each phone call is logged and is visible in the User Stats page and the Admin Modify Lead page. + +On the admin side, to enable the HCI screen, the System Settings "Lead Hopper Hold Inserts Allowed" option must be enabled, and the Campaign "Hopper Hold Inserts" option must be enabled for each campaign that you want this feature activated for. If "Hopper Hold Inserts" is enabled for a campaign, then no non-agent-screen phone calls can be placed from that campaign without first being individually confirmed by a live human user in the HCI screen. + +For a user to log into the HCI screen, they must have their User's "HCI Enabled" option enabled. + +The user can get to the HCI screen from the link on the Welcome page(HOME). Once logged in to the HCI screen, the user must select the campaign that they want to initiate calls from, then they will see the active HCI screen with phone numbers to click on (on the left side), and a summary screen (on the right side). When an agent clicks on one of the phone numbers, they will see a confirmation pop-up panel asking them to confirm that they want this number to be called. If the user confirms this propt, then the call can be placed by the system and the phone number's button will disappear from the left side of the screen and the other phone numbers will shift to fill in the empty space. + +The statistics on the right side of the screen show the following metrics: +1. Calls in Progress - the number of dialed but not-yet-answered calls active at this moment, does not include calls where agents are talking to customers +2. Calls on Hold - the number of leads in the hopper that are on HOLD waiting to be confirmed for calling by an HCI screen user +3. Records Remaining - the number of leads in the hopper that are READY and waiting to be placed through your telco carrier by the system +4. Agents Ready - the number of agents in READY or CLOSER status, waiting for a phone call +5. Calls Offset - the number of calls to be placed by the campaign that will fill the waiting agents above +6. Drop Rate - the drop rate for this campaign for today's calls, taken out of the number of Human Answer phone calls for the campaign + +At the top of the HCI screen, the user also has the option to Change Campaign to another HCI-enabled campaign, or they can LOGOUT of the HCI screen. + + + +How do I configure this on my system? + +No configuration is needed other than activating Hopper Hold Inserts for the system and campaigns, as well as activating the HCI Enabled setting for the users that you want to access the HCI screen. + + + +What are the limitations of the HCI screen? + +The HCI screen will reserve leads from the hopper that are on HOLD for each user that is logged into the HCI screen, these HOLD hopper leads are refreshed as the HCI screen user confirms phone calls, and no more than 40 calls can be initiated within 4 seconds, although in our testing we've never been able to get anywhere close to that rate. + +If the HCI screen user does not confirm any phone calls for 5 minutes, the system will reset their reserved hopper leads and allow their HCI screen to reserve new ones. This is done to ensure the freshness of the hopper leads being confirmed through the HCI screen. + +Since the HCI screen will reserve 40 hopper HOLD leads for each logged-in HCI screen user, you may need to raise your campaign Hopper Level depending on how many HCI screen users you will want to have logged in at any one time. + + + + + + + + + + +------------------------------------------------------------------------- + +DATABASE CHANGES FOR REFERENCE ONLY!!!!!!!!! + + +ALTER TABLE system_settings ADD hopper_hold_inserts ENUM('0','1','2','3','4','5','6','7') default '0'; + +ALTER TABLE vicidial_campaigns ADD hopper_hold_inserts ENUM('ENABLED','DISABLED') default 'DISABLED'; + +ALTER TABLE vicidial_hopper MODIFY status ENUM('READY','QUEUE','INCALL','DONE','HOLD','DNC','RHOLD','RQUEUE') default 'READY'; + +ALTER TABLE vicidial_users ADD hci_enabled ENUM('0','1','2','3','4','5','6') default '0'; + +CREATE TABLE vicidial_hci_live_agents ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +last_update_time TIMESTAMP, +status VARCHAR(40), +lead_id INT(9) UNSIGNED default '0', +phone_number VARCHAR(18), +random_id INT(8) UNSIGNED, +index(user), +index(campaign_id), +index(last_update_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_agent_log ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +status VARCHAR(40), +index(user), +index(login_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_reserve ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +reserve_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +index(user), +index(reserve_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE UNIQUE INDEX vhcir on vicidial_hci_reserve (lead_id,user,campaign_id); + +CREATE TABLE vicidial_hci_log ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +call_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +user_ip VARCHAR(45) default '', +index(user), +index(call_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_log_archive LIKE vicidial_hci_log; +CREATE UNIQUE INDEX vhlclu on vicidial_hci_log_archive (call_date,lead_id,user); + +CREATE TABLE hci_logs ( +date DATETIME, +user VARCHAR(20) default '', +lead_id INT(9) UNSIGNED NOT NULL, +campaign_id VARCHAR(8), +index(date) +) ENGINE=MyISAM; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index cba7eff8..f17adf26 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -704,7 +704,8 @@ failed_login_count_today SMALLINT(6) UNSIGNED default '0', failed_last_ip_today VARCHAR(50) default '', failed_last_type_today VARCHAR(20) default '', modify_dial_prefix ENUM('0','1','2','3','4','5','6') default '0', -inbound_credits MEDIUMINT(7) default '-1' +inbound_credits MEDIUMINT(7) default '-1', +hci_enabled ENUM('0','1','2','3','4','5','6') default '0' ) ENGINE=MyISAM; CREATE UNIQUE INDEX user ON vicidial_users (user); @@ -5087,6 +5088,71 @@ index(call_3way_id), index(lead_id) ) ENGINE=MyISAM; +CREATE TABLE vicidial_hci_live_agents ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +last_update_time TIMESTAMP, +status VARCHAR(40), +lead_id INT(9) UNSIGNED default '0', +phone_number VARCHAR(18), +random_id INT(8) UNSIGNED, +index(user), +index(campaign_id), +index(last_update_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_agent_log ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +status VARCHAR(40), +index(user), +index(login_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_reserve ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +reserve_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +index(user), +index(reserve_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE UNIQUE INDEX vhcir on vicidial_hci_reserve (lead_id,user,campaign_id); + +CREATE TABLE vicidial_hci_log ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +call_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +user_ip VARCHAR(45) default '', +index(user), +index(call_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_log_archive LIKE vicidial_hci_log; +CREATE UNIQUE INDEX vhlclu on vicidial_hci_log_archive (call_date,lead_id,user); + +CREATE TABLE hci_logs ( +date DATETIME, +user VARCHAR(20) default '', +lead_id INT(9) UNSIGNED NOT NULL, +campaign_id VARCHAR(8), +index(date) +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -5486,4 +5552,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues', UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1700',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1701',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 914b667a..ceef6bdc 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -2484,3 +2484,72 @@ CREATE TABLE vicidial_3way_press_log_archive LIKE vicidial_3way_press_log; CREATE UNIQUE INDEX vdpla on vicidial_3way_press_log_archive (call_date,caller_code,user); UPDATE system_settings SET db_schema_version='1700',db_schema_update_date=NOW() where db_schema_version < 1700; + +ALTER TABLE vicidial_users ADD hci_enabled ENUM('0','1','2','3','4','5','6') default '0'; + +CREATE TABLE vicidial_hci_live_agents ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +last_update_time TIMESTAMP, +status VARCHAR(40), +lead_id INT(9) UNSIGNED default '0', +phone_number VARCHAR(18), +random_id INT(8) UNSIGNED, +index(user), +index(campaign_id), +index(last_update_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_agent_log ( +user VARCHAR(20), +campaign_id VARCHAR(8), +user_ip VARCHAR(45) default '', +login_time DATETIME, +last_call_time DATETIME, +status VARCHAR(40), +index(user), +index(login_time) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_reserve ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +reserve_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +index(user), +index(reserve_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE UNIQUE INDEX vhcir on vicidial_hci_reserve (lead_id,user,campaign_id); + +CREATE TABLE vicidial_hci_log ( +user VARCHAR(20), +lead_id INT(9) UNSIGNED, +phone_number VARCHAR(18), +call_date DATETIME, +campaign_id VARCHAR(8), +status VARCHAR(40), +user_ip VARCHAR(45) default '', +index(user), +index(call_date), +index(lead_id) +) ENGINE=MyISAM; + +CREATE TABLE vicidial_hci_log_archive LIKE vicidial_hci_log; +CREATE UNIQUE INDEX vhlclu on vicidial_hci_log_archive (call_date,lead_id,user); + +CREATE TABLE hci_logs ( +date DATETIME, +user VARCHAR(20) default '', +lead_id INT(9) UNSIGNED NOT NULL, +campaign_id VARCHAR(8), +index(date) +) ENGINE=MyISAM; + +UPDATE system_settings SET db_schema_version='1701',db_schema_update_date=NOW() where db_schema_version < 1701; diff --git a/www/vicidial/AST_VICIDIAL_hopperlist.php b/www/vicidial/AST_VICIDIAL_hopperlist.php index cff2989b..609cf9c0 100644 --- a/www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/www/vicidial/AST_VICIDIAL_hopperlist.php @@ -32,6 +32,7 @@ # 220301-1627 - Added allow_web_debug system setting # 220812-0929 - Added User Group report permissions checking # 231116-0928 - Added option to display RHOLD status hopper entries +# 231127-2001 - Added display of RQUEUE status hopper entries and hold details when displaying HOLD entries # $startMS = microtime(); @@ -322,8 +323,8 @@ echo ""._QXZ("Hopper List Report").""; echo "
\n"; @@ -383,7 +384,7 @@ else $row=mysqli_fetch_row($rslt); $hopperREADY = sprintf("%10s", $row[0]); - $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysqli_real_escape_string($link, $group) . "' and status='RHOLD' $LOGallowed_campaignsSQL;"; + $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysqli_real_escape_string($link, $group) . "' and status IN('RHOLD','RQUEUE') $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysqli_fetch_row($rslt); @@ -416,7 +417,7 @@ else } echo "+------+--------+-----------+------------+-------------+---------+-------+--------+-------+--------+--------+-------+-------+----------------------$SIDhead+----------+-----------+\n"; - $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority,vicidial_hopper.source,vicidial_hopper.vendor_lead_code, phone_code,UNIX_TIMESTAMP(entry_date),UNIX_TIMESTAMP(last_local_call_time),source_id,vicidial_list.rank,vicidial_list.owner from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysqli_real_escape_string($link, $group) . "' $statusSQL and vicidial_hopper.lead_id=vicidial_list.lead_id $LOGallowed_campaignsSQL order by priority desc,hopper_id limit 5000;"; + $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority,vicidial_hopper.source,vicidial_hopper.vendor_lead_code, phone_code,UNIX_TIMESTAMP(entry_date),UNIX_TIMESTAMP(last_local_call_time),source_id,vicidial_list.rank,vicidial_list.owner,vicidial_hopper.status,vicidial_hopper.user from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysqli_real_escape_string($link, $group) . "' $statusSQL and vicidial_hopper.lead_id=vicidial_list.lead_id $LOGallowed_campaignsSQL order by priority desc,hopper_id limit 5000;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysqli_num_rows($rslt); @@ -472,6 +473,8 @@ else $source_id_TEXT = "| ".sprintf("%-20s", $row[15])." "; $rank = sprintf("%-6s", $row[16]); $owner = sprintf("%-10s", $row[17]); + $Hstatus = sprintf("%-6s", $row[18]); + $Huser = sprintf("%-20s", $row[19]); $lead_age = intval(($STARTtime - $entry_epoch) / 86400); $lead_age = sprintf("%-8s", $lead_age); @@ -514,8 +517,10 @@ else if ($SSsource_id_display < 1) {$source_id_TEXT='';} - if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number $phone_code || $state | $status | $count | $gmt | $rank | $alt_dial | $source | $vendor_lead_code | $lead_age | $last_call_age_TEXT | $hopper_id | $owner | $DBdata\n";} - else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $phone_code | $state | $status | $count | $gmt | $rank | $alt_dial | $source | $vendor_lead_code $source_id_TEXT| $lead_age | $last_call_age_TEXT |\n";} + $statusX = ''; + if (preg_match("/RHOLD|RQUEUE/",$Hstatus)) {$statusX = " $Hstatus $Huser";} + if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number $phone_code || $state | $status | $count | $gmt | $rank | $alt_dial | $source | $vendor_lead_code | $lead_age | $last_call_age_TEXT | $hopper_id | $owner | $DBdata$statusX\n";} + else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $phone_code | $state | $status | $count | $gmt | $rank | $alt_dial | $source | $vendor_lead_code $source_id_TEXT| $lead_age | $last_call_age_TEXT |$statusX\n";} $i++; } diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index ae755cb7..94ed6197 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2806,6 +2806,8 @@ if (isset($_GET["agent_search_list"])) {$agent_search_list=$_GET["agent_search elseif (isset($_POST["agent_search_list"])) {$agent_search_list=$_POST["agent_search_list"];} if (isset($_GET["hopper_hold_inserts"])) {$hopper_hold_inserts=$_GET["hopper_hold_inserts"];} elseif (isset($_POST["hopper_hold_inserts"])) {$hopper_hold_inserts=$_POST["hopper_hold_inserts"];} +if (isset($_GET["hci_enabled"])) {$hci_enabled=$_GET["hci_enabled"];} + elseif (isset($_POST["hci_enabled"])) {$hci_enabled=$_POST["hci_enabled"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); @@ -3324,6 +3326,7 @@ $second_alert_delay = preg_replace('/[^0-9]/','',$second_alert_delay); $third_alert_trigger_seconds = preg_replace('/[^0-9]/','',$third_alert_trigger_seconds); $third_alert_delay = preg_replace('/[^0-9]/','',$third_alert_delay); $agent_search_list = preg_replace('/[^0-9]/','',$agent_search_list); +$hci_enabled = preg_replace('/[^0-9]/','',$hci_enabled); $user_new_lead_limit = preg_replace('/[^-0-9]/','',$user_new_lead_limit); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); @@ -6113,12 +6116,13 @@ if ($SSscript_remove_js > 0) # 231109-0904 - Added two_factor_auth_agent_hours system setting # 231109-2027 - Added lead_dearchive API function # 231115-1636 - Added vm_view_messages_link options.php setting, hopper_hold_inserts system and campaign settings +# 231119-1520 - Added hci_enabled user setting # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-900a'; -$build = '231115-1636'; +$admin_version = '2.14-901a'; +$build = '231119-1520'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -6397,7 +6401,7 @@ if ( ($qc_auth > 0) and ($auth < 1) ) $qc_only_user=1; } -$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,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level,alter_admin_interface_options,modify_custom_dialplans,modify_languages,selected_language,user_choose_language,modify_colors,api_only_user,modify_auto_reports,modify_ip_lists,export_gdpr_leads,mobile_number,two_factor_override,modify_dial_prefix from vicidial_users where user='$PHP_AUTH_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,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level,alter_admin_interface_options,modify_custom_dialplans,modify_languages,selected_language,user_choose_language,modify_colors,api_only_user,modify_auto_reports,modify_ip_lists,export_gdpr_leads,mobile_number,two_factor_override,modify_dial_prefix,hci_enabled from vicidial_users where user='$PHP_AUTH_USER';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); @@ -6462,6 +6466,7 @@ $LOGexport_gdpr_leads =$row[92]; $LOGmobile_number =$row[93]; $LOGtwo_factor_override =$row[94]; $LOGmodify_dial_prefix =$row[95]; +$LOGhci_enabled =$row[96]; $stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times,qc_allowed_campaigns,qc_allowed_inbound_groups,reports_header_override,admin_home_url,allowed_queue_groups from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {echo "|$stmt|\n";} @@ -12138,7 +12143,7 @@ if ($ADD=="2A") $pass=''; } - $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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,modify_dial_prefix,inbound_credits) 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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,modify_dial_prefix,inbound_credits 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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,modify_dial_prefix,inbound_credits,hci_enabled) 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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,modify_dial_prefix,inbound_credits,hci_enabled from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today,group_type) SELECT \"$user\",group_id,group_rank,group_weight,\"0\",group_type from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -16129,7 +16134,7 @@ if ($ADD=="4A") echo "
"._QXZ("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',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',modify_shifts='$modify_shifts',modify_phones='$modify_phones',modify_carriers='$modify_carriers',modify_labels='$modify_labels',modify_statuses='$modify_statuses',modify_voicemail='$modify_voicemail',modify_audiostore='$modify_audiostore',modify_moh='$modify_moh',modify_tts='$modify_tts',preset_contact_search='$preset_contact_search',modify_contacts='$modify_contacts',modify_same_user_level='$modify_same_user_level',admin_hide_lead_data='$admin_hide_lead_data',admin_hide_phone_data='$admin_hide_phone_data',agentcall_email='$agentcall_email',agentcall_chat='$agentcall_chat',modify_email_accounts='$modify_email_accounts',failed_login_count=0,alter_admin_interface_options='$alter_admin_interface_options',max_inbound_calls='$max_inbound_calls',modify_custom_dialplans='$modify_custom_dialplans',wrapup_seconds_override='$wrapup_seconds_override',modify_languages='$modify_languages',selected_language='$selected_language',user_choose_language='$user_choose_language',ignore_group_on_search='$ignore_group_on_search',api_list_restrict='$api_list_restrict',api_allowed_functions='$api_allowed_functions',lead_filter_id='$lead_filter_id',admin_cf_show_hidden='$admin_cf_show_hidden',user_hide_realtime='$user_hide_realtime',access_recordings='$access_recordings',modify_colors='$modify_colors',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',api_only_user='$api_only_user',modify_auto_reports='$modify_auto_reports',modify_ip_lists='$modify_ip_lists',ignore_ip_list='$ignore_ip_list',ready_max_logout='$ready_max_logout',export_gdpr_leads='$export_gdpr_leads',pause_code_approval='$pause_code_approval',max_hopper_calls='$max_hopper_calls',max_hopper_calls_hour='$max_hopper_calls_hour',mute_recordings='$mute_recordings',hide_call_log_info='$hide_call_log_info',next_dial_my_callbacks='$next_dial_my_callbacks',user_admin_redirect_url='" . mysqli_real_escape_string($link, $user_admin_redirect_url) . "',max_inbound_filter_enabled='$max_inbound_filter_enabled',max_inbound_filter_statuses='$max_inbound_filter_statuses',max_inbound_filter_ingroups='$max_inbound_filter_ingroups',max_inbound_filter_min_sec='$max_inbound_filter_min_sec',status_group_id='$status_group_id',mobile_number='$mobile_number',two_factor_override='$two_factor_override',manual_dial_filter='$manual_dial_filter',user_location='$user_location',download_invalid_files='$download_invalid_files',user_group_two='$user_group_two',modify_dial_prefix='$modify_dial_prefix',inbound_credits='$inbound_credits' $user_codeSQL $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; + $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',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',modify_shifts='$modify_shifts',modify_phones='$modify_phones',modify_carriers='$modify_carriers',modify_labels='$modify_labels',modify_statuses='$modify_statuses',modify_voicemail='$modify_voicemail',modify_audiostore='$modify_audiostore',modify_moh='$modify_moh',modify_tts='$modify_tts',preset_contact_search='$preset_contact_search',modify_contacts='$modify_contacts',modify_same_user_level='$modify_same_user_level',admin_hide_lead_data='$admin_hide_lead_data',admin_hide_phone_data='$admin_hide_phone_data',agentcall_email='$agentcall_email',agentcall_chat='$agentcall_chat',modify_email_accounts='$modify_email_accounts',failed_login_count=0,alter_admin_interface_options='$alter_admin_interface_options',max_inbound_calls='$max_inbound_calls',modify_custom_dialplans='$modify_custom_dialplans',wrapup_seconds_override='$wrapup_seconds_override',modify_languages='$modify_languages',selected_language='$selected_language',user_choose_language='$user_choose_language',ignore_group_on_search='$ignore_group_on_search',api_list_restrict='$api_list_restrict',api_allowed_functions='$api_allowed_functions',lead_filter_id='$lead_filter_id',admin_cf_show_hidden='$admin_cf_show_hidden',user_hide_realtime='$user_hide_realtime',access_recordings='$access_recordings',modify_colors='$modify_colors',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',api_only_user='$api_only_user',modify_auto_reports='$modify_auto_reports',modify_ip_lists='$modify_ip_lists',ignore_ip_list='$ignore_ip_list',ready_max_logout='$ready_max_logout',export_gdpr_leads='$export_gdpr_leads',pause_code_approval='$pause_code_approval',max_hopper_calls='$max_hopper_calls',max_hopper_calls_hour='$max_hopper_calls_hour',mute_recordings='$mute_recordings',hide_call_log_info='$hide_call_log_info',next_dial_my_callbacks='$next_dial_my_callbacks',user_admin_redirect_url='" . mysqli_real_escape_string($link, $user_admin_redirect_url) . "',max_inbound_filter_enabled='$max_inbound_filter_enabled',max_inbound_filter_statuses='$max_inbound_filter_statuses',max_inbound_filter_ingroups='$max_inbound_filter_ingroups',max_inbound_filter_min_sec='$max_inbound_filter_min_sec',status_group_id='$status_group_id',mobile_number='$mobile_number',two_factor_override='$two_factor_override',manual_dial_filter='$manual_dial_filter',user_location='$user_location',download_invalid_files='$download_invalid_files',user_group_two='$user_group_two',modify_dial_prefix='$modify_dial_prefix',inbound_credits='$inbound_credits',hci_enabled='$hci_enabled' $user_codeSQL $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -16427,7 +16432,7 @@ if ($ADD=="4B") echo "
"._QXZ("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',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',preset_contact_search='$preset_contact_search',max_inbound_calls='$max_inbound_calls',wrapup_seconds_override='$wrapup_seconds_override',lead_filter_id='$lead_filter_id',user_hide_realtime='$user_hide_realtime',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',ready_max_logout='$ready_max_logout',failed_login_count=0,max_hopper_calls='$max_hopper_calls',max_hopper_calls_hour='$max_hopper_calls_hour',hide_call_log_info='$hide_call_log_info',next_dial_my_callbacks='$next_dial_my_callbacks',max_inbound_filter_enabled='$max_inbound_filter_enabled',max_inbound_filter_statuses='$max_inbound_filter_statuses',max_inbound_filter_ingroups='$max_inbound_filter_ingroups',max_inbound_filter_min_sec='$max_inbound_filter_min_sec',status_group_id='$status_group_id',mobile_number='$mobile_number',user_location='$user_location',user_group_two='$user_group_two' $user_codeSQL $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; + $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',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',preset_contact_search='$preset_contact_search',max_inbound_calls='$max_inbound_calls',wrapup_seconds_override='$wrapup_seconds_override',lead_filter_id='$lead_filter_id',user_hide_realtime='$user_hide_realtime',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',ready_max_logout='$ready_max_logout',failed_login_count=0,max_hopper_calls='$max_hopper_calls',max_hopper_calls_hour='$max_hopper_calls_hour',hide_call_log_info='$hide_call_log_info',next_dial_my_callbacks='$next_dial_my_callbacks',max_inbound_filter_enabled='$max_inbound_filter_enabled',max_inbound_filter_statuses='$max_inbound_filter_statuses',max_inbound_filter_ingroups='$max_inbound_filter_ingroups',max_inbound_filter_min_sec='$max_inbound_filter_min_sec',status_group_id='$status_group_id',mobile_number='$mobile_number',user_location='$user_location',user_group_two='$user_group_two',hci_enabled='$hci_enabled' $user_codeSQL $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); @@ -17304,7 +17309,7 @@ if ($ADD==41) { echo "
"._QXZ("RESETTING CAMPAIGN LEAD HOPPER")."\n"; echo "
- "._QXZ("Wait 1 minute before dialing next number")."\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE','RHOLD');"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE','RHOLD','RQUEUE');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17581,7 +17586,7 @@ if ($ADD==44) { echo "
"._QXZ("RESETTING CAMPAIGN LEAD HOPPER")."\n"; echo "
- "._QXZ("Wait 1 minute before dialing next number")."\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE','RHOLD');"; + $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE','RHOLD','RQUEUE');"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -24869,7 +24874,7 @@ if ($ADD==3) echo "\n"; } + + if ($SShopper_hold_inserts > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + } if ( ($LOGuser_level > 8) and ($LOGalter_admin_interface > 0) ) { @@ -29132,7 +29150,7 @@ if ($ADD==31) echo " - "._QXZ("SHOW")."

"; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY','RHOLD');"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' $LOGallowed_campaignsSQL and status IN('READY','RHOLD','RQUEUE');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); @@ -30850,7 +30868,7 @@ if ($ADD==34) echo " - "._QXZ("SHOW")."

"; } - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','RHOLD') $LOGallowed_campaignsSQL;"; + $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','RHOLD','RQUEUE') $LOGallowed_campaignsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $rowx=mysqli_fetch_row($rslt); diff --git a/www/vicidial/admin_modify_lead.php b/www/vicidial/admin_modify_lead.php index 70d9281e..fd838190 100644 --- a/www/vicidial/admin_modify_lead.php +++ b/www/vicidial/admin_modify_lead.php @@ -116,6 +116,7 @@ # 230307-1326 - Small fix for closer calls DID display, Issue #1447 # 230309-1444 - Added Inbound Call Menu Log display as part of IVR Log section # 231117-1920 - Added vicidial_3way_press_log display +# 231126-2218 - Added vicidial_hci_log display # require("dbconnect_mysqli.php"); @@ -277,7 +278,7 @@ if ($nonselectable_statuses > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable,allow_emails,enable_languages,language_method,active_modules,log_recording_access,admin_screen_colors,enable_gdpr_download_deletion,source_id_display,mute_recordings,sip_event_logging,allow_web_debug FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable,allow_emails,enable_languages,language_method,active_modules,log_recording_access,admin_screen_colors,enable_gdpr_download_deletion,source_id_display,mute_recordings,sip_event_logging,allow_web_debug,hopper_hold_inserts FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); #if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -298,6 +299,7 @@ if ($qm_conf_ct > 0) $SSmute_recordings = $row[11]; $SSsip_event_logging = $row[12]; $SSallow_web_debug = $row[13]; + $SShopper_hold_inserts = $row[14]; } if ($SSallow_web_debug < 1) {$DB=0;} ##### END SETTINGS LOOKUP ##### @@ -3438,6 +3440,69 @@ else } } 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,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today,modify_dial_prefix,inbound_credits from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $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,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today,modify_dial_prefix,inbound_credits,hci_enabled from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_id = $row[0]; @@ -25021,6 +25026,7 @@ if ($ADD==3) $failed_last_type_today=$row[148]; $modify_dial_prefix = $row[149]; $inbound_credits = $row[150]; + $hci_enabled = $row[151]; ##### latest 2FA auth record data $last_auth=''; @@ -25713,6 +25719,18 @@ if ($ADD==3) echo ""; echo "
"._QXZ("HCI Enabled").": $NWB#users-hci_enabled$NWE
"; + echo ""; + echo "


\n"; + + + + if ($SShopper_hold_inserts > 0) + { + echo ""._QXZ("HCI AGENT LOGS FOR THIS LEAD").":\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT phone_number,call_date,user,user_ip,campaign_id from vicidial_hci_log where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' order by call_date desc limit 500;"; + $rslt=mysql_to_mysqli($stmt, $link); + $logs_to_print = mysqli_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";} + else + {$bgcolor="bgcolor=\"#$SSstd_row1_background\"";} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + if ($archive_log=="Yes") + { + $stmt="SELECT phone_number,call_date,user,user_ip,campaign_id from vicidial_hci_log_archive where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' order by call_date desc limit 500;"; + $rslt=mysql_to_mysqli($stmt, $link); + $logs_to_print = mysqli_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";} + else + {$bgcolor="bgcolor=\"#$SSstd_row1_background\"";} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + } + echo "
# "._QXZ("PHONE").""._QXZ("DATE/TIME")." "._QXZ("USER")." "._QXZ("IP")." "._QXZ("CAMPAIGN")."
$u $row[0] $row[1] $row[2] $row[3] $row[4]  
$u $row[0] $row[1] $row[2] $row[3] $row[4]  


\n"; + } } @@ -3584,7 +3649,7 @@ else echo ""; echo "$u"; echo "$row[3]"; - echo " $row[4] \n"; + echo " $row[4] \n"; echo " $row[7]\n"; echo " $row[5]\n"; echo " $row[6] \n"; diff --git a/www/vicidial/functions.php b/www/vicidial/functions.php index 09402b8a..e1106a38 100644 --- a/www/vicidial/functions.php +++ b/www/vicidial/functions.php @@ -4,7 +4,7 @@ # # functions for administrative scripts and reports # -# Copyright (C) 2022 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # # CHANGES: @@ -40,6 +40,7 @@ # 210406-1740 - Moved 'dialable_leads' function to this script # 210615-0952 - Default security fix, CVE-2021-28854 # 220921-1209 - Added more failed login logging in user_authorization function +# 231119-1445 - Added user_authorization for HCI page users # ##### BEGIN validate user login credentials, check for failed lock out ##### @@ -100,6 +101,8 @@ function user_authorization($user,$pass,$user_option,$user_update,$api_call) {$stmt="SELECT count(*) from vicidial_users where user='$user' and $passSQL and user_level > 3 and active='Y' and ( (failed_login_count < $LOCK_trigger_attempts) or (UNIX_TIMESTAMP(last_login_date) < $LOCK_over) );";} if ($user_option == 'QC') {$stmt="SELECT count(*) from vicidial_users where user='$user' and $passSQL and user_level > 1 and active='Y' and ( (failed_login_count < $LOCK_trigger_attempts) or (UNIX_TIMESTAMP(last_login_date) < $LOCK_over) );";} + if ($user_option == 'HCI') + {$stmt="SELECT count(*) from vicidial_users where user='$user' and $passSQL and user_level >= 1 and active='Y' and ( (failed_login_count < $LOCK_trigger_attempts) or (UNIX_TIMESTAMP(last_login_date) < $LOCK_over) );";} if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); diff --git a/www/vicidial/hci_screen.php b/www/vicidial/hci_screen.php new file mode 100644 index 00000000..676dfb36 --- /dev/null +++ b/www/vicidial/hci_screen.php @@ -0,0 +1,1395 @@ + LICENSE: AGPLv2 +# +# This script is designed to allow agents to work with the hopper_hold_inserts features and allow leads in the hopper to be changed from RHOLD to READY status so they can be called. +# +# changes: +# 231119-1508 - First build +# + +$startMS = microtime(); + +$hci_version = '2.14-1h'; +$build = '231119-1508'; +$php_script='hci_screen.php'; +$zi=0; + +require("dbconnect_mysqli.php"); +require("functions.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} +if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} + elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +$DB=preg_replace('/[^0-9]/','',$DB); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,custom_fields_enabled,enable_languages,language_method,active_modules,log_recording_access,allow_web_debug,hopper_hold_inserts,agent_screen_colors,admin_web_directory,admin_home_url FROM system_settings;"; +$rslt=mysql_to_mysqli($stmt, $link); +#if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysqli_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; + $SSenable_languages = $row[2]; + $SSlanguage_method = $row[3]; + $active_modules = $row[4]; + $log_recording_access = $row[5]; + $SSallow_web_debug = $row[6]; + $SShopper_hold_inserts = $row[7]; + $agent_screen_colors = $row[8]; + $admin_web_directory = $row[9]; + $admin_home_url = $row[10]; + } +if ($SSallow_web_debug < 1) {$DB=0;} +##### END SETTINGS LOOKUP ##### +########################################### + +$phone_number = preg_replace('/[^0-9]/','',$phone_number); +$stage = preg_replace('/[^-_0-9a-zA-Z]/','',$stage); + +if ($non_latin < 1) + { + $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER); + $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW); + $user = preg_replace('/[^-\_0-9a-zA-Z]/','',$user); + $campaign_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$campaign_id); + $submit = preg_replace('/[^- 0-9a-zA-Z]/','',$submit); + $SUBMIT = preg_replace('/[^- 0-9a-zA-Z]/','',$SUBMIT); + } +else + { + $PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER); + $PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW); + $user=preg_replace('/[^-_0-9\p{L}]/u','',$user); + $campaign_id = preg_replace('/[^-\_0-9\p{L}]/u', '',$campaign_id); + $submit = preg_replace('/[^- 0-9\p{L}]/u','',$submit); + $SUBMIT = preg_replace('/[^- 0-9\p{L}]/u','',$SUBMIT); + } + + +$STARTtime = date("U"); +$defaultappointment = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$browser=preg_replace("/\'|\"|\\\\/","",$browser); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +$PHP_SELF=$_SERVER['PHP_SELF']; +$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); +$CL=':'; +if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$FQDN = "$server_name$server_port"; +$hciPAGE = "$HTTPprotocol$server_name$server_port$script_name"; + +$stmt="SELECT modify_leads,qc_enabled,full_name,modify_leads,user_group,selected_language,hci_enabled from vicidial_users where user='$PHP_AUTH_USER';"; +if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} +$rslt=mysql_to_mysqli($stmt, $link); +$users_to_parse = mysqli_num_rows($rslt); +if ($users_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $modify_leads = $rowx[0]; + $qc_enabled = $rowx[1]; + $LOGfullname = $rowx[2]; + $LOGmodify_leads = $rowx[3]; + $LOGuser_group = $rowx[4]; + $VUselected_language = $rowx[5]; + $hci_enabled = $rowx[6]; + } + +##### BEGIN Define colors and logo ##### +$SSmenu_background='015B91'; +$SSframe_background='D9E6FE'; +$SSstd_row1_background='9BB9FB'; +$SSstd_row2_background='B9CBFD'; +$SSstd_row3_background='8EBCFD'; +$SSstd_row4_background='B6D3FC'; +$SSstd_row5_background='A3C3D6'; +$SSalt_row1_background='BDFFBD'; +$SSalt_row2_background='99FF99'; +$SSalt_row3_background='CCFFCC'; + +if ($agent_screen_colors != 'default') + { + $stmt = "SELECT menu_background,frame_background,std_row1_background,std_row2_background,std_row3_background,std_row4_background,std_row5_background,alt_row1_background,alt_row2_background,alt_row3_background,web_logo FROM vicidial_screen_colors where colors_id='$agent_screen_colors';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $qm_conf_ct = mysqli_num_rows($rslt); + if ($qm_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $SSmenu_background = $row[0]; + $SSframe_background = $row[1]; + $SSstd_row1_background = $row[2]; + $SSstd_row2_background = $row[3]; + $SSstd_row3_background = $row[4]; + $SSstd_row4_background = $row[5]; + $SSstd_row5_background = $row[6]; + $SSalt_row1_background = $row[7]; + $SSalt_row2_background = $row[8]; + $SSalt_row3_background = $row[9]; + $SSweb_logo = $row[10]; + } + } + +$Mhead_color = $SSstd_row5_background; +$Mmain_bgcolor = $SSmenu_background; +$Mhead_color = $SSstd_row5_background; + +$selected_logo = "./images/vicidial_admin_web_logo.png"; +$logo_new=0; +$logo_old=0; +if (file_exists('../$admin_web_directory/images/vicidial_admin_web_logo.png')) {$logo_new++;} +if (file_exists('vicidial_admin_web_logo.gif')) {$logo_old++;} +if ($SSweb_logo=='default_new') + { + $selected_logo = "./images/vicidial_admin_web_logo.png"; + } +if ( ($SSweb_logo=='default_old') and ($logo_old > 0) ) + { + $selected_logo = "../$admin_web_directory/vicidial_admin_web_logo.gif"; + } +if ( ($SSweb_logo!='default_new') and ($SSweb_logo!='default_old') ) + { + if (file_exists("../$admin_web_directory/images/vicidial_admin_web_logo$SSweb_logo")) + { + $selected_logo = "../$admin_web_directory/images/vicidial_admin_web_logo$SSweb_logo"; + } + } +$temp_logo = $selected_logo; + +$auth=0; +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'HCI',1,0); +if ( ($auth_message == 'GOOD') or ($auth_message == '2FA') ) + { + $auth=1; + if ($auth_message == '2FA') + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("Your session is expired").". "._QXZ("Click here to log in").".\n"; + exit; + } + } + +if ($auth < 1) + { + $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); + if ($auth_message == 'LOCK') + { + $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); + Header ("Content-type: text/html; charset=utf-8"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; + exit; + } + if ($auth_message == 'IPBLOCK') + { + $VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": $ip"; + Header ("Content-type: text/html; charset=utf-8"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; + exit; + } + Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; + exit; + } + +# check user permissions +if ($hci_enabled < 1) + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("HCI is not enabled for your user account")."\n"; + exit; + } + +if ($SShopper_hold_inserts < 1) + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("HCI is not enabled on this system")."\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; +$rslt=mysql_to_mysqli($stmt, $link); +$row=mysqli_fetch_row($rslt); +if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) ) + { + $LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]); + $LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } + + +################################################################################ +### BEGIN LOGOUT - agent logout, delete live entry, reset reserved hopper leads +################################################################################ +if ( ($stage == 'LOGOUT') and (strlen($campaign_id) > 0) ) + { + $stmt="DELETE FROM vicidial_hci_live_agents WHERE user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt="INSERT INTO vicidial_hci_agent_log SET user='$PHP_AUTH_USER',campaign_id='$campaign_id',user_ip='$ip',login_time=NOW(),status='LOGOUT';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt="SELECT lead_id from vicidial_hci_reserve WHERE user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $vhr_ct++; + } + $vhr_ct=0; + $vh_clear=0; + $vhr_clear=0; + while ($vhr_to_parse > $vhr_ct) + { + $stmt="UPDATE vicidial_hopper SET status='RHOLD',user='' where lead_id='$Elead_id[$vhr_ct]' and status='RQUEUE';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vh_clear = ($vh_clear + $affected_rows); + + $stmt="DELETE FROM vicidial_hci_reserve WHERE lead_id='$Elead_id[$vhr_ct]' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vhr_clear = ($vhr_clear + $affected_rows); + $vhr_ct++; + } + + $notes = "$campaign_id $vh_clear $vhr_clear"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + } +################################################################################ +### END LOGOUT - agent logout, delete live entry, reset reserved hopper leads +################################################################################ + + +################################################################################ +### BEGIN chosen_campaign - agent has chosen a campaign to log into, insert the live agent entry and a log entry +################################################################################ +if ( ($stage == 'chosen_campaign') and (strlen($campaign_id) > 0) ) + { + $valid_campaign=0; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and active='Y' and hopper_hold_inserts='ENABLED' $LOGallowed_campaignsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $camps_to_parse = mysqli_num_rows($rslt); + if ($camps_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $valid_campaign = $rowx[0]; + } + if ($valid_campaign > 0) + { + $stmt="INSERT INTO vicidial_hci_live_agents SET user='$PHP_AUTH_USER',campaign_id='$campaign_id',user_ip='$ip',login_time=NOW(),last_call_time=NOW(),last_update_time=NOW(),status='LOGIN',lead_id=0,phone_number='',random_id=0;"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt="INSERT INTO vicidial_hci_agent_log SET user='$PHP_AUTH_USER',campaign_id='$campaign_id',user_ip='$ip',login_time=NOW(),status='LOGIN';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $hopper_hold_count=0; + $stmt="SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id' and status='RHOLD' and user='';"; + $rslt=mysql_to_mysqli($stmt, $link); + $hop_to_parse = mysqli_num_rows($rslt); + if ($hop_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $hopper_hold_count = $rowx[0]; + } + if ($hopper_hold_count > 0) + { + $stmt="UPDATE vicidial_hopper SET user='$PHP_AUTH_USER',status='RQUEUE' WHERE campaign_id='$campaign_id' and status='RHOLD' and user='' order by priority desc,hopper_id limit 40;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vh_affected_rows = mysqli_affected_rows($link); + + $stmt="SELECT lead_id from vicidial_hopper WHERE user='$PHP_AUTH_USER' and status='RQUEUE' and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $vhr_ct++; + } + $vhr_ct=0; + $vhr_insert=0; + while ($vhr_to_parse > $vhr_ct) + { + $temp_phone=''; + $stmt="SELECT phone_number from vicidial_list where lead_id='$Elead_id[$vhr_ct]';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vl_to_parse = mysqli_num_rows($rslt); + if ($vl_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $temp_phone = $rowx[0]; + } + + $stmt="INSERT INTO vicidial_hci_reserve SET user='$PHP_AUTH_USER',lead_id='$Elead_id[$vhr_ct]',phone_number='$temp_phone',reserve_date=NOW(),status='NEW',campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vhr_insert = ($vhr_insert + $affected_rows); + $vhr_ct++; + } + } + + $notes = "$campaign_id $ip $vh_affected_rows $vhr_to_parse $vhr_ct $vhr_insert"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + } + } +################################################################################ +### END chosen_campaign - agent has chosen a campaign to log into, insert the live agent entry and a log entry +################################################################################ + + +################################################################################ +### BEGIN switch_campaign - logged-in agent has chosen to switch to a different campaign, insert the live agent entry and a log entry +################################################################################ +if ( ($stage == 'switch_campaign') and (strlen($campaign_id) > 0) ) + { + $valid_campaign=0; + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and active='Y' and hopper_hold_inserts='ENABLED' $LOGallowed_campaignsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $camps_to_parse = mysqli_num_rows($rslt); + if ($camps_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $valid_campaign = $rowx[0]; + } + if ($valid_campaign > 0) + { + $stmt="SELECT campaign_id,status from vicidial_hci_live_agents where user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $users_to_parse = mysqli_num_rows($rslt); + if ($users_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $old_campaign_id = $rowx[0]; + $VHLAstatus = $rowx[1]; + + $stmt="UPDATE vicidial_hci_live_agents SET campaign_id='$campaign_id',user_ip='$ip',login_time=NOW(),last_call_time=NOW(),last_update_time=NOW(),status='SWITCH',lead_id=0,phone_number='',random_id=0 WHERE user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt="INSERT INTO vicidial_hci_agent_log SET user='$PHP_AUTH_USER',campaign_id='$campaign_id',user_ip='$ip',login_time=NOW(),status='SWITCH';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt="SELECT lead_id from vicidial_hci_reserve WHERE user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $vhr_ct++; + } + $vhr_ct=0; + $vh_clear=0; + $vhr_clear=0; + while ($vhr_to_parse > $vhr_ct) + { + $stmt="UPDATE vicidial_hopper SET status='RHOLD',user='' where lead_id='$Elead_id[$vhr_ct]' and status='RQUEUE';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vh_clear = ($vh_clear + $affected_rows); + + $stmt="DELETE FROM vicidial_hci_reserve WHERE lead_id='$Elead_id[$vhr_ct]' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vhr_clear = ($vhr_clear + $affected_rows); + $vhr_ct++; + } + + $hopper_hold_count=0; + $stmt="SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id' and status='RHOLD' and user='';"; + $rslt=mysql_to_mysqli($stmt, $link); + $hop_to_parse = mysqli_num_rows($rslt); + if ($hop_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $hopper_hold_count = $rowx[0]; + } + if ($hopper_hold_count > 0) + { + $stmt="UPDATE vicidial_hopper SET user='$PHP_AUTH_USER',status='RQUEUE' WHERE campaign_id='$campaign_id' and status='RHOLD' and user='' order by priority desc,hopper_id limit 40;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vh_affected_rows = mysqli_affected_rows($link); + + $stmt="SELECT lead_id from vicidial_hopper WHERE user='$PHP_AUTH_USER' and status='RQUEUE' and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $vhr_ct++; + } + $vhr_ct=0; + $vhr_insert=0; + while ($vhr_to_parse > $vhr_ct) + { + $temp_phone=''; + $stmt="SELECT phone_number from vicidial_list where lead_id='$Elead_id[$vhr_ct]';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vl_to_parse = mysqli_num_rows($rslt); + if ($vl_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $temp_phone = $rowx[0]; + } + + $stmt="INSERT INTO vicidial_hci_reserve SET user='$PHP_AUTH_USER',lead_id='$Elead_id[$vhr_ct]',phone_number='$temp_phone',reserve_date=NOW(),status='NEW',campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vhr_insert = ($vhr_insert + $affected_rows); + $vhr_ct++; + } + } + + $notes = "$campaign_id $old_campaign_id $VHLAstatus $vh_clear $vhr_clear $vh_affected_rows $vhr_insert"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("Agent not logged in to HCI screen")."\n"; + exit; + } + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("This is not a valid HCI campaign").": $campaign_id \n"; + exit; + } + } +################################################################################ +### END switch_campaign - logged-in agent has chosen to switch to a different campaign, insert the live agent entry and a log entry +################################################################################ + + +################################################################################ +### BEGIN dashboard - display dashboard stats for logged-in campaign +################################################################################ +if ($stage == 'dashboard') + { + $stmt="SELECT campaign_id,status from vicidial_hci_live_agents where user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $users_to_parse = mysqli_num_rows($rslt); + if ($users_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $campaign_id = $rowx[0]; + $VHLAstatus = $rowx[1]; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("Agent not logged in to HCI screen")."\n"; + exit; + } + + $hopper_ready=0; + $stmt="SELECT count(*) from vicidial_hopper WHERE status='READY' and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $hop_to_parse = mysqli_num_rows($rslt); + if ($hop_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $hopper_ready = $rowx[0]; + } + + $hopper_hold=0; + $stmt="SELECT count(*) from vicidial_hopper WHERE status='RHOLD' and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $hop_to_parse = mysqli_num_rows($rslt); + if ($hop_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $hopper_hold = $rowx[0]; + } + + $agents_ready=0; + $stmt="SELECT count(*) from vicidial_live_agents where status IN ('READY','CLOSER') and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vla_to_parse = mysqli_num_rows($rslt); + if ($vla_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $agents_ready = $rowx[0]; + } + + $calls_out=0; + $stmt="SELECT count(*) from vicidial_auto_calls where campaign_id='$campaign_id' and status = 'SENT';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vla_to_parse = mysqli_num_rows($rslt); + if ($vla_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $calls_out = $rowx[0]; + } + + $drops_today=0; + $drops_answers_pct=0; + $stmt="SELECT drops_today,drops_answers_today_pct from vicidial_campaign_stats where campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vla_to_parse = mysqli_num_rows($rslt); + if ($vla_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $drops_today = $rowx[0]; + $drops_answers_pct = $rowx[1]; + } + + $camp_dial_method=''; + $camp_dial_level=0; + $camp_adapt_level=0; + $max_dial_level=0; + $stmt="SELECT dial_method,auto_dial_level,adaptive_maximum_level from vicidial_campaigns where campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vla_to_parse = mysqli_num_rows($rslt); + if ($vla_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $camp_dial_method = $rowx[0]; + $camp_dial_level = $rowx[1]; + $camp_adapt_level = $rowx[2]; + + if (preg_match("/ADAPT/",$camp_dial_method)) + {$max_dial_level = $camp_adapt_level;} + else + {$max_dial_level = $camp_dial_level;} + } + + $calls_offset = (($agents_ready * $max_dial_level) - $calls_out); + $calls_offset_color="fa8073"; + if ($calls_offset > -30) + { $calls_offset_color="bbffb8";} + if ($calls_offset > 30) + { $calls_offset_color="edbb47";} + + + echo ""; + echo "
"; + echo ""._QXZ("Dashboard").": "; + echo ""; + echo "$NOW_TIME"; + echo "
\n
"; + + echo "
"; + echo "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
"._QXZ("Calls in Progress")."     "._QXZ("Calls on Hold")."     "._QXZ("Records Remaining")."  
$calls_out$hopper_hold$hopper_ready
 
"._QXZ("Agents Ready")."     "._QXZ("Calls Offset")."     "._QXZ("Drop Rate")."  
$agents_ready$calls_offset$drops_answers_pct%
"; + echo "

"; + + $notes = "$campaign_id $calls_out $hopper_hold $hopper_ready $agents_ready $calls_offset $drops_answers_pct"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + + exit; + } +################################################################################ +### END dashboard - display dashboard stats for logged-in campaign +################################################################################ + + +################################################################################ +### BEGIN lead_display - display reserved hold hopper leads for this agent, to be confirmed +################################################################################ +if ($stage == 'lead_display') + { + $stmt="SELECT campaign_id,status from vicidial_hci_live_agents where user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $users_to_parse = mysqli_num_rows($rslt); + if ($users_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $campaign_id = $rowx[0]; + $VHLAstatus = $rowx[1]; + } + else + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("Agent not logged in to HCI screen")."\n"; + exit; + } + + $reserved_ct=0; + $stmt="SELECT count(*) from vicidial_hci_reserve where campaign_id='$campaign_id' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $camps_to_parse = mysqli_num_rows($rslt); + if ($camps_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $reserved_ct = $rowx[0]; + } + if ($reserved_ct < 40) + { + $reserve_more_hopper_leads = (40 - $reserved_ct); + + if ($reserve_more_hopper_leads > 0) + { + $hopper_hold_count=0; + $stmt="SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id' and status='RHOLD' and user='';"; + $rslt=mysql_to_mysqli($stmt, $link); + $hop_to_parse = mysqli_num_rows($rslt); + if ($hop_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $hopper_hold_count = $rowx[0]; + } + if ($hopper_hold_count > 0) + { + $stmt="UPDATE vicidial_hopper SET user='$PHP_AUTH_USER',status='RQUEUE' WHERE campaign_id='$campaign_id' and status='RHOLD' and user='' order by priority desc,hopper_id limit $reserve_more_hopper_leads;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vh_affected_rows = mysqli_affected_rows($link); + + $stmt="SELECT lead_id from vicidial_hopper WHERE user='$PHP_AUTH_USER' and status='RQUEUE' and campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $vhr_ct++; + } + $vhr_ct=0; + $vhr_insert=0; + while ($vhr_to_parse > $vhr_ct) + { + $already_reserved=0; + $stmt="SELECT count(*) from vicidial_hci_reserve where lead_id='$Elead_id[$vhr_ct]';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vt_to_parse = mysqli_num_rows($rslt); + if ($vt_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $already_reserved = $rowx[0]; + } + + if ($already_reserved < 1) + { + $temp_phone=''; + $stmt="SELECT phone_number from vicidial_list where lead_id='$Elead_id[$vhr_ct]';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vl_to_parse = mysqli_num_rows($rslt); + if ($vl_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $temp_phone = $rowx[0]; + } + + $stmt="INSERT INTO vicidial_hci_reserve SET user='$PHP_AUTH_USER',lead_id='$Elead_id[$vhr_ct]',phone_number='$temp_phone',reserve_date=NOW(),status='NEW',campaign_id='$campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $affected_rows = mysqli_affected_rows($link); + $vhr_insert = ($vhr_insert + $affected_rows); + } + $vhr_ct++; + } + } + + $stage = 'reserve_more_leads'; + $notes = "$campaign_id $reserve_more_hopper_leads $vh_clear $hopper_hold_count $vh_affected_rows $vhr_insert"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + } + } + + $reserved_ct=0; + $stmt="SELECT count(*) from vicidial_hci_reserve where campaign_id='$campaign_id' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $camps_to_parse = mysqli_num_rows($rslt); + if ($camps_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $reserved_ct = $rowx[0]; + } + + if ($reserved_ct < 1) + { + header ("Content-type: text/html; charset=utf-8"); + echo _QXZ("There are no leads available")."\n"; + exit; + } + else + { + $stmt="SELECT lead_id,phone_number from vicidial_hci_reserve WHERE campaign_id='$campaign_id' and user='$PHP_AUTH_USER' order by reserve_date,lead_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + $Elead_id = array(); + $Ephone = array(); + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $rowx=mysqli_fetch_row($rslt); + $Elead_id[$vhr_ct] = $rowx[0]; + $Ephone[$vhr_ct] = $rowx[1]; + $vhr_ct++; + } + + echo ""._QXZ("Call Confirmation").":
"; + + $row_ct=0; + $vhr_ct=0; + while ($vhr_to_parse > $vhr_ct) + { + $USnpa = substr($Ephone[$vhr_ct], 0, 3); + $USnxx = substr($Ephone[$vhr_ct], 3, 3); + $USxxxx = substr($Ephone[$vhr_ct], 6, 4); + $temp_phone = "($USnpa) ".$USnxx.'-'.$USxxxx; + + # echo "$Elead_id[$vhr_ct] - $Ephone[$vhr_ct] - $temp_phone
"; + # echo "
\n"; + + echo ""; + # if ($row_ct >= 3) {echo "
"; $row_ct=0;} + echo "
"; + + $row_ct++; + $vhr_ct++; + } + echo "
"; + } + + exit; + } +################################################################################ +### END lead_display - display reserved hold hopper leads for this agent, to be confirmed +################################################################################ + + +################################################################################ +### BEGIN activate_lead - set hopper lead to READY and remove entry from reserved hopper leads for this user +################################################################################ +if ( ($stage == 'activate_lead') and (strlen($lead_id) > 0) ) + { + $campaign_id=''; + $phone_number=''; + $stmt="SELECT campaign_id,phone_number from vicidial_hci_reserve WHERE user='$PHP_AUTH_USER' and lead_id='$lead_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vhr_to_parse = mysqli_num_rows($rslt); + if ($vhr_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $campaign_id = $rowx[0]; + $phone_number = $rowx[1]; + } + $vhr_ct=0; + $vh_clear=0; + $vhr_clear=0; + if (strlen($phone_number) > 0) + { + $stmt="UPDATE vicidial_hopper SET status='READY',user='' where lead_id='$lead_id' and status='RQUEUE' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $VHaffected_rows = mysqli_affected_rows($link); + + if ($VHaffected_rows > 0) + { + $stmt="DELETE FROM vicidial_hci_reserve WHERE lead_id='$lead_id' and user='$PHP_AUTH_USER';"; + $rslt=mysql_to_mysqli($stmt, $link); + $VHRaffected_rows = mysqli_affected_rows($link); + + $stmt="INSERT INTO vicidial_hci_log SET lead_id='$lead_id',user='$PHP_AUTH_USER',phone_number='$phone_number',campaign_id='$campaign_id',call_date=NOW(),user_ip='$ip',status='CONFIRMED';"; + $rslt=mysql_to_mysqli($stmt, $link); + $VHLaffected_rows = mysqli_affected_rows($link); + + $stmt="INSERT INTO hci_logs SET lead_id='$lead_id',user='$PHP_AUTH_USER',campaign_id='$campaign_id',date=NOW();"; + $rslt=mysql_to_mysqli($stmt, $link); + $HLaffected_rows = mysqli_affected_rows($link); + } + } + + $notes = "$phone_number $VHaffected_rows $VHRaffected_rows $VHLaffected_rows $HLaffected_rows"; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + exit; + } +################################################################################ +### BEGIN activate_lead - set hopper lead to READY and remove entry from reserved hopper leads for this user +################################################################################ + + +# Called AJAX functions go here + + + + + + +# BEGIN building main screen +$stmt="SELECT campaign_id,status from vicidial_hci_live_agents where user='$PHP_AUTH_USER';"; +$rslt=mysql_to_mysqli($stmt, $link); +$users_to_parse = mysqli_num_rows($rslt); +if ($users_to_parse > 0) + { + $rowx=mysqli_fetch_row($rslt); + $campaign_id = $rowx[0]; + $VHLAstatus = $rowx[1]; + } + +# get list of HCI-enabled campaigns for pull-down lists +$camp_panel_code=''; +$camp_form_code = ""; + if ($campaign_id == $rowx[0]) + { + $camp_panel_code .= ""; + } + else + { + $camp_panel_code .= ""; + } + $camp_panel_code .= ""; + $o++; + } +$camp_panel_code .= "
*   $rowx[0] - $rowx[1]       $rowx[0] - $rowx[1]  
"; +$camp_form_code .= "\n"; + + +if ($users_to_parse < 1) + { + # choose a campaign screen + ?> + + + + + + <?php echo _QXZ("HCI Screen"); ?> + + + +   + +
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "


"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\"Agent "._QXZ("HCI: Campaign Selection")."
 
"._QXZ("Campaign:")." $camp_form_code
  \n"; + echo "

"._QXZ("VERSION:")." $hci_version       "._QXZ("BUILD:")." $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "

\n\n"; + + $stage='choose_campaign'; + $notes=''; + vicidial_ajax_log($NOW_TIME,$startMS,$link,$stage,$php_script,$PHP_AUTH_USER,$notes,$lead_id,$session_name,$stmt); + + exit; + } + + +?> + + + +<?php echo _QXZ("HCI Screen - Campaign").": $campaign_id" ?> + + + + + + + + + + + + + + + +
System logo               |   ">  
+ + + + + + +\n"; +echo ""; +echo "\n"; + + + +echo "\n"; + +$ENDtime = date("U"); + +$RUNtime = ($ENDtime - $STARTtime); + +echo "\n\n\n


\n\n"; + + +echo ""; + + +?> + +
+
+
+ +
+
+           " height="206px" width="206px" alt="" /> +
+
+
+
+ + + + + + + + + + +
+   : +
+ + + + + +
  +

+
  +

+ + + +

+  
+
+
+
+ + + + + + +
+   +
+ + + + + +
  +

+ + + +

+
+   + +
  + +
+
+
+ + + + + + +
+   +
+ + + + + + +
  +

+" alt="alert" border="0"> +
  +

+ + + +

+
+ +
  + +
+
+
+ + + + + diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index a2a2eddc..9e27caf6 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20231115223301 +# version: 20231119153001 users-user User ID This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-. users-pass Password This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N. @@ -93,6 +93,7 @@ users-qc_user_level QC User Level This setting defines what the agent Quali users-qc_pass QC Record Pass This option allows the agent to specify that a record has passed the first round of QC after reviewing the record. users-qc_finish QC Record Finish This option allows the agent to specify that a record has finished the second round of QC after reviewing the passed record. users-qc_commit QC Record Commit This option allows the agent to specify that a record has been committed in QC. It can no longer be modified by anyone. +users-hci_enabled HCI Enabled This option allows the user to have access to the HCI screen, which is accessible from the Welcome page, if Hopper Hold Inserts are allowed on your system. users-add_timeclock_log Add Timeclock Log Record This option allows the user to add records to the timeclock log. users-modify_timeclock_log Modify Timeclock Log Record This option allows the user to modify records in the timeclock log. users-delete_timeclock_log Delete Timeclock Log Record This option allows the user to delete records in the timeclock log. diff --git a/www/vicidial/images/icon_calls_offset.png b/www/vicidial/images/icon_calls_offset.png new file mode 100644 index 00000000..62954e9d Binary files /dev/null and b/www/vicidial/images/icon_calls_offset.png differ diff --git a/www/vicidial/images/icon_drop_rate.png b/www/vicidial/images/icon_drop_rate.png new file mode 100644 index 00000000..68fdedae Binary files /dev/null and b/www/vicidial/images/icon_drop_rate.png differ diff --git a/www/vicidial/images/icon_hourglass.png b/www/vicidial/images/icon_hourglass.png new file mode 100644 index 00000000..a71d52f1 Binary files /dev/null and b/www/vicidial/images/icon_hourglass.png differ diff --git a/www/vicidial/user_stats.php b/www/vicidial/user_stats.php index 70402a8d..94177a1a 100644 --- a/www/vicidial/user_stats.php +++ b/www/vicidial/user_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -68,6 +68,7 @@ # 220221-0916 - Added allow_web_debug system setting # 220310-1427 - Fix for LOGOUT/LOGIN events sharing the same timedate # 220916-1744 - Added reporting section for webserver/URL logins +# 231126-2235 - Added vicidial_hci_log display # $startMS = microtime(); @@ -128,7 +129,7 @@ if ( (!isset($end_date)) or (strlen($end_date) < 10) ) {$end_date = $TODAY;} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable,allow_emails,level_8_disable_add,enable_languages,language_method,log_recording_access,admin_screen_colors,mute_recordings,allow_web_debug FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable,allow_emails,level_8_disable_add,enable_languages,language_method,log_recording_access,admin_screen_colors,mute_recordings,allow_web_debug,hopper_hold_inserts FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); #if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -149,6 +150,7 @@ if ($qm_conf_ct > 0) $SSadmin_screen_colors = $row[11]; $SSmute_recordings = $row[12]; $SSallow_web_debug = $row[13]; + $SShopper_hold_inserts = $row[14]; } if ($SSallow_web_debug < 1) {$DB=0;} ##### END SETTINGS LOOKUP ##### @@ -180,6 +182,7 @@ if ($search_archived_data) $vicidial_agent_function_log=use_archive_table("vicidial_agent_function_log"); $call_log_table=use_archive_table("call_log"); $vicidial_log_table=use_archive_table("vicidial_log"); + $vicidial_hci_log=use_archive_table("vicidial_hci_log"); } else { @@ -197,6 +200,7 @@ else $vicidial_agent_function_log="vicidial_agent_function_log"; $call_log_table="call_log"; $vicidial_log_table="vicidial_log"; + $vicidial_hci_log="vicidial_hci_log"; } ############# @@ -1886,6 +1890,48 @@ else } $MAIN.="

\n"; + + if ($SShopper_hold_inserts > 0) + { + ##### BEGIN vicidial_hci_log entries ##### + $MAIN.=""._QXZ("HCI Agent Log Records for this Time Period").": ("._QXZ("10000 record download limit").") $NWB#user_stats-hci_log$NWE      ["._QXZ("DOWNLOAD")."]\n"; + $MAIN.="\n"; + $MAIN.="\n"; + $CSV_text16.="\""._QXZ("HCI Agent Log Records for this Time Period").": ("._QXZ("10000 record limit").")\"\n"; + $CSV_text16.="\"\",\"#\",\""._QXZ("DATE/TIME")."\",\""._QXZ("LEAD ID")."\",\""._QXZ("PHONE")."\",\""._QXZ("CALL DATE")."\",\""._QXZ("CAMPAIGN")."\",\""._QXZ("USER IP")."\"\n"; + + $stmt="SELECT call_date,lead_id,phone_number,user_ip,campaign_id from ".$vicidial_hci_log." where user='" . mysqli_real_escape_string($link, $user) . "' and call_date >= '" . mysqli_real_escape_string($link, $begin_date) . " 0:00:01' and call_date <= '" . mysqli_real_escape_string($link, $end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + $logs_to_print = mysqli_num_rows($rslt); + if ($DB > 0) {echo "|$logs_to_print|$stmt|";} + + $u=0; + while ($logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $u++; + if ($u <= 1000) + { + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';} + else + {$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';} + + $MAIN.=""; + $MAIN.=""; + $MAIN.=""; + $MAIN.="\n"; + $MAIN.=""; + $MAIN.="\n"; + $MAIN.="\n"; + } + $CSV_text16.="\"\",\"$u\",\"$row[0]\",\"$row[1]\",\"$row[2]\",\"$row[3]\",\"$row[4]\"\n"; + } + $MAIN.="
# "._QXZ("DATE/TIME")."   "._QXZ("LEAD ID")."   "._QXZ("PHONE")."   "._QXZ("CALL DATE")."   "._QXZ("CAMPAIGN")."   "._QXZ("USER IP")."  
$u$row[0] $row[1] $row[2] $row[3] $row[4]


\n"; + } + ##### END vicidial_hci_log entries ##### + + ##### BEGIN manager pause code approval entries ##### $MAIN.=""._QXZ("Manager Pause Code Approvals for this Time Period").": ("._QXZ("10000 record limit").") $NWB#user_stats-pause_code_approvals$NWE      ["._QXZ("DOWNLOAD")."]\n"; $MAIN.="\n"; diff --git a/www/vicidial/vicidial_stylesheet.php b/www/vicidial/vicidial_stylesheet.php index 40945362..a7c126f2 100644 --- a/www/vicidial/vicidial_stylesheet.php +++ b/www/vicidial/vicidial_stylesheet.php @@ -1,7 +1,7 @@ , Joe Johnson LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell , Joe Johnson LICENSE: AGPLv2 # # CSS/PHP file that uses the system-defined screen colors to display report elements # @@ -10,6 +10,7 @@ # 190129-1303 - New mobile display elements added # 200309-1819 - Modifications for display formatting # 221230-2220 - Added cust_form style for text input fields +# 231127-1002 - Added HCI buttons styles # require("dbconnect_mysqli.php"); @@ -810,3 +811,51 @@ padding-right:3px; opacity: 0.6; cursor: not-allowed; } + +.button_hci_ready { + background-color: #CCCCCC; /* Grey */ + border: 0px; + border-radius: 2px; + color: #333333; + padding: 10px 22px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 14px; + } + +.button_hci_active { + background-color: #FFCC99; /* Orange */ + border: 0px; + border-radius: 2px; + color: #333333; + padding: 10px 22px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 14px; + } + +.button_hci_verify_confirm { + background-color: #; + border: 2px solid #999999; + border-radius: 0px; + color: #FFFFFF; + padding: 10px 22px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 12px; + } + +.button_hci_verify_cancel { + background-color: #E6E6E6; /* Grey */ + border: 2px solid #999999; + border-radius: 0px; + color: #666666; + padding: 10px 22px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 12px; + } diff --git a/www/vicidial/welcome.php b/www/vicidial/welcome.php index 3675c17d..62554332 100644 --- a/www/vicidial/welcome.php +++ b/www/vicidial/welcome.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 141007-2140 - Finalized adding QXZ translation to all admin files # 161106-1920 - Changed to use newer design and dynamic links # 220228-1109 - Added allow_web_debug system setting +# 231119-1540 - Added HCI Screen link if hopper_hold_inserts are allowed on the system # header ("Content-type: text/html; charset=utf-8"); @@ -23,7 +24,7 @@ if (file_exists('options.php')) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_languages,language_method,default_language,agent_screen_colors,admin_web_directory,agent_script,allow_web_debug FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_languages,language_method,default_language,agent_screen_colors,admin_web_directory,agent_script,allow_web_debug,hopper_hold_inserts FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} #if ($DB) {echo "$stmt\n";} @@ -39,6 +40,7 @@ if ($qm_conf_ct > 0) $admin_web_directory = $row[5]; $SSagent_script = $row[6]; $SSallow_web_debug = $row[7]; + $SShopper_hold_inserts = $row[8]; } if ($SSallow_web_debug < 1) {$DB=0;} ##### END SETTINGS LOOKUP ##### @@ -126,6 +128,11 @@ echo "\n"; if ($hide_timeclock_link < 1) {echo "\n";} echo "\n"; +if ($SShopper_hold_inserts > 0) + { + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -134,4 +141,4 @@ echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; -?> \ No newline at end of file +?>
 
"._QXZ("Timeclock")."
 
"._QXZ("HCI Screen")."
 
"._QXZ("Administration")."