From 43a12773ea78df2e0c5d4f39a535abdaf573b1a9 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 15 Feb 2012 11:31:57 +0000 Subject: [PATCH] Added a delay on consultative transfers involving custom fields in vicidial.php, options.php option to control the delay git-svn-id: svn://192.168.202.10@1786 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/agc/options-example.php | 6 ++-- www/agc/vicidial.php | 55 +++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/www/agc/options-example.php b/www/agc/options-example.php index 89473b74..94f8d207 100644 --- a/www/agc/options-example.php +++ b/www/agc/options-example.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # rename this file to options.php for the settings here to go into effect # # CHANGELOG -# 100306-0805 - First Build +# 100306-0805 - First Build +# 120214-1636 - Added consult_custom_delay optioin # $conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording @@ -39,6 +40,7 @@ $disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from t $hide_timeclock_link = '0'; # set to 1 to hide the timeclock link on the agent login screen $conf_check_attempts = '3'; # number of attempts to try before loosing webserver connection, for bad network setups $focus_blur_enabled = '0'; # set to 1 to enable the focus/blur enter key blocking(some IE instances have issues) +$consult_custom_delay = '2'; # number of seconds to delay consultative transfers when custom fields are active $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 2871cc7e..b760068b 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database @@ -373,10 +373,11 @@ # 111114-0039 - Added scheduled callback and qm-dispo-code fields to API # 111202-1444 - Added grade-random next-agent-call options # 111227-1940 - Added Timer Action for Dx_DIAL_QUIET options +# 120213-2029 - Changed consultative transfer with custom fields behavior for better data updating # -$version = '2.4-340c'; -$build = '111227-1940'; +$version = '2.4-341c'; +$build = '120213-2029'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=75; $one_mysql_log=0; @@ -522,7 +523,9 @@ $disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from t $hide_timeclock_link = '0'; # set to 1 to hide the timeclock link on the agent login screen $conf_check_attempts = '3'; # number of attempts to try before loosing webserver connection, for bad network setups $focus_blur_enabled = '0'; # set to 1 to enable the focus/blur enter key blocking(some IE instances have issues) -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$consult_custom_delay = '2'; # number of seconds to delay consultative transfers when customfields are active + +$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen, FOR DEBUG ONLY $stretch_dimensions = '1'; # sets the vicidial screen to the size of the browser window $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 @@ -3530,6 +3533,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var qm_extension=''; var hide_dispo_list=''; var external_transferconf_count=0; + var consult_custom_delay=''; + var consult_custom_wait=0; + var consult_custom_go=0; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -3924,7 +3930,33 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } var sending_preset_name = document.vicidial_form.xfername.value; if (taskFromConf == 'YES') - {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias,'',sending_preset_name,call_variables);} + { + // give extra time for custom fields to commit before consultative transfers + if ( (document.vicidial_form.consultativexfer.checked==true) && (custom_fields_enabled > 0) && (consult_custom_delay > 0) ) + { + if (consult_custom_wait >= consult_custom_delay) + { + consult_custom_go = 1; + consult_custom_wait = 0; + } + else + { + consult_custom_wait++; + CustomerData_update(); + vcFormIFrame.document.form_custom_fields.submit(); + } + } + else + { + consult_custom_go = 1; + consult_custom_wait = 0; + } + + if (consult_custom_go > 0) + { + basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias,'',sending_preset_name,call_variables); + } + } else {basic_originate_call(manual_string,'NO','NO','','','',threeway_cid,sending_group_alias,sending_preset_name,call_variables);} @@ -8387,6 +8419,9 @@ function set_length(SLnumber,SLlength_goal,SLdirection) XDnextCID = ''; XDcheck = ''; xferchannellive=0; + consult_custom_wait=0; + consult_custom_go=0; + // DEACTIVATE CHANNEL-DEPENDANT BUTTONS AND VARIABLES document.vicidial_form.xferchannel.value = ""; @@ -8457,7 +8492,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // Update vicidial_list lead record with all altered values from form function CustomerData_update() { - var REGcommentsAMP = new RegExp('&',"g"); var REGcommentsQUES = new RegExp("\\?","g"); var REGcommentsPOUND = new RegExp("\\#","g"); @@ -9027,6 +9061,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) custom_field_types=''; customerparked=0; customerparkedcounter=0; + consult_custom_wait=0; + consult_custom_go=0; document.getElementById("ParkCounterSpan").innerHTML = ''; document.vicidial_form.xfername.value=''; document.vicidial_form.xfernumhidden.value=''; @@ -12145,6 +12181,13 @@ function phone_number_format(formatphone) { } } } + if (consult_custom_wait > 0) + { + if (consult_custom_wait >= consult_custom_delay) + {SendManualDial('YES');} + else + {consult_custom_wait++;} + } } setTimeout("all_refresh()", refresh_interval); }