From 55c5503136686ee0e2c3e1cc9815201c28312a58 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 30 Apr 2014 02:15:12 +0000 Subject: [PATCH] Added TABLEper_call_notes and called_count as agent script and form variables git-svn-id: svn://192.168.202.10@2110 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/agc/functions.php | 182 ++++++++++++++++++- agc_2-X/trunk/www/agc/vdc_form_display.php | 7 +- agc_2-X/trunk/www/agc/vdc_script_display.php | 182 ++++++++++++++++++- agc_2-X/trunk/www/agc/vicidial.php | 9 +- agc_2-X/trunk/www/vicidial/admin.php | 6 + agc_2-X/trunk/www/vicidial/help.php | 2 +- agc_2-X/trunk/www/vicidial/user_status.php | 6 +- 7 files changed, 382 insertions(+), 12 deletions(-) diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php index 71ec6546..608208a3 100644 --- a/agc_2-X/trunk/www/agc/functions.php +++ b/agc_2-X/trunk/www/agc/functions.php @@ -4,7 +4,7 @@ # # functions for agent scripts # -# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 # # # CHANGES: @@ -18,8 +18,10 @@ # 130603-2208 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes # 130705-2004 - Added optional encrypted passwords compatibility # 130802-1004 - Changed to PHP mysqli functions +# 140429-2035 - Added TABLEper_call_notes display script variable for form display # +# $mysql_queries = 19 ##### BEGIN validate user login credentials, check for failed lock out ##### function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash) @@ -473,6 +475,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) ##### BEGIN parsing for vicidial variables ##### + $NOTESout=''; if (preg_match("/--A--/",$CFoutput)) { if ( (preg_match('/--A--user_custom_/i',$CFoutput)) or (preg_match('/--A--fullname/i',$CFoutput)) ) @@ -513,6 +516,181 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) } } + if (preg_match('/--A--TABLEper_call_notes--B--/i',$CFoutput)) + { + ### BEGIN Gather Call Log and notes ### + if ($hide_call_log_info!='Y') + { + if ($search != 'logfirst') + {$NOTESout .= "CALL LOG FOR THIS LEAD:
\n";} + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + # $NOTESout .= ""; + # $NOTESout .= ""; + $NOTESout .= ""; + + + $stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05014',$user,$server_ip,$session_name,$one_mysql_log);} + $out_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {$NOTESout .= "|$out_logs_to_print|$stmt|";} + + $g=0; + $u=0; + while ($out_logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = $row[3]; + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLalt_dial[$g] = $row[9]; + $ALLuniqueid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLin_out[$g] = "OUT-AUTO"; + if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05015',$user,$server_ip,$session_name,$one_mysql_log);} + $out_notes_to_print = mysqli_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05016',$user,$server_ip,$session_name,$one_mysql_log);} + $users_to_print = mysqli_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + $g++; + $u++; + } + + $stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05017',$user,$server_ip,$session_name,$one_mysql_log);} + $in_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {$NOTESout .= "|$in_logs_to_print|$stmt|";} + + $u=0; + while ($in_logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = ($row[3] - $row[9]); + if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;} + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLuniqueid[$g] = $row[10]; + $ALLclosecallid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLalt_dial[$g] = "MAIN"; + $ALLin_out[$g] = "IN"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05018',$user,$server_ip,$session_name,$one_mysql_log);} + $in_notes_to_print = mysqli_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05019',$user,$server_ip,$session_name,$one_mysql_log);} + $users_to_print = mysqli_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + + $g++; + $u++; + } + + if ($g > 0) + {sort($ALLsort, SORT_NUMERIC);} + else + {$NOTESout .= "";} + + $u=0; + while ($g > $u) + { + $sort_split = explode("-----",$ALLsort[$u]); + $i = $sort_split[1]; + + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $phone_number_display = $ALLphone_number[$i]; + if ($disable_alter_custphone == 'HIDE') + {$phone_number_display = 'XXXXXXXXXX';} + + $u++; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= "\n"; + } + + $NOTESout .= "
  #     DATE/TIME     AGENT     LENGTH     STATUS     PHONE     CAMPAIGN     IN/OUT     ALT     HANGUP  
  FULL NAME  
