Changed internal agent interface accounting for selectable statuses
git-svn-id: svn://192.168.202.10@1605 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -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!):
|
||||
# <iframe src="./vdc_script_dispo_example.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&entry_list_id=--A--entry_list_id--B--&question=--A--question--B--&answer=--A--answer--B--" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"> </iframe>
|
||||
# <iframe src="./vdc_script_dispo_example.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&entry_list_id=--A--entry_list_id--B--&closecallid=--A--closecallid--B--&fullname=--A--fullname--B--&question=--A--question--B--&answer=--A--answer--B--" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"> </iframe>
|
||||
#
|
||||
# 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";}
|
||||
|
||||
@@ -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 .= "</table>";
|
||||
var VD_preset_names_ct = '<?php echo $VD_preset_names_ct ?>';
|
||||
VARstatuses = new Array(<?php echo $VARstatuses ?>);
|
||||
VARstatusnames = new Array(<?php echo $VARstatusnames ?>);
|
||||
VARSELstatuses = new Array(<?php echo $VARSELstatuses ?>);
|
||||
VARCBstatuses = new Array(<?php echo $VARCBstatuses ?>);
|
||||
var VARCBstatusesLIST = '<?php echo $VARCBstatusesLIST ?>';
|
||||
var VD_statuses_ct = '<?php echo $VD_statuses_ct ?>';
|
||||
var VARSELstatuses_ct = '<?php echo $VARSELstatuses_ct ?>';
|
||||
VARingroups = new Array(<?php echo $VARingroups ?>);
|
||||
var INgroupCOUNT = '<?php echo $INgrpCT ?>';
|
||||
VARterritories = new Array(<?php echo $VARterritories ?>);
|
||||
@@ -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 = "<table cellpadding=\"5\" cellspacing=\"5\" width=\"500px\"><tr><td colspan=\"2\"><b> CALL DISPOSITION</b></td></tr><tr><td bgcolor=\"#99FF99\" height=\"300px\" width=\"240px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectA\">";
|
||||
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 + "<font size=\"3\" style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "</b></font><br /><br />";
|
||||
if (VARCBstatuses[loop_ct] == 'Y')
|
||||
{CBflag = '*';}
|
||||
else
|
||||
{CBflag = '';}
|
||||
if (taskDSgrp == VARstatuses[loop_ct])
|
||||
{
|
||||
dispo_HTML = dispo_HTML + "<font size=\"3\" style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "</b></font><br /><br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
dispo_HTML = dispo_HTML + "<a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','ADD');return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "<br /><br />";
|
||||
}
|
||||
if (print_ct == VD_statuses_ct_half)
|
||||
{dispo_HTML = dispo_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=\"300px\" width=\"240px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectB\">";}
|
||||
print_ct++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dispo_HTML = dispo_HTML + "<a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','ADD');return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "<br /><br />";
|
||||
}
|
||||
if (loop_ct == VD_statuses_ct_half)
|
||||
{dispo_HTML = dispo_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=\"300px\" width=\"240px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectB\">";}
|
||||
loop_ct++;
|
||||
}
|
||||
dispo_HTML = dispo_HTML + "</span></font></td></tr></table>";
|
||||
|
||||
Reference in New Issue
Block a user