added lead recycle limit counts to admin.php

set 2.0.4 branch to RC3 release

git-svn-id: svn://192.168.202.10@924 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-07-16 03:56:39 +00:00
parent 1e058d930e
commit 86238c8316
3 changed files with 103 additions and 27 deletions
+30 -9
View File
@@ -2,28 +2,35 @@ QC(Quality Control) process flow 2008-01-03
** THIS QC FUNCTIONALITY PROSESS IS PLANNED FOR THE 2.0.5 RELEASE **
This will outline the process I have thought through for adding a Quality Assurance(QA) or Quality Control(QC) process to the VICIDIAL system. The objective is to add the following features to make VICIDIAL a more well-rounded product:
- ability to define which statuses/lists are to be able to be QCd per campaign
- ability to give agents permission to QC records for their allowable campaigns
This will outline the process I have thought through for adding a Quality Assurance(QA) or Quality Control(QC) process to the VICIDIAL system. As the needs have changed for sponsor client and VICIDIAL has evolved since this functionality was first put into the planning stages, there have been several changes to how the QC process is going to be built. The objective is to add the following QC features to make VICIDIAL a more well-rounded product:
- ability to define which statuses are to be able to be QCd per campaign and inbound group(queue)
- ability to give agents permission to QC records for their allowable campaigns/inbound groups
- ability to log all access and changes to QCd records
- creation of some basic reports on QC activity
The back-end process will work like this:
- ADMIN_keepalive_ALL.pl script will look for the 'Q' in the keepalive definition in /etc/astguiclient.conf file. If it is set, it will trigger a script to gather the QC records every five minutes(with a 15 second delay) since the last QC gathering as defined in the system_settings table qc_last_pull_time field(which is populated with the START time of the last QC-pull run).
- ADMIN_keepalive_ALL.pl script will look for the 'Q' in the keepalive definition in /etc/astguiclient.conf file. If it is set, it will trigger a script to gather the QC records every five minutes(with a 15 second delay) since the last QC gathering as defined in the system_settings table qc_last_pull_time field(which is populated with the START time of the last QC-pull run). The time interval for this might be made configurable.
- There will also be an optional method of pulling QC records available to the QC managers that enables them to specify a date range to pull and insert records
- Selected records from the vicidial_log and vicidial_closer_log tables will be taken and inserted into the qc_vicidial_list_original table and the qc_vicidial_list table at the same time.
- QC agents are then able to run their process starting with the earliest records for their selected campaign/groups
- Selected records from the vicidial_list table (keyed on the the vicidial_log and vicidial_closer_log tables) will be taken and inserted into the qc_vicidial_list_original table.
- QC agents are then able to run their process starting with the earliest records for their selected campaign/inbound groups
- After QC agents have PASSed, FINISHed and COMMITted the QC records, then they can be exported
The QC agent will login to a new qc.php screen within the agc web directory. They will then have a screen very similar to the vicidial.php login screen(but in a different color) that will have a user/pass to fill in. Then when they login they will see a green screen similar to the vicidial.php inbound(CLOSER-type) screen that will show them their allowable qc in-groups and campaigns. The agent will then choose which in-groups and campaigns that they want to QC the records for and then they will submit and they will be logged-in to the QC system.
The QC agent will login to the new qc.php screen within the agc web directory. They will then have a screen very similar to the vicidial.php login screen(but in a different color) that will have a user/pass to fill in. Then when they login they will see a green screen similar to the vicidial.php inbound(CLOSER-type) screen that will show them their allowable qc inbound-groups and campaigns. The agent will then choose which in-groups and campaigns that they want to QC the records for and then they will submit and they will be logged-in to the QC system.
Upon login, they will be able to see the count of QC-able records and they can click on a link to bring up the next record to be QCd.
Upon clicking on a link, the qc.php application will insert a record into the qc_vicidial_list to keep track of changes and other information on the qc record session.
The SCRIPTS tab and web form will both function exactly as they do in the vicidial.php application, with the exception that there will be added qc_web_form_address and qc_script options for both campaigns and inbound groups. There will also be an option to have any of these launched upon a new record appearing on the QC agent's screen.
The qc.php user interface will be using AJAX as a method to bring up records and keep track of QC-agent activity and performance.
Each qc_user_level will have different permissions for the qc system:
1- modify nothing
2- modify nothing but status
@@ -49,7 +56,8 @@ The Database Changes:
CREATE TABLE qc_vicidial_list_original (
qc_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
qc_import_date DATETIME,
original_id VARCHAR(20) UNIQUE NOT NULL,
call_date DATETIME,
log_id VARCHAR(20) UNIQUE NOT NULL,
campaign_group_id VARCHAR(20),
modify_date TIMESTAMP,
status VARCHAR(6),
@@ -82,9 +90,10 @@ comments VARCHAR(255),
# This table contains the updated QC records
CREATE TABLE qc_vicidial_list (
qc_list_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
qc_id INT(9) UNSIGNED NOT NULL,
lead_id INT(9) UNSIGNED NOT NULL,
original_id VARCHAR(20) NOT NULL,
log_id VARCHAR(20) NOT NULL,
modify_date TIMESTAMP,
status VARCHAR(6),
qc_status VARCHAR(6),
@@ -155,6 +164,15 @@ qc_user_level INT(2) default '0',
campaign_group_id VARCHAR(20)
);
# For the inbound groups table, some fields will need to be added to the vicidial_campaigns table:
ALTER TABLE vicidial_inbound_groups ADD qc_enabled ENUM('Y','N') default 'N';
ALTER TABLE vicidial_inbound_groups ADD qc_statuses TEXT;
ALTER TABLE vicidial_inbound_groups ADD qc_web_form_address VARCHAR(255);
ALTER TABLE vicidial_inbound_groups ADD qc_script VARCHAR(10);
ALTER TABLE vicidial_inbound_groups ADD qc_get_record_launch ENUM('NONE','SCRIPT','WEBFORM','QCSCRIPT','QCWEBFORM') default 'NONE';
ALTER TABLE vicidial_campaigns ADD qc_get_record_launch ENUM('NONE','SCRIPT','WEBFORM','QCSCRIPT','QCWEBFORM') default 'NONE';
ALTER TABLE system_settings ADD qc_last_pull_time DATETIME;
@@ -162,6 +180,9 @@ ALTER TABLE system_settings ADD qc_last_pull_time DATETIME;
# qc codes to be used for statistics
CREATE TABLE vicidial_qc_codes (
code VARCHAR(8) PRIMARY KEY NOT NULL,
@@ -230,6 +230,8 @@ Agent Display Queue Count: ||
agents in dead calls||
QC Last Pull Time: ||
and less than 43200 seconds or 12 hours||
LEADS AT LIMIT||
Lead counts taken from active lists in the campaign only||
############################################################ CLIENT
+71 -18
View File
@@ -1340,11 +1340,12 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
# 80608-1304 - Changed add-to-DNC to allow for multiple entries per submission
# 80625-0032 - Added time/phone display format options to system settings
# 80703-0124 - Added alter cust phone and api settings
# 80715-1130 - Added Recycle leads limit count
#
# 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.5-134';
$build = '80703-0124';
$admin_version = '2.0.5-135';
$build = '80715-1130';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -11022,32 +11023,82 @@ if ($ADD==31)
##### CAMPAIGN LEAD RECYCLING #####
if ($SUB==25)
{
echo "<br><br><b>LEAD RECYCLING WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_lead_recycle$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>ATTEMPT DELAY</td><td>ATTEMPT MAXIMUM</td><td>ACTIVE</td><td> </td><td>DELETE</td></tr>\n";
### display counts on leads that have hit the limit in this campaign
$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'";
$rslt=mysql_query($stmt, $link);
$lists_to_print = mysql_num_rows($rslt);
$camp_lists='';
$o=0;
while ($lists_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";}
$o++;
}
$camp_lists = eregi_replace(".$","",$camp_lists);
$stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$recycle_to_print = mysql_num_rows($rslt);
$o=0;
while ($recycle_to_print > $o) {
$rowx=mysql_fetch_row($rslt);
$o++;
$stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status";
$rslt=mysql_query($stmt, $link);
$recycle_to_print = mysql_num_rows($rslt);
$o=0;
while ($recycle_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$RECYCLE_status[$o] = $rowx[2];
$RECYCLE_delay[$o] = $rowx[3];
$RECYCLE_attempt[$o] = $rowx[4];
$RECYCLE_active[$o] = $rowx[5];
$RECYCLE_count[$o] = "'Y','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";
if ($RECYCLE_attempt[$o]==1) {$RECYCLE_count[$o] = "'Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==2) {$RECYCLE_count[$o] = "'Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==3) {$RECYCLE_count[$o] = "'Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==4) {$RECYCLE_count[$o] = "'Y4','Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==5) {$RECYCLE_count[$o] = "'Y5','Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==6) {$RECYCLE_count[$o] = "'Y6','Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==7) {$RECYCLE_count[$o] = "'Y7','Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==8) {$RECYCLE_count[$o] = "'Y8','Y9','Y10'";}
if ($RECYCLE_attempt[$o]==9) {$RECYCLE_count[$o] = "'Y9','Y10'";}
if ($RECYCLE_attempt[$o]>9) {$RECYCLE_count[$o] = "'Y10'";}
$o++;
}
$o=0;
echo "<br><br><b>LEAD RECYCLING WITHIN THIS CAMPAIGN: &nbsp; $NWB#vicidial_lead_recycle$NWE</b><br>\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td>STATUS</td><td>ATTEMPT DELAY</td><td>ATTEMPT MAXIMUM</td><td>LEADS AT LIMIT</td><td>ACTIVE</td><td> </td><td>DELETE</td></tr>\n";
while ($recycle_to_print > $o)
{
$recycle_limit=0;
if (strlen($camp_lists) > 2)
{
$stmt="SELECT count(*) from vicidial_list where status='$RECYCLE_status[$o]' and list_id IN($camp_lists) and called_since_last_reset IN($RECYCLE_count[$o]);";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$counts_to_print = mysql_num_rows($rslt);
if ($counts_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$recycle_limit = $rowx[0];
}
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1>$rowx[2]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=status value=\"$rowx[2]\">\n";
echo "<tr $bgcolor><td><font size=2> &nbsp; $RECYCLE_status[$o]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=status value=\"$RECYCLE_status[$o]\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=ADD value=45></td>\n";
echo "<td><font size=1><input type=text size=7 maxlength=5 name=attempt_delay value=\"$rowx[3]\"></td>\n";
echo "<td><font size=1><input type=text size=5 maxlength=3 name=attempt_maximum value=\"$rowx[4]\"></td>\n";
echo "<td><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$rowx[5]</option></select></td>\n";
echo "<td><font size=1><input type=text size=7 maxlength=5 name=attempt_delay value=\"$RECYCLE_delay[$o]\"></td>\n";
echo "<td><font size=1><input type=text size=5 maxlength=3 name=attempt_maximum value=\"$RECYCLE_attempt[$o]\"></td>\n";
echo "<td align=right><font size=2>$recycle_limit &nbsp; </td>\n";
echo "<td><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$RECYCLE_active[$o]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=65&campaign_id=$campaign_id&status=$rowx[2]\">DELETE</a></td></tr>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=65&campaign_id=$campaign_id&status=$RECYCLE_status[$o]\">DELETE</a></td></tr>\n";
$o++;
}
echo "</table>\n";
@@ -11064,6 +11115,8 @@ if ($ADD==31)
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
echo "<br>\n";
echo "* Lead counts taken from active lists in the campaign only.\n";
}
##### CAMPAIGN AUTO-ALT-NUMBER DIALING #####