From 04e9be559a7d706534dd343f938d1247ad58c295 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 2 Feb 2007 19:55:46 +0000 Subject: [PATCH] first client portions of pause code in vicidial.php and vdc_db_query.php git-svn-id: svn://192.168.202.10@493 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../TO_BE_TRANSLATED_2.0.3.txt | 1 + www/agc/vdc_db_query.php | 28 +++- www/agc/vicidial.php | 121 +++++++++++++++++- 3 files changed, 144 insertions(+), 6 deletions(-) diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt index f9d4064e..59f0dfc0 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt @@ -107,6 +107,7 @@ CAMPAIGN PAUSE CODE NOT DELETED|| FAST DIAL|| YOU MUST BE ENTER A PHONE NUMBER AND DIAL CODE TO USE FAST DIAL|| + SELECT A PAUSE CODE :|| ############################################################ MANAGER Manual diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 1fa78544..8930d972 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -114,10 +114,11 @@ # 70115-1733 - Added alt_dial functionality in auto-dial modes # 70118-1501 - Added user_group to vicidial_log,_agent_log,_closer_log,_callbacks # 70123-1357 - Fixed bug that would not update vicidial_closer_log status to dispo +# 70202-1438 - Added pause code submit function # -$version = '2.0.41'; -$build = '70123-1357'; +$version = '2.0.42'; +$build = '70202-1438'; require("dbconnect.php"); @@ -1738,6 +1739,27 @@ if ($ACTION == 'UpdatEFavoritEs') } +################################################################################ +### PauseCodeSubmit - Update vicidial_agent_log with pause code +################################################################################ +if ($ACTION == 'PauseCodeSubmit') +{ + $row=''; $rowx=''; + if ( (strlen($status)<1) || (strlen($agent_log_id)<1) ) + { + echo "agent_log_id $agent_log_id or pause_code $status is not valid\n"; + exit; + } + else + { + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } +echo "Pause Code has been updated to $status for $agent_log_id\n"; +} + + ################################################################################ ### CalLBacKLisT - List the USERONLY callbacks for an agent ################################################################################ diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index b42554b7..6bfff016 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -139,10 +139,11 @@ # 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group # 70201-1249 - Added FAST DIAL option for manually dialing, added UTF8 compatible code # 70201-1703 - Fixed cursor bug for most text input fields +# 70202-1453 - Added first portions of Agent Pause Codes # -$version = '2.0.110'; -$build = '70201-1703'; +$version = '2.0.111'; +$build = '70202-1453'; require("dbconnect.php"); @@ -593,7 +594,7 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -630,6 +631,7 @@ $VDloginDISPLAY=0; $use_internal_dnc=$row[29]; $allcalls_delay=$row[30]; $omit_phone_code=$row[31]; + $agent_pause_codes_active=$row[32]; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) {$scheduled_callbacks='1';} @@ -643,6 +645,30 @@ $VDloginDISPLAY=0; $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; + if ($agent_pause_codes_active=='Y') + { + ##### grab the campaign-specific statuses that can be used for dispositioning by an agent + $stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 50;"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VD_pause_codes = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_pause_codes) + { + $row=mysql_fetch_row($rslt); + $pause_codes[$i] =$row[0]; + $pause_code_names[$i] =$row[1]; + $VARpause_codes = "$VARpause_codes'$pause_codes[$i]',"; + $VARpause_code_names = "$VARpause_code_names'$pause_code_names[$i]',"; + $i++; + $j++; + } + $VD_pause_codes_ct = ($VD_pause_codes_ct+$VD_pause_codes); + $VARpause_codes = substr("$VARpause_codes", 0, -1); + $VARpause_code_names = substr("$VARpause_code_names", 0, -1); + } + ##### grab the inbound groups to choose from if campaign contains CLOSER $VARingroups="''"; if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) @@ -1261,6 +1287,11 @@ $CCAL_OUT .= ""; var CallBackCommenTs = ''; var scheduled_callbacks = ''; var dispo_check_all_pause = ''; + var pause_code_select_display = 0; + var agent_pause_codes_active = ''; + VARpause_codes = new Array(); + VARpause_code_names = new Array(); + var VD_pause_codes_ct = ''; VARstatuses = new Array(); VARstatusnames = new Array(); var VD_statuses_ct = ''; @@ -1469,6 +1500,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBuser = ''; var CBcomments = ''; var volumecontrol_active = ''; + var PauseCode_HTML = ''; var manual_auto_hotkey = 0; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; @@ -3265,6 +3297,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AutoDialReady = 0; AutoDialWaiting = 0; document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + if (agent_pause_codes_active=='Y') + { + pause_code_select_display=1; + } } var xmlhttp=false; @@ -4175,6 +4211,25 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("DispoSelectContent").innerHTML = dispo_HTML; } +// ################################################################################ +// Generate the Pause Code Chooser panel + function PauseCodeSelectContent_create(taskDSgrp,taskDSstage) + { + pause_code_HTML = ''; + document.vicidial_form.PauseCodeSelection.value = ''; + var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2); + pause_code_HTML = "
PAUSE CODE
"; + var loop_ct = 0; + while (loop_ct < VD_pause_codes_ct) + { + PauseCode_HTML = PauseCode_HTML + "" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "

"; + if (loop_ct == VD_pause_codes_ct_half) + {PauseCode_HTML = PauseCode_HTML + "
";} + loop_ct++; + } + PauseCode_HTML = PauseCode_HTML + "
"; + document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; + } // ################################################################################ // open web form, then submit disposition @@ -4340,6 +4395,52 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + +// ################################################################################ +// Submit the Pause Code + function PauseCodeSelect_submit(newpausecode) + { + hideDiv('PauseCodeSelectBox'); + WaitingForNextStep=0; + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id; + xmlhttp.open('POST', 'manager_send.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VMCpausecode_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + + + // ################################################################################ // Populate the dtmf and xfer number for each preset link in xfer-conf frame function DtMf_PreSet_a() @@ -5055,6 +5156,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('DispoButtonHideC'); hideDiv('CallBacKsLisTBox'); hideDiv('NeWManuaLDiaLBox'); + hideDiv('PauseCodeSelectBox'); if (agentonly_callbacks != '1') {hideDiv('CallbacksButtons');} // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) @@ -5131,6 +5233,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=1; check_for_conf_calls(session_id, '0'); } + if (pause_code_select_display==1) + { + PauseCodeSelectContent_create('','ReSET'); + showDiv('PauseCodeSelectBox'); + WaitingForNextStep=1; + } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();} if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();} @@ -5805,6 +5913,13 @@ Your Status:
Calls Dialing: +
SELECT A PAUSE CODE :
+ Pause Code Selection + +

  +
+
Select a CallBack Date :