From e72a328dc339527ad03af98da49609fefb6ec307 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 10 May 2010 15:48:02 +0000 Subject: [PATCH] Added DISPLAY readonly field typ to custom list fields git-svn-id: svn://192.168.202.10@1429 3d104415-ff17-0410-8863-d5cf3c621b8a --- extras/MySQL_AST_CREATE_tables.sql | 4 +-- extras/upgrade_2.4.sql | 4 +++ .../TO_BE_TRANSLATED_2.4.txt | 1 + www/vicidial/admin_lists_custom.php | 25 ++++++++++++++++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 88c8924e..5e681b7e 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -2077,7 +2077,7 @@ field_name VARCHAR(1000), field_description VARCHAR(100), field_rank SMALLINT(5), field_help VARCHAR(1000), -field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME') default 'TEXT', +field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY') default 'TEXT', field_options VARCHAR(5000), field_size SMALLINT(5), field_max SMALLINT(5), @@ -2230,7 +2230,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log; -UPDATE system_settings SET db_schema_version='1219',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1220',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.4.sql b/extras/upgrade_2.4.sql index 52b6fee7..4c84f5c3 100644 --- a/extras/upgrade_2.4.sql +++ b/extras/upgrade_2.4.sql @@ -313,3 +313,7 @@ UPDATE system_settings SET db_schema_version='1218',db_schema_update_date=NOW(); ALTER TABLE vicidial_lists_fields ADD field_order SMALLINT(5) default '1'; UPDATE system_settings SET db_schema_version='1219',db_schema_update_date=NOW(); + +ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY') default 'TEXT'; + +UPDATE system_settings SET db_schema_version='1220',db_schema_update_date=NOW(); diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index b3baf52a..dec38fda 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -182,6 +182,7 @@ SUCCESS: Custom Field Modified|| SUCCESS: Custom Field Deleted|| Copy List Custom Fields|| ERROR: You cannot copy fields to the same list|| +DISPLAY will display only and not allow for modification by the agent|| AST_VICIDIAL_ingrouplist.php diff --git a/www/vicidial/admin_lists_custom.php b/www/vicidial/admin_lists_custom.php index 3f080801..e75ff901 100644 --- a/www/vicidial/admin_lists_custom.php +++ b/www/vicidial/admin_lists_custom.php @@ -10,10 +10,11 @@ # 100507-1027 - Added name position and options position, added extra space for name and help # 100508-1855 - Added field_order to allow for multiple fields on the same line # 100509-0922 - Added copy fields options +# 100510-1130 - Added DISPLAY field type option # -$admin_version = '2.4-4'; -$build = '100509-0922'; +$admin_version = '2.4-5'; +$build = '100510-1130'; require("dbconnect.php"); @@ -77,6 +78,10 @@ if (strlen($DB) < 1) {$DB=0;} if ($field_size > 100) {$field_size = 100;} +if ( (strlen($field_size) < 1) or ($field_size < 1) ) + {$field_size = 1;} +if ( (strlen($field_max) < 1) or ($field_max < 1) ) + {$field_max = 1;} if ($non_latin < 1) @@ -249,7 +254,7 @@ if ($action == "HELP")
- Field Type - 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. + Field Type - 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.

@@ -909,7 +914,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) {echo "right";} echo ">"; } - echo "$A_field_name[$o]"; + echo "$A_field_name[$o]"; if ($A_name_position[$o]=='TOP') {echo "     help+
";} else @@ -971,6 +976,11 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) { $field_HTML .= ""; } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } if ($A_field_type[$o]=='DATE') { if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} @@ -1098,6 +1108,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo " $NWB#vicidial_lists_fields-field_type$NWE \n"; echo "Field Options $A_field_rank[$o]: $NWB#vicidial_lists_fields-field_options$NWE \n"; @@ -1159,6 +1170,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo " $NWB#vicidial_lists_fields-field_type$NWE \n"; echo "Field Options: $NWB#vicidial_lists_fields-field_options$NWE \n"; @@ -1405,6 +1417,11 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field $field_sql .= "VARCHAR($field_max) "; $field_cost = ($field_max + $field_cost); } + if ($field_type=='DISPLAY') + { + $field_sql .= "VARCHAR($field_max) "; + $field_cost = ($field_max + $field_cost); + } if ($field_type=='AREA') { $field_sql .= "TEXT ";