diff --git a/UPGRADE b/UPGRADE index 0a379df5..2ff77b75 100644 --- a/UPGRADE +++ b/UPGRADE @@ -106,6 +106,11 @@ OTHER CHANGES: 17. Changed Custom Fields of SCRIPT type to allow URLs and urlencoded variables when using --U-- and --V-- to declare variables +18. Added option for custom list fields to be required for all calls or only + inbound calls. Will prevent agent hanging up call if field is not filled + in. Must also have campaign option enabled for it to work. Will work for + the following custom field types: TEXT, AREA, DATE + diff --git a/docs/NON-AGENT_API.txt b/docs/NON-AGENT_API.txt index 02835b17..2e2921d5 100644 --- a/docs/NON-AGENT_API.txt +++ b/docs/NON-AGENT_API.txt @@ -1,4 +1,4 @@ -NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2017-02-19 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2017-03-01 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -119,6 +119,8 @@ Changes: 170204-0947 - Added phone_number_log function 170209-1149 - Added URL and IP logging 170219-1520 - Added 90-day duplicate check option +170223-0743 - Added QXZ translation to admin web user functions text +170301-1649 - Added validation that sounds web dir exists to sounds_list function API Functions use the 'function' variable @@ -162,7 +164,7 @@ Example responses: ERROR: sounds_list USER DOES NOT HAVE PERMISSION TO VIEW SOUNDS LIST - +ERROR: audio store web directory does not exist: |6666|sounds_list|/srv/www/htdocs/1234| ERROR: sounds_list CENTRAL SOUND CONTROL IS NOT ACTIVE diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index c5a64112..366841e5 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -2613,7 +2613,7 @@ field_size SMALLINT(5), field_max SMALLINT(5), field_default VARCHAR(255), field_cost SMALLINT(5), -field_required ENUM('Y','N') default 'N', +field_required ENUM('Y','N','INBOUND_ONLY') default 'N', name_position ENUM('LEFT','TOP') default 'LEFT', multi_position ENUM('HORIZONTAL','VERTICAL') default 'HORIZONTAL', field_order SMALLINT(5) default '1', @@ -3870,4 +3870,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1490',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1491',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 7d092d74..84385be7 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -74,3 +74,7 @@ ALTER TABLE vicidial_closer_log MODIFY term_reason ENUM('CALLER','AGENT','QUEUE ALTER TABLE vicidial_closer_log_archive MODIFY term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRECALLXFER','HOLDTIME','NOAGENT','NONE','MAXCALLS','ACFILTER') default 'NONE'; UPDATE system_settings SET db_schema_version='1490',db_schema_update_date=NOW() where db_schema_version < 1490; + +ALTER TABLE vicidial_lists_fields MODIFY field_required ENUM('Y','N','INBOUND_ONLY') default 'N'; + +UPDATE system_settings SET db_schema_version='1491',db_schema_update_date=NOW() where db_schema_version < 1491; diff --git a/www/agc/functions.php b/www/agc/functions.php index cecf54a5..ae49287f 100644 --- a/www/agc/functions.php +++ b/www/agc/functions.php @@ -32,6 +32,7 @@ # 160510-2151 - Fixed issues with select lists and common contents # 160913-0827 - Fixed issues with multiple selected values in custom fields # 170228-2258 - Changes to allow URLs in SCRIPT field types +# 170301-0837 - Added functionality for required custom fields # # $mysql_queries = 20 @@ -229,13 +230,14 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur ##### BEGIN custom_list_fields_values - gather values for display of custom list fields for a lead ##### -function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB) +function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_id) { $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $vicidial_list_fields = '|lead_id|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|'; + $custom_required_fields='|'; require("dbconnect_mysqli.php"); @@ -447,12 +449,16 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB) if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} $field_HTML .= "\n"; + if ( ($A_field_required[$o] == 'Y') or ( ($A_field_required[$o] == 'INBOUND_ONLY') and (preg_match("/^Y\d\d\d\d\d\d\d/",$call_id)) ) ) + {$custom_required_fields .= "$A_field_label[$o]|";} } if ($A_field_type[$o]=='AREA') { if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} $field_HTML .= ""; + if ( ($A_field_required[$o] == 'Y') or ( ($A_field_required[$o] == 'INBOUND_ONLY') and (preg_match("/^Y\d\d\d\d\d\d\d/",$call_id)) ) ) + {$custom_required_fields .= "$A_field_label[$o]|";} } if ($A_field_type[$o]=='DISPLAY') { @@ -490,6 +496,8 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB) $field_HTML .= " 'controlname': '$A_field_label[$o]'});\n"; $field_HTML .= "o_cal.a_tpl.yearscroll = false;\n"; $field_HTML .= "\n"; + if ( ($A_field_required[$o] == 'Y') or ( ($A_field_required[$o] == 'INBOUND_ONLY') and (preg_match("/^Y\d\d\d\d\d\d\d/",$call_id)) ) ) + {$custom_required_fields .= "$A_field_label[$o]|";} } if ($A_field_type[$o]=='TIME') { @@ -749,7 +757,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB) {$NOTESout .= ""._QXZ("No calls found")."";} $u=0; - while ($g > $u) + while ($g > $u) { $sort_split = explode("-----",$ALLsort[$u]); $i = $sort_split[1]; @@ -970,6 +978,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB) if ($DB > 0) {echo "$CFoutput
\n";} } ##### END parsing for vicidial variables ##### + echo "\n"; return $CFoutput; diff --git a/www/agc/vdc_form_display.php b/www/agc/vdc_form_display.php index ddc0f6c2..7e902031 100644 --- a/www/agc/vdc_form_display.php +++ b/www/agc/vdc_form_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 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 @@ -36,10 +36,11 @@ # 150923-2027 - Added DID custom variables # 160129-1019 - Added missing pass field to SUBMIT stage form # 160912-0805 - Added debug, fixed issue with multi-selected values +# 170301-0834 - Added call_id field for custom fields # -$version = '2.12-26'; -$build = '160912-0805'; +$version = '2.14-27'; +$build = '170301-0834'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -508,12 +509,13 @@ else echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; require_once("functions.php"); - $CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB); + $CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_id); echo "$CFoutput"; diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 637302cb..531e313d 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -541,10 +541,11 @@ # 170217-1359 - Added dead_to_dispo campaign option # 170220-1306 - Added external_lead_id trigger for switch_lead API function # 170223-2122 - Fixed rare recording issue +# 170301-0839 - Added functionality for required custom fields # -$version = '2.14-511c'; -$build = '170223-2122'; +$version = '2.14-512c'; +$build = '170301-0839'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -11600,6 +11601,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (allow_required_fields=='Y') { var required_fields_list = document.vicidial_form.required_fields.value; + var error_field_list=''; if (required_fields_list.length > 4) { var regRFtitle = new RegExp("title","ig"); @@ -11618,7 +11620,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var regRFvendor_lead_code = new RegExp("vendor_lead_code","ig"); var regRFsecurity_phrase = new RegExp("security_phrase","ig"); var regRFemail = new RegExp("email","ig"); - var error_field_list=''; if (required_fields_list.match(regRFtitle)) { @@ -11701,9 +11702,32 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (TEMP_email.length < 1){required_fail++; error_field_list = error_field_list + " email";} } } + if (custom_fields_enabled > 0) + { + var temp_custom_required = vcFormIFrame.document.form_custom_fields.custom_required.value; + // alert_box("checking for required custom fields: " + temp_custom_required); + + if (temp_custom_required.length > 2) + { + var CFR_array=temp_custom_required.split('|'); + var CFR_count=CFR_array.length; + var CFR_tick=0; + while (CFR_tick < CFR_count) + { + var CFR_field = CFR_array[CFR_tick]; + if (CFR_field.length > 0) + { + var temp_field_check = vcFormIFrame.document.getElementById(CFR_field).value; + if (temp_field_check.length < 1){required_fail++; error_field_list = error_field_list + " CF: " + CFR_field;} + } + CFR_tick++; + } + } + } } if (required_fail > 0) { + button_click_log = button_click_log + "" + SQLdate + "-----required_fields_alert---" + error_field_list + "|"; alert_box(": " + error_field_list); } else @@ -15764,7 +15788,9 @@ function phone_number_format(formatphone) { var form_entry_list_id = document.vicidial_form.entry_list_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('vcFormIFrame').src='./?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + "&called_count=" + document.vicidial_form.called_count.value + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + ''; + 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 + ''; + document.getElementById('vcFormIFrame').src = temp_vcFormIFrame_url; + // alert_box(temp_vcFormIFrame_url); form_list_id = ''; form_entry_list_id = ''; } @@ -15780,7 +15806,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 + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + ''; + document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&agent_email=" + LOGemail + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&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 = ''; } @@ -15795,7 +15821,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 + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' + "&xfercallid=" + xfercallid + '' + "&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 + ''; + 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 + ''; form_list_id = ''; form_chat_id = ''; form_entry_list_id = ''; diff --git a/www/vicidial/admin_lists_custom.php b/www/vicidial/admin_lists_custom.php index d3e5e2e2..0c37f22c 100644 --- a/www/vicidial/admin_lists_custom.php +++ b/www/vicidial/admin_lists_custom.php @@ -41,10 +41,11 @@ # 160508-0219 - Added screen colors feature # 160510-2108 - Fixing issues with using only standard fields # 170228-2254 - Changes to allow URLs in SCRIPT field types +# 170301-0827 - Enabled required custom fields with INBOUND_ONLY option # -$admin_version = '2.14-33'; -$build = '170228-2254'; +$admin_version = '2.14-34'; +$build = '170301-0827'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -145,7 +146,7 @@ if ($non_latin < 1) $field_order = preg_replace('/[^0-9]/','',$field_order); $source_list_id = preg_replace('/[^0-9]/','',$source_list_id); - $field_required = preg_replace('/[^NY]/','',$field_required); + $field_required = preg_replace('/[^_A-Z]/','',$field_required); $field_type = preg_replace('/[^0-9a-zA-Z]/','',$field_type); $ConFiRm = preg_replace('/[^0-9a-zA-Z]/','',$ConFiRm); @@ -1216,7 +1217,6 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "
\n"; echo "\n"; @@ -1265,11 +1265,12 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "\n"; echo "\n"; echo "\n"; - // echo "\n"; + echo "\n"; echo "\n"; @@ -1287,7 +1288,6 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; -// echo "\n"; + echo "\n"; echo "\n"; echo "
"._QXZ("Field Label")." $A_field_rank[$o]: $LcolorB$A_field_label[$o]$LcolorE $NWB#lists_fields-field_label$NWE
"._QXZ("Field Size")." $A_field_rank[$o]: $NWB#lists_fields-field_size$NWE
"._QXZ("Field Max")." $A_field_rank[$o]: $NWB#lists_fields-field_max$NWE
"._QXZ("Field Default")." $A_field_rank[$o]: $NWB#lists_fields-field_default$NWE
Field Required $A_field_rank[$o]: $NWB#lists_fields-field_required$NWE
"._QXZ("Field Required")." $A_field_rank[$o]: $NWB#lists_fields-field_required$NWE
             \n"; echo ""._QXZ("DELETE THIS CUSTOM FIELD").""; echo "