No calls found
$u$ALLcall_date[$i] $ALLuser[$i] $ALLlength_in_sec[$i] $ALLstatus[$i] $ALLphone_code[$i] $phone_number_display $ALLcampaign_id[$i] $ALLin_out[$i] $ALLalt_dial[$i] $ALLhangup_reason[$i]
$Allcall_notes[$i]
"; + $NOTESout .= "
"; + } + ### END Gather Call Log and notes ### + } + ##### grab the data from vicidial_list for the lead_id $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); @@ -611,6 +789,8 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) $CFoutput = preg_replace('/--A--xfercallid--B--/i',"$xfercallid",$CFoutput); $CFoutput = preg_replace('/--A--agent_log_id--B--/i',"$agent_log_id",$CFoutput); $CFoutput = preg_replace('/--A--call_id--B--/i',"$call_id",$CFoutput); + $CFoutput = preg_replace('/--A--called_count--B--/i',"$called_count",$CFoutput); + $CFoutput = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$CFoutput); # custom fields replacement $o=0; diff --git a/agc_2-X/trunk/www/agc/vdc_form_display.php b/agc_2-X/trunk/www/agc/vdc_form_display.php index 2cd67946..7c6df4c0 100644 --- a/agc_2-X/trunk/www/agc/vdc_form_display.php +++ b/agc_2-X/trunk/www/agc/vdc_form_display.php @@ -23,10 +23,11 @@ # 130705-1512 - Added optional encrypted passwords compatibility # 130802-1033 - Changed to PHP mysqli functions # 140101-2139 - Small fix for admin modify lead page on encrypted password systems +# 140429-2042 - Added TABLEper_call_notes display script variable for form display # -$version = '2.8-14'; -$build = '140101-2139'; +$version = '2.8-15'; +$build = '140429-2042'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -158,6 +159,8 @@ if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];} elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} if ($bcrypt == 'OFF') {$bcrypt=0;} diff --git a/agc_2-X/trunk/www/agc/vdc_script_display.php b/agc_2-X/trunk/www/agc/vdc_script_display.php index bcb270d3..aef62adf 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_display.php +++ b/agc_2-X/trunk/www/agc/vdc_script_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 # # This script is designed display the contents of the SCRIPT tab in the agent interface # @@ -22,10 +22,11 @@ # 130603-2206 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes # 130705-1513 - Added optional encrypted passwords compatibility # 130802-1035 - Changed to PHP mysqli functions +# 140429-2034 - Added TABLEper_call_notes display script variable # -$version = '2.8-16'; -$build = '130802-1035'; +$version = '2.8-17'; +$build = '140429-2034'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -201,6 +202,8 @@ if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} if (isset($_GET["orig_pass"])) {$orig_pass=$_GET["orig_pass"];} elseif (isset($_POST["orig_pass"])) {$orig_pass=$_POST["orig_pass"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} header ("Content-type: text/html; charset=utf-8"); @@ -400,6 +403,7 @@ if (preg_match("/iframe\ssrc/i",$script_text)) $did_extension = preg_replace('/\s/i','+',$did_extension); $did_pattern = preg_replace('/\s/i','+',$did_pattern); $did_description = preg_replace('/\s/i','+',$did_description); + $called_count = preg_replace('/\s/i','+',$called_count); $web_vars = preg_replace('/\s/i','+',$web_vars); } @@ -486,6 +490,7 @@ $script_text = preg_replace('/--A--agent_log_id--B--/i',"$agent_log_id",$script_ $script_text = preg_replace('/--A--entry_list_id--B--/i',"$entry_list_id",$script_text); $script_text = preg_replace('/--A--call_id--B--/i',"$call_id",$script_text); $script_text = preg_replace('/--A--user_group--B--/i',"$user_group",$script_text); +$script_text = preg_replace('/--A--called_count--B--/i',"$called_count",$script_text); $script_text = preg_replace('/--A--web_vars--B--/i',"$web_vars",$script_text); if ($CF_uses_custom_fields=='Y') @@ -509,7 +514,178 @@ if ($CF_uses_custom_fields=='Y') } } +$NOTESout=''; +if (preg_match('/--A--TABLEper_call_notes--B--/i',$script_text)) + { + ### BEGIN Gather Call Log and notes ### + if ($hide_call_log_info!='Y') + { + if ($search != 'logfirst') + {$NOTESout .= "CALL LOG FOR THIS LEAD:
\n";} + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + # $NOTESout .= ""; + # $NOTESout .= ""; + $NOTESout .= ""; + + + $stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + $out_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {$NOTESout .= "|$out_logs_to_print|$stmt|";} + + $g=0; + $u=0; + while ($out_logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = $row[3]; + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLalt_dial[$g] = $row[9]; + $ALLuniqueid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLin_out[$g] = "OUT-AUTO"; + if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + $out_notes_to_print = mysqli_num_rows($rslt); + if ($out_notes_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + $users_to_print = mysqli_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + $g++; + $u++; + } + + $stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + $in_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {$NOTESout .= "|$in_logs_to_print|$stmt|";} + + $u=0; + while ($in_logs_to_print > $u) + { + $row=mysqli_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = ($row[3] - $row[9]); + if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;} + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLuniqueid[$g] = $row[10]; + $ALLclosecallid[$g] = $row[11]; + $ALLuser[$g] = $row[12]; + $ALLalt_dial[$g] = "MAIN"; + $ALLin_out[$g] = "IN"; + + $stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + $in_notes_to_print = mysqli_num_rows($rslt); + if ($in_notes_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $Allcall_notes[$g] = $rowA[0]; + if (strlen($Allcall_notes[$g]) > 0) + {$Allcall_notes[$g] = "NOTES: $Allcall_notes[$g]";} + } + $stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + $users_to_print = mysqli_num_rows($rslt); + if ($users_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $ALLuser[$g] .= " - $rowA[0]"; + } + + $Allcounter[$g] = $g; + + $g++; + $u++; + } + + if ($g > 0) + {sort($ALLsort, SORT_NUMERIC);} + else + {$NOTESout .= "";} + + $u=0; + while ($g > $u) + { + $sort_split = explode("-----",$ALLsort[$u]); + $i = $sort_split[1]; + + if (preg_match("/1$|3$|5$|7$|9$/i", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $phone_number_display = $ALLphone_number[$i]; + if ($disable_alter_custphone == 'HIDE') + {$phone_number_display = 'XXXXXXXXXX';} + + $u++; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= "\n"; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= ""; + $NOTESout .= "\n"; + } + + $NOTESout .= "
  #     DATE/TIME     AGENT     LENGTH     STATUS     PHONE     CAMPAIGN     IN/OUT     ALT     HANGUP  
  FULL NAME  
