From baae108a477e029e247f63cc2bc6ff6bdc4954cb Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 21 Feb 2011 17:56:35 +0000 Subject: [PATCH] Changed internal agent interface accounting for selectable statuses git-svn-id: svn://192.168.202.10@1605 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../www/agc/vdc_script_dispo_example.php | 24 ++++++-- agc_2-X/trunk/www/agc/vicidial.php | 57 ++++++++++++------- 2 files changed, 58 insertions(+), 23 deletions(-) diff --git a/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php b/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php index 5cf0e2c3..e1b63394 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php +++ b/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php @@ -9,14 +9,15 @@ # 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 +# 110221-1252 - Added missing variables, accounted for call notes on manual dial calls # -$version = '2.4-1'; -$build = '110208-1239'; +$version = '2.4-2'; +$build = '110221-1252'; require("dbconnect.php"); @@ -185,13 +186,14 @@ 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"];} +if (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} + elseif (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} ##### BEGIN Put custom fields parsing and input here ##### if (isset($_POST["question"])) {$question=$_POST["question"];} @@ -213,6 +215,7 @@ if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];} elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];} if ($notesid < 100) {$notesid=0;} +$vicidial_id = $closecallid; if (strlen($vicidial_id) < 1) {$vicidial_id = $uniqueid;} if (strlen($appointment_time) < 1) @@ -384,6 +387,19 @@ if ($process > 0) if ($notesid < 100) { + if (strlen($vicidial_id) < 1) + { + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $stmt = "SELECT uniqueid FROM vicidial_log where call_date > \"$four_hours_ago\" and user='$user' and lead_id='$lead_id' order by call_date desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vid_ct = mysql_num_rows($rslt); + if ($vid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $vicidial_id = $row[0]; + } + } # 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";} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 0381d794..a91a816b 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -335,10 +335,11 @@ # 110212-2206 - Added scheduled callback custom statuses compatibility # 110215-1412 - Added my_callback_option and per_call_notes options # 110218-1522 - Added agent_lead_search feature +# 110221-1251 - Changed statuses display to keep track of non-selectable statuses # -$version = '2.4-312'; -$build = '110218-1522'; +$version = '2.4-313'; +$build = '110221-1251'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=69; $one_mysql_log=0; @@ -1224,14 +1225,14 @@ else $CAMPactive=$row[0]; if($CAMPactive>0) { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} $VARstatuses=''; $VARstatusnames=''; + $VARSELstatuses=''; + $VARSELstatuses_ct=0; $VARCBstatuses=''; $VARCBstatusesLIST=''; ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name,scheduled_callback FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 300;"; + $stmt="SELECT status,status_name,scheduled_callback,selectable FROM vicidial_statuses WHERE status != 'NEW' order by status limit 500;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1243,16 +1244,21 @@ else $statuses[$i] =$row[0]; $status_names[$i] =$row[1]; $CBstatuses[$i] =$row[2]; + $SELstatuses[$i] =$row[3]; + if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} $VARstatuses = "$VARstatuses'$statuses[$i]',"; $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; + $VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',"; $VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',"; if ($CBstatuses[$i] == 'Y') {$VARCBstatusesLIST .= " $statuses[$i]";} + if ($SELstatuses[$i] == 'Y') + {$VARSELstatuses_ct++;} $i++; } ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name,scheduled_callback FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 300;"; + $stmt="SELECT status,status_name,scheduled_callback,selectable FROM vicidial_campaign_statuses WHERE status != 'NEW' and campaign_id='$VD_campaign' order by status limit 500;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1264,17 +1270,23 @@ else $statuses[$i] =$row[0]; $status_names[$i] =$row[1]; $CBstatuses[$i] =$row[2]; + $SELstatuses[$i] =$row[3]; + if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} $VARstatuses = "$VARstatuses'$statuses[$i]',"; $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; + $VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',"; $VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',"; if ($CBstatuses[$i] == 'Y') {$VARCBstatusesLIST .= " $statuses[$i]";} + if ($SELstatuses[$i] == 'Y') + {$VARSELstatuses_ct++;} $i++; $j++; } $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); $VARstatuses = substr("$VARstatuses", 0, -1); $VARstatusnames = substr("$VARstatusnames", 0, -1); + $VARSELstatuses = substr("$VARSELstatuses", 0, -1); $VARCBstatuses = substr("$VARCBstatuses", 0, -1); $VARCBstatusesLIST .= " "; @@ -2830,9 +2842,11 @@ $CCAL_OUT .= ""; var VD_preset_names_ct = ''; VARstatuses = new Array(); VARstatusnames = new Array(); + VARSELstatuses = new Array(); VARCBstatuses = new Array(); var VARCBstatusesLIST = ''; var VD_statuses_ct = ''; + var VARSELstatuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; VARterritories = new Array(); @@ -7866,25 +7880,30 @@ function set_length(SLnumber,SLlength_goal,SLdirection) HidEGenDerPulldown(); AgentDispoing = 1; var CBflag = ''; - var VD_statuses_ct_half = parseInt(VD_statuses_ct / 2); + var VD_statuses_ct_half = parseInt(VARSELstatuses_ct / 2); var dispo_HTML = "
CALL DISPOSITION
"; var loop_ct = 0; + var print_ct = 0; while (loop_ct < VD_statuses_ct) { - if (VARCBstatuses[loop_ct] == 'Y') - {CBflag = '*';} - else - {CBflag = '';} - if (taskDSgrp == VARstatuses[loop_ct]) + if (VARSELstatuses[loop_ct] == 'Y') { - dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; + if (VARCBstatuses[loop_ct] == 'Y') + {CBflag = '*';} + else + {CBflag = '';} + if (taskDSgrp == VARstatuses[loop_ct]) + { + dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; + } + else + { + dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; + } + if (print_ct == VD_statuses_ct_half) + {dispo_HTML = dispo_HTML + "
";} + print_ct++; } - else - { - dispo_HTML = dispo_HTML + "" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + " " + CBflag + "

"; - } - if (loop_ct == VD_statuses_ct_half) - {dispo_HTML = dispo_HTML + "
";} loop_ct++; } dispo_HTML = dispo_HTML + "
";