From 1a1d5ca558af5cf0c072a8a2bd74e4d521f6ccc2 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 9 Feb 2011 02:40:38 +0000 Subject: [PATCH] Added vdc_script_dispo_example.php script which can be customized to require specific fields be filled in before submitting Some docs updates Some vicidial.php agent screen formatting changes git-svn-id: svn://192.168.202.10@1598 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 12 +- bin/AST_call_log_export.pl | 21 +- docs/BASE_INSTALL.txt | 3 + docs/LOAD_BALANCING.txt | 2 + docs/SCRATCH_INSTALL.txt | 3 + www/agc/vdc_script_dispo_example.php | 795 +++++++++++++++++++++++++++ www/agc/vicidial.php | 44 +- 7 files changed, 863 insertions(+), 17 deletions(-) create mode 100644 www/agc/vdc_script_dispo_example.php diff --git a/UPGRADE b/UPGRADE index fefe0e57..52d36669 100644 --- a/UPGRADE +++ b/UPGRADE @@ -409,7 +409,10 @@ OTHER CHANGES: 92. Added List override options for webform fields 93. Added script to purge all vicidial_callbacks records that are inactive or - are tied to deleted leads, AST_DB_dead_cb_purge.pl + are tied to deleted leads, AST_DB_dead_cb_purge.pl + add to the crontab like this: + # cleanup of the scheduled callback records + 25 0 * * * /usr/share/astguiclient/AST_DB_dead_cb_purge.pl --purge-non-cb -q 94. Added did_log_export and recording_lookup functions to the non-agent API @@ -438,6 +441,13 @@ OTHER CHANGES: 103. Changed vicidial.php HTML formatting to be XHTML compliant +104. Added vdc_script_dispo_example.php script which can be customized to + require specific fields be filled in before submitting, as well as + limiting this restriction to only specific dispositions. You can also + specify dispositions to be selectable that are set to non-selectable. + You use this script in an IFRAME for the campaign. It must be + customized for your specific business rules. + diff --git a/bin/AST_call_log_export.pl b/bin/AST_call_log_export.pl index 83b50449..92717813 100644 --- a/bin/AST_call_log_export.pl +++ b/bin/AST_call_log_export.pl @@ -13,6 +13,7 @@ # # CHANGES # 100310-0112 - First version +# 110202-2214 - Added ncad14csv format # $txt = '.txt'; @@ -103,9 +104,10 @@ if (length($ARGV[0])>1) print " call_date phone_number vendor_id status user first_name last_name lead_id list_id campaign_id length_in_sec source_id\n"; print " pipe-basic:\n"; print " call_date|phone_number|vendor_id|status|user|first_name|last_name|lead_id|list_id|campaign_id|length_in_sec|source_id|\n"; + print " ncad14csv:\n"; + print " vendor_lead_code,\"source_id\",\"last_name, first_name\",\"phone_number\",\"address2\",\"alt_phone\",\"postal_code\",\"address1\",\"address3\",\"\security_phrase\",\"status\",\"call_date\",\"email\",\"city\"\n"; print "\n"; - exit; } else @@ -315,6 +317,8 @@ if ($output_format =~ /^tab-basic$/) {$DLT = "\t"; $txt='.txt'; if (!$Q) {print "---- tab-basic ----\n";}} if ($output_format =~ /^pipe-basic$/) {$DLT = "|"; $txt='.txt'; if (!$Q) {print "---- pipe-basic ----\n";}} +if ($output_format =~ /^ncad14csv$/) + {$DLT = ","; $txt='.csv'; if (!$Q) {print "---- ncad14csv ----\n";}} if (length($campaignSQL) < 2) { @@ -563,6 +567,7 @@ if ($ftp_transfer > 0) if (!$Q) {print "Sending File Over FTP: $outfile\n";} $ftp = Net::FTP->new("$VARREPORT_host", Port => $VARREPORT_port, Debug => $DB); $ftp->login("$VARREPORT_user","$VARREPORT_pass"); +# $ftp->cwd("CALL_LOG"); $ftp->cwd("CALL_LOG"); $ftp->put("$PATHweb/vicidial/server_reports/$outfile", "$outfile"); $ftp->quit; @@ -597,6 +602,20 @@ sub select_format_loop $str = "$call_date\t$phone_number\t$vendor_id\t$status\t$user\t$first_name\t$last_name\t$lead_id\t$list_id\t$campaign_id\t$length_in_sec\t$source_id\t\n"; } + if ($output_format =~ /^ncad14csv$/) + { + if ($status =~ /^PU$/) {$status='HU';} + if ($status =~ /^PM$/) {$status='BM';} + if ($status =~ /^AL$/) {$status='BM';} + if ($status =~ /^A$/) {$status='AH';} + if ($status =~ /^AA$/) {$status='AH';} + if ($status =~ /^B$/) {$status='BS';} + if ($status =~ /^AB$/) {$status='BS';} + if ($status =~ /^DC$/) {$status='IP';} + + $str = "$vendor_lead_code,\"$source_id\",\"$last_name, $first_name\",\"$phone_number\",\"$address2\",\"$alt_phone\",\"$postal_code\",\"$address1\",\"$address3\",\"$security_phrase\",\"$status\",\"$call_date\",\"$email\",\"$city\"\n"; + } + $Ealert .= "$str"; diff --git a/docs/BASE_INSTALL.txt b/docs/BASE_INSTALL.txt index 5f9bd95f..67e148bd 100644 --- a/docs/BASE_INSTALL.txt +++ b/docs/BASE_INSTALL.txt @@ -450,6 +450,9 @@ PHASE 6: ADDING CRONTAB ENTRIES FOR ASTGUICLIENT/VICIDIAL SCRIPTS ## uncomment below if using QueueMetrics #*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check +# cleanup of the scheduled callback records +25 0 * * * /usr/share/astguiclient/AST_DB_dead_cb_purge.pl --purge-non-cb -q + ## uncomment below if using Vtiger #1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet diff --git a/docs/LOAD_BALANCING.txt b/docs/LOAD_BALANCING.txt index d4d6f03b..7da2de2e 100644 --- a/docs/LOAD_BALANCING.txt +++ b/docs/LOAD_BALANCING.txt @@ -52,6 +52,8 @@ AS OF RELEASE 2.2.0 YOU SHOULD NOT HAVE TO TAKE ANY STEPS BEYOND STEP 2 IN THIS - AST_VDadapt.pl (defined in /etc/astguiclient.conf) - AST_VDauto_dial_FILL.pl (defined in /etc/astguiclient.conf) - ADMIN_archive_log_tables.pl (crontab) + - AST_DB_dead_cb_purge.pl (crontab) + 2. The VARactive_keepalives variable in /etc/astguiclient.conf should have "5" and "7" on only ONE SERVER in your entire dialer setup, the other servers should not have 5 or 7 in that field. # 1 - AST_update diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 8811e65b..1e81dc54 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -2429,6 +2429,9 @@ SUBPHASE 6.5: setting up astguiclient scripts for continuous running ## uncomment below if using QueueMetrics #*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check +# cleanup of the scheduled callback records +25 0 * * * /usr/share/astguiclient/AST_DB_dead_cb_purge.pl --purge-non-cb -q + ## uncomment below if using Vtiger #1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet diff --git a/www/agc/vdc_script_dispo_example.php b/www/agc/vdc_script_dispo_example.php new file mode 100644 index 00000000..5cf0e2c3 --- /dev/null +++ b/www/agc/vdc_script_dispo_example.php @@ -0,0 +1,795 @@ + LICENSE: AGPLv2 +# +# This script is designed to be used in the SCRIPT tab in an IFRAME and will not submit unless a specific field is filled in +# +# ***** THIS SCRIPT REQUIRES CUSTOMIZATION BEFORE USING !!!!!!!!!!!! ***** +# The default of this script assumes 2 custom fields('question' and 'answer') +# +# Example of a ViciDial agent SCRIPT using this script(you must customize this for your custom fields!): +# +# +# CHANGELOG: +# 110208-1239 - First build of script based upon vdc_script_notes.php +# + +$version = '2.4-1'; +$build = '110208-1239'; + +require("dbconnect.php"); + + +# Configuration settings- +# Define the required fields: (these must be text fields, pipe separated) +$required_fields = 'phone_number|question|answer'; + +# Define statuses that trigger required fields: (must be surrounded by pipes) +#$required_statuses = '---ALL---'; # use this for all statuses required +$required_statuses = '|CALLBK|'; + +# Define any extra non-selectable: (single-quote-qualified, comma delimited) +$extra_statuses = "'CALLBK'"; + + + +if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} +if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} + elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + $vendor_lead_code = $vendor_id; +if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} +if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} + elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} +if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} +if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} +if (isset($_POST["title"])) {$title=$_POST["title"];} + elseif (isset($_GET["title"])) {$title=$_GET["title"];} +if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} +if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} + elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} +if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} +if (isset($_POST["address1"])) {$address1=$_POST["address1"];} + elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];} +if (isset($_POST["address2"])) {$address2=$_POST["address2"];} + elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];} +if (isset($_POST["address3"])) {$address3=$_POST["address3"];} + elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];} +if (isset($_POST["city"])) {$city=$_POST["city"];} + elseif (isset($_GET["city"])) {$city=$_GET["city"];} +if (isset($_POST["state"])) {$state=$_POST["state"];} + elseif (isset($_GET["state"])) {$state=$_GET["state"];} +if (isset($_POST["province"])) {$province=$_POST["province"];} + elseif (isset($_GET["province"])) {$province=$_GET["province"];} +if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} + elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} +if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} + elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} +if (isset($_POST["gender"])) {$gender=$_POST["gender"];} + elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];} +if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} +if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} + elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} +if (isset($_POST["email"])) {$email=$_POST["email"];} + elseif (isset($_GET["email"])) {$email=$_GET["email"];} +if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} + elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} +if (isset($_POST["comments"])) {$comments=$_POST["comments"];} + elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];} +if (isset($_POST["user"])) {$user=$_POST["user"];} + elseif (isset($_GET["user"])) {$user=$_GET["user"];} +if (isset($_POST["pass"])) {$pass=$_POST["pass"];} + elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];} +if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} +if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} +if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} + elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} +if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} +if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} + elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} +if (isset($_POST["closer"])) {$closer=$_POST["closer"];} + elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];} +if (isset($_POST["group"])) {$group=$_POST["group"];} + elseif (isset($_GET["group"])) {$group=$_GET["group"];} +if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} + elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} +if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} + elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} +if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} + elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} +if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} +if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} + elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} +if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} + elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} +if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} +if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} + elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} +if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} +if (isset($_POST["phone"])) {$phone=$_POST["phone"];} + elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];} +if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} + elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} +if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} +if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} + elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} +if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} + elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} +if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} + elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} +if (isset($_POST["rank"])) {$rank=$_POST["rank"];} + elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];} +if (isset($_POST["owner"])) {$owner=$_POST["owner"];} + elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];} +if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} + elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} +if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} + elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} +if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} + elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} +if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} + elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} +if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} + elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} +if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} + elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} +if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} + elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} +if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} + elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} +if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} + elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} +if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} + elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} +if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} + elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} +if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} + elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} +if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} + elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} +if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} + elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} +if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} + elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} +if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} + elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} +if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} + elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} +if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} + elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} +if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} + elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} +if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} + elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} +if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} + elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} +if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} + elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} +if (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} + elseif (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} +if (isset($_POST["status"])) {$status=$_POST["status"];} + elseif (isset($_GET["status"])) {$status=$_GET["status"];} +if (isset($_POST["pause"])) {$pause=$_POST["pause"];} + elseif (isset($_GET["pause"])) {$pause=$_GET["pause"];} + +if (isset($_POST["DB"])) {$DB=$_POST["DB"];} + elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];} +if (isset($_POST["process"])) {$process=$_POST["process"];} + elseif (isset($_GET["process"])) {$process=$_GET["process"];} +if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];} + elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];} + +##### BEGIN Put custom fields parsing and input here ##### +if (isset($_POST["question"])) {$question=$_POST["question"];} + elseif (isset($_GET["question"])) {$question=$_GET["question"];} +if (isset($_POST["answer"])) {$answer=$_POST["answer"];} + elseif (isset($_GET["answer"])) {$answer=$_GET["answer"];} + +if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];} + elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];} +if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];} + elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} + elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} +if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];} + elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];} +if ($notesid < 100) + {$notesid=0;} +if (strlen($vicidial_id) < 1) + {$vicidial_id = $uniqueid;} +if (strlen($appointment_time) < 1) + {$appointment_time = '12:00:00';} + +$appointment_timeARRAY = explode(":",$appointment_time); +$appointment_hour = $appointment_timeARRAY[0]; +$appointment_min = $appointment_timeARRAY[1]; +##### END Put custom fields here ##### + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$txt = '.txt'; +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$CIDdate = date("mdHis"); +$ENTRYdate = date("YmdHis"); +$MT[0]=''; +$agents='@agents'; + +if (strlen($call_date) < 1) + {$call_date = $NOW_TIME;} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $agentonly_callback_campaign_lock = $row[2]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $user=ereg_replace("[^-_0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); + $phone_code = ereg_replace("[^0-9]","",$phone_code); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + } + +if ($DB > 0) + { + echo "
$lead_id|$entry_date|$modify_date|$status|$user|$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|$called_count|$last_local_call_time|$rank|$owner|\n
"; + } + +### BEGIN find any custom field labels ### +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'City'; +$label_state = 'State'; +$label_province = 'Province'; +$label_postal_code = 'PostCode'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Gender'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Comments'; + +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} +### END find any custom field labels ### + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Invalid Username/Password: |$user|$pass|\n"; + exit; + } +else + { + # do nothing for now + } + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "ViciDial Script"; +echo "\n"; +?> + +\n"; +echo "\n"; + +if ($process > 0) + { + #Update vicidial_list record + $stmt="UPDATE vicidial_list SET vendor_lead_code='$vendor_lead_code',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',phone_code='$phone_code',phone_number='$phone_number',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',rank='$rank',owner='$owner' where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + + #Insert/Update custom record + $stmt="INSERT IGNORE INTO custom_$entry_list_id SET question='$question',answer='$answer',lead_id='$lead_id' ON DUPLICATE KEY UPDATE question='$question',answer='$answer';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $CFaffected_rows = mysql_affected_rows($link); + + $pauseSQL = ''; + $epoch = date("U"); + if ($pause == '1') {$pauseSQL = ",external_pause='PAUSE!$epoch'";} + #Update the agent screen with new data + $stmt="UPDATE vicidial_live_agents set external_update_fields='1',external_update_fields_data='vendor_lead_code,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,phone_code,phone_number,gender,date_of_birth,alt_phone,email,security_phrase,comments,rank,owner,question,answer,formreload,' $pauseSQL where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + + if ($notesid < 100) + { + # Insert into vicidial_call_notes + $stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$call_date',call_notes='$call_notes';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $notesid = mysql_insert_id($link); + } + else + { + # update vicidial_call_notes record + $stmt="UPDATE vicidial_call_notes set order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes' where notesid='$notesid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + } + + echo "
Data Updated, Hanging up call, please wait

\n"; + + sleep(3); + + #Update the agent screen with status and hangup + $stmt="UPDATE vicidial_live_agents set external_status='$status',external_hangup='1' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + } + +$URLarray = explode("?", $PHP_SELF); +$URLsubmit = $URLarray[0]; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\n"; + + +?> + + + + + + + + + +
+
+> + + + + + + + + + + + + +
Vendor ID:
Title:
: *
Middle Initial:
: *
: *
:
:
: *
: + *
Province:
: *
: *
Alt. Phone: *
Email: *
Show: *
Comments:

