From a5c576f87a839760087b8d8e7c297f00d1ede0bb Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 7 Feb 2010 16:34:03 +0000 Subject: [PATCH] Changed Pause Code functions to allow for multiple pause codes per paused period changed warning spans to variable length in vicidial.php git-svn-id: svn://192.168.202.10@1332 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/agc/vdc_db_query.php | 77 +++++++++++++++++++++++++++++++++------- www/agc/vicidial.php | 62 ++++++++++++++++++-------------- 2 files changed, 100 insertions(+), 39 deletions(-) diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 5753df08..839f6c92 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -233,12 +233,13 @@ # 100113-1949 - Fixed dispo_choice bug and added dispo_status to dispo URL call # 100122-0757 - Added NOT-LOGGED-IN-AGENTS option for sidebar view and transfer view # 100202-2305 - Fixed logging issues related to INBOUND_MAN dial_method +# 100207-1104 - Changed Pause Codes function to allow for multiple pause codes per pause period # -$version = '2.4-141'; -$build = '100202-2305'; +$version = '2.4-142'; +$build = '100207-1104'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=301; +$mysql_log_count=310; $one_mysql_log=0; require("dbconnect.php"); @@ -1865,7 +1866,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) { @@ -1876,7 +1877,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -2294,7 +2295,7 @@ if ($ACTION == 'manDiaLonly') $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysql_num_rows($rslt); if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) { @@ -2305,7 +2306,7 @@ if ($ACTION == 'manDiaLonly') $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} } } @@ -6140,11 +6141,61 @@ if ($ACTION == 'PauseCodeSubmit') } 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); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($link); + ### if this is the first pause code entry in a pause session, simply update and log to queue_log + if ($stage < 1) + { + $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); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + } + ### this is not the first pause code entry, insert new vicidial_agent_log entry + else + { + $pause_sec=0; + $stmt = "select pause_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00306',$user,$server_ip,$session_name,$one_mysql_log);} + $VDpr_ct = mysql_num_rows($rslt); + if ($VDpr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $pause_sec = ($StarTtime - $row[0]); + } + $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00307',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00308',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = trim("$row[0]"); + } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','$status');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00309',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00310',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); + } + + ### if entry accepted, add a queue_log entry if QM integration is enabled if ($affected_rows > 0) { ############################################# @@ -6189,7 +6240,7 @@ if ($ACTION == 'PauseCodeSubmit') } } } - echo " Pause Code has been updated to $status for $agent_log_id\n"; + echo ' Pause Code ' . $status . " has been recorded\nNext agent_log_id:\n" . $agent_log_id . "\n"; } diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 04950421..570b04b9 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -275,10 +275,11 @@ # 100123-0954 - changes to AGENTDIRECT selection span # 100131-2233 - Added functions to allow for a webphone loaded in a separate IFRAME # 100203-0639 - Fixed logging issues related to INBOUND_MAN dial method +# 100207-1103 - Changed Pause Codes function to allow for multiple pause codes per pause period # -$version = '2.4-253'; -$build = '100203-0639'; +$version = '2.4-254'; +$build = '100207-1103'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -2285,6 +2286,7 @@ $HKwidth = ($MASTERwidth + 20); # 450 - Hotkeys button $HSwidth = ($MASTERwidth + 1); # 431 - Header spacer $CLwidth = ($MASTERwidth - 160); # 270 - Calls in queue link +$WRheight = ($MASTERheight + 160); # 460 - Warning boxes $CQheight = ($MASTERheight + 140); # 440 - Calls in queue section $SLheight = ($MASTERheight + 122); # 422 - SideBar link, Calls in queue link $HKheight = ($MASTERheight + 105); # 405 - HotKey active Button @@ -2794,6 +2796,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var timer_action_message=''; var timer_action_seconds=''; var is_webphone=''; + var pause_code_counter=0; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -4351,7 +4354,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Request list of USERONLY callbacks for this agent function CalLBacKsLisTCheck() { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { alert("YOU MUST BE PAUSED TO CHECK CALLBACKS IN AUTO-DIAL MODE"); } @@ -4462,7 +4465,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Open page to enter details for a new manual dial lead function NeWManuaLDiaLCalL(TVfast) { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { alert("YOU MUST BE PAUSED TO MANUAL DIAL A NEW LEAD IN AUTO-DIAL MODE"); } @@ -6137,6 +6140,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VDRP_stage = 'PAUSED'; AutoDialReady = 0; AutoDialWaiting = 0; + pause_code_counter = 0; if (dial_method == "INBOUND_MAN") { auto_dial_level=starting_dial_level; @@ -7860,7 +7864,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Generate the Pause Code Chooser panel function PauseCodeSelectContent_create() { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { alert("YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-DIAL MODE"); } @@ -8135,7 +8139,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } } - } @@ -8169,7 +8172,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } 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 + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages; + 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 + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&stage=" + pause_code_counter; + pause_code_counter++; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCpausecode_query); @@ -8177,11 +8181,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - // alert(xmlhttp.responseText); + var check_pause_code = null; + var check_pause_code = xmlhttp.responseText; + var check_PC_array=check_pause_code.split("\n"); + if (check_PC_array[1] == 'Next agent_log_id:') + {agent_log_id = check_PC_array[2];} + // alert(xmlhttp.responseText + "\n|" + check_PC_array[1] + "\n|" + check_PC_array[2] + "|" + agent_log_id + "|" + pause_code_counter); } } delete xmlhttp; } +// return agent_log_id; } @@ -9310,7 +9320,7 @@ function phone_number_format(formatphone) { { if (CQauto_call_id > 0) { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { alert("YOU MUST BE PAUSED TO GRAB CALLS IN QUEUE"); } @@ -9562,7 +9572,7 @@ function phone_number_format(formatphone) { // Show the groups selection span function OpeNGrouPSelectioN() { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { alert("YOU MUST BE PAUSED TO CHANGE GROUPS"); } @@ -9585,9 +9595,9 @@ function phone_number_format(formatphone) { // Show the territories selection span function OpeNTerritorYSelectioN() { - if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { - alert("YOU MUST BE PAUSED TO CHANGE GROUPS"); + alert("YOU MUST BE PAUSED TO CHANGE TERRITORIES"); } else { @@ -11079,7 +11089,7 @@ Available Agents Transfer: - height=500>
Noone is in your session:
+ height=>
Noone is in your session:
Go Back

