From 867db867fd058f1c747eb22ca6c8e5f277fbc275 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 14 Mar 2007 16:38:37 +0000 Subject: [PATCH] Added script variable quick-entry function to admin.php git-svn-id: svn://192.168.202.10@554 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/admin.php | 124 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 6 deletions(-) diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 84ff19f9..65afce5b 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -967,12 +967,13 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70219-1102 - Changed campaign dial statuses to be one string allowing for high limit # 70223-0957 - Added queuemetrics_eq_prepend for custom ENTERQUEUE prepending of a field # 70302-1111 - Fixed small bug in dialable leads calculation +# 70314-1133 - Added insert selection on script forms # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.90'; -$build = '70302-1111'; +$admin_version = '2.0.91'; +$build = '70314-1133'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3099,6 +3100,31 @@ if ($hh=='reports') function openNewWindow(url) { window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); } +function scriptInsertField() { + openField = '--A--'; + closeField = '--B--'; + var textBox = document.scriptForm.script_text; + var scriptIndex = document.getElementById("selectedField").selectedIndex; + var insValue = document.getElementById('selectedField').options[scriptIndex].value; + if (document.selection) { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } else if (textBox.selectionStart || textBox.selectionStart == 0) { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } else { + textBox.value += openField + insValue + closeField; + } +} + @@ -3525,14 +3551,57 @@ if ($ADD==1111111) echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; - echo "
ADD NEW SCRIPT
\n"; + echo "
ADD NEW SCRIPT\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: $NWB#vicidial_scripts-script_text$NWE
Script Text: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; } @@ -8535,14 +8604,57 @@ if ($ADD==3111111) $active = $row[4]; echo ""; - echo "
MODIFY A SCRIPT\n"; + echo "
MODIFY A SCRIPT\n"; echo "\n"; echo "\n"; echo "
Script ID: $script_id$NWB#vicidial_scripts-script_name$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text:

Preview Script
$NWB#vicidial_scripts-script_text$NWE
Script Text:

Preview Script
"; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n";