diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE
index 6b403b1f..8409ebf5 100644
--- a/agc_2-X/trunk/UPGRADE
+++ b/agc_2-X/trunk/UPGRADE
@@ -305,6 +305,9 @@ OTHER CHANGES:
82. Added In-Group option to override the Park Music-on-Hold.
+83. Added SWITCH custom field type to put buttons on the agent FORM to allow for
+ the form to be switched while on an active call.
+
diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
index 887a165a..ed11d526 100644
--- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
+++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
@@ -2685,7 +2685,7 @@ field_name VARCHAR(5000),
field_description VARCHAR(100),
field_rank SMALLINT(5),
field_help VARCHAR(1000),
-field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB') default 'TEXT',
+field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH') default 'TEXT',
field_options VARCHAR(5000),
field_size SMALLINT(5),
field_max SMALLINT(5),
@@ -4216,4 +4216,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_
UPDATE system_settings set vdc_agent_api_active='1';
-UPDATE system_settings SET db_schema_version='1543',db_schema_update_date=NOW(),reload_timestamp=NOW();
+UPDATE system_settings SET db_schema_version='1544',db_schema_update_date=NOW(),reload_timestamp=NOW();
diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql
index ed607882..1ca8e48f 100644
--- a/agc_2-X/trunk/extras/upgrade_2.14.sql
+++ b/agc_2-X/trunk/extras/upgrade_2.14.sql
@@ -623,3 +623,7 @@ UPDATE system_settings SET db_schema_version='1542',db_schema_update_date=NOW()
ALTER TABLE vicidial_inbound_groups ADD park_file_name VARCHAR(100) default '';
UPDATE system_settings SET db_schema_version='1543',db_schema_update_date=NOW() where db_schema_version < 1543;
+
+ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT','HIDDEN','READONLY','HIDEBLOB','SWITCH') default 'TEXT';
+
+UPDATE system_settings SET db_schema_version='1544',db_schema_update_date=NOW() where db_schema_version < 1544;
diff --git a/agc_2-X/trunk/www/agc/css/vicidial_stylesheet.css b/agc_2-X/trunk/www/agc/css/vicidial_stylesheet.css
index 656115de..0d40d0e4 100644
--- a/agc_2-X/trunk/www/agc/css/vicidial_stylesheet.css
+++ b/agc_2-X/trunk/www/agc/css/vicidial_stylesheet.css
@@ -100,3 +100,29 @@ div.scrolling_chat_display {
background-color: #FFF;
padding: 2px;
}
+
+.button_active {
+ background-color: #4CAF50; /* Green */
+ border: 1px solid green;
+ border-radius: 2px;
+ color: white;
+ padding: 10px 22px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 16px;
+ }
+
+.button_inactive {
+ background-color: #4CAF50; /* Green */
+ border: 1px solid green;
+ border-radius: 2px;
+ color: white;
+ padding: 10px 22px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 16px;
+ opacity: 0.6;
+ cursor: not-allowed;
+ }
diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php
index 11f1bde9..35908b8c 100644
--- a/agc_2-X/trunk/www/agc/functions.php
+++ b/agc_2-X/trunk/www/agc/functions.php
@@ -45,6 +45,7 @@
# 171129-0812 - Fixed issue with duplicate custom fields
# 180319-1339 - Added entry_date as custom field SCRIPT type variable
# 180327-1357 - Added code for LOCALFQDN conversion to browser-used server URL script iframes
+# 180503-1817 - Added code for SWITCH field type
#
# $mysql_queries = 26
@@ -412,7 +413,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
}
if ( (!preg_match("/\|$A_field_label[$o]\|/i",$vicidial_list_fields)) and (!preg_match("/\|$A_master_field[$o]\|/i",$vicidial_list_fields)) )
{
- if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
+ if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') or ($A_field_type[$o]=='SWITCH') )
{
$select_SQL .= "8,";
$A_field_select[$o]='----EMPTY----';
@@ -522,7 +523,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
{
$field_HTML .= "\n";
}
- if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
+ if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='SWITCH') )
{
$field_options_array = explode("\n",$A_field_options[$o]);
$field_options_count = count($field_options_array);
@@ -570,6 +571,24 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i
{$field_HTML .= " \n";}
$te_printed++;
}
+ if ($A_field_type[$o]=='SWITCH')
+ {
+ if ($A_multi_position[$o]=='VERTICAL')
+ {$field_HTML .= " ";}
+ $temp_opt_val = $field_options_value_array[0];
+ if (preg_match("/^$temp_opt_val$/",$list_id))
+ {
+ $field_HTML .= " "._QXZ("$field_options_value_array[1]")." \n";
+ }
+ else
+ {
+ $field_HTML .= " "._QXZ("$field_options_value_array[1]")." \n";
+ }
+ if ($A_multi_position[$o]=='VERTICAL')
+ {$field_HTML .= " \n";}
+ if ($DB > 0) {echo "DEBUG3: |$temp_options_value|$A_field_value[$o]|$field_selected|\n";}
+ $te_printed++;
+ }
}
$te++;
}
diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php
index d3d424a3..3c2d752b 100644
--- a/agc_2-X/trunk/www/agc/vdc_db_query.php
+++ b/agc_2-X/trunk/www/agc/vdc_db_query.php
@@ -460,7 +460,7 @@ $version = '2.14-348';
$build = '180418-1713';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
-$mysql_log_count=719;
+$mysql_log_count=721;
$one_mysql_log=0;
$DB=0;
$VD_login=0;
@@ -1788,7 +1788,7 @@ if ($ACTION == 'UpdateFields')
$lead_comment_count = trim("$row[0]");
##### grab the data from vicidial_list for the lead_id
- $stmt="SELECT vendor_lead_code,source_id,gmt_offset_now,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,rank,owner,entry_date FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
+ $stmt="SELECT vendor_lead_code,source_id,gmt_offset_now,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,rank,owner,entry_date,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00546',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1822,10 +1822,58 @@ if ($ACTION == 'UpdateFields')
$rank = trim("$row[23]");
$owner = trim("$row[24]");
$entry_date = trim("$row[25]");
+ $entry_list_id = trim("$row[26]");
$comments = preg_replace("/\r/i",'',$comments);
$comments = preg_replace("/\n/i",'!N',$comments);
+ if (strlen($entry_list_id) > 1)
+ {
+ $custom_field_names='|';
+ $custom_field_names_SQL='';
+ $custom_field_values='----------';
+ $custom_field_types='|';
+ ### find the names of all custom fields, if any
+ $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY','SWITCH') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
+ $rslt=mysql_to_mysqli($stmt, $link);
+ if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00720',$user,$server_ip,$session_name,$one_mysql_log);}
+ if ($DB) {echo "$stmt\n";}
+ $cffn_ct = mysqli_num_rows($rslt);
+ $d=0;
+ while ($cffn_ct > $d)
+ {
+ $row=mysqli_fetch_row($rslt);
+ $custom_field_names .= "$row[0]|";
+ $custom_field_names_SQL .= "$row[0],";
+ $custom_field_types .= "$row[1]|";
+ $custom_field_values .= "----------";
+ $d++;
+ }
+ if ($cffn_ct > 0)
+ {
+ $custom_field_names_SQL = preg_replace("/.$/i","",$custom_field_names_SQL);
+ ### find the values of the named custom fields
+ $stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
+ $rslt=mysql_to_mysqli($stmt, $link);
+ if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00721',$user,$server_ip,$session_name,$one_mysql_log);}
+ if ($DB) {echo "$stmt\n";}
+ $cffv_ct = mysqli_num_rows($rslt);
+ if ($cffv_ct > 0)
+ {
+ $custom_field_values='----------';
+ $row=mysqli_fetch_row($rslt);
+ $d=0;
+ while ($cffn_ct > $d)
+ {
+ $custom_field_values .= "$row[$d]----------";
+ $d++;
+ }
+ $custom_field_values = preg_replace("/\n/"," ",$custom_field_values);
+ $custom_field_values = preg_replace("/\r/","",$custom_field_values);
+ }
+ }
+ }
+
$LeaD_InfO = "GOOD\n";
$LeaD_InfO .= $vendor_id . "\n";
$LeaD_InfO .= $source_id . "\n";
@@ -1853,6 +1901,10 @@ if ($ACTION == 'UpdateFields')
$LeaD_InfO .= $rank . "\n";
$LeaD_InfO .= $owner . "\n";
$LeaD_InfO .= $lead_comment_count . "\n";
+ $LeaD_InfO .= $entry_list_id . "\n";
+ $LeaD_InfO .= $custom_field_names . "\n";
+ $LeaD_InfO .= $custom_field_values . "\n";
+ $LeaD_InfO .= $custom_field_types . "\n";
$LeaD_InfO .= "\n";
echo $LeaD_InfO;
@@ -5084,7 +5136,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
- $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
+ $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY','SWITCH') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -8821,7 +8873,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
- $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
+ $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY','SWITCH') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00339',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -10125,7 +10177,7 @@ if ($ACTION == 'VDADcheckINCOMINGother')
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
- $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
+ $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY','SWITCH') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00512',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -11216,7 +11268,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
- $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
+ $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY','SWITCH') and field_label NOT IN('entry_date','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') and field_label NOT LIKE \"%_DUPLICATE_%\";";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00479',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -14252,7 +14304,7 @@ if ($ACTION == 'PauseCodeMgrApr')
if ($auth_pca > 0)
{
- ### insert into the vicidial_agent_function_log table that the switch happened
+ ### insert into the vicidial_agent_function_log table that the pause code approval happened
$stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='$agent_log_id',user='$user',function='mgrapr_pause_code',event_time=NOW(),campaign_id='$campaign',user_group='$user_group',lead_id='0',uniqueid='',caller_code='',stage='$MgrApr_user',comments='$status';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
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 b275313f..b83f72ea 100644
--- a/agc_2-X/trunk/www/agc/vdc_form_display.php
+++ b/agc_2-X/trunk/www/agc/vdc_form_display.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2
#
# This script is designed display the contents of the FORM tab in the agent
# interface, as well as take submission of the form submission when the agent
@@ -42,10 +42,11 @@
# 170428-1215 - Small fix for admin modify lead display
# 171021-1339 - Fix to update default field if duplicate field in custom fields changed
# 171116-2333 - Added code for duplicate fields
+# 180503-1813 - Added code for SWITCH field type
#
-$version = '2.14-32';
-$build = '171116-2333';
+$version = '2.14-33';
+$build = '180503-1813';
$php_script = 'vdc_form_display.php';
require_once("dbconnect_mysqli.php");
@@ -57,6 +58,8 @@ if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
+if (isset($_GET["new_list_id"])) {$new_list_id=$_GET["new_list_id"];}
+ elseif (isset($_POST["new_list_id"])) {$new_list_id=$_POST["new_list_id"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
@@ -96,8 +99,6 @@ if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];}
elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];}
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
-if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
- elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];}
@@ -225,15 +226,19 @@ $startMS = microtime();
$vicidial_list_fields = '|lead_id|entry_date|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|';
$IFRAME=0;
+$SUBMIT_only=0;
$user = preg_replace("/\'|\"|\\\\|;| /","",$user);
$pass = preg_replace("/\'|\"|\\\\|;| /","",$pass);
$lead_id = preg_replace('/[^0-9]/', '', $lead_id);
$list_id = preg_replace('/[^0-9]/', '', $list_id);
+$new_list_id = preg_replace('/[^0-9]/', '', $new_list_id);
+$agent_log_id = preg_replace('/[^0-9]/', '', $agent_log_id);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
$session_id = preg_replace('/[^0-9]/','',$session_id);
$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid);
$campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign);
+$user_group = preg_replace('/[^-_0-9a-zA-Z]/','',$user_group);
#############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
@@ -241,7 +246,7 @@ $VUselected_language = '';
$stmt="SELECT selected_language from vicidial_users where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
- if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
+ if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06002',$user,$server_ip,$session_name,$one_mysql_log);}
$sl_ct = mysqli_num_rows($rslt);
if ($sl_ct > 0)
{
@@ -251,7 +256,7 @@ if ($sl_ct > 0)
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
- if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
+ if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06005',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
@@ -336,12 +341,13 @@ else
### BEGIN parse submission of the custom fields form ###
if ($stage=='SUBMIT')
{
+ $SUBMIT_only=1;
if ($SSagent_debug_logging > 0)
{
$stage .= " custom_$list_id";
}
$update_sent=0;
- $CFoutput='';
+ $SUBMIT_output='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
if ($DB>0) {echo "$stmt";}
@@ -403,9 +409,9 @@ if ($stage=='SUBMIT')
$A_field_value[$o] = $form_field_value;
- if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') or ($A_field_type[$o]=='HIDDEN') or ($A_field_type[$o]=='HIDEBLOB') or ($A_field_type[$o]=='READONLY') )
+ if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') or ($A_field_type[$o]=='SWITCH') or ($A_field_type[$o]=='HIDDEN') or ($A_field_type[$o]=='HIDEBLOB') or ($A_field_type[$o]=='READONLY') )
{
- if (($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') or ($A_field_type[$o]=='READONLY'))
+ if (($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') or ($A_field_type[$o]=='SWITCH') or ($A_field_type[$o]=='READONLY'))
{
$SUBMIT_output .= "$A_field_name[$o]: $A_field_value[$o] ";
}
@@ -497,19 +503,48 @@ if ($stage=='SUBMIT')
}
}
else
- {$CFoutput .= _QXZ("ERROR: no custom list fields table")."\n";}
+ {$SUBMIT_output .= _QXZ("ERROR: no custom list fields table")."\n";}
- echo _QXZ("Custom Form Output:")."\n \n";
+ if (strlen($new_list_id) > 1)
+ {
+ $SUBMIT_only=0;
- echo "$SUBMIT_output";
+ ### change the entry_list_id for this lead to new list ID
+ $new_list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$new_list_id' where lead_id='$lead_id';";
+ $rslt=mysql_to_mysqli($new_list_table_update_SQL, $link);
+ $new_list_update_count = mysqli_affected_rows($link);
+ if ($DB) {echo "$new_list_update_count|$new_list_table_update_SQL \n";}
+ if (!$rslt) {die('Could not execute: ' . mysqli_error($link));}
- echo "\n";
+ ### update the vicidial_live_agents record to update the entry_list_id
+ $vla_update_SQL = "UPDATE vicidial_live_agents SET external_update_fields='1',external_update_fields_data='entry_list_id,custom_field_names' where user='$user';";
+ $rslt=mysql_to_mysqli($vla_update_SQL, $link);
+ $vla_update_count = mysqli_affected_rows($link);
+ if ($DB) {echo "$vla_update_count|$vla_update_SQL \n";}
+ if (!$rslt) {die('Could not execute: ' . mysqli_error($link));}
+
+ ### insert into the vicidial_agent_function_log table that the list switch happened
+ $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='$agent_log_id',user='$user',function='switch_list',event_time=NOW(),campaign_id='$campaign',user_group='$user_group',lead_id='$lead_id',uniqueid='$uniqueid',caller_code='$call_id',stage='$new_list_id',comments='$list_id';";
+ if ($DB) {echo "$stmt\n";}
+ $rslt=mysql_to_mysqli($stmt, $link);
+ if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06006',$user,$server_ip,$session_name,$one_mysql_log);}
+
+ $list_id = $new_list_id;
+ }
+ else
+ {
+ echo _QXZ("Custom Form Output:")."\n \n";
+
+ echo "$SUBMIT_output";
+
+ echo "\n";
+ }
}
### END parse submission of the custom fields form ###
-else
+if ($SUBMIT_only < 1)
{
if ($SSagent_debug_logging > 0)
{
@@ -523,6 +558,7 @@ else
echo "\n";
echo " \n";
+ echo " \n";
echo " \n";
echo " \n";
echo "\n";
@@ -564,9 +611,14 @@ else
echo " $NWB#lists_fields-field_type$NWE \n";
@@ -1911,7 +1954,7 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
$SQLexecuted=0;
- if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
+ if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or ($field_type=='SWITCH') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
{
if ($DB) {echo "Non-DB $field_type field type, $field_label\n";}
@@ -1972,7 +2015,7 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$field_encrypt,$field_show_hide,$field_duplicate,$vicidial_list_fields)
{
$field_db_exists=0;
- if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
+ if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or ($field_type=='SWITCH') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
{$field_db_exists=1;}
else
{
@@ -2097,7 +2140,7 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
$SQLexecuted=0;
- if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
+ if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or ($field_type=='SWITCH') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
{
if ($DB) {echo _QXZ("Non-DB")." $field_type "._QXZ("field type").", $field_label\n";}
$SQLexecuted++;
@@ -2152,7 +2195,7 @@ function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
{
$SQLexecuted=0;
- if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
+ if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or ($field_type=='SWITCH') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) or ($field_duplicate=='Y') )
{
if ($DB) {echo "Non-DB $field_type field type, $field_label\n";}
$SQLexecuted++;
diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php
index 2f30cc2e..2e45cfbc 100644
--- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php
+++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php
@@ -91,6 +91,7 @@
# 180310-2300 - Added optional source_id display
# 180311-0008 - Added CIDdisplay
# 180410-1720 - Added switch lead log entry display
+# 180506-1813 - Added switch_list log entry display
#
require("dbconnect_mysqli.php");
@@ -2507,6 +2508,45 @@ else
##### END switch lead log entries #####
+ ##### BEGIN switch list(for custom fields) log entries #####
+ $stmt="SELECT * from vicidial_agent_function_log where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' and function='switch_list' order by event_time desc limit 500;";
+ $rslt=mysql_to_mysqli($stmt, $link);
+ $logs_to_print = mysqli_num_rows($rslt);
+ if ($DB) {echo "$logs_to_print|$stmt|\n";}
+
+ if ($logs_to_print > 0)
+ {
+ echo ""._QXZ("AGENT CUSTOM FIELDS SWITCH-LISTS FOR THIS LEAD").": \n";
+ echo "
\n";
+ echo "# "._QXZ("SWITCH TIME")." "._QXZ("CAMPAIGN")." "._QXZ("TSR")." "._QXZ("TO LIST ID")." "._QXZ("FROM LIST ID")." "._QXZ("CALL ID")." \n";
+
+
+ $u=0;
+ while ($logs_to_print > $u)
+ {
+ $row=mysqli_fetch_array($rslt);
+ if (preg_match("/1$|3$|5$|7$|9$/i", $u))
+ {$bgcolor="bgcolor=\"#$SSstd_row2_background\"";}
+ else
+ {$bgcolor="bgcolor=\"#$SSstd_row1_background\"";}
+
+ $u++;
+ echo "";
+ echo "$u ";
+ echo " $row[event_time] ";
+ echo " $row[campaign_id] \n";
+ echo " $row[user] \n";
+ echo " $row[stage] \n";
+ echo " $row[comments] \n";
+ echo " $row[caller_code] \n";
+ echo " \n";
+ }
+
+ echo "
\n";
+ }
+ ##### END switch list log entries #####
+
+
##### vicidial agent outbound calls for this time period #####
if ($allow_emails>0)
{
diff --git a/agc_2-X/trunk/www/vicidial/display_help.php b/agc_2-X/trunk/www/vicidial/display_help.php
new file mode 100644
index 00000000..04277eb8
--- /dev/null
+++ b/agc_2-X/trunk/www/vicidial/display_help.php
@@ -0,0 +1,43 @@
+, Joe Johnson LICENSE: AGPLv2
+#
+# pulls help text to display on the screen when the appropriate help link is clicked
+#
+# CHANGELOG:
+# 180501-0045 - First build
+#
+
+$startMS = microtime();
+
+require("dbconnect_mysqli.php");
+require("functions.php");
+
+if (isset($_GET["help_id"])) {$help_id=$_GET["help_id"];}
+ elseif (isset($_POST["help_id"])) {$help_id=$_POST["help_id"];}
+
+$help_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$help_id);
+
+$help_stmt="select help_title, help_text from help_documentation where help_id='$help_id'";
+$help_rslt=mysql_to_mysqli($help_stmt, $link);
+while ($help_row=mysqli_fetch_row($help_rslt)) {
+ preg_match_all("/(.*?)<\/QXZ>/", $help_row[1], $QXZ_matches);
+
+ $qxz_match=$QXZ_matches[0];
+ $qxz_replace=$QXZ_matches[1];
+ for ($q=0; $q";
+ echo ""._QXZ("$help_row[0]")." [X] ";
+ echo "$help_row[1] ";
+ echo "";
+}
+?>
diff --git a/agc_2-X/trunk/www/vicidial/help.js b/agc_2-X/trunk/www/vicidial/help.js
new file mode 100644
index 00000000..38f6c388
--- /dev/null
+++ b/agc_2-X/trunk/www/vicidial/help.js
@@ -0,0 +1,84 @@
+// help.js
+//
+// Copyright (C) 2018 Matt Florell , Joe Johnson LICENSE: AGPLv2
+//
+// Javascript functions for displaying/hiding/moving/populating the help span with text
+//
+// CHANGELOG:
+// 180501-0045 - First build
+
+// Detect if the browser is IE or not.
+// If it is not IE, we assume that the browser is NS.
+var IE = document.all?true:false
+// If NS -- that is, !IE -- then set up for mouse capture
+if (!IE) document.captureEvents(Event.MOUSEMOVE)
+
+
+function ClearAndHideHelpDiv() {
+ document.getElementById("HelpDisplayDiv").innerHTML="";
+ document.getElementById("HelpDisplayDiv").style.display="none";
+}
+
+function FillAndShowHelpDiv(e, help_id)
+ {
+ var help_text_id=help_id.replace("#", "");
+ document.getElementById("HelpDisplayDiv").innerHTML="";
+
+ if (IE) { // grab the x-y pos.s if browser is IE
+ tempX = event.clientX + document.body.scrollLeft+250
+ tempY = event.clientY + document.body.scrollTop
+ } else { // grab the x-y pos.s if browser is NS
+ tempX = e.pageX
+ tempY = e.pageY
+ }
+ // catch possible negative values in NS4
+ if (tempX < 0){tempX = 0}
+ if (tempY < 0){tempY = 0}
+ // show the position values in the form named Show
+ // in the text fields named MouseX and MouseY
+
+ tempX+=20;
+
+ document.getElementById("HelpDisplayDiv").style.display="block";
+ document.getElementById("HelpDisplayDiv").style.left = tempX + "px";
+ document.getElementById("HelpDisplayDiv").style.top = tempY + "px";
+
+
+ var HelpVerbiage = null;
+
+ var xmlhttp=false;
+ /*@cc_on @*/
+ /*@if (@_jscript_version >= 5)
+ // JScript gives us Conditional compilation, we can cope with old IE versions.
+ // and security blocked creation of the objects.
+ try {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (E) {
+ xmlhttp = false;
+ }
+ }
+ @end @*/
+ if (!xmlhttp && typeof XMLHttpRequest!='undefined')
+ {
+ xmlhttp = new XMLHttpRequest();
+ }
+ if (xmlhttp)
+ {
+ helptext_query = "action=grab_help_text&help_id=" + help_text_id;
+ xmlhttp.open('POST', 'display_help.php');
+ xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
+ xmlhttp.send(helptext_query);
+ xmlhttp.onreadystatechange = function()
+ {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
+ {
+ HelpVerbiage = xmlhttp.responseText;
+ document.getElementById("HelpDisplayDiv").innerHTML=HelpVerbiage;
+ }
+ }
+ delete xmlhttp;
+ }
+ }
diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php
index 06c22f47..5cd4faf3 100644
--- a/agc_2-X/trunk/www/vicidial/help.php
+++ b/agc_2-X/trunk/www/vicidial/help.php
@@ -159,6 +159,7 @@
# 180410-1609 - Added users-pause_code_approval
# 180424-1530 - Added in-group populate_lead_source, populate_lead_vendor entries
# 180430-1837 - Added inbound_groups-park_ext entry
+# 180506-1822 - Added text for custom list fields SWITCH field type
#
require("dbconnect_mysqli.php");
@@ -2456,12 +2457,12 @@ if ($SSqc_features_active > 0)
- -
+ -
- -
+ -
diff --git a/agc_2-X/trunk/www/vicidial/vicidial_stylesheet.php b/agc_2-X/trunk/www/vicidial/vicidial_stylesheet.php
index a7e667f0..64e2e904 100644
--- a/agc_2-X/trunk/www/vicidial/vicidial_stylesheet.php
+++ b/agc_2-X/trunk/www/vicidial/vicidial_stylesheet.php
@@ -6,6 +6,7 @@
# CSS/PHP file that uses the system-defined screen colors to display report elements
#
# 170830-2123 - First build
+# 180501-0045 - New elements added
require("dbconnect_mysqli.php");
require("functions.php");
@@ -13,7 +14,7 @@ header("Content-type: text/css");
require("screen_colors.php");
?>
-/* TEXT/DISPLAY STYLES */
+/* TEXT / DISPLAY STYLES */
.vertical-text {
-ms-writing-mode: tb-rl;
-webkit-writing-mode: vertical-rl;
@@ -42,12 +43,17 @@ redalert {font-size: 18px; font-weight:bold; font-family: Arial, Sans-Serif; col
border-radius: 5px;
}
.embossed {
- text-shadow: -1px -1px 2px #fff, 1px 1px 2px #000;
+ text-shadow: -1px -1px 1px #fff, 1px 1px 1px #000;
opacity: 1.0;
}
.embossed_bold {
font-weight:bold;
- text-shadow: -1px -1px 2px #fff, 1px 1px 2px #000;
+ text-shadow: -1px -1px 1px #fff, 1px 1px 1px #000;
+ opacity: 1.0;
+}
+.help_bold {
+ font-weight:bold;
+ font-size: 12pt;
opacity: 1.0;
}
.green {color: black; background-color: #99FF99}
@@ -243,9 +249,9 @@ input.tiny_green_btn{
/* TABLE ELEMENTS */
TABLE.question_td {
- -moz-border-radius: 10px 10px 10px 10px;
- -webkit-border-radius: 10px 10px 10px 10px;
- border-radius: 10px 10px 10px 10px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
box-shadow: 5px 5px 12px #000000;
padding: 5px;
font-family: Arial, Helvetica, sans-serif;
@@ -258,9 +264,9 @@ TABLE.question_td {
border:solid 2px #
}
TABLE.help_td {
- -moz-border-radius: 10px 10px 10px 10px;
- -webkit-border-radius: 10px 10px 10px 10px;
- border-radius: 10px 10px 10px 10px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
box-shadow: 5px 5px 12px #000000;
padding: 5px;
font-family: Arial, Helvetica, sans-serif;
@@ -302,7 +308,7 @@ div.shadowbox
{
box-shadow: 6px 6px 3px #888888;
border:2px solid;
-border-radius:25px;
+border-radius:5px;
FONT-WEIGHT: bold;
FONT-SIZE: 12pt;
FONT-FAMILY: Courier;
@@ -313,7 +319,7 @@ div.shadowbox_1st
background-color:#66FF66;
box-shadow: 6px 6px 3px #888888;
border:2px solid;
-border-radius:25px;
+border-radius:5px;
padding-left:10px;
FONT-WEIGHT: bold;
FONT-SIZE: 12pt;
@@ -324,7 +330,7 @@ div.shadowbox_2nd
background-color:#FFFF66;
box-shadow: 6px 6px 3px #888888;
border:2px solid;
-border-radius:25px;
+border-radius:5px;
FONT-WEIGHT: bold;
FONT-SIZE: 12pt;
FONT-FAMILY: Courier;
@@ -335,7 +341,7 @@ div.shadowbox_3rd
background-color:#66FFFF;
box-shadow: 6px 6px 3px #888888;
border:2px solid;
-border-radius:25px;
+border-radius:5px;
FONT-WEIGHT: bold;
FONT-SIZE: 12pt;
FONT-FAMILY: Courier;
@@ -347,7 +353,7 @@ div.shadowbox_4th
background-color:#FF6666;
box-shadow: 6px 6px 3px #888888;
border:2px solid;
-border-radius:25px;
+border-radius:5px;
FONT-WEIGHT: bold;
FONT-SIZE: 12pt;
FONT-FAMILY: Courier;
@@ -355,3 +361,29 @@ padding-left:10px;
}
div.help_info {position:absolute; top:0; left:0; display:none;}
+
+.button_active {
+ background-color: #4CAF50; /* Green */
+ border: 1px solid green;
+ border-radius: 2px;
+ color: white;
+ padding: 10px 22px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 16px;
+ }
+
+.button_inactive {
+ background-color: #4CAF50; /* Green */
+ border: 1px solid green;
+ border-radius: 2px;
+ color: white;
+ padding: 10px 22px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 16px;
+ opacity: 0.6;
+ cursor: not-allowed;
+ }