Added DID custom fields as webform and script variables in the agent screen

git-svn-id: svn://192.168.202.10@2383 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2015-09-24 01:07:13 +00:00
parent dd8e8094ed
commit 727af56ae9
10 changed files with 257 additions and 26 deletions
+3
View File
@@ -150,6 +150,9 @@ OTHER CHANGES:
and the admin modify lead pages to follow the database schema field and the admin modify lead pages to follow the database schema field
lengths for the default lead fields. lengths for the default lead fields.
34. Added DID custom fields as webform and script variables
(did_custom_one, did_custom_two,..., did_custom_five)
@@ -15,7 +15,7 @@ write = command
[listencron] [listencron]
secret = 1234 secret = 1234
read = system,call,log,verbose,command,agent,user read = system,call,log,verbose,command,agent,user,dtmf
write = command write = command
[sendcron] [sendcron]
@@ -385,6 +385,11 @@ if ($match_found > 0)
$email_subject = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$email_subject); $email_subject = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$email_subject);
$email_subject = preg_replace('/--A--recording_id--B--/i',"$recording_id",$email_subject); $email_subject = preg_replace('/--A--recording_id--B--/i',"$recording_id",$email_subject);
$email_subject = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$email_subject); $email_subject = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$email_subject);
$email_subject = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($did_custom_one)),$email_subject);
$email_subject = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($did_custom_two)),$email_subject);
$email_subject = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($did_custom_three)),$email_subject);
$email_subject = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($did_custom_four)),$email_subject);
$email_subject = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($did_custom_five)),$email_subject);
$email_subject = urldecode($email_subject); $email_subject = urldecode($email_subject);
} }
+7
View File
@@ -28,6 +28,7 @@
# 150111-1541 - Added lists option: local call time(Issue #812) # 150111-1541 - Added lists option: local call time(Issue #812)
# 150512-0615 - Fix for non-latin customer data # 150512-0615 - Fix for non-latin customer data
# 150724-0843 - Added vicidial_ajax_log function # 150724-0843 - Added vicidial_ajax_log function
# 150923-2017 - Added DID custom fields
# #
# $mysql_queries = 20 # $mysql_queries = 20
@@ -877,6 +878,12 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
$CFoutput = preg_replace('/--A--agent_log_id--B--/i',"$agent_log_id",$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--call_id--B--/i',"$call_id",$CFoutput);
$CFoutput = preg_replace('/--A--called_count--B--/i',"$called_count",$CFoutput); $CFoutput = preg_replace('/--A--called_count--B--/i',"$called_count",$CFoutput);
$CFoutput = preg_replace('/--A--did_custom_one--B--/i',"$did_custom_one",$CFoutput);
$CFoutput = preg_replace('/--A--did_custom_two--B--/i',"$did_custom_two",$CFoutput);
$CFoutput = preg_replace('/--A--did_custom_three--B--/i',"$did_custom_three",$CFoutput);
$CFoutput = preg_replace('/--A--did_custom_four--B--/i',"$did_custom_four",$CFoutput);
$CFoutput = preg_replace('/--A--did_custom_five--B--/i',"$did_custom_five",$CFoutput);
$CFoutput = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$CFoutput); $CFoutput = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$CFoutput);
# custom fields replacement # custom fields replacement
+57 -6
View File
@@ -388,10 +388,11 @@
# 150727-0910 - Added default_language # 150727-0910 - Added default_language
# 150728-1049 - Added option for secondary sorting by vendor_lead_code, Issue #833 # 150728-1049 - Added option for secondary sorting by vendor_lead_code, Issue #833
# 150814-1057 - Added compatibility for custom fields data option # 150814-1057 - Added compatibility for custom fields data option
# 150923-2013 - Added DID custom variables to call data transmission
# #
$version = '2.12-283'; $version = '2.12-284';
$build = '150814-1057'; $build = '150923-2013';
$php_script = 'vdc_db_query.php'; $php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=616; $mysql_log_count=616;
@@ -7225,7 +7226,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$DID_id = $row[0]; $DID_id = $row[0];
$DID_extension = $row[1]; $DID_extension = $row[1];
$stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00338',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00338',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -7235,6 +7236,11 @@ if ($ACTION == 'VDADcheckINCOMING')
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$DID_pattern = $row[0]; $DID_pattern = $row[0];
$DID_description = $row[1]; $DID_description = $row[1];
$DID_custom_one = $row[2];
$DID_custom_two= $row[3];
$DID_custom_three= $row[4];
$DID_custom_four= $row[5];
$DID_custom_five= $row[6];
} }
} }
@@ -7386,6 +7392,11 @@ if ($ACTION == 'VDADcheckINCOMING')
$LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $VDCL_ingroup_script_color . "\n";
$LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $list_description . "\n";
$LeaD_InfO .= $entry_date . "\n"; $LeaD_InfO .= $entry_date . "\n";
$LeaD_InfO .= $DID_custom_one . "\n";
$LeaD_InfO .= $DID_custom_two . "\n";
$LeaD_InfO .= $DID_custom_three . "\n";
$LeaD_InfO .= $DID_custom_four . "\n";
$LeaD_InfO .= $DID_custom_five . "\n";
echo $LeaD_InfO; echo $LeaD_InfO;
@@ -7558,6 +7569,11 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$VDCL_start_call_url);
if (strlen($custom_field_names)>2) if (strlen($custom_field_names)>2)
{ {
@@ -8290,7 +8306,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$DID_id = $row[0]; $DID_id = $row[0];
$DID_extension = $row[1]; $DID_extension = $row[1];
$stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00510',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00510',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -8300,6 +8316,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$DID_pattern = $row[0]; $DID_pattern = $row[0];
$DID_description = $row[1]; $DID_description = $row[1];
$DID_custom_one = $row[2];
$DID_custom_two= $row[3];
$DID_custom_three= $row[4];
$DID_custom_four= $row[5];
$DID_custom_five= $row[6];
} }
} }
@@ -8420,6 +8441,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $VDCL_ingroup_script_color . "\n";
$LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $list_description . "\n";
$LeaD_InfO .= $entry_date . "\n"; $LeaD_InfO .= $entry_date . "\n";
$LeaD_InfO .= $DID_custom_one . "\n";
$LeaD_InfO .= $DID_custom_two . "\n";
$LeaD_InfO .= $DID_custom_three . "\n";
$LeaD_InfO .= $DID_custom_four . "\n";
$LeaD_InfO .= $DID_custom_five . "\n";
echo $LeaD_InfO; echo $LeaD_InfO;
@@ -8591,6 +8617,11 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url); $VDCL_start_call_url = preg_replace('/--A--entry_date--B--/i',urlencode(trim($entry_date)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$VDCL_start_call_url);
$VDCL_start_call_url = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$VDCL_start_call_url);
if (strlen($custom_field_names)>2) if (strlen($custom_field_names)>2)
{ {
@@ -9321,7 +9352,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$DID_id = $row[0]; $DID_id = $row[0];
$DID_extension = $row[1]; $DID_extension = $row[1];
$stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00475',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00475',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -9331,6 +9362,11 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$DID_pattern = $row[0]; $DID_pattern = $row[0];
$DID_description = $row[1]; $DID_description = $row[1];
$DID_custom_one = $row[2];
$DID_custom_two= $row[3];
$DID_custom_three= $row[4];
$DID_custom_four= $row[5];
$DID_custom_five= $row[6];
} }
} }
@@ -9493,6 +9529,11 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$LeaD_InfO .= $VDCL_ingroup_script_color . "\n"; $LeaD_InfO .= $VDCL_ingroup_script_color . "\n";
$LeaD_InfO .= $list_description . "\n"; $LeaD_InfO .= $list_description . "\n";
$LeaD_InfO .= $entry_date . "\n"; $LeaD_InfO .= $entry_date . "\n";
$LeaD_InfO .= $DID_custom_one . "\n";
$LeaD_InfO .= $DID_custom_two . "\n";
$LeaD_InfO .= $DID_custom_three . "\n";
$LeaD_InfO .= $DID_custom_four . "\n";
$LeaD_InfO .= $DID_custom_five . "\n";
echo $LeaD_InfO; echo $LeaD_InfO;
@@ -10891,7 +10932,7 @@ if ($ACTION == 'updateDISPO')
$DID_id = $row[0]; $DID_id = $row[0];
$DID_extension = $row[1]; $DID_extension = $row[1];
$stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;";
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00347',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00347',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -10901,6 +10942,11 @@ if ($ACTION == 'updateDISPO')
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$DID_pattern = urlencode(trim($row[0])); $DID_pattern = urlencode(trim($row[0]));
$DID_description = urlencode(trim($row[1])); $DID_description = urlencode(trim($row[1]));
$DID_custom_one = urlencode(trim($row[2]));
$DID_custom_two= urlencode(trim($row[3]));
$DID_custom_three= urlencode(trim($row[4]));
$DID_custom_four= urlencode(trim($row[5]));
$DID_custom_five= urlencode(trim($row[6]));
} }
} }
} }
@@ -11062,6 +11108,11 @@ if ($ACTION == 'updateDISPO')
$dispo_call_urlARY[$j] = preg_replace('/--A--recording_id--B--/i',"$recording_id",$dispo_call_urlARY[$j]); $dispo_call_urlARY[$j] = preg_replace('/--A--recording_id--B--/i',"$recording_id",$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$dispo_call_urlARY[$j]); $dispo_call_urlARY[$j] = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--entry_date--B--/i',"$entry_date",$dispo_call_urlARY[$j]); $dispo_call_urlARY[$j] = preg_replace('/--A--entry_date--B--/i',"$entry_date",$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$dispo_call_urlARY[$j]);
if (strlen($FORMcustom_field_names)>2) if (strlen($FORMcustom_field_names)>2)
{ {
+13 -2
View File
@@ -33,10 +33,11 @@
# 150418-1751 - Added fixed fields to submit output, issue #842 # 150418-1751 - Added fixed fields to submit output, issue #842
# 150512-0617 - Fix for non-latin customer data # 150512-0617 - Fix for non-latin customer data
# 150609-1923 - Added list_description variable # 150609-1923 - Added list_description variable
# 150923-2027 - Added DID custom variables
# #
$version = '2.12-24'; $version = '2.12-25';
$build = '150609-1923'; $build = '150923-2027';
require_once("dbconnect_mysqli.php"); require_once("dbconnect_mysqli.php");
require_once("functions.php"); require_once("functions.php");
@@ -176,6 +177,16 @@ if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];}
elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];}
if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];} if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];}
elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];} elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];}
if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];}
elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];}
if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];}
elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];}
if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];}
elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];}
if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];}
elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];}
if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];}
elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];}
if ($bcrypt == 'OFF') if ($bcrypt == 'OFF')
{$bcrypt=0;} {$bcrypt=0;}
+28 -2
View File
@@ -31,10 +31,11 @@
# 141216-2121 - Added language settings lookups and user/pass variable standardization # 141216-2121 - Added language settings lookups and user/pass variable standardization
# 150703-2034 - Added option to fully urlencode variables if IFRAME is used in script Issue #864 # 150703-2034 - Added option to fully urlencode variables if IFRAME is used in script Issue #864
# 150725-1622 - Added entry_date variable # 150725-1622 - Added entry_date variable
# 150923-2028 - Added DID custom variables
# #
$version = '2.12-25'; $version = '2.12-26';
$build = '150725-1622'; $build = '150923-2028';
require_once("dbconnect_mysqli.php"); require_once("dbconnect_mysqli.php");
require_once("functions.php"); require_once("functions.php");
@@ -220,6 +221,16 @@ if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];} if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];}
elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];} elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];}
if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];}
elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];}
if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];}
elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];}
if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];}
elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];}
if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];}
elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];}
if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];}
elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];}
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -445,6 +456,11 @@ if (preg_match("/iframe\ssrc/i",$script_text))
$called_count = urlencode(trim($called_count)); $called_count = urlencode(trim($called_count));
$session_name = urlencode(trim($session_name)); $session_name = urlencode(trim($session_name));
$entry_date = urlencode(trim($entry_date)); $entry_date = urlencode(trim($entry_date));
$did_custom_one = urlencode(trim($did_custom_one));
$did_custom_two = urlencode(trim($did_custom_two));
$did_custom_three = urlencode(trim($did_custom_three));
$did_custom_four = urlencode(trim($did_custom_four));
$did_custom_five = urlencode(trim($did_custom_five));
$web_vars = urlencode(trim($web_vars)); $web_vars = urlencode(trim($web_vars));
} }
else else
@@ -528,6 +544,11 @@ if (preg_match("/iframe\ssrc/i",$script_text))
$called_count = preg_replace('/\s/i','+',$called_count); $called_count = preg_replace('/\s/i','+',$called_count);
$session_name = preg_replace('/\s/i','+',$session_name); $session_name = preg_replace('/\s/i','+',$session_name);
$entry_date = preg_replace('/\s/i','+',$entry_date); $entry_date = preg_replace('/\s/i','+',$entry_date);
$did_custom_one = preg_replace('/\s/i','+',$did_custom_one);
$did_custom_two = preg_replace('/\s/i','+',$did_custom_two);
$did_custom_three = preg_replace('/\s/i','+',$did_custom_three);
$did_custom_four = preg_replace('/\s/i','+',$did_custom_four);
$did_custom_five = preg_replace('/\s/i','+',$did_custom_five);
$web_vars = preg_replace('/\s/i','+',$web_vars); $web_vars = preg_replace('/\s/i','+',$web_vars);
} }
} }
@@ -620,6 +641,11 @@ $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--called_count--B--/i',"$called_count",$script_text);
$script_text = preg_replace('/--A--session_name--B--/i',"$session_name",$script_text); $script_text = preg_replace('/--A--session_name--B--/i',"$session_name",$script_text);
$script_text = preg_replace('/--A--entry_date--B--/i',"$entry_date",$script_text); $script_text = preg_replace('/--A--entry_date--B--/i',"$entry_date",$script_text);
$script_text = preg_replace('/--A--did_custom_one--B--/i',"$did_custom_one",$script_text);
$script_text = preg_replace('/--A--did_custom_two--B--/i',"$did_custom_two",$script_text);
$script_text = preg_replace('/--A--did_custom_three--B--/i',"$did_custom_three",$script_text);
$script_text = preg_replace('/--A--did_custom_four--B--/i',"$did_custom_four",$script_text);
$script_text = preg_replace('/--A--did_custom_five--B--/i',"$did_custom_five",$script_text);
$script_text = preg_replace('/--A--web_vars--B--/i',"$web_vars",$script_text); $script_text = preg_replace('/--A--web_vars--B--/i',"$web_vars",$script_text);
if ($CF_uses_custom_fields=='Y') if ($CF_uses_custom_fields=='Y')
+55 -4
View File
@@ -499,10 +499,11 @@
# 150808-1439 - Added compatibility for custom fields data option # 150808-1439 - Added compatibility for custom fields data option
# 150909-0212 - Fixed MDlogEPOCH variable issue #882 # 150909-0212 - Fixed MDlogEPOCH variable issue #882
# 150917-0926 - Added dynamic default field maxlengths based on DB schema # 150917-0926 - Added dynamic default field maxlengths based on DB schema
# 150923-1952 - Added DID custum fields as web and form variables
# #
$version = '2.12-471c'; $version = '2.12-472c';
$build = '150917-0926'; $build = '150923-1952';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=85; $mysql_log_count=85;
$one_mysql_log=0; $one_mysql_log=0;
@@ -4130,6 +4131,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var did_id=''; var did_id='';
var did_extension=''; var did_extension='';
var did_description=''; var did_description='';
var did_custom_one='';
var did_custom_two='';
var did_custom_three='';
var did_custom_four='';
var did_custom_five='';
var closecallid=''; var closecallid='';
var xfercallid=''; var xfercallid='';
var custom_field_names=''; var custom_field_names='';
@@ -7046,6 +7052,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// script color - 57 // script color - 57
document.vicidial_form.list_description.value = change_array[58]; document.vicidial_form.list_description.value = change_array[58];
entry_date = change_array[59]; entry_date = change_array[59];
did_custom_one = change_array[60];
did_custom_two = change_array[61];
did_custom_three = change_array[62];
did_custom_four = change_array[63];
did_custom_five = change_array[64];
if (agent_display_fields.match(adfREGentry_date)) if (agent_display_fields.match(adfREGentry_date))
{document.getElementById("entry_dateDISP").innerHTML = entry_date;} {document.getElementById("entry_dateDISP").innerHTML = entry_date;}
@@ -9368,6 +9379,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
CalL_ScripT_color = check_VDIC_array[57]; CalL_ScripT_color = check_VDIC_array[57];
document.vicidial_form.list_description.value = check_VDIC_array[58]; document.vicidial_form.list_description.value = check_VDIC_array[58];
entry_date = check_VDIC_array[59]; entry_date = check_VDIC_array[59];
did_custom_one = check_VDIC_array[60];
did_custom_two = check_VDIC_array[61];
did_custom_three = check_VDIC_array[62];
did_custom_four = check_VDIC_array[63];
did_custom_five = check_VDIC_array[64];
if (agent_display_fields.match(adfREGentry_date)) if (agent_display_fields.match(adfREGentry_date))
{document.getElementById("entry_dateDISP").innerHTML = entry_date;} {document.getElementById("entry_dateDISP").innerHTML = entry_date;}
@@ -9955,6 +9971,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// script color - 53 // script color - 53
document.vicidial_form.list_description.value = check_VDIC_array[54]; document.vicidial_form.list_description.value = check_VDIC_array[54];
entry_date = check_VDIC_array[55]; entry_date = check_VDIC_array[55];
did_custom_one = check_VDIC_array[56];
did_custom_two = check_VDIC_array[57];
did_custom_three = check_VDIC_array[58];
did_custom_four = check_VDIC_array[59];
did_custom_five = check_VDIC_array[60];
if (agent_display_fields.match(adfREGentry_date)) if (agent_display_fields.match(adfREGentry_date))
{document.getElementById("entry_dateDISP").innerHTML = entry_date;} {document.getElementById("entry_dateDISP").innerHTML = entry_date;}
@@ -11653,6 +11674,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
did_id=''; did_id='';
did_extension=''; did_extension='';
did_description=''; did_description='';
did_custom_one='';
did_custom_two='';
did_custom_three='';
did_custom_four='';
did_custom_five='';
closecallid=''; closecallid='';
xfercallid=''; xfercallid='';
custom_field_names=''; custom_field_names='';
@@ -13133,6 +13159,11 @@ else
"&list_name=" + encodeURIComponent(document.vicidial_form.list_name.value) + "&list_name=" + encodeURIComponent(document.vicidial_form.list_name.value) +
"&list_description=" + encodeURIComponent(document.vicidial_form.list_description.value) + "&list_description=" + encodeURIComponent(document.vicidial_form.list_description.value) +
"&entry_date=" + entry_date + '' + "&entry_date=" + entry_date + '' +
"&did_custom_one=" + did_custom_one + '' +
"&did_custom_two=" + did_custom_two + '' +
"&did_custom_three=" + did_custom_three + '' +
"&did_custom_four=" + did_custom_four + '' +
"&did_custom_five=" + did_custom_five + '' +
"&web_vars=" + LIVE_web_vars + '' + "&web_vars=" + LIVE_web_vars + '' +
webform_session; webform_session;
@@ -13356,6 +13387,11 @@ else
var SCuser_group = VU_user_group; var SCuser_group = VU_user_group;
var SCagent_log_id = agent_log_id; var SCagent_log_id = agent_log_id;
var SCentry_date = entry_date; var SCentry_date = entry_date;
var SCdid_custom_one = did_custom_one;
var SCdid_custom_two = did_custom_two;
var SCdid_custom_three = did_custom_three;
var SCdid_custom_four = did_custom_four;
var SCdid_custom_five = did_custom_five;
var SCweb_vars = LIVE_web_vars; var SCweb_vars = LIVE_web_vars;
if (encoded.match(RGiframe)) if (encoded.match(RGiframe))
@@ -13433,6 +13469,11 @@ else
SCcall_id = SCcall_id.replace(RGplus,'+'); SCcall_id = SCcall_id.replace(RGplus,'+');
SCuser_group = SCuser_group.replace(RGplus,'+'); SCuser_group = SCuser_group.replace(RGplus,'+');
SCentry_date = SCentry_date.replace(RGplus,'+'); SCentry_date = SCentry_date.replace(RGplus,'+');
SCdid_custom_one = SCdid_custom_one.replace(RGplus,'+');
SCdid_custom_two = SCdid_custom_two.replace(RGplus,'+');
SCdid_custom_three = SCdid_custom_three.replace(RGplus,'+');
SCdid_custom_four = SCdid_custom_four.replace(RGplus,'+');
SCdid_custom_five = SCdid_custom_five.replace(RGplus,'+');
SCweb_vars = SCweb_vars.replace(RGplus,'+'); SCweb_vars = SCweb_vars.replace(RGplus,'+');
} }
@@ -13514,6 +13555,11 @@ else
var RGcall_id = new RegExp("--A--call_id--B--","g"); var RGcall_id = new RegExp("--A--call_id--B--","g");
var RGuser_group = new RegExp("--A--user_group--B--","g"); var RGuser_group = new RegExp("--A--user_group--B--","g");
var RGentry_date = new RegExp("--A--entry_date--B--","g"); var RGentry_date = new RegExp("--A--entry_date--B--","g");
var RGdid_custom_one = new RegExp("--A--did_custom_one--B--","g");
var RGdid_custom_two = new RegExp("--A--did_custom_two--B--","g");
var RGdid_custom_three = new RegExp("--A--did_custom_three--B--","g");
var RGdid_custom_four = new RegExp("--A--did_custom_four--B--","g");
var RGdid_custom_five = new RegExp("--A--did_custom_five--B--","g");
var RGweb_vars = new RegExp("--A--web_vars--B--","g"); var RGweb_vars = new RegExp("--A--web_vars--B--","g");
encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code); encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
@@ -13594,6 +13640,11 @@ else
encoded = encoded.replace(RGcall_id, SCcall_id); encoded = encoded.replace(RGcall_id, SCcall_id);
encoded = encoded.replace(RGuser_group, SCuser_group); encoded = encoded.replace(RGuser_group, SCuser_group);
encoded = encoded.replace(RGentry_date, SCentry_date); encoded = encoded.replace(RGentry_date, SCentry_date);
encoded = encoded.replace(RGdid_custom_one,SCdid_custom_one);
encoded = encoded.replace(RGdid_custom_two,SCdid_custom_two);
encoded = encoded.replace(RGdid_custom_three,SCdid_custom_three);
encoded = encoded.replace(RGdid_custom_four,SCdid_custom_four);
encoded = encoded.replace(RGdid_custom_five,SCdid_custom_five);
encoded = encoded.replace(RGweb_vars, SCweb_vars); encoded = encoded.replace(RGweb_vars, SCweb_vars);
} }
@@ -14431,7 +14482,7 @@ function phone_number_format(formatphone) {
var form_entry_list_id = document.vicidial_form.entry_list_id.value; var form_entry_list_id = document.vicidial_form.entry_list_id.value;
if (form_entry_list_id.length > 2) if (form_entry_list_id.length > 2)
{form_list_id = form_entry_list_id} {form_list_id = form_entry_list_id}
document.getElementById('vcFormIFrame').src='./<?php echo $vdc_form_display ?>?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 + '' +"&agent_email=" + LOGemail + '' +"&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 + ''; document.getElementById('vcFormIFrame').src='./<?php echo $vdc_form_display ?>?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 + '' +"&agent_email=" + LOGemail + '' +"&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 + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + '';
form_list_id = ''; form_list_id = '';
form_entry_list_id = ''; form_entry_list_id = '';
} }
@@ -14446,7 +14497,7 @@ function phone_number_format(formatphone) {
var form_entry_list_id = document.vicidial_form.entry_list_id.value; var form_entry_list_id = document.vicidial_form.entry_list_id.value;
if (form_entry_list_id.length > 2) if (form_entry_list_id.length > 2)
{form_list_id = form_entry_list_id} {form_list_id = form_entry_list_id}
document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_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 + '' +"&agent_email=" + LOGemail + '' +"&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('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_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 + '' +"&agent_email=" + LOGemail + '' +"&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 + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + '';
form_list_id = ''; form_list_id = '';
form_entry_list_id = ''; form_entry_list_id = '';
} }
@@ -3,6 +3,10 @@
# #
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2015 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# #
# This is the report page where you can view report informatio of any of the dialer's chats. The web page will
# display the information about the chat, including the start time and participants, and will also provide links
# allowing you to download transcripts of any chat you wish, based on your account permissions.
#
# CHANGES # CHANGES
# #
# 150608-0647 First build # 150608-0647 First build
@@ -833,6 +837,11 @@ else
$GRAPH_text.=" <tr><th class='column_header grey_graph_cell'>"._QXZ("MESSAGE TIME")."</th><th class='column_header grey_graph_cell'>"._QXZ("CHAT MEMBER NAME")."</th><th class='thgraph'>"._QXZ("MESSAGE")."</th><th class='thgraph'>&nbsp;</th></tr>"; $GRAPH_text.=" <tr><th class='column_header grey_graph_cell'>"._QXZ("MESSAGE TIME")."</th><th class='column_header grey_graph_cell'>"._QXZ("CHAT MEMBER NAME")."</th><th class='thgraph'>"._QXZ("MESSAGE")."</th><th class='thgraph'>&nbsp;</th></tr>";
while ($sub_row=mysqli_fetch_array($sub_rslt)) while ($sub_row=mysqli_fetch_array($sub_rslt))
{ {
$pos=strpos($sub_row["message"], "\n");
if ($pos)
{
$sub_row["message"]=substr($sub_row["message"],0,$pos)."...";
}
if (strlen($sub_row["message"])>50) {$message=substr($sub_row["message"],0,50)."...";} else {$message=$sub_row["message"];} if (strlen($sub_row["message"])>50) {$message=substr($sub_row["message"],0,50)."...";} else {$message=$sub_row["message"];}
$ASCII_text.=" | ".$sub_row["message_time"]." "; $ASCII_text.=" | ".$sub_row["message_time"]." ";
$ASCII_text.="| ".sprintf("%-28s", substr("$sub_row[chat_member_name]", 0, 28))." "; $ASCII_text.="| ".sprintf("%-28s", substr("$sub_row[chat_member_name]", 0, 28))." ";
@@ -93,6 +93,7 @@
# 150211-2342 - Added hopper link, issue #825 # 150211-2342 - Added hopper link, issue #825
# 150307-0825 - small cosmetic fix # 150307-0825 - small cosmetic fix
# 150804-0956 - Added WHISPER option agent monitoring # 150804-0956 - Added WHISPER option agent monitoring
# 150919-0238 - Added display for chats in queue
# #
$version = '2.12-82'; $version = '2.12-82';
@@ -179,7 +180,7 @@ $db_source = 'M';
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled FROM system_settings;"; $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled,allow_chats FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt); $qm_conf_ct = mysqli_num_rows($rslt);
@@ -193,6 +194,7 @@ if ($qm_conf_ct > 0)
$SSenable_languages = $row[4]; $SSenable_languages = $row[4];
$SSlanguage_method = $row[5]; $SSlanguage_method = $row[5];
$agent_whisper_enabled = $row[6]; $agent_whisper_enabled = $row[6];
$allow_chats = $row[7];
} }
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
@@ -2012,16 +2014,33 @@ else
{ {
$stmtB="from vicidial_auto_calls where status NOT IN('XFER') $group_SQLand order by queue_priority desc,campaign_id,call_time;"; $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $group_SQLand order by queue_priority desc,campaign_id,call_time;";
} }
if ($CALLSdisplay > 0) if ($CALLSdisplay > 0)
{ {
$stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority,agent_only"; $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority,agent_only";
## JCJ Display chats
if ($allow_chats)
{
$chat_stmtA="SELECT vlc.status,group_id as campaign_id,if(length(v.phone_number)=0 or v.phone_number is null, v.phone_number, '**NO PHONE**') as phone_number, '' as server_ip,UNIX_TIMESTAMP(chat_start_time), 'CHAT' as call_type, '' as queue_priority, '' as agent_only";
}
} }
else else
{ {
$stmtA = "SELECT status"; $stmtA = "SELECT status";
## JCJ Display chats
if ($allow_chats)
{
$chat_stmtA="SELECT vlc.status";
}
} }
$k=0; $k=0;
$agentonlycount=0; $agentonlycount=0;
$stmt = "$stmtA $stmtB"; $stmt = "$stmtA $stmtB";
@@ -2138,6 +2157,48 @@ if ($parked_to_print > 0)
} }
if ($allow_chats)
{
$chat_stmtB=" from vicidial_live_chats vlc, vicidial_list v where vlc.status='WAITING' and group_id IN($closer_campaignsSQL) and vlc.lead_id=v.lead_id ";
$chat_stmt="$chat_stmtA $chat_stmtB";
#$stmt="$chat_stmt UNION $stmtA $stmtB";
$chat_rslt=mysql_to_mysqli($chat_stmt, $link);
$waiting_to_chat = mysqli_num_rows($chat_rslt);
if ($waiting_to_chat > 0)
{
$i=0;
$chats_waiting=0;
while ($i < $waiting_to_chat)
{
$chat_row=mysqli_fetch_row($chat_rslt);
$chats_waiting++;
if ($CALLSdisplay > 0)
{
$CDstatus[$k] = $chat_row[0];
$CDcampaign_id[$k] = $chat_row[1];
$CDphone_number[$k] = $chat_row[2];
$CDserver_ip[$k] = $chat_row[3];
$CDcall_time[$k] = $chat_row[4];
$CDcall_type[$k] = $chat_row[5];
$CDqueue_priority[$k] = $chat_row[6];
$CDagent_only[$k] = $chat_row[7];
if (strlen($CDagent_only[$k]) > 0) {$agentonlycount++;}
$k++;
}
$i++;
}
if ($chats_waiting > 0) {$F='<FONT class="r1">'; $FG='</FONT>';}
if ($chats_waiting > 4) {$F='<FONT class="r2">'; $FG='</FONT>';}
if ($chats_waiting > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
if ($chats_waiting > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
echo " &nbsp; &nbsp; &nbsp; $NFB$F &nbsp;$chats_waiting $FG$NFE "._QXZ("chats waiting for agents")." &nbsp; &nbsp; &nbsp; \n";
}
else
{
echo _QXZ(" NO LIVE CHATS WAITING ")." \n";
}
}
################################################################################### ###################################################################################
###### CALLS WAITING ###### CALLS WAITING
@@ -2147,14 +2208,14 @@ if ($agentonlycount > 0)
{$agentonlyheader = _QXZ("AGENTONLY");} {$agentonlyheader = _QXZ("AGENTONLY");}
$Cecho = ''; $Cecho = '';
$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n";
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n";
$Cecho .= "| "._QXZ("STATUS",6)." | "._QXZ("CAMPAIGN",20)." | "._QXZ("PHONE NUMBER",12)." | "._QXZ("SERVER IP",15)." | "._QXZ("DIALTIME",8)."| "._QXZ("CALL TYPE",10)." | "._QXZ("PRIORITY",8)." | $agentonlyheader\n"; $Cecho .= "| "._QXZ("STATUS",7)." | "._QXZ("CAMPAIGN",20)." | "._QXZ("PHONE NUMBER",12)." | "._QXZ("SERVER IP",15)." | "._QXZ("DIALTIME",8)."| "._QXZ("CALL TYPE",10)." | "._QXZ("PRIORITY",8)." | $agentonlyheader\n";
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n";
$p=0; $p=0;
while($p<$k) while($p<$k)
{ {
$Cstatus = sprintf("%-6s", _QXZ("$CDstatus[$p]",6)); #TRANSLATE $Cstatus = sprintf("%-7s", _QXZ("$CDstatus[$p]",6)); #TRANSLATE
$Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); # Do not translate $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); # Do not translate
$Cphone_number = sprintf("%-12s", $CDphone_number[$p]); # Do not translate $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); # Do not translate
$Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); # Do not translate $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); # Do not translate
@@ -2167,7 +2228,7 @@ while($p<$k)
$Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS);
$G = ''; $EG = ''; $G = ''; $EG = '';
if ($CDcall_type[$p] == 'IN') if ($CDcall_type[$p] == 'IN' || $CDcall_type[$p] == 'CHAT')
{ {
$G="<SPAN class=\"csc$CDcampaign_id[$p]\"><B>"; $EG='</B></SPAN>'; $G="<SPAN class=\"csc$CDcampaign_id[$p]\"><B>"; $EG='</B></SPAN>';
$Ccampaign_id="<a href=\"AST_VICIDIAL_ingrouplist.php?group=$CDcampaign_id[$p]&SUBMIT=SUBMIT\">$Ccampaign_id</a>"; $Ccampaign_id="<a href=\"AST_VICIDIAL_ingrouplist.php?group=$CDcampaign_id[$p]&SUBMIT=SUBMIT\">$Ccampaign_id</a>";
@@ -2181,7 +2242,7 @@ while($p<$k)
$p++; $p++;
} }
$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $Cecho .= "+---------+----------------------+--------------+-----------------+---------+------------+----------+\n";
if ($p<1) if ($p<1)
{$Cecho='';} {$Cecho='';}
@@ -2680,10 +2741,15 @@ $talking_to_print = mysqli_num_rows($rslt);
$G = ''; $EG = ''; $G = ''; $EG = '';
if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') ) if ( ($Lstatus=='INCALL') or ($Lstatus=='PARK') )
{ {
if ($call_time_S >= 10) {$G='<SPAN class="thistle"><B>'; $EG='</B></SPAN>';} if ($comments == 'CHAT') {$G='<SPAN class="red"><B>'; $EG='</B></SPAN>'; $status='CHAT';}
if ($call_time_S >= 60) {$G='<SPAN class="violet"><B>'; $EG='</B></SPAN>';} else if ($comments == 'EMAIL') {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>'; $status='EMAIL';}
if ($call_time_S >= 300) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';} else
# if ($call_time_S >= 600) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';} {
if ($call_time_S >= 10) {$G='<SPAN class="thistle"><B>'; $EG='</B></SPAN>';}
if ($call_time_S >= 60) {$G='<SPAN class="violet"><B>'; $EG='</B></SPAN>';}
if ($call_time_S >= 300) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
# if ($call_time_S >= 600) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
}
} }
if ($Lstatus=='3-WAY') if ($Lstatus=='3-WAY')
{ {
@@ -2822,6 +2888,8 @@ $talking_to_print = mysqli_num_rows($rslt);
$Aecho .= " "._QXZ("System Load Average").": $load_ave &nbsp; $db_source\n\n"; $Aecho .= " "._QXZ("System Load Average").": $load_ave &nbsp; $db_source\n\n";
# $Aecho .= " <SPAN class=\"orange\"><B> </SPAN> - "._QXZ("Balanced call")."</B>\n"; # $Aecho .= " <SPAN class=\"orange\"><B> </SPAN> - "._QXZ("Balanced call")."</B>\n";
$Aecho .= " <SPAN class=\"red\"><B> </SPAN> - "._QXZ("Agent chatting")."</B>\n";
$Aecho .= " <SPAN class=\"orange\"><B> </SPAN> - "._QXZ("Agent in email")."</B>\n";
$Aecho .= " <SPAN class=\"lightblue\"><B> </SPAN> - "._QXZ("Agent waiting for call")."</B>\n"; $Aecho .= " <SPAN class=\"lightblue\"><B> </SPAN> - "._QXZ("Agent waiting for call")."</B>\n";
$Aecho .= " <SPAN class=\"blue\"><B> </SPAN> - "._QXZ("Agent waiting for call > 1 minute")."</B>\n"; $Aecho .= " <SPAN class=\"blue\"><B> </SPAN> - "._QXZ("Agent waiting for call > 1 minute")."</B>\n";
$Aecho .= " <SPAN class=\"midnightblue\"><B> </SPAN> - "._QXZ("Agent waiting for call > 5 minutes")."</B>\n"; $Aecho .= " <SPAN class=\"midnightblue\"><B> </SPAN> - "._QXZ("Agent waiting for call > 5 minutes")."</B>\n";