"._QXZ("New Field Rank").":
"._QXZ("Field Size").": $NWB#lists_fields-field_size$NWE
"._QXZ("Field Max").": $NWB#lists_fields-field_max$NWE
"._QXZ("Field Default").": $NWB#lists_fields-field_default$NWE
Field Required: $NWB#lists_fields-field_required$NWE
"._QXZ("Field Required").": $NWB#lists_fields-field_required$NWE


\n"; echo "

\n"; diff --git a/www/vicidial/audio_store.php b/www/vicidial/audio_store.php index 8737901d..bbc3a113 100644 --- a/www/vicidial/audio_store.php +++ b/www/vicidial/audio_store.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # @@ -24,10 +24,11 @@ # 160330-1550 - navigation changes and fixes, added force_allow var # 160508-0139 - Added screen colors feature # 160613-1002 - Added feature to copy recordings to a new filename +# 170301-1650 - Added validation that sounds web dir exists # -$version = '2.12-18'; -$build = '160613-1002'; +$version = '2.14-19'; +$build = '170301-1650'; $MT[0]=''; @@ -130,6 +131,11 @@ if (strlen($sounds_web_directory) < 30) echo _QXZ("NOTICE").": "._QXZ("new web directory created")."\n"; } +if (!file_exists("$WeBServeRRooT/$sounds_web_directory")) + { + echo _QXZ("ERROR").": "._QXZ("audio store web directory does not exist").": $WeBServeRRooT/$sounds_web_directory\n"; + exit; + } ### get list of all servers, if not one of them, then force authentication check $stmt = "SELECT server_ip FROM servers;"; diff --git a/www/vicidial/help.php b/www/vicidial/help.php index 4a2de538..de0e298d 100644 --- a/www/vicidial/help.php +++ b/www/vicidial/help.php @@ -110,6 +110,7 @@ # 170207-1331 - Added api_only_user entry # 170217-1353 - Added dead_to_dispo entry # 170220-1811 - Added areacode_filter entries +# 170301-1337 - Updated entry for custom fields required setting # @@ -2237,7 +2238,7 @@ if ($SSqc_features_active > 0)