No calls found
$u$ALLcall_date[$i] $ALLuser[$i] $ALLlength_in_sec[$i] $ALLstatus[$i] $ALLphone_code[$i] $phone_number_display $ALLcampaign_id[$i] $ALLin_out[$i] $ALLalt_dial[$i] $ALLhangup_reason[$i]
$Allcall_notes[$i]
"; + $NOTESout .= "
"; + } + ### END Gather Call Log and notes ### + } + $script_text = preg_replace("/\n/i","
",$script_text); +$script_text = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$script_text); $script_text = stripslashes($script_text); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 012e388c..91be3cd7 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -427,10 +427,11 @@ # 140418-0937 - Added max inbound calls feature # 140423-1728 - Added campaign options manual_dial_search_checkbox and hide_call_log_info # 140428-1514 - Added pause_type +# 140429-2040 - Added called_count and call notes display option as script and form variables # -$version = '2.8-396c'; -$build = '140428-1514'; +$version = '2.8-397c'; +$build = '140429-2040'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=80; $one_mysql_log=0; @@ -8376,7 +8377,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } if (xmlhttp) { - NeWscript_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ScrollDIV=1&" + web_form_vars; + NeWscript_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&called_count=" + document.vicidial_form.called_count.value + "&ScrollDIV=1&" + web_form_vars; xmlhttp.open('POST', 'vdc_script_display.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(NeWscript_query); @@ -13158,7 +13159,7 @@ function phone_number_format(formatphone) { var form_entry_list_id = document.vicidial_form.entry_list_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' +"&web_vars=" + LIVE_web_vars + ''; + document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + "&called_count=" + document.vicidial_form.called_count.value + '' +"&web_vars=" + LIVE_web_vars + ''; form_list_id = ''; form_entry_list_id = ''; } diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 72ae4159..8969f1a5 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -4833,6 +4833,7 @@ if ($ADD==7111111) $entry_list_id = 'entry_list_id'; $call_id = 'call_id'; $user_group = 'user_group'; + $called_count = '2'; echo "\n"; echo "\n"; @@ -4985,6 +4986,7 @@ if ($ADD==7111111) $script_text = preg_replace('/\-\-A\-\-entry_list_id\-\-B\-\-/i', "$entry_list_id",$script_text); $script_text = preg_replace('/\-\-A\-\-call_id\-\-B\-\-/i', "$call_id",$script_text); $script_text = preg_replace('/\-\-A\-\-user_group\-\-B\-\-/i', "$user_group",$script_text); + $script_text = preg_replace('/\-\-A\-\-called_count\-\-B\-\-/i', "$called_count",$script_text); $script_text = preg_replace('/\n/i', "
",$script_text); @@ -6409,6 +6411,8 @@ if ($ADD==1111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; echo ""; echo "
"; # END Insert Field @@ -25829,6 +25833,8 @@ if ($ADD==3111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; echo ""; echo "
"; # END Insert Field diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index 1d32d485..9603fc64 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -2969,7 +2969,7 @@ if ($SSqc_features_active > 0)
-Script Text - This is where you place the content of an agent screen Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id, user_group. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: +Script Text - This is where you place the content of an agent screen Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id, user_group, called_count, TABLEper_call_notes. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
<iframe src="http://www.sample.net/test_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&user_group=--A--user_group--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> diff --git a/agc_2-X/trunk/www/vicidial/user_status.php b/agc_2-X/trunk/www/vicidial/user_status.php index 0b015e4b..776f4872 100644 --- a/agc_2-X/trunk/www/vicidial/user_status.php +++ b/agc_2-X/trunk/www/vicidial/user_status.php @@ -29,6 +29,7 @@ # 140108-0707 - Added webserver and hostname to report logging # 140305-0905 - Bug fix for issue #744, emergency logout # 140425-1314 - Added pause_type field to logout +# 140429-0750 - Fixed issue with queue_log if login/out logging is disabled # $startMS = microtime(); @@ -496,6 +497,8 @@ if ($stage == "log_agent_out") $agent_logged_in=''; $time_logged_in='0'; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysqli_real_escape_string($link, $user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; + if ($queuemetrics_loginout == 'NONE') { $pause_typeSQL=''; @@ -505,9 +508,10 @@ if ($stage == "log_agent_out") if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); $affected_rows = mysqli_affected_rows($linkB); + + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysqli_real_escape_string($link, $user) . "' and verb IN('ADDMEMBER','ADDMEMBER2') and time_id > $check_time order by time_id desc limit 1;"; } - $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysqli_real_escape_string($link, $user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') and time_id > $check_time order by time_id desc limit 1;"; $rsltB=mysql_to_mysqli($stmtB, $linkB); if ($DB) {echo "
$stmtB\n";} $qml_ct = mysqli_num_rows($rsltB);