diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php index eb17f108..cd9b04b6 100644 --- a/agc_2-X/trunk/www/agc/functions.php +++ b/agc_2-X/trunk/www/agc/functions.php @@ -29,6 +29,7 @@ # 150512-0615 - Fix for non-latin customer data # 150724-0843 - Added vicidial_ajax_log function # 150923-2017 - Added DID custom fields +# 160510-2151 - Fixed issues with select lists and common contents # # $mysql_queries = 20 @@ -398,9 +399,9 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) $field_options_value_array = explode(",",$field_options_array[$te]); if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) { - if (strlen($A_field_value[$o]) > 0) + if (strlen($A_field_value[$o]) > 0) { - if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o])) + if (preg_match("/^$field_options_value_array[0]$/",$A_field_value[$o])) {$field_selected = 'SELECTED';} } else @@ -411,11 +412,11 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) } if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) { - if ($A_multi_position[$o]=='VERTICAL') + if ($A_multi_position[$o]=='VERTICAL') {$field_HTML .= "   ";} if (strlen($A_field_value[$o]) > 0) { - if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o])) + if (preg_match("/^$field_options_value_array[0]$/",$A_field_value[$o])) {$field_selected = 'CHECKED';} } else 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 3b76acb3..d0848d11 100644 --- a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php +++ b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php @@ -39,10 +39,11 @@ # 160414-1243 - Fixed translation issue with COPY form # 160429-1125 - Added admin_row_click option # 160508-0219 - Added screen colors feature +# 160510-2108 - Fixing issues with using only standard fields # -$admin_version = '2.12-31'; -$build = '160508-0219'; +$admin_version = '2.12-32'; +$build = '160510-2108'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -1611,10 +1612,14 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/i",$vicidial_list_fields)) ) { - if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} - $SQLexecuted++; + if ($DB) {echo "Non-DB $field_type field type, $field_label\n";} + + if ($table_exists < 1) + {$field_sql = "CREATE TABLE custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL);";} + else + {$SQLexecuted++;} } - else + if ($SQLexecuted < 1) { $stmtCUSTOM="$field_sql"; $rsltCUSTOM=mysql_to_mysqli($stmtCUSTOM, $linkCUSTOM);