From 9d1274222846c0472ca8d485bc2b0a276c2ccba2 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 29 Jun 2010 06:47:02 +0000 Subject: [PATCH] Renamed the password fields in the modify phone page for the admin interface Added SCRIPT field type to custom fields git-svn-id: svn://192.168.202.10@1461 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 4 +- agc_2-X/trunk/extras/upgrade_2.4.sql | 4 + .../TO_BE_TRANSLATED_2.4.txt | 5 ++ agc_2-X/trunk/www/vicidial/admin.php | 16 ++-- .../trunk/www/vicidial/admin_lists_custom.php | 74 ++++++++++++------- 5 files changed, 68 insertions(+), 35 deletions(-) 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 f2a3ea92..28bf644d 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -2116,7 +2116,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','DISPLAY') default 'TEXT', +field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT') default 'TEXT', field_options VARCHAR(5000), field_size SMALLINT(5), field_max SMALLINT(5), @@ -2269,7 +2269,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='1229',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1230',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 249e8534..f1509c8a 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -389,3 +389,7 @@ ALTER TABLE system_settings ADD label_email VARCHAR(40) default ''; ALTER TABLE system_settings ADD label_comments VARCHAR(40) default ''; UPDATE system_settings SET db_schema_version='1229',db_schema_update_date=NOW(); + +ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT') default 'TEXT'; + +UPDATE system_settings SET db_schema_version='1230',db_schema_update_date=NOW(); diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 0bd2343d..4fed6a7b 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -237,6 +237,11 @@ Label Security Phrase|| Label Email|| Label Comments|| We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone|| +Formerly called Conf File Secret|| +Registration Password|| +Login Password|| +The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field|| +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|| AST_VICIDIAL_ingrouplist.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 86756abc..09140795 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -5584,7 +5584,12 @@ if ($ADD==99999)

- Password - The password used for the phone user to login to the client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Conf File Secret field further down on this page. + Login Password - The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field. + +
+
+
+ Registration Password - This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test. Formerly called Conf File Secret.
@@ -5735,11 +5740,6 @@ if ($ADD==99999)
Phone Context - This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default. -
-
-
- Conf File Secret - This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test. -

@@ -22426,7 +22426,8 @@ if ($ADD==31111111111) echo "\n"; echo "$NWB#phones-server_ip$NWE\n"; echo "Login: $NWB#phones-login$NWE\n"; - echo "Password: $NWB#phones-pass$NWE\n"; + echo "Login Password: $NWB#phones-pass$NWE\n"; + echo "Registration Password: $NWB#phones-conf_secret$NWE\n"; echo "Set As Webphone: $NWB#phones-is_webphone$NWE\n"; echo "Use External Server IP: $NWB#phones-use_external_server_ip$NWE\n"; echo "Status: $NWB#phones-status$NWE\n"; @@ -22458,7 +22459,6 @@ if ($ADD==31111111111) echo "Exten Context: $NWB#phones-ext_context$NWE\n"; echo "Phone Context: $NWB#phones-phone_context$NWE\n"; - echo "Conf File Secret: $NWB#phones-conf_secret$NWE\n"; echo "Allowed Codecs: $NWB#phones-codecs_list$NWE\n"; echo "Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE\n"; 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 e75ff901..c5b05b64 100644 --- a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php +++ b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php @@ -11,10 +11,11 @@ # 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 +# 100629-0200 - Added SCRIPT field type option # -$admin_version = '2.4-5'; -$build = '100510-1130'; +$admin_version = '2.4-6'; +$build = '100629-0200'; require("dbconnect.php"); @@ -254,7 +255,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. DISPLAY will display only and not allow for modification by the agent. + 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. 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.

@@ -976,11 +977,16 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) { $field_HTML .= ""; } - if ($A_field_type[$o]=='DISPLAY') + 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]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$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;} @@ -1109,6 +1115,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"; @@ -1171,6 +1178,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"; @@ -1417,11 +1425,6 @@ 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 "; @@ -1447,11 +1450,18 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field else {$field_sql .= ";";} - $stmtCUSTOM="$field_sql"; - $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); - $table_update = mysql_affected_rows($linkCUSTOM); - if ($DB) {echo "$table_update|$stmtCUSTOM\n";} - if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') ) + { + if ($DB) {echo "Non-DB $field_type field type\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + } $stmt="INSERT INTO vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',list_id='$list_id',multi_position='$multi_position',name_position='$name_position',field_order='$field_order';"; $rslt=mysql_query($stmt, $link); @@ -1543,11 +1553,18 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi else {$field_sql .= "default '$field_default';";} - $stmtCUSTOM="$field_sql"; - $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); - $field_update = mysql_affected_rows($linkCUSTOM); - if ($DB) {echo "$field_update|$stmtCUSTOM\n";} - if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') ) + { + if ($DB) {echo "Non-DB $field_type field type\n";} + } + else + { + $stmtCUSTOM="$field_sql"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $field_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$field_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + } $stmt="UPDATE vicidial_lists_fields set field_label='$field_label',field_name='$field_name',field_description='$field_description',field_rank='$field_rank',field_help='$field_help',field_type='$field_type',field_options='$field_options',field_size='$field_size',field_max='$field_max',field_default='$field_default',field_required='$field_required',field_cost='$field_cost',multi_position='$multi_position',name_position='$name_position',field_order='$field_order' where list_id='$list_id' and field_id='$field_id';"; $rslt=mysql_query($stmt, $link); @@ -1572,12 +1589,19 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi ################################################################################ ##### BEGIN delete field function function delete_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) - { - $stmtCUSTOM="ALTER TABLE custom_$list_id DROP $field_label;"; - $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); - $table_update = mysql_affected_rows($linkCUSTOM); - if ($DB) {echo "$table_update|$stmtCUSTOM\n";} - if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + { + if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') ) + { + if ($DB) {echo "Non-DB $field_type field type\n";} + } + else + { + $stmtCUSTOM="ALTER TABLE custom_$list_id DROP $field_label;"; + $rsltCUSTOM=mysql_query($stmtCUSTOM, $linkCUSTOM); + $table_update = mysql_affected_rows($linkCUSTOM); + if ($DB) {echo "$table_update|$stmtCUSTOM\n";} + if (!$rsltCUSTOM) {die('Could not execute: ' . mysql_error());} + } $stmt="DELETE FROM vicidial_lists_fields WHERE field_label='$field_label' and field_id='$field_id' and list_id='$list_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link);