Added $HTMLcolors validation for color form entry fields in admin.php for In-Groups, Scripts and Screen Colors

git-svn-id: svn://192.168.202.10@3662 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2022-12-14 20:03:44 +00:00
parent 3b1574c879
commit d95ef3d48d
5 changed files with 209 additions and 29 deletions
+3 -3
View File
@@ -1223,7 +1223,7 @@ php_tz VARCHAR(100) default ''
CREATE TABLE vicidial_inbound_groups (
group_id VARCHAR(20) PRIMARY KEY NOT NULL,
group_name VARCHAR(30),
group_color VARCHAR(7),
group_color VARCHAR(20),
active ENUM('Y','N'),
web_form_address TEXT,
voicemail_ext VARCHAR(10),
@@ -1520,7 +1520,7 @@ script_comments VARCHAR(255),
script_text TEXT,
active ENUM('Y','N'),
user_group VARCHAR(20) default '---ALL---',
script_color VARCHAR(7) default 'white'
script_color VARCHAR(20) default 'white'
) ENGINE=MyISAM;
CREATE TABLE phone_favorites (
@@ -5180,4 +5180,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues',
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1671',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1672',db_schema_update_date=NOW(),reload_timestamp=NOW();
+6
View File
@@ -2069,3 +2069,9 @@ CREATE INDEX vicqa_icbq_date on vicidial_inbound_callback_queue_archive(icbq_dat
CREATE INDEX vicqa_call_date on vicidial_inbound_callback_queue_archive(call_date);
UPDATE system_settings SET db_schema_version='1671',db_schema_update_date=NOW() where db_schema_version < 1671;
ALTER TABLE vicidial_inbound_groups MODIFY group_color VARCHAR(20);
ALTER TABLE vicidial_scripts MODIFY script_color VARCHAR(20) default 'white';
UPDATE system_settings SET db_schema_version='1672',db_schema_update_date=NOW() where db_schema_version < 1672;
+133 -20
View File
File diff suppressed because one or more lines are too long
+64 -3
View File
@@ -94,8 +94,11 @@
# 220827-0941 - Added ConfBridge top menu options
# 220829-1017 - Changed 'admin.php' links to "$ADMIN" variable
# 220830-2303 - Fix for ADMIN change, issue #1370
# 221214-1321 - Added HTML color chooser
#
$HTMLcolors = 'IndianRed,CD5C5C|LightCoral,F08080|Salmon,FA8072|DarkSalmon,E9967A|LightSalmon,FFA07A|Crimson,DC143C|Red,FF0000|FireBrick,B22222|DarkRed,8B0000|Pink,FFC0CB|LightPink,FFB6C1|HotPink,FF69B4|DeepPink,FF1493|MediumVioletRed,C71585|PaleVioletRed,DB7093|LightSalmon,FFA07A|Coral,FF7F50|Tomato,FF6347|OrangeRed,FF4500|DarkOrange,FF8C00|Orange,FFA500|Gold,FFD700|Yellow,FFFF00|LightYellow,FFFFE0|LemonChiffon,FFFACD|LightGoldenrodYellow,FAFAD2|PapayaWhip,FFEFD5|Moccasin,FFE4B5|PeachPuff,FFDAB9|PaleGoldenrod,EEE8AA|Khaki,F0E68C|DarkKhaki,BDB76B|Lavender,E6E6FA|Thistle,D8BFD8|Plum,DDA0DD|Violet,EE82EE|Orchid,DA70D6|Fuchsia,FF00FF|Magenta,FF00FF|MediumOrchid,BA55D3|MediumPurple,9370DB|RebeccaPurple,663399|BlueViolet,8A2BE2|DarkViolet,9400D3|DarkOrchid,9932CC|DarkMagenta,8B008B|Purple,800080|Indigo,4B0082|SlateBlue,6A5ACD|DarkSlateBlue,483D8B|MediumSlateBlue,7B68EE|GreenYellow,ADFF2F|Chartreuse,7FFF00|LawnGreen,7CFC00|Lime,00FF00|LimeGreen,32CD32|PaleGreen,98FB98|LightGreen,90EE90|MediumSpringGreen,00FA9A|SpringGreen,00FF7F|MediumSeaGreen,3CB371|SeaGreen,2E8B57|ForestGreen,228B22|Green,008000|DarkGreen,006400|YellowGreen,9ACD32|OliveDrab,6B8E23|Olive,808000|DarkOliveGreen,556B2F|MediumAquamarine,66CDAA|DarkSeaGreen,8FBC8B|LightSeaGreen,20B2AA|DarkCyan,008B8B|Teal,008080|Aqua,00FFFF|Cyan,00FFFF|LightCyan,E0FFFF|PaleTurquoise,AFEEEE|Aquamarine,7FFFD4|Turquoise,40E0D0|MediumTurquoise,48D1CC|DarkTurquoise,00CED1|CadetBlue,5F9EA0|SteelBlue,4682B4|LightSteelBlue,B0C4DE|PowderBlue,B0E0E6|LightBlue,ADD8E6|SkyBlue,87CEEB|LightSkyBlue,87CEFA|DeepSkyBlue,00BFFF|DodgerBlue,1E90FF|CornflowerBlue,6495ED|MediumSlateBlue,7B68EE|RoyalBlue,4169E1|Blue,0000FF|MediumBlue,0000CD|DarkBlue,00008B|Navy,000080|MidnightBlue,191970|Cornsilk,FFF8DC|BlanchedAlmond,FFEBCD|Bisque,FFE4C4|NavajoWhite,FFDEAD|Wheat,F5DEB3|BurlyWood,DEB887|Tan,D2B48C|RosyBrown,BC8F8F|SandyBrown,F4A460|Goldenrod,DAA520|DarkGoldenrod,B8860B|Peru,CD853F|Chocolate,D2691E|SaddleBrown,8B4513|Sienna,A0522D|Brown,A52A2A|Maroon,800000|White,FFFFFF|Snow,FFFAFA|HoneyDew,F0FFF0|MintCream,F5FFFA|Azure,F0FFFF|AliceBlue,F0F8FF|GhostWhite,F8F8FF|WhiteSmoke,F5F5F5|SeaShell,FFF5EE|Beige,F5F5DC|OldLace,FDF5E6|FloralWhite,FFFAF0|Ivory,FFFFF0|AntiqueWhite,FAEBD7|Linen,FAF0E6|LavenderBlush,FFF0F5|MistyRose,FFE4E1|Gainsboro,DCDCDC|LightGray,D3D3D3|Silver,C0C0C0|DarkGray,A9A9A9|Gray,808080|DimGray,696969|LightSlateGray,778899|SlateGray,708090|DarkSlateGray,2F4F4F|Black,000000';
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists,allow_ip_lists,admin_web_directory from system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
@@ -832,9 +835,12 @@ else
}
document.addEventListener("click", getMousePos);
var chooser_field='';
var chooser_field_td='';
var chooser_type='';
function launch_chooser(fieldname,stage)
{
var h = window.innerHeight;
var vposition=mouseY;
@@ -851,7 +857,6 @@ else
function launch_moh_chooser(fieldname,stage)
{
var h = window.innerHeight;
var vposition=mouseY;
@@ -868,7 +873,6 @@ else
function launch_vm_chooser(fieldname,stage)
{
var h = window.innerHeight;
var vposition=mouseY;
@@ -883,6 +887,63 @@ else
document.getElementById("audio_chooser_span").innerHTML = Iframe_content;
}
function launch_color_chooser(fieldname,stage,type)
{
var h = window.innerHeight;
var vposition=mouseY;
chooser_field = fieldname;
chooser_field_td = fieldname + '_td';
chooser_type = type;
<?php
$color_chooser_output .= " &nbsp; <a href=\\\"javascript:close_chooser();\\\"><font size=1 face='Arial,Helvetica'>"._QXZ("close frame")."</font></a> &nbsp; <BR>";
$color_chooser_output .= "<div id='select_color_frame' style=\\\"height:400px;width:400px;overflow:scroll;background-color:white;\\\">";
$color_chooser_output .= '<table border=0 cellpadding=2 cellspacing=2 width=400 bgcolor=white>';
$HTMLcolorsARY = explode('|',$HTMLcolors);
$HTMLcolorsARYcount = count($HTMLcolorsARY);
$HTMLct=0;
while ($HTMLcolorsARYcount > $HTMLct)
{
$HTMLcolorsLINE = explode(',',$HTMLcolorsARY[$HTMLct]);
if (preg_match("/1$|3$|5$|7$|9$/i", $HTMLct))
{$bgcolor='#E6E6E6';}
else
{$bgcolor='#F6F6F6';}
$color_chooser_output .= "<tr bgcolor=\\\"$bgcolor\\\"><td>$HTMLcolorsLINE[0] </td><td><a href=\\\"javascript:choose_color('$HTMLcolorsLINE[1]');\\\"><font size=1 face='Arial,Helvetica'>#$HTMLcolorsLINE[1]</a> </td><td bgcolor='#$HTMLcolorsLINE[1]'> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </td></tr>";
$HTMLct++;
}
$color_chooser_output .= '</table></div>';
?>
var span_content = '<span id="color_chooser_frame' + epoch + '" name="color_chooser_frame" style="width:740;height:440;background-color:white;overflow:scroll;z-index:2;">' + "<?php echo $color_chooser_output ?></span>";
document.getElementById("audio_chooser_span").style.position = "absolute";
document.getElementById("audio_chooser_span").style.left = "220px";
document.getElementById("audio_chooser_span").style.top = vposition + "px";
document.getElementById("audio_chooser_span").style.visibility = 'visible';
document.getElementById("audio_chooser_span").style.backgroundcolor = 'white';
document.getElementById("audio_chooser_span").innerHTML = span_content;
}
function choose_color(colorname)
{
if (colorname.length > 0)
{
if (chooser_type == '2')
{
document.getElementById(chooser_field).value = colorname;
document.getElementById(chooser_field_td).style.backgroundColor = '#' + colorname;
}
else
{
document.getElementById(chooser_field).value = '#' + colorname;
document.getElementById(chooser_field_td).style.backgroundColor = '#' + colorname;
}
close_chooser();
}
}
function close_chooser()
{
document.getElementById("audio_chooser_span").style.visibility = 'hidden';
+3 -3
View File
@@ -1,4 +1,4 @@
# version: 20221021101501
# version: 20221214142601
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -491,7 +491,7 @@ lists_fields-name_position Field Name Position <QXZ>If set to LEFT, this field n
lists_fields-copy_option Copy Option <QXZ>When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option.</QXZ>
inbound_groups-group_id Group ID <QXZ>This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length.</QXZ>
inbound_groups-group_name Group Name <QXZ>This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, pluses or spaces .</QXZ>
inbound_groups-group_color Group Color <QXZ>This is the color that displays in the agent client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or the agent screen will not work properly.</QXZ>
inbound_groups-group_color Group Color <QXZ>This is the color that displays in the agent client app when a call comes in on this group. It must be between 2 and 20 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or the agent screen will not work properly. If using an HTML-safe color name, be sure to make sure you spell it correctly. You can also use the -color chooser- to select a color.</QXZ>
inbound_groups-active Active <QXZ>This determines whether this inbound group is available to take calls. If this is set to inactive then the After Hours Action will be used on any calls coming into it.</QXZ>
inbound_groups-user_group Admin User Group <QXZ>This is the administrative user group for this inbound group, this allows admin viewing of this in-group restricted by user group. Default is --ALL-- which allows any admin user to view this in-group.</QXZ>
inbound_groups-callback_queue_calls Callback Queue Calls <QXZ>This will only show up if there are LIVE inbound callback queue calls waiting to be called back by agents when their turn arrives.</QXZ>
@@ -799,7 +799,7 @@ scripts-script_comments Script Comments <QXZ>This is where you can place comment
scripts-user_group Admin User Group <QXZ>This is the administrative user group for this record, this allows admin viewing of this record restricted by user group. Default is --ALL-- which allows any admin user to view this record.</QXZ>
scripts-script_text Script Text <QXZ>This is where you place the content of an agent screen Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using --A--field--B-- where field is one of the following fieldnames: 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, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id, user_group, called_count, TABLEper_call_notes, MANUALDIALLINK, EMAILinbound_message. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:</QXZ><DIV style='height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;' id=iframe_example>&#60;iframe src='http://www.sample.net/test_output.php?lead_id=--A--lead_id--B--&#38;vendor_id=--A--vendor_lead_code--B--&#38;list_id=--A--list_id--B--&#38;gmt_offset_now=--A--gmt_offset_now--B--&#38;phone_code=--A--phone_code--B--&#38;phone_number=--A--phone_number--B--&#38;title=--A--title--B--&#38;first_name=--A--first_name--B--&#38;middle_initial=--A--middle_initial--B--&#38;last_name=--A--last_name--B--&#38;address1=--A--address1--B--&#38;address2=--A--address2--B--&#38;address3=--A--address3--B--&#38;city=--A--city--B--&#38;state=--A--state--B--&#38;province=--A--province--B--&#38;postal_code=--A--postal_code--B--&#38;country_code=--A--country_code--B--&#38;gender=--A--gender--B--&#38;date_of_birth=--A--date_of_birth--B--&#38;alt_phone=--A--alt_phone--B--&#38;email=--A--email--B--&#38;security_phrase=--A--security_phrase--B--&#38;comments=--A--comments--B--&#38;user=--A--user--B--&#38;campaign=--A--campaign--B--&#38;phone_login=--A--phone_login--B--&#38;fronter=--A--fronter--B--&#38;closer=--A--user--B--&#38;group=--A--group--B--&#38;channel_group=--A--group--B--&#38;SQLdate=--A--SQLdate--B--&#38;epoch=--A--epoch--B--&#38;uniqueid=--A--uniqueid--B--&#38;customer_zap_channel=--A--customer_zap_channel--B--&#38;server_ip=--A--server_ip--B--&#38;SIPexten=--A--SIPexten--B--&#38;session_id=--A--session_id--B--&#38;dialed_number=--A--dialed_number--B--&#38;dialed_label=--A--dialed_label--B--&#38;rank=--A--rank--B--&#38;owner=--A--owner--B--&#38;phone=--A--phone--B--&#38;camp_script=--A--camp_script--B--&#38;in_script=--A--in_script--B--&#38;script_width=--A--script_width--B--&#38;script_height=--A--script_height--B--&#38;recording_filename=--A--recording_filename--B--&#38;recording_id=--A--recording_id--B--&#38;user_custom_one=--A--user_custom_one--B--&#38;user_custom_two=--A--user_custom_two--B--&#38;user_custom_three=--A--user_custom_three--B--&#38;user_custom_four=--A--user_custom_four--B--&#38;user_custom_five=--A--user_custom_five--B--&#38;preset_number_a=--A--preset_number_a--B--&#38;preset_number_b=--A--preset_number_b--B--&#38;preset_number_c=--A--preset_number_c--B--&#38;preset_number_d=--A--preset_number_d--B--&#38;preset_number_e=--A--preset_number_e--B--&#38;preset_number_f=--A--preset_number_f--B--&#38;preset_dtmf_a=--A--preset_dtmf_a--B--&#38;preset_dtmf_b=--A--preset_dtmf_b--B--&#38;did_id=--A--did_id--B--&#38;did_extension=--A--did_extension--B--&#38;did_pattern=--A--did_pattern--B--&#38;did_description=--A--did_description--B--&#38;closecallid=--A--closecallid--B--&#38;xfercallid=--A--xfercallid--B--&#38;agent_log_id=--A--agent_log_id--B--&#38;entry_list_id=--A--entry_list_id--B--&#38;call_id=--A--call_id--B--&&#38;user_group=--A--user_group--B--&&#38;' style='width:580;height:290;background-color:transparent;' scrolling='auto' frameborder='0' allowtransparency='true' id='popupFrame' name='popupFrame' width='460' height='290' STYLE='z-index:17'&#62;&#60;/iframe&#62;</DIV><BR><QXZ>You can also use a special variable IGNORENOSCROLL to force scroll bars on the script tab even if you are using an iframe within it.</QXZ>
scripts-active Active <QXZ>This determines whether this script can be selected to be used by a campaign.</QXZ>
scripts-script_color Script Color <QXZ>This determines the background color of the script as displayed in the agent screen. default is white.</QXZ>
scripts-script_color Script Color <QXZ>This determines the background color of the script as displayed in the agent screen. default is white. If using an HTML-safe color name, be sure to make sure you spell it correctly. You can also use the -color chooser- to select a color.</QXZ>
lead_filters-lead_filter_id Filter ID <QXZ>This is the short name of a Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters.</QXZ>
lead_filters-lead_filter_name Filter Name <QXZ>This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters.</QXZ>
lead_filters-lead_filter_comments Filter Comments <QXZ>This is where you can place comments for a Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters.</QXZ>