fixes for bugs 270, 259, 273 all related to manual dialing and alt number dialing

git-svn-id: svn://192.168.202.10@1300 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-01-09 13:33:36 +00:00
parent d8269d9afe
commit a12f0f4c2e
6 changed files with 59 additions and 46 deletions
+13 -6
View File
@@ -85,6 +85,7 @@
# - $vtiger_callback_id - ('16534'...)
# - $nodeletevdac - ('0','1')
# - $agent_territories - ('ABC001','ABC002'...)
# - $alt_num_status - ('0','1')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -226,10 +227,11 @@
# 91228-1340 - Added API fields update functions
# 100103-1254 - Added 3 more conf-presets, list ID override presets and call start/dispo URLs
# 100104-1509 - Fixed vicidial_log duplicate check to allow update if dup and logging update
# 100109-0745 - Added alt_num_status for ALTNUM dialing status
#
$version = '2.2.0-136';
$build = '100104-1509';
$version = '2.2.0-137';
$build = '100109-0745';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=290;
$one_mysql_log=0;
@@ -407,6 +409,8 @@ if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];}
elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];}
if (isset($_GET["agent_territories"])) {$agent_territories=$_GET["agent_territories"];}
elseif (isset($_POST["agent_territories"])) {$agent_territories=$_POST["agent_territories"];}
if (isset($_GET["alt_num_status"])) {$alt_num_status=$_GET["alt_num_status"];}
elseif (isset($_POST["alt_num_status"])) {$alt_num_status=$_POST["alt_num_status"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -2481,6 +2485,9 @@ if ($stage == "start")
if ($stage == "end")
{
$status_dispo = 'DISPO';
if ($alt_num_status > 0)
{$status_dispo = 'ALTNUM';}
##### get call type from vicidial_live_agents table
$VLA_inOUT='NONE';
$stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;";
@@ -2578,7 +2585,7 @@ if ($stage == "end")
if ($VLA_inOUT == 'INBOUND')
{
$stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
$stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec', status='$status_dispo' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -3155,7 +3162,7 @@ if ($stage == "end")
}
##### update the duration and end time in the vicidial_log table
$stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;";
$stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec', status='$status_dispo' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -3204,7 +3211,7 @@ if ($stage == "end")
if (strlen($SQLterm) > 0)
{
##### update the duration and end time in the vicidial_log table
$stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
$stmt="UPDATE vicidial_closer_log set $SQLterm, status='$status_dispo' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -4577,7 +4584,7 @@ if ($ACTION == 'userLOGout')
################################################################################
### updateDISPO - update the vicidial_list table to reflect the agent choice of
### call disposition for that leand
### call disposition for that lead
################################################################################
if ($ACTION == 'updateDISPO')
{
+19 -13
View File
@@ -269,10 +269,11 @@
# 91228-1339 - Added API "fields update" functions and "timer action" functions
# 100103-1250 - Added 3 more conf-presets, list ID override presets and call start/dispo URLs
# 100107-0108 - Added dynamic screen size based on login screen browser dimensions
# 100109-0801 - Added ALTNUM alt number status, fixed alt number dialing from setting
#
$version = '2.2.0-247';
$build = '100107-0108';
$version = '2.2.0-248';
$build = '100109-0801';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=64;
$one_mysql_log=0;
@@ -4091,6 +4092,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// Insert or update the vicidial_log entry for a customer call
function DialLog(taskMDstage,nodeletevdac)
{
var alt_num_status = 0;
if (taskMDstage == "start")
{
var MDlogEPOCH = 0;
@@ -4107,6 +4109,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
if (document.vicidial_form.DiaLAltPhonE.checked==true)
{
alt_num_status = 1;
reselect_alt_dial = 1;
alt_dial_active = 1;
alt_dial_status_display = 1;
@@ -4135,14 +4138,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
{
manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value +
"&user=" + user + "&pass=" + pass + "&campaign=" + campaign +
"&lead_id=" + document.vicidial_form.lead_id.value +
"&list_id=" + document.vicidial_form.list_id.value +
"&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value +
"&phone_number=" + lead_dial_number +
"&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer + "&dial_method" + dial_method + "&nodeletevdac=" + nodeletevdac;
"&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer + "&dial_method" + dial_method + "&nodeletevdac=" + nodeletevdac + "&alt_num_status=" + alt_num_status;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
// document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query;
@@ -4376,14 +4379,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// Open up a callback customer record as manual dial preview mode
function new_callback_call(taskCBid,taskLEADid)
{
alt_phone_dialing=1;
// alt_phone_dialing=1;
auto_dial_level=0;
manual_dial_in_progress=1;
MainPanelToFront();
buildDiv('DiaLLeaDPrevieW');
buildDiv('DiaLDiaLAltPhonE');
if (alt_phone_dialing == 1)
{buildDiv('DiaLDiaLAltPhonE');}
document.vicidial_form.LeadPreview.checked=true;
document.vicidial_form.DiaLAltPhonE.checked=true;
// document.vicidial_form.DiaLAltPhonE.checked=true;
hideDiv('CallBacKsLisTBox');
ManualDialNext(taskCBid,taskLEADid,'','','','0');
}
@@ -4455,7 +4459,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
else
{
alt_phone_dialing=1;
auto_dial_level=0;
manual_dial_in_progress=1;
agent_dialed_number=1;
@@ -4463,11 +4466,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (tempDiaLnow == 'PREVIEW')
{
// alt_phone_dialing=1;
agent_dialed_type='MANUAL_PREVIEW';
buildDiv('DiaLLeaDPrevieW');
buildDiv('DiaLDiaLAltPhonE');
if (alt_phone_dialing == 1)
{buildDiv('DiaLDiaLAltPhonE');}
document.vicidial_form.LeadPreview.checked=true;
document.vicidial_form.DiaLAltPhonE.checked=true;
// document.vicidial_form.DiaLAltPhonE.checked=true;
}
else
{
@@ -4505,14 +4510,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
agent_dialed_number=1;
agent_dialed_type='MANUAL_DIALFAST';
alt_phone_dialing=1;
// alt_phone_dialing=1;
auto_dial_level=0;
manual_dial_in_progress=1;
MainPanelToFront();
buildDiv('DiaLLeaDPrevieW');
buildDiv('DiaLDiaLAltPhonE');
if (alt_phone_dialing == 1)
{buildDiv('DiaLDiaLAltPhonE');}
document.vicidial_form.LeadPreview.checked=false;
document.vicidial_form.DiaLAltPhonE.checked=true;
// document.vicidial_form.DiaLAltPhonE.checked=true;
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0');
}
}
+7 -7
View File
@@ -268,14 +268,14 @@ else
if ($file_download < 1)
{
echo "CALL STATS BREAKDOWN:\n";
echo "LEAD STATS BREAKDOWN:\n";
echo "+------------+--------+--------+--------+$statusesHEAD\n";
echo "| <a href=\"$LINKbase\">DATE</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
echo "| <a href=\"$LINKbase\">DATE</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
echo "+------------+--------+--------+--------+$statusesHEAD\n";
}
else
{
$file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
$file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n";
}
### BEGIN loop through each user ###
@@ -371,7 +371,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWdate) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'CALLS')
if ($stage == 'LEADS')
{
$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
$TOPsortTALLY[$m]=$RAWcalls;
@@ -391,7 +391,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
$TOPsortTALLY[$m]=$RAWdncPCT;
}
if (!ereg("ID|TIME|CALLS|CI|DNCCI",$stage))
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
{
if ($file_download < 1)
{echo "$Toutput";}
@@ -409,11 +409,11 @@ else
### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|CALLS|CI|DNCCI",$stage))
if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
{
if (ereg("ID",$stage))
{sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|CALLS|CI|DNCCI",$stage))
if (ereg("TIME|LEADS|CI|DNCCI",$stage))
{rsort($TOPsort, SORT_NUMERIC);}
$m=0;
@@ -326,9 +326,9 @@ while ($i < $rows_to_print)
$i++;
}
echo "CALL STATS BREAKDOWN:\n";
echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG |$statusesHTML\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG |$statusesHTML\n";
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
@@ -449,11 +449,11 @@ while ($m < $k)
if ($stage == 'ID')
{$TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
if ($stage == 'CALLS')
if ($stage == 'LEADS')
{$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
if ($stage == 'TIME')
{$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
if (!ereg("ID|TIME|CALLS",$stage))
if (!ereg("ID|TIME|LEADS",$stage))
{echo "$Toutput";}
$m++;
@@ -463,11 +463,11 @@ while ($m < $k)
### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|CALLS",$stage))
if (ereg("ID|TIME|LEADS",$stage))
{
if (ereg("ID",$stage))
{sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|CALLS",$stage))
if (ereg("TIME|LEADS",$stage))
{rsort($TOPsort, SORT_NUMERIC);}
$m=0;
@@ -737,7 +737,7 @@ while ($m < $k)
### BEGIN sort through output to display properly ###
#if (ereg("ID|TIME|CALLS",$stage))
#if (ereg("ID|TIME|LEADS",$stage))
# {
# $n=0;
# while ($n <= $m)
+7 -7
View File
@@ -314,14 +314,14 @@ else
if ($file_download < 1)
{
echo "CALL STATS BREAKDOWN:\n";
echo "LEADS STATS BREAKDOWN:\n";
echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
}
else
{
$file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n";
$file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n";
}
@@ -431,7 +431,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'CALLS')
if ($stage == 'LEADS')
{
$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
@@ -451,7 +451,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWdncPCT;
}
if (!ereg("ID|TIME|CALLS|CI|DNCCI",$stage))
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
if ($file_download < 1)
{echo "$Toutput";}
else
@@ -467,11 +467,11 @@ else
### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|CALLS|CI|DNCCI",$stage))
if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
{
if (ereg("ID",$stage))
{sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|CALLS|CI|DNCCI",$stage))
if (ereg("TIME|LEADS|CI|DNCCI",$stage))
{rsort($TOPsort, SORT_NUMERIC);}
$m=0;
+6 -6
View File
@@ -411,12 +411,12 @@ else
{
echo "AGENT TIME BREAKDOWN:\n";
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | |$sub_statusesHTML\n";
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | |$sub_statusesHTML\n";
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
}
else
{
$file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD$sub_statusesFILE\n";
$file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD$sub_statusesFILE\n";
}
##### END print the output to screen or put into file output variable
@@ -588,7 +588,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'CALLS')
if ($stage == 'LEADS')
{
$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
@@ -603,7 +603,7 @@ else
$TOPsort[$m] = '' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWtimeTCsec;
}
if (!ereg("NAME|ID|TIME|CALLS|TCLOCK",$stage))
if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage))
if ($file_download < 1)
{echo "$Toutput";}
else
@@ -624,11 +624,11 @@ else
### BEGIN sort through output to display properly ###
if (ereg("NAME|ID|TIME|CALLS|TCLOCK",$stage))
if (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage))
{
if (ereg("ID",$stage))
{sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|CALLS|TCLOCK",$stage))
if (ereg("TIME|LEADS|TCLOCK",$stage))
{rsort($TOPsort, SORT_NUMERIC);}
if (ereg("NAME",$stage))
{rsort($TOPsort, SORT_STRING);}