- - + -
diff --git a/www/vicidial/non_agent_api.php b/www/vicidial/non_agent_api.php index 9c49cd0a..69452d02 100644 --- a/www/vicidial/non_agent_api.php +++ b/www/vicidial/non_agent_api.php @@ -114,10 +114,11 @@ # 170209-1149 - Added URL and IP logging # 170219-1520 - Added 90-day duplicate check option # 170223-0743 - Added QXZ translation to admin web user functions text +# 170301-1649 - Added validation that sounds web dir exists to sounds_list function # -$version = '2.14-90'; -$build = '170223-0743'; +$version = '2.14-91'; +$build = '170301-1649'; $api_url_log = 0; $startMS = microtime(); @@ -844,6 +845,16 @@ if ($function == 'sounds_list') $i=0; $filename_sort=$MT; $dirpath = "$WeBServeRRooT/$sounds_web_directory"; + if (!file_exists("$WeBServeRRooT/$sounds_web_directory")) + { + $result = 'ERROR'; + $result_reason = "audio store web directory does not exist"; + echo "$result: $result_reason: |$user|$function|$WeBServeRRooT/$sounds_web_directory|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + $dh = opendir($dirpath); if ($DB>0) {echo "DEBUG: sounds_list variables - $dirpath|$stage|$format\n";} while (false !== ($file = readdir($dh)))