Call Agent Again @@ -11087,7 +11097,7 @@ Available Agents Transfer: - height=500>
Customer has hung up:
+ height=>
Customer has hung up:
Go Back

Finish and Disposition Call @@ -11095,7 +11105,7 @@ Available Agents Transfer: - height=550>
Call Wrapup: seconds remaining in wrapup

+ height=>
Call Wrapup: seconds remaining in wrapup



Finish Wrapup and Move On @@ -11110,17 +11120,17 @@ Available Agents Transfer: - height=500>
Your session has been disabled
LOGOUT

Go Back + height=>
Your session has been disabled
LOGOUT

Go Back
- height=500>
There is a time synchronization problem with your system, please tell your system administrator


Go Back + height=>
There is a time synchronization problem with your system, please tell your system administrator


Go Back
- height=500>

LOGOUT
+ height=>

LOGOUT
@@ -11136,7 +11146,7 @@ Available Agents Transfer: - height=460>
DISPOSITION CALL :       Hangup Again       minimize
+ height=>
DISPOSITION CALL :       Hangup Again       minimize
End-of-call Disposition Selection
PAUSE AGENT DIALING
@@ -11149,7 +11159,7 @@ Available Agents Transfer: - height=460>
Select a CallBack Date :
+ height=>
Select a CallBack Date :
Select a Date Below   @@ -11202,7 +11212,7 @@ Available Agents Transfer: - height=460>
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list. + height=>
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list.

  @@ -11213,7 +11223,7 @@ Available Agents Transfer: - height=460>
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call. + height=>
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call.
- height=460>
CLOSER INBOUND GROUP SELECTION
+ height=>
CLOSER INBOUND GROUP SELECTION
Closer Inbound Group Selection
- height=460>
TERRITORY SELECTION
+ height=>
TERRITORY SELECTION
Territory Selection
RESET | @@ -11295,7 +11305,7 @@ Available Agents Transfer: - height=460>
SELECT A PAUSE CODE :
+ height=>
SELECT A PAUSE CODE :
Pause Code Selection

  @@ -11303,7 +11313,7 @@ Available Agents Transfer: - height=460>
SELECT A GROUP ALIAS :
+ height=>
SELECT A GROUP ALIAS :
Group Alias Selection