+
Question:
Answer:
Disposition:
+ + + + + +         PAUSE AGENT DIALING +
Please click SUBMIT to hangup and disposition the call,           * denotes required fields
+
+ + + + + + + + + + + + + diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 609a2763..c990fb5a 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -331,10 +331,11 @@ # 110109-1205 - Added queuemetrics_loginout NONE option # 110112-1254 - Added options.php option for focus/blur/enter functions # 110129-1050 - Changed to XHTML compliant formatting, issue #444 +# 110208-1202 - Made scheduled callbacks notice move when on script/form tabs # -$version = '2.4-308'; -$build = '110129-1050'; +$version = '2.4-309'; +$build = '110208-1202'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=69; $one_mysql_log=0; @@ -2589,8 +2590,9 @@ $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $CQwidth = ($MASTERwidth + 300); # 730 - calls in queue listings -$AMwidth = ($MASTERwidth + 270); # 700 - preset-dial links +$AMwidth = ($MASTERwidth + 270); # 700 - refresh links $SCwidth = ($MASTERwidth + 230); # 670 - live call seconds counter, sidebar link +$PDwidth = ($MASTERwidth + 210); # 650 - preset-dial links $MUwidth = ($MASTERwidth + 180); # 610 - agent mute $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session @@ -3205,6 +3207,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AllowManualQueueCallsChoice=''; var call_variables=''; var focus_blur_enabled=''; + var CBlinkCONTENT=''; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -5091,8 +5094,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) CBpost = ''; } } - - document.getElementById("CBstatusSpan").innerHTML ="" + CBpre + '' + CBprint + '' + " ACTIVE CALLBACKS" + CBpost + ""; + CBlinkCONTENT ="" + CBpre + '' + CBprint + '' + " ACTIVE CALLBACKS" + CBpost + ""; + document.getElementById("CBstatusSpan").innerHTML = CBlinkCONTENT; } } delete xmlhttp; @@ -5736,7 +5739,9 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var regUDowner = new RegExp("owner,","ig"); if (fields_list.match(regUDowner)) {document.vicidial_form.owner.value = UDfieldsResponse_array[25];} - + var regUDformreload = new RegExp("formreload,","ig"); + if (fields_list.match(regUDformreload)) + {FormContentsLoad();} var regWFAcustom = new RegExp("^VAR","ig"); if (VDIC_web_form_address.match(regWFAcustom)) @@ -8193,7 +8198,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); - document.getElementById("DispoSelectBox").style.top = 1; // Firefox error on this line for some reason + document.getElementById("DispoSelectBox").style.top = '1px'; // Firefox error on this line for some reason document.getElementById("DispoSelectMaxMin").innerHTML = " minimize "; document.getElementById("DispoSelectHAspan").innerHTML = "Hangup Again"; @@ -11325,6 +11330,9 @@ else { document.getElementById("MainTable").style.backgroundColor=""; document.getElementById("MaiNfooter").style.backgroundColor=""; + var CBMPheight = 'px'; + document.getElementById("CallbacksButtons").style.top = CBMPheight; + document.getElementById("CallbacksButtons").style.left = '300px'; hideDiv('ScriptPanel'); hideDiv('ScriptRefresH'); hideDiv('FormPanel'); @@ -11373,6 +11381,9 @@ else function ScriptPanelToFront() { + var CBSPheight = 'px'; + document.getElementById("CallbacksButtons").style.top = CBSPheight; + document.getElementById("CallbacksButtons").style.left = '360px'; showDiv('ScriptPanel'); showDiv('ScriptRefresH'); hideDiv('FormPanel'); @@ -11387,6 +11398,9 @@ else function FormPanelToFront() { + var CBFPheight = 'px'; + document.getElementById("CallbacksButtons").style.top = CBFPheight; + document.getElementById("CallbacksButtons").style.left = '360px'; showDiv('FormPanel'); showDiv('FormRefresH'); document.getElementById("MainTable").style.backgroundColor=""; @@ -11750,10 +11764,6 @@ $zi=2; MANUAL DIAL       FAST DIAL
- -X ACTIVE CALLBACKS
-
-
@@ -11762,7 +11772,7 @@ $zi=2; VIEW CALL LOG
- +    
VERSION:   BUILD:     Server:              
@@ -11799,12 +11809,12 @@ $zi=2; Your Status:
Calls Dialing:
- + D1 - DIAL\n"; - echo "
\n"; + echo "   \n"; echo "D2 - DIAL\n"; } else {echo "
\n";} @@ -11826,6 +11836,10 @@ if ($view_calls_in_queue > 0) ?>
+ +X ACTIVE CALLBACKS
+
+
  Other Agents Status:  
 
@@ -12134,7 +12148,7 @@ Available Agents Transfer:
End-of-call Disposition Selection
- PAUSE AGENT DIALING
+ PAUSE AGENT DIALING
CLEAR FORM | SUBMIT