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"; - echo "\n"; - 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"; + echo "\n"; + echo "\n"; + 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 "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -576,10 +628,10 @@ else echo "$CFoutput"; + if ($bcrypt=='0') + {echo "\n";} if ($submit_button=='YES') { - if ($bcrypt=='0') - {echo "\n";} echo "\n"; echo "

\n"; } diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index a2e17b0e..d4de94da 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -593,10 +593,11 @@ # 180410-1629 - Added Pause Code manager approval feature, Added switch_lead logging # 180421-0754 - Moved AGENT TIME link and Dialable Leads display to not overlap # 180425-2036 - Added INSERT_first_onload variable +# 180506-2222 - Added SWITCH custom field type # -$version = '2.14-563c'; -$build = '180425-2036'; +$version = '2.14-564c'; +$build = '180506-2222'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -8890,6 +8891,22 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.vicidial_form.owner.value = UDfieldsResponse_array[25]; event_data = event_data + '--- owner ' + UDfieldsResponse_array[25]; } + var regUDentry_list_id = new RegExp("entry_list_id,","ig"); + if (fields_list.match(regUDentry_list_id)) + { + document.vicidial_form.entry_list_id.value = UDfieldsResponse_array[27]; + event_data = event_data + '--- entry_list_id ' + UDfieldsResponse_array[27]; + } + var regUDcustom_field_names = new RegExp("custom_field_names,","ig"); + if (fields_list.match(regUDcustom_field_names)) + { + custom_field_names = UDfieldsResponse_array[28]; + event_data = event_data + '--- custom_field_names ' + UDfieldsResponse_array[28]; + custom_field_values = UDfieldsResponse_array[29]; + event_data = event_data + '--- custom_field_values ' + UDfieldsResponse_array[29]; + custom_field_types = UDfieldsResponse_array[30]; + event_data = event_data + '--- custom_field_types ' + UDfieldsResponse_array[30]; + } var regUDformreload = new RegExp("formreload,","ig"); if (fields_list.match(regUDformreload)) { @@ -16779,7 +16796,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} - var temp_vcFormIFrame_url = './?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 + '' +"&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 + '' +"&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 + ''; + var temp_vcFormIFrame_url = './?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 + "&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 + '' +"&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 + '' +"&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 + ''; document.getElementById('vcFormIFrame').src = temp_vcFormIFrame_url; // alert_box(temp_vcFormIFrame_url); form_list_id = ''; @@ -16797,7 +16814,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('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&email_row_id=' + email_row_id + '&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 + '' +"&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 + '' +"&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 + '' ; + document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&email_row_id=' + email_row_id + '&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 + "&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 + '' +"&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 + '' +"&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 + '' ; form_list_id = ''; form_entry_list_id = ''; } @@ -16812,7 +16829,7 @@ function phone_number_format(formatphone) { var form_chat_id = document.vicidial_form.chat_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('CustomerChatIFrame').src='./vdc_chat_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&chat_id=' + form_chat_id + '&dial_method=' + dial_method + '&clickmute=' + clickMute + '&email_invite_lead_id=' + email_invite_lead_id + '&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 + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' + "&xfercallid=" + xfercallid + '' + "&chat_group_id=" + VDCL_group_id + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' +"&web_vars=" + LIVE_web_vars + '' +"&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 + ''; + document.getElementById('CustomerChatIFrame').src='./vdc_chat_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&chat_id=' + form_chat_id + '&dial_method=' + dial_method + '&clickmute=' + clickMute + '&email_invite_lead_id=' + email_invite_lead_id + '&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 + "&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 + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' + "&xfercallid=" + xfercallid + '' + "&chat_group_id=" + VDCL_group_id + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' +"&web_vars=" + LIVE_web_vars + '' +"&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 + ''; form_list_id = ''; form_chat_id = ''; form_entry_list_id = ''; diff --git a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php index 4f1f5701..89297436 100644 --- a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php +++ b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php @@ -50,10 +50,12 @@ # 180123-1817 - cleanup of enc code # 180125-1733 - Added more reserved words from MySQL/MariaDB # 180316-0754 - Translated phrases fixes, issue #1081 +# 180502-2215 - Added new help display +# 180504-1807 - Added new SWITCH field type # -$admin_version = '2.14-42'; -$build = '180316-0754'; +$admin_version = '2.14-43'; +$build = '180504-1807'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -321,6 +323,10 @@ function close_help(taskspan,taskhelp) } ?> + + + + <?php echo _QXZ("ADMINISTRATION: Lists Custom Fields"); ?> <?php @@ -388,9 +394,12 @@ if ($SScustom_fields_enabled < 1) } -$NWB = "   <a href=\"javascript:openNewWindow('./help.php?action=HELP"; +$NWB = "   <a href=\"javascript:openNewWindow('help.php?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; +#$NWB = "<IMG SRC=\"help.gif\" onClick=\"FillAndShowHelpDiv(event, '"; +#$NWE = "')\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP>"; + if ($DB > 0) { @@ -811,11 +820,12 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) else { $TEST_valid_options=0; - if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') ) { $TESTfield_options_array = explode("\n",$field_options); $TESTfield_options_count = count($TESTfield_options_array); $te=0; + $switch_list_self=0; while ($te < $TESTfield_options_count) { if (preg_match("/,/",$TESTfield_options_array[$te])) @@ -823,6 +833,8 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) {$TEST_valid_options++;} + if ( ($field_type=='SWITCH') and ($TESTfield_options_value_array[0] == "$list_id") ) + {$switch_list_self++;} } $te++; } @@ -830,62 +842,67 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) ) } if ( ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) and ( (!preg_match("/,/",$field_options)) or (!preg_match("/\n/",$field_options)) or (strlen($field_options)<6) or ($TEST_valid_options < 1) ) ) - {echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when adding a SELECT, MULTI, RADIO or CHECKBOX field type")." - $list_id|$field_label|$field_type|$field_options</B></font>\n<BR>";} + {echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when adding a SELECT, MULTI, RADIO or CHECKBOX field type")." - $list_id|$field_label|$field_type|$switch_list_self|$field_options</B></font>\n<BR>";} else { - if ( ($field_exists > 0) and ($field_duplicate != 'Y') ) - {echo "<B><font color=red>"._QXZ("ERROR: Field already exists for this list")." - $list_id|$field_label</B></font>\n<BR>";} + if ( ($field_type=='SWITCH') and ($switch_list_self < 1) ) + {echo "<B><font color=red>"._QXZ("ERROR: You must include the current List ID in field options when adding a SWITCH field type")." - $list_id|$field_label|$field_type|$field_options</B></font>\n<BR>";} else { - if ( ($field_exists < 1) and ($field_duplicate == 'Y') ) - {echo "<B><font color=red>"._QXZ("ERROR: Field set to duplicate but original does not exist for this list")." - $list_id|$field_label|$field_duplicate</B></font>\n<BR>";} + if ( ($field_exists > 0) and ($field_duplicate != 'Y') ) + {echo "<B><font color=red>"._QXZ("ERROR: Field already exists for this list")." - $list_id|$field_label</B></font>\n<BR>";} else { - if ( ($field_type!='TEXT') and ($field_duplicate == 'Y') ) - {echo "<B><font color=red>"._QXZ("ERROR: Field set to duplicate but not TEXT type")." - $list_id|$field_label|$field_duplicate|$field_type</B></font>\n<BR>";} + if ( ($field_exists < 1) and ($field_duplicate == 'Y') ) + {echo "<B><font color=red>"._QXZ("ERROR: Field set to duplicate but original does not exist for this list")." - $list_id|$field_label|$field_duplicate</B></font>\n<BR>";} else { - $table_exists=0; - #$linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); - #if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysqli_error());} - #mysql_select_db("$VARDB_database", $linkCUSTOM); - - $linkCUSTOM=mysqli_connect("$VARDB_server", "$VARDB_custom_user", "$VARDB_custom_pass", "$VARDB_database", "$VARDB_port"); - if (!$linkCUSTOM) + if ( ($field_type!='TEXT') and ($field_duplicate == 'Y') ) + {echo "<B><font color=red>"._QXZ("ERROR: Field set to duplicate but not TEXT type")." - $list_id|$field_label|$field_duplicate|$field_type</B></font>\n<BR>";} + else { - die('MySQL '._QXZ("connect ERROR").': '. mysqli_connect_error()); - } + $table_exists=0; + #$linkCUSTOM=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_custom_user","$VARDB_custom_pass"); + #if (!$linkCUSTOM) {die("Could not connect: $VARDB_server|$VARDB_port|$VARDB_database|$VARDB_custom_user|$VARDB_custom_pass" . mysqli_error());} + #mysql_select_db("$VARDB_database", $linkCUSTOM); - $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; - $rslt=mysql_to_mysqli($stmt, $link); - $tablecount_to_print = mysqli_num_rows($rslt); - if ($tablecount_to_print > 0) - {$table_exists = 1;} - if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} - - if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) - {$field_label = strtolower($field_label);} - - if ($field_duplicate == 'Y') - { - $duplicate_field_count=0; - $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label LIKE \"$field_label%\";"; - if ($DB>0) {echo "$stmt";} - $rslt=mysql_to_mysqli($stmt, $link); - $dupscount_to_print = mysqli_num_rows($rslt); - if ($dupscount_to_print > 0) + $linkCUSTOM=mysqli_connect("$VARDB_server", "$VARDB_custom_user", "$VARDB_custom_pass", "$VARDB_database", "$VARDB_port"); + if (!$linkCUSTOM) { - $rowx=mysqli_fetch_row($rslt); - $duplicate_field_count = $rowx[0]; + die('MySQL '._QXZ("connect ERROR").': '. mysqli_connect_error()); } - $field_label .= "_DUPLICATE_" . sprintf('%03d', $duplicate_field_count); + + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $tablecount_to_print = mysqli_num_rows($rslt); + if ($tablecount_to_print > 0) + {$table_exists = 1;} + if ($DB>0) {echo "$stmt|$tablecount_to_print|$table_exists";} + + if (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) + {$field_label = strtolower($field_label);} + + if ($field_duplicate == 'Y') + { + $duplicate_field_count=0; + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id' and field_label LIKE \"$field_label%\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_to_mysqli($stmt, $link); + $dupscount_to_print = mysqli_num_rows($rslt); + if ($dupscount_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $duplicate_field_count = $rowx[0]; + } + $field_label .= "_DUPLICATE_" . sprintf('%03d', $duplicate_field_count); + } + + ### add field function + $SQLsuccess = add_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,$mysql_reserved_words); + + if ($SQLsuccess > 0) + {echo _QXZ("SUCCESS: Custom Field Added")." - $list_id|$field_label\n<BR>";} } - - ### add field function - $SQLsuccess = add_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,$mysql_reserved_words); - - if ($SQLsuccess > 0) - {echo _QXZ("SUCCESS: Custom Field Added")." - $list_id|$field_label\n<BR>";} } } } @@ -949,11 +966,12 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i else { $TEST_valid_options=0; - if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') ) + if ( ($field_type=='SELECT') or ($field_type=='MULTI') or ($field_type=='RADIO') or ($field_type=='CHECKBOX') or ($field_type=='SWITCH') ) { $TESTfield_options_array = explode("\n",$field_options); $TESTfield_options_count = count($TESTfield_options_array); $te=0; + $switch_list_self=0; while ($te < $TESTfield_options_count) { if (preg_match("/,/",$TESTfield_options_array[$te])) @@ -961,6 +979,9 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i $TESTfield_options_value_array = explode(",",$TESTfield_options_array[$te]); if ( (strlen($TESTfield_options_value_array[0]) > 0) and (strlen($TESTfield_options_value_array[1]) > 0) ) {$TEST_valid_options++;} + if ( ($field_type=='SWITCH') and ($TESTfield_options_value_array[0] == "$list_id") ) + {$switch_list_self++;} + if ($DB) {echo "DEBUG: |$list_id|$field_label|$field_type|$switch_list_self|$TESTfield_options_value_array[0]|$TESTfield_options_value_array[1]|\n";} } $te++; } @@ -971,11 +992,16 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i {echo "<B><font color=red>"._QXZ("ERROR: You must enter field options when updating a SELECT, MULTI, RADIO or CHECKBOX field type")." - $list_id|$field_label|$field_type|$field_options</B></font>\n<BR>";} else { - ### modify field function - $SQLsuccess = 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); + if ( ($field_type=='SWITCH') and ($switch_list_self < 1) ) + {echo "<B><font color=red>"._QXZ("ERROR: You must include the current List ID in field options when modifying a SWITCH field type")." - $list_id|$field_label|$field_type|$switch_list_self|$field_options</B></font>\n<BR>";} + else + { + ### modify field function + $SQLsuccess = 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); - if ($SQLsuccess > 0) - {echo _QXZ("SUCCESS: Custom Field Modified")." - $list_id|$field_label\n<BR>";} + if ($SQLsuccess > 0) + {echo _QXZ("SUCCESS: Custom Field Modified")." - $list_id|$field_label\n<BR>";} + } } } } @@ -1191,7 +1217,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) { $field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o] id=$A_field_label[$o]>\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); @@ -1216,6 +1242,21 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) if ($A_multi_position[$o]=='VERTICAL') {$field_HTML .= "<BR>\n";} } + if ($A_field_type[$o]=='SWITCH') + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if ($list_id == "$field_options_value_array[0]") + { + $field_HTML .= "<button class='button_inactive' disabled onclick=\"nothing();\"> "._QXZ("$field_options_value_array[1]")." </button> "; + } + else + { + $field_HTML .= "<button class='button_active' disabled onclick=\"switch_list('$field_options_value_array[0]');\"> "._QXZ("$field_options_value_array[1]")." </button> \n"; + } + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "<BR>\n";} + } } $te++; } @@ -1454,6 +1495,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "<option value='SCRIPT'>"._QXZ("SCRIPT")."</option>\n"; echo "<option value='HIDDEN'>"._QXZ("HIDDEN")."</option>\n"; echo "<option value='HIDEBLOB'>"._QXZ("HIDEBLOB")."</option>\n"; + echo "<option value='SWITCH'>"._QXZ("SWITCH")."</option>\n"; echo "<option value='READONLY'>"._QXZ("READONLY")."</option>\n"; echo "<option value='$A_field_type[$o]' selected>"._QXZ("$A_field_type[$o]")."</option>\n"; echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\n"; @@ -1556,6 +1598,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "<option value='SCRIPT'>"._QXZ("SCRIPT")."</option>\n"; echo "<option value='HIDDEN'>"._QXZ("HIDDEN")."</option>\n"; echo "<option value='HIDEBLOB'>"._QXZ("HIDEBLOB")."</option>\n"; + echo "<option value='SWITCH'>"._QXZ("SWITCH")."</option>\n"; echo "<option value='READONLY'>"._QXZ("READONLY")."</option>\n"; echo "<option selected value='TEXT'>"._QXZ("TEXT")."</option>\n"; echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\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 "<B>"._QXZ("AGENT CUSTOM FIELDS SWITCH-LISTS FOR THIS LEAD").":</B>\n"; + echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td align=left><font size=2> "._QXZ("SWITCH TIME")."</td><td><font size=2>"._QXZ("CAMPAIGN")." </td><td align=left><font size=2>"._QXZ("TSR")." </td><td align=left><font size=2>   "._QXZ("TO LIST ID")."</td><td align=left><font size=2> "._QXZ("FROM LIST ID")."</td><td align=left><font size=2> "._QXZ("CALL ID")."</td></tr>\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 "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td align=left><font size=1> $row[event_time] </td>"; + echo "<td align=left><font size=1> $row[campaign_id] </td>\n"; + echo "<td align=left><font size=2> $row[user] </td>\n"; + echo "<td align=left><font size=2> <a href=\"$PHP_SELF?ADD=311&list_id=$row[stage]\">$row[stage]</a> </td>\n"; + echo "<td align=left><font size=2> <a href=\"$PHP_SELF?ADD=311&list_id=$row[stage]\">$row[comments]</a> </td>\n"; + echo "<td align=left><font size=1> $row[caller_code] </td>\n"; + echo "</tr>\n"; + } + + echo "</TABLE><BR><BR>\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 @@ +<?php +# display_help.php +# +# Copyright (C) 2018 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> 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>(.*?)<\/QXZ>/", $help_row[1], $QXZ_matches); + + $qxz_match=$QXZ_matches[0]; + $qxz_replace=$QXZ_matches[1]; + for ($q=0; $q<count($qxz_replace); $q++) { + # $qxz_match[$q]=preg_replace("/\//", '\\\/', $qxz_match[$q]); + $qxz_match[$q]=preg_quote($qxz_match[$q], '/'); + $qxz_match[$q]="/".$qxz_match[$q]."/"; + $qxz_replace[$q]=_QXZ($qxz_replace[$q]); + } + $help_row[1]=preg_replace($qxz_match, $qxz_replace, $help_row[1]); + + # preg_replace('/"/', '\\"', $help_row[1]); + echo "<TABLE CELLPADDING=2 CELLSPACING=0 border='0' class='help_td' width='300'>"; + echo "<TR><TD VALIGN='TOP' width='280'><FONT class='help_bold'>"._QXZ("$help_row[0]")."</font></td><TD VALIGN='TOP' align='right' width='20' onClick='ClearAndHideHelpDiv()'><B>[X]</B></tr>"; + echo "<TR><TD VALIGN='TOP' colspan='2'>$help_row[1]</td></tr>"; + echo "</TABLE>"; +} +?> 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 <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> 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) <BR> <A NAME="lists_fields-field_type"> <BR> -<B><?php echo _QXZ("Field Type"); ?> -</B><?php echo _QXZ("This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured."); ?> +<B><?php echo _QXZ("Field Type"); ?> -</B><?php echo _QXZ("This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured. The SWITCH field type allows the agent to switch the lead custom fields to another list, as well as reloading the FORM tab with the new set of list custom fields for the new list. To configure SWITCH type fields, you must define the button values below in the Field Options box."); ?> <BR> <A NAME="lists_fields-field_options"> <BR> -<B><?php echo _QXZ("Field Options"); ?> -</B><?php echo _QXZ("For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter") . ". " . _QXZ("For the SCRIPT field types, this field is where you put your script contents. You can use single quote and amphersand characters as well so that you can create links and iframe elements. If you want to put urlencoded fields in this area, make sure you use the --U-- and --V-- flags for your variables instead of using A and B, for example --U--test_field--V--."); ?> +<B><?php echo _QXZ("Field Options"); ?> -</B><?php echo _QXZ("For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter") . ". " . _QXZ("For the SCRIPT field types, this field is where you put your script contents. You can use single quote and amphersand characters as well so that you can create links and iframe elements. If you want to put urlencoded fields in this area, make sure you use the --U-- and --V-- flags for your variables instead of using A and B, for example --U--test_field--V--. For the SWITCH field type, you should define the list ID for the custom fields as well as the text that you want to appear in the button to activate the new form in a comma separated line, with one line for each button you want to appear. For the SWITCH field type, it is a requirement that one of the entries be the current list ID."); ?> <BR> <A NAME="lists_fields-multi_position"> 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 #<?php echo $SSmenu_background; ?> } 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; + }