From 22b18068383880f2aefee6189d57a2fc0a7fc5ae Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 14 Apr 2011 06:08:54 +0000 Subject: [PATCH] Added ALT dial link and beginning of comments to scheduled callbacks list in agent interface Added CONNECT-PAUSEALL validation to cleanup script git-svn-id: svn://192.168.202.10@1638 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_cleanup_agent_log.pl | 59 ++++++++++++++++++++++++++++++++++++ www/agc/vdc_db_query.php | 12 ++++++-- www/agc/vicidial.php | 42 ++++++++++++++++--------- 3 files changed, 96 insertions(+), 17 deletions(-) diff --git a/bin/AST_cleanup_agent_log.pl b/bin/AST_cleanup_agent_log.pl index c80adacc..a791e54e 100644 --- a/bin/AST_cleanup_agent_log.pl +++ b/bin/AST_cleanup_agent_log.pl @@ -30,6 +30,7 @@ # 110124-1134 - Small query fix for large queue_log tables # 110224-1916 - Added compatibility with QM phone environment logging # 110310-2259 - Added check for PAUSEREASON if no COMPLETE record +# 110414-0200 - Added queue_log CONNECT and PAUSEALL/UNPAUSEALL validation and fixing # # constants @@ -699,6 +700,64 @@ if ($enable_queuemetrics_logging > 0) $h++; } + + @time_id=@MT; + @agent=@MT; + + ############################################################## + ##### grab all queue_log entries with a verb of CONNECT to validate + $stmtB = "SELECT time_id,agent FROM queue_log where verb IN('CONNECT') $QM_SQL_time_H order by time_id;"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $A_connect_records=$sthB->rows; + if ($DB) {print "CONNECT Records: $A_connect_records|$stmtB|\n\n";} + $h=0; + while ($A_connect_records > $h) + { + @aryB = $sthB->fetchrow_array; + $time_id[$h] = $aryB[0]; + $agent[$h] = $aryB[1]; + $h++; + } + $sthB->finish(); + + $h=0; + while ($A_connect_records > $h) + { + $samecount=0; + ##### find the next queue_log record after the PAUSEREASON record + $stmtB = "SELECT count(*) FROM queue_log where agent='$agent[$h]' and time_id='$time_id[$h]' and verb IN('PAUSEALL','UNPAUSEALL');"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $PAU_records=$sthB->rows; + if ($PAU_records > 0) + { + @aryB = $sthB->fetchrow_array; + $samecount = $aryB[0]; + } + $sthB->finish(); + + if ($samecount >= 2) + { + $NEXTtime = ($time_id[$h] + 1); + if ($DB) {print "CONNECT-PAUSE SAME TIME: $h|$time_id[$h]|$agent[$h]|$NEXTtime|$samecount|\n";} + + ##### update the CONNECT and UNPAUSEALL records in the queue_log to one second after the PAUSEALL + $stmtB = "UPDATE queue_log SET time_id='$NEXTtime' where agent='$agent[$h]' and time_id='$time_id[$h]' and verb IN('CONNECT','UNPAUSEALL') limit 2;"; + if ($TEST < 1) + { + $Baffected_rows = $dbhB->do($stmtB); + } + if ($DB) {print " CONNECT-PAUSE records updated: $Baffected_rows|$stmtB|\n";} + + $event_string = "CONNECT-PAUSE SAME TIME: $h|$time_id[$h]|$agent[$h]|$NEXTtime|$samecount|$Baffected_rows|$stmtB"; + &event_logger; + } + + $h++; + } + + if ($qm_live_call_check > 0) { exit; diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index f12fdda8..a360e541 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -281,10 +281,11 @@ # 110310-0546 - Added ability to set a pause code at the same time of a pause # 110310-1628 - removed callslogview, extended lead info function to be used instead # 110317-0222 - Logging bug fixes +# 110413-1245 - Added ALT dialing from scheduled callback list # -$version = '2.4-186'; -$build = '110317-0222'; +$version = '2.4-187'; +$build = '110413-1245'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=413; $one_mysql_log=0; @@ -2075,6 +2076,13 @@ if ($ACTION == 'manDiaLnextCaLL') if (strlen($agent_dialed_type) < 3) {$agent_dialed_type = 'MAIN';} } + if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) + { + if ($agent_dialed_type=='ALT') + {$agent_dialed_number = $alt_phone;} + if ($agent_dialed_type=='ADDR3') + {$agent_dialed_number = $address3;} + } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 582e109e..a60571ac 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -343,10 +343,11 @@ # 110310-0331 - Added auto-pause/resume functions in auto-dial mode for pre-call work # 110310-1627 - Changed most browser alerts to HTML alerts, other bug fixes # 110322-0923 - Allowed hiding of gender pulldown +# 110413-1244 - Added ALT dialing from scheduled callback list, and other formatting changes # -$version = '2.4-320c'; -$build = '110322-0923'; +$version = '2.4-321c'; +$build = '110413-1244'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=72; $one_mysql_log=0; @@ -5281,7 +5282,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = "px\">\">" + var CB_HTML = "
# CALLBACK DATE/TIMENUMBERNAME STATUSCAMPAIGNLAST CALL DATE/TIME DIAL
px\">\">" while (loop_ct < CB_calls) { loop_ct++; @@ -5301,7 +5302,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var CB_lastcall_time = call_array[7]; var CB_callback_time = call_array[8]; var CB_comments = call_array[9]; - CB_HTML = CB_HTML + ""; + var CB_comments_ten = CB_comments; + if (CB_comments_ten.length > 10) + { + CB_comments_ten = CB_comments_ten.substr(0,10); + CB_comments_ten = CB_comments_ten + '...'; + } + CB_HTML = CB_HTML + ""; } CB_HTML = CB_HTML + "
# CALLBACK DATE/TIMENUMBERINFONAME STATUSCAMPAIGNLAST CALL DATE/TIME DIAL ALT
" + loop_ct + "" + CB_callback_time + "" + CB_phone + " - INFO" + CB_name + "" + CB_status + "" + CB_campaign + "" + CB_lastcall_time + " DIAL 
" + loop_ct + "" + CB_callback_time + "" + CB_phone + "" + CB_comments_ten + " - INFO" + CB_name + "" + CB_status + "" + CB_campaign + "" + CB_lastcall_time + " DIAL ALT 
"; document.getElementById("CallBacKsLisT").innerHTML = CB_HTML; @@ -5364,7 +5371,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // ################################################################################ // Open up a callback customer record as manual dial preview mode - function new_callback_call(taskCBid,taskLEADid) + function new_callback_call(taskCBid,taskLEADid,taskCBalt) { // alt_phone_dialing=1; LastCallbackViewed=1; @@ -5378,7 +5385,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.vicidial_form.LeadPreview.checked=true; // document.vicidial_form.DiaLAltPhonE.checked=true; hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','','','0'); + ManualDialNext(taskCBid,taskLEADid,'','','','0','',taskCBalt); } @@ -6029,15 +6036,25 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { document.getElementById("DiaLControl").innerHTML = "\"Dial"; } + var manual_dial_only_type_flag = ''; + if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') ) + { + agent_dialed_type = mdtype; + agent_dialed_number = mdnPhonENumbeR; + if (mdtype == 'ALT') + {manual_dial_only_type_flag = 'ALTPhonE';} + if (mdtype == 'ADDR3') + {manual_dial_only_type_flag = 'AddresS3';} + } if (document.vicidial_form.LeadPreview.checked==true) { reselect_preview_dial = 1; in_lead_preview_state = 1; var man_preview = 'YES'; - var man_status = "Preview the Lead then DIAL LEAD or SKIP LEAD"; + var man_status = "Preview the Lead then DIAL LEAD or SKIP LEAD"; if (manual_preview_dial=='PREVIEW_ONLY') { - var man_status = "Preview the Lead then DIAL LEAD"; + var man_status = "Preview the Lead then DIAL LEAD"; } } else @@ -6047,11 +6064,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var man_status = "Waiting for Ring..."; } - if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') ) - { - agent_dialed_type = mdtype; - agent_dialed_number = mdnPhonENumbeR; - } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -6092,8 +6104,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var MDnextResponse = null; - // alert(manDiaLnext_query); - // alert(xmlhttp.responseText); + // alert(manDiaLnext_query); + // alert(xmlhttp.responseText); MDnextResponse = xmlhttp.responseText; var MDnextResponse_array=MDnextResponse.split("\n");