Added QC functionality
git-svn-id: svn://192.168.202.10@1877 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -114,6 +114,10 @@ OTHER CHANGES:
|
||||
|
||||
24. Added recording filename variable INGROUP for the In-Group ID of a call
|
||||
|
||||
25. Added QC functionality contributed by PoundTeam and Affinity On-Call.
|
||||
To enable, go to Admin -> System Settings and set "QC Features Active"
|
||||
to "1", then submit.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,197 @@
|
||||
QC(Quality Control) process flow 2008-01-03
|
||||
QC(Quality Control) process flow 2012-11-16
|
||||
|
||||
Thanks to the Pound Team(pounteam.com) and Affinity On-Call(affinity.co.za) for
|
||||
contributing this functionaly QC application to the vicidial project.
|
||||
|
||||
Below are the basic operating instructions for how the QC system works.
|
||||
|
||||
As of SVN/trunk revision 1877, this is built into the vicidial codebase.
|
||||
|
||||
The full instructions for how to use these QC features will be added to the Vicidial
|
||||
Manager Manuals soon.
|
||||
|
||||
For the full QC manual, go here:
|
||||
http://www.vicidial.org/docs/Vicidial_Quality_Control_Manual_v1.pdf
|
||||
|
||||
|
||||
|
||||
To enable QC functionality, go to Admin -> System Settings and set "QC Features Active" to "1", then submit.
|
||||
(Note: API must also be active in the System Settings for this to work)
|
||||
|
||||
|
||||
Configure Campaigns/Lists/Users:
|
||||
|
||||
For Each Campaign:
|
||||
Detail View (top menu)
|
||||
QC (top menu)
|
||||
QC Enabled: Y
|
||||
Check boxes for one or more Statuses
|
||||
|
||||
For Each List:
|
||||
Audit Comments: Y (Optional, only if using Audited Comments)
|
||||
|
||||
For Each QC User: (such as 6666 or admin, plus any other QC users)
|
||||
QC Enabled: 1
|
||||
QC User Level: 1
|
||||
QC Pass: 1
|
||||
QC Finish: 1
|
||||
QC Commit: 1
|
||||
Agent Call Manual: 1
|
||||
Agent API Access: 1
|
||||
|
||||
For Each AGENT: (non QC, standard agents)
|
||||
Agent-Only Callbacks: 1
|
||||
Agent Call Manual: 1
|
||||
|
||||
|
||||
Notes:
|
||||
Campaigns with QC active will now appear under the “Quality Control” left menu.
|
||||
Calls dispositioned in one of those campaigns with a QC selected status will appear under the Campaign.
|
||||
Clicking on each lead will allow the QC agent to “Pass/Fail/Cancel” each lead. Fail will appear in the “Callbacks” for the originating agent to “re-sell” or fix the problem(s) with the sale.
|
||||
If activated, Audited Comments will be visible in QC Modify Lead (NOT in “Comments” for each lead, they are removed from this editable field and placed in a view only table!). Agents may view comment history when on a call with a client who has comment history. Administrators must be in QC Modify Lead to view comment history.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Each Campaign:
|
||||
|
||||
Enable QC for each campaign
|
||||
Detail View -> QC -> QC Enabled = Y
|
||||
|
||||
Choose QC Statuses
|
||||
Check the boxes for each Status you want to be managed by the QC system. You can select just one (such as SALE), or you can select as many as you would like.
|
||||
Any previously dispositioned leads with these statuses will automatically be included in the QC system, even though QC was not installed when they happened.
|
||||
|
||||
|
||||
Each List:
|
||||
|
||||
Enable Audited Comments for each List
|
||||
Audited Comments = Y
|
||||
Audited comments will move comments made by agents to a secure table where agents will be able to VIEW but not CHANGE those previous comments. They will also be available for VIEW in the QC system for modifying leads. This can also be accessed by those in the Admin Modify Lead page for those with QC privileges (link at the bottom of the page to move to the QC modify page, which will log all views/edits).
|
||||
|
||||
Note: This is optional and only applies if you want to activate the audited comments system. This will only affect campaigns on which it is turned on. This cannot be “deactivated” to retrieve the comments. Once comments are “audited” they are moved to a separate table and no longer editable or visible on the record except in the audited comments system.
|
||||
Choose QC Statuses
|
||||
Check the boxes for each Status you want to be managed by the QC system. You can select just one (such as SALE), or you can select as many as you would like.
|
||||
Any previously dispositioned leads with these statuses will automatically be included in the QC system, even though QC was not installed when they happened.
|
||||
|
||||
Modify/Create System QC Results
|
||||
Admin -> System Statuses -> QC Status Codes
|
||||
|
||||
Modify the names of the “CANCEL”, “PASS”, “FAIL” status codes to suit your needs (do not change the CATEGORY).
|
||||
|
||||
Note: We have not tested qc with different names. Please send feedback regarding success OR failure of changing the names!
|
||||
|
||||
Note: Creating new QC Results is (as yet) untested. (Alpha: use at your own risk, please report results)
|
||||
|
||||
Note: “Commit” category is not yet active (Can be created and possibly chosen, but will cause no “action” within Vicidial regarding QC).
|
||||
|
||||
Info Regarding QC Categories
|
||||
“Cancel” category items will simply change the status to the given statuscode.
|
||||
“Pass” category items will simply change the status to the given statuscode.
|
||||
“Fail” category items will create a callback for the sales agent which will require that the sale be re-sold to get back to QC again.
|
||||
|
||||
Note: Fail category items require a MATCHING System Status or Campaign Status with “Schedule Callback” = “Y” to cause a callback to be created.
|
||||
|
||||
Note: Adding new “Fail” or other QC Results is (as yet) untested. . (Alpha: use at your own risk, please report results)
|
||||
|
||||
|
||||
Standard and QC User requirements
|
||||
|
||||
Regular users must have agent-only callback and Agent Call Manual (or they cannot call clients back for a QC reject, so this is required for QC callbacks).
|
||||
Vicidial Administration->Users->(choose user)->Agent-Only Callbacks
|
||||
|
||||
Agent Call Manual
|
||||
|
||||
QC Users must have Agent Call Manual (or they cannot call clients during QC)
|
||||
Vicidial Administration->Users->(choose user)->Agent Call Manual
|
||||
|
||||
Agent Call Manual
|
||||
|
||||
User Level of 2 or greater
|
||||
|
||||
QC Enabled
|
||||
|
||||
Agent API Access
|
||||
|
||||
QC User Level 1 (or higher, levels are not yet differentiated but will be as the package matures)
|
||||
|
||||
QC Pass / Finish / Commit – Not in use yet.
|
||||
User Group settings for QC Allowed Campaigns / InGroups – Not in use yet.
|
||||
Standard Agent Interface
|
||||
QC Rejections will be received in “Callbacks”.
|
||||
Method to resolve a QC Rejection: Manual dial client, correct errors and/or create new recording based on notes from QC agent in the QCFAIL callback record.
|
||||
Agent Call Manual – Without this the agent cannot manual dial
|
||||
|
||||
Agent-Only Callbacks – Without this the agent will not see callback notification in agent window
|
||||
|
||||
QC User Interface
|
||||
Note: Until there are QC campaigns with Sales in them … there will be nothing to look at in the QC menu!
|
||||
Enter the QC System
|
||||
Admin->Quality Control
|
||||
|
||||
Choose a Campaign to QC
|
||||
|
||||
Select one record at a time to QC
|
||||
|
||||
QC Each Record in Queue
|
||||
With Each Record:
|
||||
Listen to recordings listed at bottom of screen
|
||||
To call client you must be logged in, in manual dial mode, in the correct campaign (Alpha NOTE: System does not presently verify Campaign!)
|
||||
IF you call the client, disposition that call normally FIRST (as any agent would). THEN disposition in the QC window. Do not make changes in the AGENT screen (this may change in later versions), except to disposition at the end of the call.
|
||||
After completing the call on the agent screen and dispositioning, choose your QC Result in the QC screen.
|
||||
To set the call to FAIL (and require the original agent to re-call the client):
|
||||
QC Result: FAIL
|
||||
SUBMIT
|
||||
If you want to make specific notes regarding the reason for the failure, they can be made in one of two ways:
|
||||
1. Use the Comment field before submitting (At present these notes will be editable / deletable by the agent).
|
||||
2. After submitting press Go back to re-modify this QC lead and modify the CallBack Details. (These will be temporary and viewable only by the agent during the call. However, in the future these will then appear with the Audited Comments because they are stored in the Vicidial callbacks table.)
|
||||
To specify a Date/Time other than “NOW” for the callback OR to schedule for a different user or to leave notes for the reason for the FAIL:
|
||||
Press “Go back to re-modify this QC lead” on the resulting page
|
||||
Then set the date/time/user
|
||||
SUBMIT (at the bottom of the callback details, not the QC Result!)
|
||||
When done, click on QC Campaign at the top of the page for your next record
|
||||
Quality Control Log
|
||||
Viewing:
|
||||
The QC log records are only visible within the QC system. Each time a QC agent views or modifies a record, the view and all changes are logged. It can be viewed on each lead record along with the call and recording logs.
|
||||
Log showing viewed*:
|
||||
|
||||
Log showing modified*:
|
||||
|
||||
*Note: There will always be a “viewed” record as the last entry when YOU are VIEWING the record. Obviously.
|
||||
Viewing actual changes to the record:
|
||||
The record is viewed via the “tooltip” accessed by putting your mouse over the word “details”. We will later add a “Detail viewing page”. This function works well in IE, but in Firefox there is no “Line Ending” option in a tooltip, so the lines are not easily read.
|
||||
|
||||
Note for developers: All information for the viewed and modified records is stored in vicidial_qc_agent_log. All changes made to the vicidial_list record are stored in the “details” field.
|
||||
Notes
|
||||
Testing: “QC Only” user modeled after “Reporting Only” user. Requires user level > 1, active = “Y”, and QC Enabled.
|
||||
To QC Modify a lead that is NOT presently a QC status (whether it was in the past or not), search for and Modify the lead (under Lists->Search for a Lead), then click on “Click here to QC Modify this lead” at the bottom of the Admin Modify Lead screen (if you have QC permissions, this will be visible).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
******************** ARCHIVED DOC BELOW, NOT APPLICABLE **********************************************
|
||||
|
||||
******************** PLEASE IGNORE FURTHER CONTENT, IT WILL BE DELETED IN A FUTURE REVISION **********
|
||||
|
||||
|
||||
** THIS QC FUNCTIONALITY PROSESS IS PLANNED FOR THE 2.0.5 RELEASE AND IS CURRENTLY IN DEVELOPMENT **
|
||||
|
||||
|
||||
@@ -62,3 +62,4 @@ SVYCLM - Survey sent to Call Menu - Survey outbound campaign status only
|
||||
MLINAT - Multi-Lead auto-alt-dial lead set to inactive
|
||||
MAXCAL - Max Calls drop from in-group
|
||||
LRERR - Outbound Local Channel Resolution Error
|
||||
QCFAIL - QC_FAIL_CALLBK
|
||||
|
||||
@@ -2698,6 +2698,63 @@ index (call_date)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE vicidial_qc_agent_log (
|
||||
qc_agent_log_id INT(9) unsigned NOT NULL AUTO_INCREMENT,
|
||||
qc_user VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
qc_user_group VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
qc_user_ip VARCHAR(15) COLLATE utf8_unicode_ci NOT NULL,
|
||||
lead_user VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
web_server_ip VARCHAR(15) COLLATE utf8_unicode_ci NOT NULL,
|
||||
view_datetime DATETIME NOT NULL,
|
||||
save_datetime DATETIME DEFAULT NULL,
|
||||
view_epoch INT(10) unsigned NOT NULL,
|
||||
save_epoch INT(10) unsigned DEFAULT NULL,
|
||||
elapsed_seconds SMALLINT(5) unsigned DEFAULT NULL,
|
||||
lead_id INT(9) unsigned NOT NULL,
|
||||
list_id BIGINT(14) unsigned NOT NULL,
|
||||
campaign_id VARCHAR(8) COLLATE utf8_unicode_ci NOT NULL,
|
||||
old_status VARCHAR(6) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
new_status VARCHAR(6) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
details TEXT COLLATE utf8_unicode_ci,
|
||||
processed ENUM('Y','N') COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (qc_agent_log_id),
|
||||
KEY view_epoch (view_epoch)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_comments (
|
||||
comment_id BIGINT(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
lead_id INT(11) NOT NULL,
|
||||
user_id INT(11) NOT NULL,
|
||||
timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
list_id INT(11) NOT NULL,
|
||||
campaign_id INT(11) NOT NULL,
|
||||
comment VARCHAR(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
hidden TINYINT(1) DEFAULT NULL,
|
||||
hidden_user_id INT(11) DEFAULT NULL,
|
||||
hidden_timestamp DATETIME DEFAULT NULL,
|
||||
unhidden_user_id INT(11) DEFAULT NULL,
|
||||
unhidden_timestamp DATETIME DEFAULT NULL,
|
||||
PRIMARY KEY (comment_id),
|
||||
index (lead_id)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_configuration (
|
||||
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||
name VARCHAR(36) NOT NULL ,
|
||||
value VARCHAR(36) NOT NULL ,
|
||||
UNIQUE (name)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists_custom (
|
||||
list_id BIGINT(14) unsigned NOT NULL,
|
||||
audit_comments TINYINT(1) DEFAULT NULL COMMENT 'visible',
|
||||
audit_comments_enabled TINYINT(1) DEFAULT NULL COMMENT 'invisible',
|
||||
PRIMARY KEY (list_id)
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE vicidial_qc_codes ADD qc_result_type ENUM( 'PASS', 'FAIL', 'CANCEL', 'COMMIT' ) NOT NULL;
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY;
|
||||
|
||||
ALTER TABLE live_channels ENGINE=MEMORY;
|
||||
@@ -2917,5 +2974,15 @@ INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,cate
|
||||
INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed) values('MLINAT','Multi-Lead auto-alt-dial lead set to inactive','N','Y','UNDEFINED','N','N','N','N','N','N','Y');
|
||||
INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed) values('MAXCAL','Inbound Max Calls Drop','N','Y','UNDEFINED','N','N','N','N','N','N','N');
|
||||
INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed) values('LRERR','Outbound Local Channel Res Err','N','Y','UNDEFINED','N','N','N','N','N','N','N');
|
||||
INSERT INTO vicidial_statuses (status, status_name, selectable, human_answered, category, sale, dnc, customer_contact, not_interested, unworkable, scheduled_callback) VALUES ('QCFAIL', 'QC_FAIL_CALLBK', 'N', 'Y', 'QC', 'N', 'N', 'Y', 'N', 'N', 'Y');
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1330',db_schema_update_date=NOW();
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCPASS','PASS','PASS');
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCFAIL','FAIL','FAIL');
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCCANCEL','CANCEL','CANCEL');
|
||||
|
||||
INSERT INTO vicidial_configuration (id, name, value) VALUES (NULL, 'qc_database_version', '1638');
|
||||
UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1331',db_schema_update_date=NOW();
|
||||
|
||||
@@ -92,3 +92,72 @@ ALTER TABLE vicidial_campaigns ADD pause_after_next_call ENUM('ENABLED','DISABLE
|
||||
ALTER TABLE vicidial_campaigns ADD owner_populate ENUM('ENABLED','DISABLED') default 'DISABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1330',db_schema_update_date=NOW() where db_schema_version < 1330;
|
||||
|
||||
CREATE TABLE vicidial_qc_agent_log (
|
||||
qc_agent_log_id INT(9) unsigned NOT NULL AUTO_INCREMENT,
|
||||
qc_user VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
qc_user_group VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
qc_user_ip VARCHAR(15) COLLATE utf8_unicode_ci NOT NULL,
|
||||
lead_user VARCHAR(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
web_server_ip VARCHAR(15) COLLATE utf8_unicode_ci NOT NULL,
|
||||
view_datetime DATETIME NOT NULL,
|
||||
save_datetime DATETIME DEFAULT NULL,
|
||||
view_epoch INT(10) unsigned NOT NULL,
|
||||
save_epoch INT(10) unsigned DEFAULT NULL,
|
||||
elapsed_seconds SMALLINT(5) unsigned DEFAULT NULL,
|
||||
lead_id INT(9) unsigned NOT NULL,
|
||||
list_id BIGINT(14) unsigned NOT NULL,
|
||||
campaign_id VARCHAR(8) COLLATE utf8_unicode_ci NOT NULL,
|
||||
old_status VARCHAR(6) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
new_status VARCHAR(6) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
details TEXT COLLATE utf8_unicode_ci,
|
||||
processed ENUM('Y','N') COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (qc_agent_log_id),
|
||||
KEY view_epoch (view_epoch)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_comments (
|
||||
comment_id BIGINT(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
lead_id INT(11) NOT NULL,
|
||||
user_id INT(11) NOT NULL,
|
||||
timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
list_id INT(11) NOT NULL,
|
||||
campaign_id INT(11) NOT NULL,
|
||||
comment VARCHAR(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
hidden TINYINT(1) DEFAULT NULL,
|
||||
hidden_user_id INT(11) DEFAULT NULL,
|
||||
hidden_timestamp DATETIME DEFAULT NULL,
|
||||
unhidden_user_id INT(11) DEFAULT NULL,
|
||||
unhidden_timestamp DATETIME DEFAULT NULL,
|
||||
PRIMARY KEY (comment_id),
|
||||
index (lead_id)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_configuration (
|
||||
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||
name VARCHAR(36) NOT NULL ,
|
||||
value VARCHAR(36) NOT NULL ,
|
||||
UNIQUE (name)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists_custom (
|
||||
list_id BIGINT(14) unsigned NOT NULL,
|
||||
audit_comments TINYINT(1) DEFAULT NULL COMMENT 'visible',
|
||||
audit_comments_enabled TINYINT(1) DEFAULT NULL COMMENT 'invisible',
|
||||
PRIMARY KEY (list_id)
|
||||
);
|
||||
|
||||
ALTER TABLE vicidial_qc_codes ADD qc_result_type ENUM( 'PASS', 'FAIL', 'CANCEL', 'COMMIT' ) NOT NULL;
|
||||
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCPASS','PASS','PASS');
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCFAIL','FAIL','FAIL');
|
||||
INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCCANCEL','CANCEL','CANCEL');
|
||||
|
||||
INSERT INTO vicidial_statuses (status, status_name, selectable, human_answered, category, sale, dnc, customer_contact, not_interested, unworkable, scheduled_callback) VALUES ('QCFAIL', 'QC_FAIL_CALLBK', 'N', 'Y', 'QC', 'N', 'N', 'Y', 'N', 'N', 'Y');
|
||||
|
||||
INSERT INTO vicidial_configuration (id, name, value) VALUES (NULL, 'qc_database_version', '1638');
|
||||
UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1331',db_schema_update_date=NOW() where db_schema_version < 1331;
|
||||
|
||||
@@ -29,6 +29,8 @@ If this is enabled and the owner field of the lead is blank, the owner field for
|
||||
This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are||
|
||||
The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length||
|
||||
This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are||
|
||||
Audit Comments||
|
||||
This option allows comments to be moved to an audit table. No longer editable, but viewable along with the date-time-creator of each comment. Default is N. This is a part of the Quality Control Add-On||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
@@ -47,6 +49,7 @@ Called Count||
|
||||
Unidentified Hangup Cause Code||
|
||||
YOU MUST SELECT AN AGENT TO TRANSFER TO WHEN USING AGENTDIRECT||
|
||||
Another live agent session was open using your user ID. It has been disabled. Click OK to continue to the agent screen||
|
||||
View Comment History||
|
||||
|
||||
|
||||
############################################################ MANAGER Manual
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
# audit_comments.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to display QC audit comments, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1322 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
function audit_comments($lead_id,$list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log,$campaign) {
|
||||
$audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
if ($audit_comments_active) {
|
||||
//Get comment from list
|
||||
$stmt="select comments from vicidial_list where lead_id='$lead_id' limit 1;";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments2',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($row[0]) > 0) {
|
||||
$comment=$row[0];
|
||||
//Put comment in comment table
|
||||
$stmt="INSERT INTO vicidial_comments (lead_id,user_id,list_id,campaign_id,comment) VALUES ('$lead_id','$user','$list_id','$campaign','$comment');";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments3',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$affected=mysql_affected_rows();
|
||||
if($affected>0) {
|
||||
$stmt="UPDATE vicidial_list set comments='' where lead_id='$lead_id';";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments4',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
} else {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditCommentsERROR-Comment not moved',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
echo "\n<!-- 00142-AuditCommentsERROR-Comment not moved -->";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log){
|
||||
$stmt="select count(audit_comments) from vicidial_lists_custom where list_id='$list_id' and audit_comments='1' limit 1;";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments5',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] == '1') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log) {
|
||||
global $ACcount;
|
||||
global $ACcomments;
|
||||
$stmt="select user_id,comment from vicidial_comments where lead_id='$lead_id';";
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"00142-65-AuditComments:$stmt LeadID: $lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log",$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-69-AuditComments',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$ACcount=mysql_num_rows($rslt);
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-72-AuditComments $ACcount='.$ACcount,$user,$server_ip,$session_name,$one_mysql_log);
|
||||
if($ACcount>0) {
|
||||
$i=0;
|
||||
while ($i < $ACcount) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-77-AuditComments UserID='.$row[0],$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$ACcomments .= "UserID: $row[0]\n";
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-79-AuditComments Comment='.$row[1],$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$ACcomments .= $row[1];
|
||||
$ACcomments .= "\n----------------------------------\n";
|
||||
$i++;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -315,10 +315,11 @@
|
||||
# 121018-2320 - Added blank option to owner only dialing
|
||||
# 121029-0159 - Added owner_populate campaign option
|
||||
# 121114-1749 - Fixed manual dial lead preview script variable issue
|
||||
# 121116-1409 - Added QC functionality
|
||||
#
|
||||
|
||||
$version = '2.6-213';
|
||||
$build = '121114-1749';
|
||||
$version = '2.6-214';
|
||||
$build = '121116-1409';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=443;
|
||||
$one_mysql_log=0;
|
||||
@@ -650,7 +651,7 @@ $hangup_cause_dictionary = array(
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -666,6 +667,7 @@ if ($qm_conf_ct > 0)
|
||||
$alt_log_login = $row[5];
|
||||
$alt_log_pass = $row[6];
|
||||
$tables_use_alt_log_db = $row[7];
|
||||
$qc_features_active = $row[8];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -1186,6 +1188,14 @@ if ($ACTION == 'UpdateFields')
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0] > 0) {$lead_id = $rowx[0];}
|
||||
### ADDED BY POUNDTEAM FOR AUDITED COMMENTS! acquire audited comment count for this lead
|
||||
$stmt="SELECT count(comment_id) as comment_count FROM vicidial_comments where lead_id='$lead_id' and hidden is null";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00275',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_comment_count = trim("$row[0]");
|
||||
|
||||
##### grab the data from vicidial_list for the lead_id
|
||||
$stmt="SELECT vendor_lead_code,source_id,gmt_offset_now,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,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -1250,6 +1260,7 @@ if ($ACTION == 'UpdateFields')
|
||||
$LeaD_InfO .= $comments . "\n";
|
||||
$LeaD_InfO .= $rank . "\n";
|
||||
$LeaD_InfO .= $owner . "\n";
|
||||
$LeaD_InfO .= $lead_comment_count . "\n";
|
||||
$LeaD_InfO .= "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
@@ -2166,6 +2177,23 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$entry_list_id = trim("$row[34]");
|
||||
if ($entry_list_id < 100) {$entry_list_id = $list_id;}
|
||||
}
|
||||
if ($qc_features_active > 0)
|
||||
{
|
||||
//Added by Poundteam for Audited Comments
|
||||
##### if list has audited comments, grab the audited comments
|
||||
require_once('audit_comments.php');
|
||||
$ACcount = '';
|
||||
$ACcomments = '';
|
||||
$audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
if ($audit_comments_active)
|
||||
{
|
||||
get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$ACcomments = strip_tags(htmlentities($ACcomments));
|
||||
$ACcomments = eregi_replace("\r",'',$ACcomments);
|
||||
$ACcomments = eregi_replace("\n",'!N',$ACcomments);
|
||||
//END Added by Poundteam for Audited Comments
|
||||
}
|
||||
|
||||
$called_count++;
|
||||
|
||||
@@ -2826,6 +2854,8 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$LeaD_InfO .= $LISTweb_form_address . "\n";
|
||||
$LeaD_InfO .= $LISTweb_form_address_two . "\n";
|
||||
$LeaD_InfO .= $post_phone_time_diff_alert_message . "\n";
|
||||
$LeaD_InfO .= $ACcount . "\n";
|
||||
$LeaD_InfO .= $ACcomments . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
}
|
||||
@@ -4831,6 +4861,23 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$entry_list_id = trim("$row[34]");
|
||||
if ($entry_list_id < 100) {$entry_list_id = $list_id;}
|
||||
}
|
||||
if ($qc_features_active > 0)
|
||||
{
|
||||
//Added by Poundteam for Audited Comments
|
||||
##### if list has audited comments, grab the audited comments
|
||||
require_once('audit_comments.php');
|
||||
$ACcount = '';
|
||||
$ACcomments = '';
|
||||
$audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
if ($audit_comments_active)
|
||||
{
|
||||
get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$ACcomments = strip_tags(htmlentities($ACcomments));
|
||||
$ACcomments = eregi_replace("\r",'',$ACcomments);
|
||||
$ACcomments = eregi_replace("\n",'!N',$ACcomments);
|
||||
//END Added by Poundteam for Audited Comments
|
||||
}
|
||||
|
||||
##### if lead is a callback, grab the callback comments
|
||||
$CBentry_time = '';
|
||||
@@ -5549,6 +5596,10 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$LeaD_InfO .= $custom_field_names . "\n";
|
||||
$LeaD_InfO .= $custom_field_values . "\n";
|
||||
$LeaD_InfO .= $custom_field_types . "\n";
|
||||
$LeaD_InfO .= $LISTweb_form_address . "\n";
|
||||
$LeaD_InfO .= $LISTweb_form_address_two . "\n";
|
||||
$LeaD_InfO .= $ACcount . "\n";
|
||||
$LeaD_InfO .= $ACcomments . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
|
||||
@@ -6198,12 +6249,14 @@ if ($ACTION == 'updateDISPO')
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00285',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
//Added by Poundteam Incorporated for Audit Comments Package
|
||||
require_once('audit_comments.php');
|
||||
audit_comments($lead_id,$list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log,$campaign);
|
||||
# $fp = fopen ("./vicidial_debug.txt", "a");
|
||||
# fwrite ($fp, "$NOW_TIME|DISPO_CALL |$MDnextCID|$stage|$campaign|$lead_id|$dispo_choice|$user|$uniqueid|$auto_dial_level|$agent_log_id|\n");
|
||||
# fclose($fp);
|
||||
|
||||
@@ -388,10 +388,11 @@
|
||||
# 121029-0122 - Added pause_after_next_call and owner_populate campaign options
|
||||
# 121114-1759 - Fixed manual dial lead preview script variable issue
|
||||
# 121114-1937 - Added INGROUP recording option
|
||||
# 121116-1407 - Added QC functionality
|
||||
#
|
||||
|
||||
$version = '2.6-356c';
|
||||
$build = '121114-1937';
|
||||
$version = '2.6-357c';
|
||||
$build = '121116-1407';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=79;
|
||||
$one_mysql_log=0;
|
||||
@@ -476,7 +477,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -498,6 +499,7 @@ if ($qm_conf_ct > 0)
|
||||
$static_agent_url = $row[11];
|
||||
$custom_fields_enabled = $row[12];
|
||||
$SSpllb_grouping_limit = $row[13];
|
||||
$qc_enabled = $row[14];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -3639,6 +3641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var next_call_pause='<?php echo $pause_after_next_call ?>';
|
||||
var deactivated_old_session='<?php echo $vlaLIaffected_rows ?>';
|
||||
var owner_populate='<?php echo $owner_populate ?>';
|
||||
var qc_enabled='<?php echo $qc_enabled ?>';
|
||||
var DiaLControl_auto_HTML = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><img src=\"./images/vdc_LB_resume.gif\" border=\"0\" alt=\"Resume\" /></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><img src=\"./images/vdc_LB_pause.gif\" border=\"0\" alt=\" Pause \" /></a><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
|
||||
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
|
||||
@@ -6833,6 +6836,16 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
var list_webform = MDnextResponse_array[48];
|
||||
var list_webform_two = MDnextResponse_array[49];
|
||||
post_phone_time_diff_alert_message = MDnextResponse_array[50];
|
||||
//Added By Poundteam for Audited Comments (Manual Dial Section Only)
|
||||
if (qc_enabled > 0)
|
||||
{
|
||||
document.vicidial_form.ViewCommentButton.value = MDnextResponse_array[51];
|
||||
document.vicidial_form.audit_comments_button.value = MDnextResponse_array[51];
|
||||
var REGACcomments = new RegExp("!N","g");
|
||||
MDnextResponse_array[52] = MDnextResponse_array[52].replace(REGACcomments, "\n");
|
||||
document.vicidial_form.audit_comments.value = MDnextResponse_array[52];
|
||||
}
|
||||
//END section Added By Poundteam for Audited Comments
|
||||
|
||||
timer_action = campaign_timer_action;
|
||||
timer_action_message = campaign_timer_action_message;
|
||||
@@ -7100,6 +7113,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
document.vicidial_form.email.value ='';
|
||||
document.vicidial_form.security_phrase.value='';
|
||||
document.vicidial_form.comments.value ='';
|
||||
document.vicidial_form.audit_comments.value ='';
|
||||
if (qc_enabled > 0)
|
||||
{
|
||||
document.vicidial_form.ViewCommentButton.value ='';
|
||||
document.vicidial_form.audit_comments_button.value ='';
|
||||
}
|
||||
document.vicidial_form.called_count.value ='';
|
||||
document.vicidial_form.rank.value ='';
|
||||
document.vicidial_form.owner.value ='';
|
||||
@@ -7810,7 +7829,17 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
custom_field_names = check_VDIC_array[48];
|
||||
custom_field_values = check_VDIC_array[49];
|
||||
custom_field_types = check_VDIC_array[50];
|
||||
|
||||
//Added By Poundteam for Audited Comments (Manual Dial Section Only)
|
||||
if (qc_enabled > 0)
|
||||
{
|
||||
document.vicidial_form.ViewCommentButton.value = check_VDIC_array[53];
|
||||
document.vicidial_form.audit_comments_button.value = check_VDIC_array[53];
|
||||
var REGACcomments = new RegExp("!N","g");
|
||||
check_VDIC_array[54] = check_VDIC_array[54].replace(REGACcomments, "\n");
|
||||
document.vicidial_form.audit_comments.value = check_VDIC_array[54];
|
||||
}
|
||||
//END section Added By Poundteam for Audited Comments
|
||||
// Add here for AutoDial (VDADcheckINCOMING in vdc_db_query)
|
||||
|
||||
if (hide_gender > 0)
|
||||
{
|
||||
@@ -9238,6 +9267,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
document.vicidial_form.email.value ='';
|
||||
document.vicidial_form.security_phrase.value='';
|
||||
document.vicidial_form.comments.value ='';
|
||||
document.vicidial_form.audit_comments.value ='';
|
||||
if (qc_enabled > 0)
|
||||
{
|
||||
document.vicidial_form.ViewCommentButton.value ='';
|
||||
document.vicidial_form.audit_comments_button.value ='';
|
||||
}
|
||||
document.vicidial_form.called_count.value ='';
|
||||
document.vicidial_form.call_notes.value ='';
|
||||
document.vicidial_form.call_notes_dispo.value ='';
|
||||
@@ -12005,6 +12040,7 @@ function phone_number_format(formatphone) {
|
||||
hideDiv('EAcommentsMinBox');
|
||||
hideDiv('HotKeyActionBox');
|
||||
hideDiv('HotKeyEntriesBox');
|
||||
hideDiv('ViewCommentsBox');
|
||||
hideDiv('MainPanel');
|
||||
hideDiv('ScriptPanel');
|
||||
hideDiv('ScriptRefresH');
|
||||
@@ -12093,6 +12129,8 @@ function phone_number_format(formatphone) {
|
||||
{hideDiv('ParkCustomerDial');}
|
||||
if (AllowManualQueueCallsChoice == '1')
|
||||
{document.getElementById("ManualQueueChoice").innerHTML = "<a href=\"#\" onclick=\"ManualQueueChoiceChange('1');return false;\">Manual Queue is Off</a><br />";}
|
||||
if (qc_enabled < 1)
|
||||
{document.getElementById("viewcommentsdisplay").innerHTML = "";}
|
||||
|
||||
document.vicidial_form.LeadLookuP.checked=true;
|
||||
|
||||
@@ -12787,6 +12825,24 @@ function phone_number_format(formatphone) {
|
||||
}
|
||||
}
|
||||
|
||||
function ViewComments(VCommstate)
|
||||
{
|
||||
if ( (VCommstate == 'ON') )
|
||||
{
|
||||
showDiv('ViewCommentsBox');
|
||||
//view_comments_active = 1;
|
||||
document.getElementById("viewcommentsdisplay").innerHTML = "<input type=\"button\" id='ViewCommentButton' onClick=\"ViewComments('OFF')\" value='HIDE' />";
|
||||
}
|
||||
else
|
||||
{
|
||||
hideDiv('ViewCommentsBox');
|
||||
//view_comments_active = 0;
|
||||
document.getElementById("viewcommentsdisplay").innerHTML = "<input type=\"button\" id='ViewCommentButton' value='0' onClick=\"ViewComments('ON')\">";
|
||||
document.vicidial_form.ViewCommentButton.value = document.vicidial_form.audit_comments_button.value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function ShoWTransferMain(showxfervar,showoffvar)
|
||||
{
|
||||
if (VU_vicidial_transfers == '1')
|
||||
@@ -13299,14 +13355,15 @@ $zi=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "$label_comments: </td><td align=\"left\" colspan=\"5\"><font class=\"body_text\">";
|
||||
echo "$label_comments: <br><span id='viewcommentsdisplay'><input type='button' id='ViewCommentButton' onClick=\"ViewComments('ON')\" value='History'/></span>
|
||||
</td><td align=\"left\" colspan=\"5\"><font class=\"body_text\">";
|
||||
if ( ($multi_line_comments) )
|
||||
{echo "<textarea name=\"comments\" id=\"comments\" rows=\"2\" cols=\"85\" class=\"cust_form_text\" value=\"\"></textarea>\n";}
|
||||
else
|
||||
{echo "<input type=\"text\" size=\"65\" name=\"comments\" id=\"comments\" maxlength=\"255\" class=\"cust_form\" value=\"\" />\n";}
|
||||
}
|
||||
|
||||
echo "</font></td></tr><tr><td align=\"right\"><font class=\"body_text\">\n";
|
||||
echo "</font></td>
|
||||
</tr><tr><td align=\"right\"><font class=\"body_text\">\n";
|
||||
|
||||
if ($per_call_notes == 'ENABLED')
|
||||
{
|
||||
@@ -13634,7 +13691,19 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
|
||||
</font></td>
|
||||
</tr></table>
|
||||
</span>
|
||||
|
||||
<? //AUDIT COMMENTS ADDED BY POUNDTEAM // ?>
|
||||
<span style="position:absolute;left:5px;top:350px;z-index:<?php $zi++; echo $zi ?>;" id="ViewCommentsBox">
|
||||
<TABLE border=0 bgcolor="#FFDD99" width=<?php echo $HCwidth; ?>px height='<?php echo $BROWSER_HEIGHT-380; ?>px'>
|
||||
<TR bgcolor="#FFEEBB">
|
||||
<TD><font class="sh_text"> View Comment History: </font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<TD><TEXTAREA readonly NAME=audit_comments ROWS=<?php echo ($BROWSER_HEIGHT-365)/15; ?> COLS=<?php echo ($HCwidth)/4.6; ?>
|
||||
class="cust_form_text" value=""></TEXTAREA><input type="hidden" class="cust_form_text" id="audit_comments_button" name="audit_comments_button" value="0" /></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</span>
|
||||
<? //end AUDIT COMMENTS ADDED BY POUNDTEAM // ?>
|
||||
<span style="position:absolute;left:5px;top:<?php echo $HTheight ?>px;z-index:<?php $zi++; echo $zi ?>;" id="CBcommentsBox">
|
||||
<table border="0" bgcolor="#FFFFCC" width="<?php echo $HCwidth ?>px" height="70px">
|
||||
<tr bgcolor="#FFFF66">
|
||||
@@ -14191,4 +14260,4 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -70,6 +70,8 @@ $reports_font = 'BLACK';
|
||||
$cts_font = 'BLACK';
|
||||
$subcamp_font = 'BLACK';
|
||||
|
||||
### QC font and color variables
|
||||
require_once('qc/QC_admin_variables.php');
|
||||
### comment this section out for colorful section headings
|
||||
$users_color = '#E6E6E6';
|
||||
$campaigns_color = '#E6E6E6';
|
||||
@@ -1540,6 +1542,8 @@ if (isset($_GET["auto_resume_precall"])) {$auto_resume_precall=$_GET["auto_res
|
||||
elseif (isset($_POST["auto_resume_precall"])) {$auto_resume_precall=$_POST["auto_resume_precall"];}
|
||||
if (isset($_GET["auto_pause_precall_code"])) {$auto_pause_precall_code=$_GET["auto_pause_precall_code"];}
|
||||
elseif (isset($_POST["auto_pause_precall_code"])) {$auto_pause_precall_code=$_POST["auto_pause_precall_code"];}
|
||||
if (isset($_GET["audit_comments"])) {$audit_comments=$_GET["audit_comments"];}
|
||||
elseif (isset($_POST["audit_comments"])) {$audit_comments=$_POST["audit_comments"];}
|
||||
if (isset($_GET["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_GET["reload_dialplan_on_servers"];}
|
||||
elseif (isset($_POST["reload_dialplan_on_servers"])) {$reload_dialplan_on_servers=$_POST["reload_dialplan_on_servers"];}
|
||||
if (isset($_GET["manual_dial_cid"])) {$manual_dial_cid=$_GET["manual_dial_cid"];}
|
||||
@@ -3162,12 +3166,13 @@ else
|
||||
# 121027-2344 - Added servers versions page
|
||||
# 121029-0109 - Added pause_after_next_call and owner_populate campaign options
|
||||
# 121114-1923 - Added Basic Lead Management page link. Added INGROUP as a recording filename option
|
||||
# 121116-1410 - Added QC functionality
|
||||
#
|
||||
|
||||
# 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.6-381a';
|
||||
$build = '121114-1923';
|
||||
$admin_version = '2.6-382a';
|
||||
$build = '121116-1410';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3221,7 +3226,6 @@ if ($force_logout)
|
||||
echo "You have now logged out. Thank you\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refresh,nocache_admin,webroot_writable FROM system_settings;";
|
||||
@@ -3262,6 +3266,10 @@ if ( ($reports_auth > 0) and ($auth < 1) )
|
||||
$ADD=999999;
|
||||
$reports_only_user=1;
|
||||
}
|
||||
##############################################
|
||||
# Include QC Agents with no other permission #
|
||||
##############################################
|
||||
require_once('qc/QC_admin_include02.php');
|
||||
|
||||
if ($SSwebroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
@@ -3270,7 +3278,7 @@ $date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) )
|
||||
if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) and ($qc_auth < 1)) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -3278,7 +3286,7 @@ if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) an
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ($auth > 0) or ($reports_auth > 0) )
|
||||
if ( ($auth > 0) or ($reports_auth > 0) or ($qc_auth > 0) )
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
@@ -3774,6 +3782,8 @@ if ($ADD==180000000000) {$hh='admin'; $sh='label'; echo "SCREEN LABELS LIST";}
|
||||
if ($ADD==190000000000) {$hh='admin'; $sh='cts'; echo "CONTACTS LIST";}
|
||||
if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "CONFERENCE LIST";}
|
||||
if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL CONFERENCE LIST";}
|
||||
##QC
|
||||
require_once('qc/QC_admin_variables01.php');
|
||||
if ($ADD==550) {$hh='users'; echo "Search Form";}
|
||||
if ($ADD==551) {$hh='users'; echo "SEARCH PHONES";}
|
||||
if ($ADD==660) {$hh='users'; echo "Search Results";}
|
||||
@@ -5836,6 +5846,11 @@ if ($ADD==99999)
|
||||
<BR>
|
||||
<B>Reset Times -</B> This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_lists-audit_comments">
|
||||
<BR>
|
||||
<B>Audit Comments -</B> This option allows comments to be moved to an audit table. No longer editable, but viewable along with the date-time-creator of each comment. Default is N. This is a part of the Quality Control Add-On.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_lists-agent_script_override">
|
||||
<BR>
|
||||
@@ -13975,41 +13990,7 @@ if ($ADD==231111111111111)
|
||||
######################
|
||||
# ADD=241111111111111 adds the new qc status code to the system
|
||||
######################
|
||||
|
||||
if ($ADD==241111111111111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT count(*) from vicidial_qc_codes where code='$code';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{echo "<br>QC STATUS CODE NOT ADDED - there is already a qc status code in the system with this name: $row[0]\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($code) < 1) or (strlen($code_name) < 2) )
|
||||
{
|
||||
echo "<br>QC STATUS CODE NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>code must be between 1 and 8 characters in length\n";
|
||||
echo "<br>code name must be between 2 and 30 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><B>QC STATUS CODE ADDED: $code_name - $code</B>\n";
|
||||
|
||||
$stmt="INSERT INTO vicidial_qc_codes (code,code_name) values('$code','$code_name');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='QCSTATUSES', event_type='ADD', record_id='$code', event_code='ADMIN ADD QC STATUS', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
}
|
||||
$ADD=341111111111111;
|
||||
}
|
||||
//Moved to qc/QC_status_codes_include.php include file
|
||||
|
||||
|
||||
|
||||
@@ -15782,7 +15763,6 @@ if ($ADD==401)
|
||||
|
||||
$stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
@@ -15855,6 +15835,12 @@ if ($ADD==411)
|
||||
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
## BEGIN QC Addition for Audited Comments
|
||||
$stmt="INSERT INTO vicidial_lists_custom (audit_comments, list_id) VALUES ('" . mysql_real_escape_string($audit_comments) . "','$list_id') ON DUPLICATE KEY UPDATE audit_comments='" . mysql_real_escape_string($audit_comments) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
## END QC Addition for Audited Comments
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
@@ -24387,8 +24373,9 @@ if ($ADD==311)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$stmt="SELECT vicidial_lists.list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report,IFNULL(audit_comments,0) from vicidial_lists left outer join vicidial_lists_custom on vicidial_lists.list_id=vicidial_lists_custom.list_id where vicidial_lists.list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$list_name = $row[1];
|
||||
$campaign_id = $row[2];
|
||||
@@ -24410,6 +24397,7 @@ if ($ADD==311)
|
||||
$web_form_address_two = $row[18];
|
||||
$time_zone_setting = $row[19];
|
||||
$inventory_report = $row[20];
|
||||
$audit_comments = $row[21];
|
||||
|
||||
# grab names of global statuses and statuses in the selected campaign
|
||||
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_statuses order by status;";
|
||||
@@ -24505,6 +24493,11 @@ if ($ADD==311)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_lists-active$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Reset Lead-Called-Status for this list: </td><td align=left><select size=1 name=reset_list><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_lists-reset_list$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Reset Times: </td><td align=left><input type=text name=reset_time size=30 maxlength=100 value=\"$reset_time\">$NWB#vicidial_lists-reset_time$NWE</td></tr>\n";
|
||||
if($audit_comments=='1') {
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Audit Comments: </td><td align=left><select size=1 name=audit_comments><option value='1' selected>Y</option><option value='0'>N</option></select>$NWB#vicidial_lists-audit_comments$NWE</td></tr>\n";
|
||||
} else {
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Audit Comments: </td><td align=left><select size=1 name=audit_comments><option value='1'>Y</option><option value='0' selected>N</option></select>$NWB#vicidial_lists-audit_comments$NWE</td></tr>\n";
|
||||
}
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>List Change Date: </td><td align=left>$list_changedate $NWB#vicidial_lists-list_changedate$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>List Last Call Date: </td><td align=left>$list_lastcalldate $NWB#vicidial_lists-list_lastcalldate$NWE</td></tr>\n";
|
||||
|
||||
@@ -30621,89 +30614,12 @@ if ($ADD==331111111111111)
|
||||
|
||||
|
||||
|
||||
##QC
|
||||
require_once('qc/QC_status_codes_include.php');
|
||||
######################
|
||||
# ADD=341111111111111 modify vicidial QC status code
|
||||
######################
|
||||
|
||||
if ($ADD==341111111111111)
|
||||
{
|
||||
if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) )
|
||||
{
|
||||
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
|
||||
{
|
||||
$modify_url = "$PHP_SELF?ADD=341111111111111";
|
||||
$modify_footer_refresh=1;
|
||||
}
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br><center>\n";
|
||||
echo "<b>VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: $NWB#vicidial_qc_status_codes$NWE</b><br>\n";
|
||||
echo "<TABLE width=600 cellspacing=3>\n";
|
||||
echo "<tr><td>STATUS CODE</td><td>DESCRIPTION</td><td>MODIFY/DELETE</td></tr>\n";
|
||||
|
||||
##### go through each QC status code
|
||||
$stmt="SELECT count(*) from vicidial_qc_codes;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0] > 0)
|
||||
{
|
||||
$stmt="SELECT code,code_name from vicidial_qc_codes order by code;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$o++;
|
||||
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=441111111111111>\n";
|
||||
echo "<input type=hidden name=stage value=modify>\n";
|
||||
echo "<input type=hidden name=code value=\"$rowx[0]\">\n";
|
||||
echo "<font size=2><B>$rowx[0]</B></td>\n";
|
||||
echo "<td><input type=text name=code_name size=20 maxlength=30 value=\"$rowx[1]\"></td>\n";
|
||||
echo "<td align=center nowrap><font size=1><input type=submit name=submit value=MODIFY> \n";
|
||||
echo " \n";
|
||||
|
||||
if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0]))
|
||||
{
|
||||
echo "<DEL>DELETE</DEL>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?ADD=441111111111111&status=$rowx[0]&stage=delete\">DELETE</a>\n";
|
||||
}
|
||||
echo "</form></td></tr>\n";
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<br>ADD NEW QC STATUS CODE<BR><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=241111111111111>\n";
|
||||
echo "Status: <input type=text name=code size=9 maxlength=8> \n";
|
||||
echo "Description: <input type=text name=code_name size=30 maxlength=30><BR>\n";
|
||||
echo "<input type=submit name=submit value=ADD><BR>\n";
|
||||
|
||||
echo "</FORM><br>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//This section moved to include file as part of QC
|
||||
|
||||
######################
|
||||
# ADD=550 user search form
|
||||
@@ -32387,7 +32303,10 @@ if ($ADD==10000000000000)
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=100000000000000 display all qc campaigns
|
||||
######################
|
||||
require_once('qc/QC_admin_include01.php');
|
||||
|
||||
|
||||
######################
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
# 111106-0939 - Changes for user group restrictions
|
||||
# 111116-0208 - Added ALT and ADDR3 in-group handle methods
|
||||
# 120402-2134 - Changed lead loader link to fourth gen
|
||||
# 121116-1412 - Added QC functionality
|
||||
#
|
||||
|
||||
|
||||
@@ -50,6 +51,7 @@ if($short_header)
|
||||
?>
|
||||
<TD> <A HREF="admin.php" ALT="Users"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Users</B></A> </TD>
|
||||
<TD> <A HREF="admin.php?ADD=10" ALT="Campaigns"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Campaigns</B></A> </TD>
|
||||
<?php include 'QC_header_include02.php'; ?>
|
||||
<TD> <A HREF="admin.php?ADD=100" ALT="Lists"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Lists</B></A> </TD>
|
||||
<TD> <A HREF="admin.php?ADD=1000000" ALT="Scripts"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Scripts</B></A> </TD>
|
||||
<TD> <A HREF="admin.php?ADD=10000000" ALT="Filters"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Filters</B></A> </TD>
|
||||
@@ -110,6 +112,7 @@ if ($hh=='admin')
|
||||
if ($hh=='reports')
|
||||
{$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";}
|
||||
else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";}
|
||||
include ('qc/QC_header_include01.php');
|
||||
|
||||
echo "</title>\n";
|
||||
echo "<script language=\"Javascript\">\n";
|
||||
@@ -475,7 +478,7 @@ else
|
||||
{
|
||||
var audiolistURL = "./non_agent_api.php";
|
||||
var audiolistQuery = "source=admin&function=sounds_list&user=" + user + "&pass=" + pass + "&format=selectframe&stage=" + stage + "&comments=" + fieldname;
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </iframe>';
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </IFRAME>';
|
||||
|
||||
document.getElementById("audio_chooser_span").style.position = "absolute";
|
||||
document.getElementById("audio_chooser_span").style.left = "220px";
|
||||
@@ -488,7 +491,7 @@ else
|
||||
{
|
||||
var audiolistURL = "./non_agent_api.php";
|
||||
var audiolistQuery = "source=admin&function=moh_list&user=" + user + "&pass=" + pass + "&format=selectframe&stage=" + stage + "&comments=" + fieldname;
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </iframe>';
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </IFRAME>';
|
||||
|
||||
document.getElementById("audio_chooser_span").style.position = "absolute";
|
||||
document.getElementById("audio_chooser_span").style.left = "220px";
|
||||
@@ -501,7 +504,7 @@ else
|
||||
{
|
||||
var audiolistURL = "./non_agent_api.php";
|
||||
var audiolistQuery = "source=admin&function=vm_list&user=" + user + "&pass=" + pass + "&format=selectframe&stage=" + stage + "&comments=" + fieldname;
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </iframe>';
|
||||
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </IFRAME>';
|
||||
|
||||
document.getElementById("audio_chooser_span").style.position = "absolute";
|
||||
document.getElementById("audio_chooser_span").style.left = "220px";
|
||||
@@ -1206,6 +1209,7 @@ $SScustom_fields_enabled = $row[3];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php include 'qc/QC_header_include.php'; ?>
|
||||
<!-- SCRIPTS NAVIGATION -->
|
||||
<TR><TD <?php echo $scripts_hh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=1000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $scripts_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $scripts_bold ?> Scripts </a>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
# admin_modify_lead.php version 2.4
|
||||
# admin_modify_lead.php version 2.6
|
||||
#
|
||||
# ViciDial database administration modify lead in vicidial_list
|
||||
# admin_modify_lead.php
|
||||
@@ -48,6 +48,7 @@
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
# 120518-1004 - Fix for multi-line comments
|
||||
# 120529-1635 - Added User Group Campaign-Lists validation
|
||||
# 121116-1411 - Added QC functionality
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -1411,7 +1412,8 @@ else
|
||||
{
|
||||
echo "<a href=\"./admin.php?ADD=720000000000000&stage=$lead_id&category=LEADS\">Click here to see Lead Modify changes to this lead</a>\n";
|
||||
}
|
||||
|
||||
//Display link to QC if user has QC permissions
|
||||
require('./qc/QC_admin_modify_lead_include.php');
|
||||
echo "</center>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
# QC_admin_include01.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by admin.php with QC enabled, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1334 - First build, added to vicidial codebase
|
||||
#
|
||||
//Line 28030 admin.php
|
||||
######################
|
||||
# ADD=100000000000000 display all qc campaigns
|
||||
######################
|
||||
if (($ADD==100000000000000) && ($qc_auth=='1')) {
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
//SELECT campaign_id,campaign_name from vicidial_campaigns where active = 'Y' and qc_enabled='Y' order by campaign_name
|
||||
$stmt="SELECT campaign_id,campaign_name, qc_statuses from vicidial_campaigns where active = 'Y' and qc_enabled='Y' order by campaign_name";
|
||||
// echo $stmt="SELECT conf_exten,server_ip,extension from vicidial_conferences order by conf_exten";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vicidialconf_to_print = mysql_num_rows($rslt);
|
||||
|
||||
echo "<br>VICIDIAL QUALITY LISTINGS:\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td><font size=1 color=white align=left><B>CAMPAIGN ID</B></td>";
|
||||
echo "<td><font size=1 color=white><B>CAMPAIGN NAME</B></td>";
|
||||
echo "<td><font size=1 color=white><B>QC STATUSES</B></td>";
|
||||
echo "<td align=center><font size=1 color=white><B>MODIFY</B></td></tr>\n";
|
||||
|
||||
$o=0;
|
||||
while ($vicidialconf_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $o)) {
|
||||
$bgcolor='bgcolor="#B9CBFD"';
|
||||
}
|
||||
else {
|
||||
$bgcolor='bgcolor="#9BB9FB"';
|
||||
}
|
||||
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=881&campaign_id=$row[0]\">$row[0]</a></td>";
|
||||
echo "<td><font size=1> $row[1]</td>";
|
||||
echo "<td><font size=1> $row[2]</td>";
|
||||
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">MODIFY</a></td></tr>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
######################
|
||||
# ADD=881 VIEW one qc campaign
|
||||
######################
|
||||
if (($ADD==881) && ($qc_auth=='1')) {
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT campaign_id,campaign_name, qc_statuses from vicidial_campaigns where active = 'Y' and qc_enabled='Y' and campaign_id='$campaign_id' limit 1";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vicidialconf_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($vicidialconf_to_print > $o) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$o++;
|
||||
}
|
||||
$qc_status_list=substr($row[2],0,strlen($row[2])-2);
|
||||
|
||||
echo "<br>$campaign_id - {$row[1]} - Quality Control Queue<br>QC statuses: $qc_status_list\n";
|
||||
|
||||
$qc_statuses=explode(' ',$qc_status_list);
|
||||
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||
foreach ( $qc_statuses as $qc_status ) {
|
||||
$stmt="SELECT lead_id,first_name,last_name,modify_date,user from vicidial_list inner join vicidial_lists on vicidial_list.list_id=vicidial_lists.list_id where campaign_id='$campaign_id' and status='$qc_status' order by status, modify_date";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vicidialconf_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($vicidialconf_to_print > $o) {
|
||||
if($o==0){
|
||||
echo "<tr bgcolor=black>";
|
||||
echo "<td><font size=1 color=white align=left><B>$qc_status ($vicidialconf_to_print)</B></td>";
|
||||
echo "<td><font size=1 color=white align=left><B>LEAD ID</B></td>";
|
||||
echo "<td><font size=1 color=white><B>NAME</B></td>";
|
||||
echo "<td><font size=1 color=white><B>Last Modified</B></td>";
|
||||
echo "<td align=center><font size=1 color=white><B>UserID</B></td></tr>\n";
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("1$|3$|5$|7$|9$", $o)) {
|
||||
$bgcolor='bgcolor="#B9CBFD"';
|
||||
}
|
||||
else {
|
||||
$bgcolor='bgcolor="#9BB9FB"';
|
||||
}
|
||||
echo "<tr $bgcolor><td><font size=1> </td>";
|
||||
echo "<td><font size=1> $row[0]</td>";
|
||||
$lead_name=trim($row[1].' '.$row[2]);
|
||||
$lead_nameENC=urlencode($lead_name);
|
||||
if (strlen($lead_name)<1) $lead_name='No Name';
|
||||
echo "<td><font size=1><a href=\"/vicidial/qc/qc_modify_lead.php?lead_id=$row[0]&campaign_id=$campaign_id&lead_name=$lead_nameENC\">$lead_name</a></td>";
|
||||
echo "<td><font size=1> $row[3]</td>";
|
||||
echo "<td align=center><font size=1><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[4]\">$row[4]</a></td></tr>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
}
|
||||
echo "</TABLE></center>\n";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
# QC_admin_include02.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by admin.php with QC enabled, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1333 - First build, added to vicidial codebase
|
||||
#
|
||||
//Get QC User permissions
|
||||
$stmt="SELECT qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 1 and active='Y' and qc_enabled='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$qc_auth=$row[0];
|
||||
//Not "qc_" as it will interfere with ADD=4A storage of modified user.
|
||||
if ($qc_auth=='1') {
|
||||
$qcuser_level=$row[1];
|
||||
$qcpass=$row[2];
|
||||
$qcfinish=$row[3];
|
||||
$qccommit=$row[4];
|
||||
}
|
||||
//Modify menuing to allow qc users into the system (if they have no permission otherwise)
|
||||
//Copied Reports-Only user setup for QC-Only user (Poundteam QC setup)
|
||||
$qc_only_user=0;
|
||||
if ( ($qc_auth > 0) and ($auth < 1) )
|
||||
{
|
||||
if ($ADD != '881'){
|
||||
$ADD=100000000000000;
|
||||
}
|
||||
$qc_only_user=1;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
//Line 1349 admin_modify_lead.php
|
||||
# QC_admin_modify_lead_include.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by admin.php with QC enabled, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1332 - First build, added to vicidial codebase
|
||||
#
|
||||
######################
|
||||
# //Display link to QC if user has QC permissions
|
||||
######################
|
||||
require('QC_admin_include02.php');
|
||||
if ($qcuser_level > 0)
|
||||
{
|
||||
echo "<br><br><a href=\"./qc/qc_modify_lead.php?lead_id=$lead_id\">Click here to QC Modify this lead</a>\n";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
//line 65 admin.php
|
||||
# QC_admin_variables.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by admin.php with QC enabled, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1331 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
$qc_font = 'BLACK';
|
||||
$qc_color = '#E6E6E6';
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
//admin.php line 3160
|
||||
//##QC
|
||||
//require_once('qc/QC_admin_variables01.php');
|
||||
# QC_admin_variables01.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by admin.php with QC enabled, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1330 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
if ($ADD==100000000000000) {$hh='qc'; echo "Quality Control";}
|
||||
if ($ADD==881) {$hh='qc'; echo "Quality Control Campaign $campaign_id";}
|
||||
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
# qc_modify_lead.php modified from:
|
||||
//admin_modify_lead.php version 2.4
|
||||
#
|
||||
# ViciDial database administration modify lead in vicidial_list
|
||||
# QC_call_client_iframe.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to allow QC review and modification of leads, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1328 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
require("../dbconnect.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];}
|
||||
elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["title"])) {$title=$_GET["title"];}
|
||||
elseif (isset($_POST["title"])) {$title=$_POST["title"];}
|
||||
if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
|
||||
elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
|
||||
if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];}
|
||||
elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];}
|
||||
if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
|
||||
elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
|
||||
if (isset($_GET["lead_name"])) {$lead_name=$_GET["lead_name"];}
|
||||
elseif (isset($_POST["lead_name"])) {$lead_name=$_POST["lead_name"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];}
|
||||
elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
|
||||
elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
|
||||
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
|
||||
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
|
||||
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["extension"])) {$extension=$_GET["extension"];}
|
||||
elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];}
|
||||
if (isset($_GET["channel"])) {$channel=$_GET["channel"];}
|
||||
elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];}
|
||||
if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];}
|
||||
elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];}
|
||||
if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];}
|
||||
elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];}
|
||||
if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];}
|
||||
elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];}
|
||||
if (isset($_GET["address1"])) {$address1=$_GET["address1"];}
|
||||
elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];}
|
||||
if (isset($_GET["address2"])) {$address2=$_GET["address2"];}
|
||||
elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];}
|
||||
if (isset($_GET["address3"])) {$address3=$_GET["address3"];}
|
||||
elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];}
|
||||
if (isset($_GET["city"])) {$city=$_GET["city"];}
|
||||
elseif (isset($_POST["city"])) {$city=$_POST["city"];}
|
||||
if (isset($_GET["state"])) {$state=$_GET["state"];}
|
||||
elseif (isset($_POST["state"])) {$state=$_POST["state"];}
|
||||
if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
|
||||
elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
|
||||
if (isset($_GET["province"])) {$province=$_GET["province"];}
|
||||
elseif (isset($_POST["province"])) {$province=$_POST["province"];}
|
||||
if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
|
||||
elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
|
||||
if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
|
||||
elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
|
||||
if (isset($_GET["email"])) {$email=$_GET["email"];}
|
||||
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
|
||||
if (isset($_GET["security"])) {$security=$_GET["security"];}
|
||||
elseif (isset($_POST["security"])) {$security=$_POST["security"];}
|
||||
if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
|
||||
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["rank"])) {$rank=$_GET["rank"];}
|
||||
elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];}
|
||||
if (isset($_GET["owner"])) {$owner=$_GET["owner"];}
|
||||
elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];}
|
||||
elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];}
|
||||
if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];}
|
||||
elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];}
|
||||
if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];}
|
||||
elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];}
|
||||
if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];}
|
||||
elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];}
|
||||
if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];}
|
||||
elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];}
|
||||
if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];}
|
||||
elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];}
|
||||
if (isset($_GET["modify_logs"])) {$modify_logs=$_GET["modify_logs"];}
|
||||
elseif (isset($_POST["modify_logs"])) {$modify_logs=$_POST["modify_logs"];}
|
||||
if (isset($_GET["modify_closer_logs"])) {$modify_closer_logs=$_GET["modify_closer_logs"];}
|
||||
elseif (isset($_POST["modify_closer_logs"])) {$modify_closer_logs=$_POST["modify_closer_logs"];}
|
||||
if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent_logs"];}
|
||||
elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];}
|
||||
if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];}
|
||||
elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];}
|
||||
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"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,custom_fields_enabled 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];
|
||||
$custom_fields_enabled = $row[1];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$old_phone = ereg_replace("[^0-9]","",$old_phone);
|
||||
$phone_number = ereg_replace("[^0-9]","",$phone_number);
|
||||
$alt_phone = ereg_replace("[^0-9]","",$alt_phone);
|
||||
} # end of non_latin
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW);
|
||||
}
|
||||
|
||||
if (strlen($phone_number)<6) {$phone_number=$old_phone;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and qc_enabled = '1' and qc_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 ($WeBRooTWritablE > 0)
|
||||
{$fp = fopen ("../project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname =$row[0];
|
||||
$LOGmodify_leads =$row[1];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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 = 'Postal Code';
|
||||
$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';
|
||||
|
||||
### find any custom field labels
|
||||
$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];}
|
||||
include('QC_call_client_include.php');
|
||||
$qc_user_logged_in=is_user_logged_in($PHP_AUTH_USER);
|
||||
if ($qc_user_logged_in===true){
|
||||
echo "<A HREF=/vicidial/qc/qc_api.php?source=test&user=$PHP_AUTH_USER&pass=$PHP_AUTH_PW&agent_user=$PHP_AUTH_USER&function=external_dial_lead&value=$phone_number&phone_code=$phone_code&search=YES&preview=NO&focus=YES target='_SELF'>Call Lead</A>";
|
||||
} else {
|
||||
echo "$qc_user_logged_in";
|
||||
}
|
||||
echo " <A HREF=$PHP_SELF?lead_id=$lead_id&list_id=$CLlist_id&stage=DISPLAY&submit_button=YES&user=$PHP_AUTH_USER&pass=$PHP_AUTH_PW&bgcolor=E6E6E6>Refresh</A>";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 121116-1328 - First build, added to vicidial codebase
|
||||
#
|
||||
/* QC_call_client_include.php
|
||||
* Part of QC system by Poundteam.
|
||||
* Location: /vicidial/qc
|
||||
* Included in: qc_modify_lead.php
|
||||
* Purpose: Determine availability of "Call Lead" button and call the lead when button is pressed.
|
||||
* Also: display REASON if lead cannot be called by pressing button (to allow agent to resolve the reason without guessing)
|
||||
*/
|
||||
/* 1. Is logged in admin user also logged in as an agent?
|
||||
* If not: display admin user name followed by "not logged in as agent"
|
||||
* 2. Is logged in agent available to manual dial this prospect?
|
||||
* Requires pause or manual mode and campaign with this prospect available.
|
||||
* 3. If possible, log the agent in with NO permission to change data on the agent screen. Require changes ONLY on QC screen (except hangup button).
|
||||
*/
|
||||
|
||||
//Is logged in admin user also logged in as an agent?
|
||||
function is_user_logged_in($user){
|
||||
global $link;
|
||||
$stmt="select status from vicidial_live_agents where user='$user'";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$live_agent_count = mysql_num_rows($rslt);
|
||||
if($live_agent_count != '1'){
|
||||
if($live_agent_count == '0'){
|
||||
return "Cannot call prospect. You are not logged in as $user.";
|
||||
} else {
|
||||
return "Cannot call prospect. $live_agent_count agents logged in as $user.";
|
||||
}
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$status = $row[0];
|
||||
if($status!='PAUSED'){
|
||||
return "Status must be paused to call lead. $user is presently in $status status.";
|
||||
}
|
||||
//@TODO: check user is in the correct CAMPAIGN for this lead.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!-- QC NAVIGATION -->
|
||||
<?
|
||||
# QC_header_include.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to display header contents for QC, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1327 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
if (($SSqc_features_active=='1') && ($qc_auth=='1')) { ?>
|
||||
|
||||
<TR>
|
||||
<TD <?php echo $qc_hh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=100000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $qc_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $qc_bold ?> Quality Control </FONT></a>
|
||||
</TD>
|
||||
</TR>
|
||||
<?php
|
||||
if (strlen($qc_hh) > 1) {
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $qc_color ?>>
|
||||
<TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=100000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show QC Campaigns </FONT></a>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR=<?php echo $qc_color ?>>
|
||||
<TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=100000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Enter QC Queue </FONT></a>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR=<?php echo $qc_color ?>>
|
||||
<TD ALIGN=LEFT>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Modify QC Codes </FONT></a>
|
||||
</TD>
|
||||
</TR>
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
# QC_header_include01.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to display header contents for QC, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1326 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
if ($hh=='qc')
|
||||
{$qc_hh="bgcolor=\"$qc_color\""; $qc_fc="$qc_font"; $qc_bold="$header_selected_bold";}
|
||||
else {$qc_hh=''; $qc_fc='WHITE'; $qc_bold="$header_nonselected_bold";}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?PHP
|
||||
# QC_header_include02.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to display header contents for QC, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1325 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
if (($SSqc_features_active=='1') && ($qc_auth=='1')) {
|
||||
?>
|
||||
<TD> <A HREF="admin.php?ADD=100000000000000" ALT="Quality Control"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Quality Control</B></FONT></A> </TD>
|
||||
<?PHP
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
# QC_status_codes_include.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to display admin sections for QC functions, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1323 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
/*
|
||||
* include at line 26437 replacing existing section entirely
|
||||
//##QC
|
||||
//require_once('qc/QC_status_codes_include.php');
|
||||
*/
|
||||
######################
|
||||
# ADD=241111111111111 adds the new qc status code to the system
|
||||
######################
|
||||
//Moved to qc/QC_status_codes_include.php include file
|
||||
if ($ADD==241111111111111)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT count(*) from vicidial_qc_codes where code='$code';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{echo "<br>QC STATUS CODE NOT ADDED - there is already a qc status code in the system with this name: $row[0]\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($code) < 1) or (strlen($code_name) < 2) )
|
||||
{
|
||||
echo "<br>QC STATUS CODE NOT ADDED - Please go back and look at the data you entered\n";
|
||||
echo "<br>code must be between 1 and 8 characters in length\n";
|
||||
echo "<br>code name must be between 2 and 30 characters in length\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><B>QC STATUS CODE ADDED: $code_name - $code</B>\n";
|
||||
if (isset($_POST["qc_category"])) {$qc_category=$_POST["qc_category"];}
|
||||
|
||||
$stmt="INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) values('$code','$code_name','$qc_category');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||
$SQL_log = addslashes($SQL_log);
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='QCSTATUSES', event_type='ADD', record_id='$code', event_code='ADMIN ADD QC STATUS', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
}
|
||||
$ADD=341111111111111;
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# ADD=341111111111111 modify vicidial QC status code
|
||||
######################
|
||||
|
||||
if ($ADD==341111111111111)
|
||||
{
|
||||
if ( ($LOGmodify_servers==1) and ($SSqc_features_active > 0) )
|
||||
{
|
||||
if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) )
|
||||
{
|
||||
$modify_url = "$PHP_SELF?ADD=341111111111111";
|
||||
$modify_footer_refresh=1;
|
||||
}
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br><center>\n";
|
||||
echo "<b>VICIDIAL QC STATUS CODES WITHIN THIS SYSTEM: $NWB#vicidial_qc_status_codes$NWE</b><br>\n";
|
||||
echo "<TABLE width=600 cellspacing=3>\n";
|
||||
echo "<tr><td>STATUS CODE</td><td>DESCRIPTION</td><td>QC CATEGORY</td><td>MODIFY/DELETE</td></tr>\n";
|
||||
|
||||
##### go through each QC status code
|
||||
$stmt="SELECT count(*) from vicidial_qc_codes;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0] > 0)
|
||||
{
|
||||
$stmt="SELECT code,code_name,qc_result_type from vicidial_qc_codes order by code;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$o++;
|
||||
|
||||
if (eregi("1$|3$|5$|7$|9$", $o))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=441111111111111>\n";
|
||||
echo "<input type=hidden name=stage value=modify>\n";
|
||||
echo "<input type=hidden name=code value=\"$rowx[0]\">\n";
|
||||
echo "<font size=2><B>$rowx[0]</B></td>\n";
|
||||
echo "<td><input type=text name=code_name size=20 maxlength=30 value=\"$rowx[1]\"></td>\n";
|
||||
echo "<td><font size=2><B>$rowx[2]</B></td>\n";
|
||||
echo "<td align=center nowrap><font size=1><input type=submit name=submit value=MODIFY> \n";
|
||||
echo " \n";
|
||||
|
||||
if (preg_match("/^B$|^NA$|^DNC$|^NA$|^DROP$|^INCALL$|^QUEUE$|^NEW$/i",$rowx[0]))
|
||||
{
|
||||
echo "<DEL>DELETE</DEL>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?ADD=441111111111111&code=$rowx[0]&stage=delete\">DELETE</a>\n";
|
||||
}
|
||||
echo "</form></td></tr>\n";
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<br>ADD NEW QC STATUS CODE<BR><form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=241111111111111>\n";
|
||||
echo "Status: <input type=text name=code size=9 maxlength=8> \n";
|
||||
echo "Description: <input type=text name=code_name size=25 maxlength=30> \n";
|
||||
echo "QC Category: <select name=qc_category><option selected value=''>-Choose-</option><option value='PASS'>PASS</option><option value='FAIL'>FAIL</option><option value='CANCEL'>CANCEL</option><option value='COMMIT'>COMMIT</option><BR>\n";
|
||||
echo "<input type=submit name=submit value=ADD><BR>\n";
|
||||
|
||||
echo "</FORM><br>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "You do not have permission to view this page\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
# audit_comments.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used by the QC application, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1335 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
function audit_comments($lead_id,$list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log,$campaign) {
|
||||
$audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
|
||||
if ($audit_comments_active) {
|
||||
//Get comment from list
|
||||
$stmt="select comments from vicidial_list where lead_id='$lead_id' limit 1;";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments2',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (strlen($row[0]) > 0) {
|
||||
$comment=$row[0];
|
||||
//Put comment in comment table
|
||||
$stmt="INSERT INTO vicidial_comments (lead_id,user_id,list_id,campaign_id,comment) VALUES ('$lead_id','$user','$list_id','$campaign','$comment');";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments3',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$affected=mysql_affected_rows();
|
||||
if($affected>0) {
|
||||
$stmt="UPDATE vicidial_list set comments='' where lead_id='$lead_id';";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments4',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
} else {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditCommentsERROR-Comment not moved',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
echo "\n<!-- 00142-AuditCommentsERROR-Comment not moved -->";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log){
|
||||
$stmt="select count(audit_comments) from vicidial_lists_custom where list_id='$list_id' and audit_comments='1' limit 1;";
|
||||
if ($format=='debug') {
|
||||
echo "\n<!-- $stmt -->";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-AuditComments5',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] == '1') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log) {
|
||||
global $ACcount;
|
||||
global $ACcomments;
|
||||
$stmt="select user_id,comment from vicidial_comments where lead_id='$lead_id';";
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"00142-65-AuditComments:$stmt LeadID: $lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log",$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-69-AuditComments',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
}
|
||||
$ACcount=mysql_num_rows($rslt);
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-72-AuditComments $ACcount='.$ACcount,$user,$server_ip,$session_name,$one_mysql_log);
|
||||
if($ACcount>0) {
|
||||
$i=0;
|
||||
while ($i < $ACcount) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-77-AuditComments UserID='.$row[0],$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$ACcomments .= "UserID: $row[0]\n";
|
||||
mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142-79-AuditComments Comment='.$row[1],$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$ACcomments .= $row[1];
|
||||
$ACcomments .= "\n----------------------------------\n";
|
||||
$i++;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,627 @@
|
||||
<?php
|
||||
# qc_api.php
|
||||
#
|
||||
# Copyright (C) 2012 poundteam.com LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to allow API functions for QC applications, contributed by poundteam.com
|
||||
#
|
||||
# changes:
|
||||
# 121116-1329 - First build, added to vicidial codebase
|
||||
#
|
||||
|
||||
$version = '2.6-1';
|
||||
$build = '121116-1329';
|
||||
|
||||
require("../dbconnect.php");
|
||||
|
||||
$query_string = getenv("QUERY_STRING");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];}
|
||||
elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];}
|
||||
if (isset($_GET["function"])) {$function=$_GET["function"];}
|
||||
elseif (isset($_POST["function"])) {$function=$_POST["function"];}
|
||||
if (isset($_GET["value"])) {$value=$_GET["value"];}
|
||||
elseif (isset($_POST["value"])) {$value=$_POST["value"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["focus"])) {$focus=$_GET["focus"];}
|
||||
elseif (isset($_POST["focus"])) {$focus=$_POST["focus"];}
|
||||
if (isset($_GET["preview"])) {$preview=$_GET["preview"];}
|
||||
elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];}
|
||||
if (isset($_GET["notes"])) {$notes=$_GET["notes"];}
|
||||
elseif (isset($_POST["notes"])) {$notes=$_POST["notes"];}
|
||||
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
|
||||
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
|
||||
if (isset($_GET["search"])) {$search=$_GET["search"];}
|
||||
elseif (isset($_POST["search"])) {$search=$_POST["search"];}
|
||||
if (isset($_GET["group_alias"])) {$group_alias=$_GET["group_alias"];}
|
||||
elseif (isset($_POST["group_alias"])) {$group_alias=$_POST["group_alias"];}
|
||||
if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];}
|
||||
elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];}
|
||||
if (isset($_GET["source"])) {$source=$_GET["source"];}
|
||||
elseif (isset($_POST["source"])) {$source=$_POST["source"];}
|
||||
if (isset($_GET["format"])) {$format=$_GET["format"];}
|
||||
elseif (isset($_POST["format"])) {$format=$_POST["format"];}
|
||||
if (isset($_GET["vtiger_callback"])) {$vtiger_callback=$_GET["vtiger_callback"];}
|
||||
elseif (isset($_POST["vtiger_callback"])) {$vtiger_callback=$_POST["vtiger_callback"];}
|
||||
if (isset($_GET["blended"])) {$blended=$_GET["blended"];}
|
||||
elseif (isset($_POST["blended"])) {$blended=$_POST["blended"];}
|
||||
if (isset($_GET["ingroup_choices"])) {$ingroup_choices=$_GET["ingroup_choices"];}
|
||||
elseif (isset($_POST["ingroup_choices"])) {$ingroup_choices=$_POST["ingroup_choices"];}
|
||||
if (isset($_GET["set_as_default"])) {$set_as_default=$_GET["set_as_default"];}
|
||||
elseif (isset($_POST["set_as_default"])) {$set_as_default=$_POST["set_as_default"];}
|
||||
if (isset($_GET["alt_user"])) {$alt_user=$_GET["alt_user"];}
|
||||
elseif (isset($_POST["alt_user"])) {$alt_user=$_POST["alt_user"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];}
|
||||
elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];}
|
||||
if (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];}
|
||||
elseif (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];}
|
||||
if (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];}
|
||||
elseif (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];}
|
||||
if (isset($_GET["title"])) {$title=$_GET["title"];}
|
||||
elseif (isset($_POST["title"])) {$title=$_POST["title"];}
|
||||
if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
|
||||
elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
|
||||
if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];}
|
||||
elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];}
|
||||
if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
|
||||
elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
|
||||
if (isset($_GET["address1"])) {$address1=$_GET["address1"];}
|
||||
elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];}
|
||||
if (isset($_GET["address2"])) {$address2=$_GET["address2"];}
|
||||
elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];}
|
||||
if (isset($_GET["address3"])) {$address3=$_GET["address3"];}
|
||||
elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];}
|
||||
if (isset($_GET["city"])) {$city=$_GET["city"];}
|
||||
elseif (isset($_POST["city"])) {$city=$_POST["city"];}
|
||||
if (isset($_GET["state"])) {$state=$_GET["state"];}
|
||||
elseif (isset($_POST["state"])) {$state=$_POST["state"];}
|
||||
if (isset($_GET["province"])) {$province=$_GET["province"];}
|
||||
elseif (isset($_POST["province"])) {$province=$_POST["province"];}
|
||||
if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
|
||||
elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
|
||||
if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
|
||||
elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
|
||||
if (isset($_GET["gender"])) {$gender=$_GET["gender"];}
|
||||
elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];}
|
||||
if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];}
|
||||
elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];}
|
||||
if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
|
||||
elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
|
||||
if (isset($_GET["email"])) {$email=$_GET["email"];}
|
||||
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
|
||||
if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];}
|
||||
elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];}
|
||||
if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
|
||||
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
|
||||
if (isset($_GET["rank"])) {$rank=$_GET["rank"];}
|
||||
elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];}
|
||||
if (isset($_GET["owner"])) {$owner=$_GET["owner"];}
|
||||
elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||
if (isset($_GET["close_window_link"])) {$close_window_link=$_GET["close_window_link"];}
|
||||
elseif (isset($_POST["close_window_link"])) {$close_window_link=$_POST["close_window_link"];}
|
||||
if (isset($_GET["dnc_check"])) {$dnc_check=$_GET["dnc_check"];}
|
||||
elseif (isset($_POST["dnc_check"])) {$dnc_check=$_POST["dnc_check"];}
|
||||
if (isset($_GET["campaign_dnc_check"])) {$campaign_dnc_check=$_GET["campaign_dnc_check"];}
|
||||
elseif (isset($_POST["campaign_dnc_check"])) {$campaign_dnc_check=$_POST["campaign_dnc_check"];}
|
||||
if (isset($_GET["dial_override"])) {$dial_override=$_GET["dial_override"];}
|
||||
elseif (isset($_POST["dial_override"])) {$dial_override=$_POST["dial_override"];}
|
||||
if (isset($_GET["consultative"])) {$consultative=$_GET["consultative"];}
|
||||
elseif (isset($_POST["consultative"])) {$consultative=$_POST["consultative"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
|
||||
|
||||
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
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin 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];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$ingroup_choices = ereg_replace("\+"," ",$ingroup_choices);
|
||||
$query_string = ereg_replace("'|\"|\\\\|;","",$query_string);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
|
||||
$agent_user=ereg_replace("[^0-9a-zA-Z]","",$agent_user);
|
||||
$function = ereg_replace("[^-\_0-9a-zA-Z]","",$function);
|
||||
$value = ereg_replace("[^-\_0-9a-zA-Z]","",$value);
|
||||
$vendor_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vendor_id);
|
||||
$focus = ereg_replace("[^-\_0-9a-zA-Z]","",$focus);
|
||||
$preview = ereg_replace("[^-\_0-9a-zA-Z]","",$preview);
|
||||
$notes = ereg_replace("\+"," ",$notes);
|
||||
$notes = ereg_replace("[^ -\.\_0-9a-zA-Z]","",$notes);
|
||||
$phone_code = ereg_replace("[^0-9X]","",$phone_code);
|
||||
$search = ereg_replace("[^-\_0-9a-zA-Z]","",$search);
|
||||
$group_alias = ereg_replace("[^0-9a-zA-Z]","",$group_alias);
|
||||
$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix);
|
||||
$source = ereg_replace("[^0-9a-zA-Z]","",$source);
|
||||
$format = ereg_replace("[^0-9a-zA-Z]","",$format);
|
||||
$vtiger_callback = ereg_replace("[^A-Z]","",$vtiger_callback);
|
||||
$blended = ereg_replace("[^A-Z]","",$blended);
|
||||
$ingroup_choices = ereg_replace("[^ -\_0-9a-zA-Z]","",$ingroup_choices);
|
||||
$set_as_default = ereg_replace("[^A-Z]","",$set_as_default);
|
||||
$phone_number = ereg_replace("[^0-9]","",$phone_number);
|
||||
$address1 = ereg_replace("[^ -\_0-9a-zA-Z]","",$address1);
|
||||
$address2 = ereg_replace("[^ -\_0-9a-zA-Z]","",$address2);
|
||||
$address3 = ereg_replace("[^ -\_0-9a-zA-Z]","",$address3);
|
||||
$alt_phone = ereg_replace("[^ -\_0-9a-zA-Z]","",$alt_phone);
|
||||
$city = ereg_replace("[^ -\_0-9a-zA-Z]","",$city);
|
||||
$comments = ereg_replace("[^ -\_0-9a-zA-Z]","",$comments);
|
||||
$country_code = ereg_replace("[^A-Z]","",$country_code);
|
||||
$date_of_birth = ereg_replace("[^ -\_0-9]","",$date_of_birth);
|
||||
$email = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$email);
|
||||
$first_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$first_name);
|
||||
$gender = ereg_replace("[^A-Z]","",$gender);
|
||||
$gmt_offset_now = ereg_replace("[^ \.-\_0-9]","",$gmt_offset_now);
|
||||
$last_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$last_name);
|
||||
$lead_id = ereg_replace("[^0-9]","",$lead_id);
|
||||
$middle_initial = ereg_replace("[^ -\_0-9a-zA-Z]","",$middle_initial);
|
||||
$province = ereg_replace("[^ -\.\_0-9a-zA-Z]","",$province);
|
||||
$security_phrase = ereg_replace("[^ -\.\_0-9a-zA-Z]","",$security_phrase);
|
||||
$source_id = ereg_replace("[^ -\.\_0-9a-zA-Z]","",$source_id);
|
||||
$state = ereg_replace("[^ -\_0-9a-zA-Z]","",$state);
|
||||
$title = ereg_replace("[^ -\_0-9a-zA-Z]","",$title);
|
||||
$vendor_lead_code = ereg_replace("[^ -\.\_0-9a-zA-Z]","",$vendor_lead_code);
|
||||
$rank = ereg_replace("[^-0-9]","",$rank);
|
||||
$owner = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$owner);
|
||||
$dial_override = ereg_replace("[^A-Z]","",$dial_override);
|
||||
$consultative = ereg_replace("[^A-Z]","",$consultative);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = ereg_replace("'|\"|\\\\|;","",$user);
|
||||
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
|
||||
$source = ereg_replace("'|\"|\\\\|;","",$source);
|
||||
$agent_user = ereg_replace("'|\"|\\\\|;","",$agent_user);
|
||||
$alt_user = ereg_replace("'|\"|\\\\|;","",$alt_user);
|
||||
}
|
||||
|
||||
### date and fixed variables
|
||||
$epoch = date("U");
|
||||
$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]='';
|
||||
$api_script = 'agent';
|
||||
$api_logging = 1;
|
||||
if ($consultative != 'YES') {$consultative='NO';}
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - version - show version and date information for the API
|
||||
################################################################################
|
||||
if ($function == 'version')
|
||||
{
|
||||
$data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime";
|
||||
$result = 'SUCCESS';
|
||||
echo "$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
################################################################################
|
||||
### END - version
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - user validation section (most functions run through this first)
|
||||
################################################################################
|
||||
|
||||
if ($ACTION == 'LogiNCamPaigns')
|
||||
{
|
||||
$skip_user_validation=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strlen($source)<2)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "Invalid Source";
|
||||
echo "$result: $result_reason - $source\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access = '1';";
|
||||
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))
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "Invalid Username/Password";
|
||||
echo "$result: $result_reason: |$user|$pass|$auth|\n";
|
||||
$data = "$user|$pass|$auth";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT count(*) from system_settings where vdc_agent_api_active='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "System API NOT ACTIVE";
|
||||
echo "$result: $result_reason\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
# do nothing for now
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$DB=1;
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $build USER: $user\n";
|
||||
echo "<title>VICIDiaL Agent API";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
################################################################################
|
||||
### END - user validation section
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### BEGIN - external_dial_lead - manual dial a specific Lead
|
||||
################################################################################
|
||||
if ($function == 'external_dial_lead')
|
||||
{
|
||||
$value = ereg_replace("[^0-9]","",$value);
|
||||
|
||||
if ( (strlen($value)<1) or ( (strlen($agent_user)<2) and (strlen($alt_user)<2) ) or (strlen($search)<2) or (strlen($preview)<2) or (strlen($focus)<2) )
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "external_dial not valid";
|
||||
$data = "$phone_code|$search|$preview|$focus";
|
||||
echo "$result: $result_reason - $value|$data|$agent_user|$alt_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($alt_user)>1)
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_user = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "no user found";
|
||||
echo "$result: $result_reason - $alt_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "SELECT campaign_id FROM vicidial_live_agents where user='$agent_user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vlac_conf_ct = mysql_num_rows($rslt);
|
||||
if ($vlac_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vac_campaign_id = $row[0];
|
||||
}
|
||||
$stmt = "SELECT api_manual_dial FROM vicidial_campaigns where campaign_id='$vac_campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vcc_conf_ct = mysql_num_rows($rslt);
|
||||
if ($vcc_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$api_manual_dial = $row[0];
|
||||
}
|
||||
|
||||
if ($api_manual_dial=='STANDARD')
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user' and status='PAUSED' and lead_id < 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_ready = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$agent_ready=1;
|
||||
}
|
||||
if ($agent_ready > 0)
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_users where user='$agent_user' and agentcall_manual='1';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
if (strlen($group_alias)>1)
|
||||
{
|
||||
$stmt = "select caller_id_number from groups_alias where group_alias_id='$group_alias';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$VDIG_cidnum_ct = mysql_num_rows($rslt);
|
||||
if ($VDIG_cidnum_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$caller_id_number = $row[0];
|
||||
if ($caller_id_number < 4)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "caller_id_number from group_alias is not valid";
|
||||
$data = "$group_alias|$caller_id_number";
|
||||
echo "$result: $result_reason - $agent_user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "group_alias is not valid";
|
||||
$data = "$group_alias";
|
||||
echo "$result: $result_reason - $agent_user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
####### Begin Vtiger CallBack Launching #######
|
||||
$vtiger_callback_id='';
|
||||
if ( (eregi("YES",$vtiger_callback)) and (preg_match("/^99/",$value)) )
|
||||
{
|
||||
$value = preg_replace("/^99/",'',$value);
|
||||
$value = ($value + 0);
|
||||
|
||||
$stmt = "SELECT enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$ss_conf_ct = mysql_num_rows($rslt);
|
||||
if ($ss_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$enable_vtiger_integration = $row[0];
|
||||
$vtiger_server_ip = $row[1];
|
||||
$vtiger_dbname = $row[2];
|
||||
$vtiger_login = $row[3];
|
||||
$vtiger_pass = $row[4];
|
||||
$vtiger_url = $row[5];
|
||||
}
|
||||
|
||||
if ($enable_vtiger_integration > 0)
|
||||
{
|
||||
$stmt = "SELECT campaign_id FROM vicidial_live_agents where user='$agent_user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vtc_camp_ct = mysql_num_rows($rslt);
|
||||
if ($vtc_camp_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$campaign_id = $row[0];
|
||||
}
|
||||
$stmt = "SELECT vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_search_dead,vtiger_status_call FROM vicidial_campaigns where campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$vtc_conf_ct = mysql_num_rows($rslt);
|
||||
if ($vtc_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vtiger_search_category = $row[0];
|
||||
$vtiger_create_call_record = $row[1];
|
||||
$vtiger_create_lead_record = $row[2];
|
||||
$vtiger_search_dead = $row[3];
|
||||
$vtiger_status_call = $row[4];
|
||||
}
|
||||
|
||||
### connect to your vtiger database
|
||||
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
|
||||
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
|
||||
mysql_select_db("$vtiger_dbname", $linkV);
|
||||
|
||||
# make sure the ID is present in Vtiger database as an account
|
||||
$stmt="SELECT count(*) from vtiger_seactivityrel where activityid='$value';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkV);
|
||||
$vt_act_ct = mysql_num_rows($rslt);
|
||||
if ($vt_act_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$activity_check = $row[0];
|
||||
}
|
||||
if ($activity_check > 0)
|
||||
{
|
||||
$stmt="SELECT crmid from vtiger_seactivityrel where activityid='$value';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkV);
|
||||
$vt_actsel_ct = mysql_num_rows($rslt);
|
||||
if ($vt_actsel_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vendor_id = $row[0];
|
||||
}
|
||||
if (strlen($vendor_id) > 0)
|
||||
{
|
||||
$stmt="SELECT phone from vtiger_account where accountid='$vendor_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkV);
|
||||
$vt_acct_ct = mysql_num_rows($rslt);
|
||||
if ($vt_acct_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vtiger_callback_id="$value";
|
||||
$value = $row[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "vtiger callback activity does not exist in vtiger system";
|
||||
echo "$result: $result_reason - $value\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
####### End Vtiger CallBack Launching #######
|
||||
|
||||
$success=0;
|
||||
### If no errors, run the update to place the call ###
|
||||
if ($api_manual_dial=='STANDARD')
|
||||
{
|
||||
$stmt="UPDATE vicidial_live_agents set external_dial='$value!$phone_code!$search!$preview!$focus!$vendor_id!$epoch!$dial_prefix!$group_alias!$caller_id_number!$vtiger_callback_id' where user='$agent_user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$success=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_manual_dial_queue where user='$agent_user' and phone_number='$value';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] < 1)
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_manual_dial_queue set user='$agent_user',phone_number='$value',entry_time=NOW(),status='READY',external_dial='$value!$phone_code!$search!$preview!$focus!$vendor_id!$epoch!$dial_prefix!$group_alias!$caller_id_number!$vtiger_callback_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$success=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "phone_number is already in this agents manual dial queue";
|
||||
echo "$result: $result_reason - $agent_user|$value\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
if ($success > 0)
|
||||
{
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$result = 'SUCCESS';
|
||||
$result_reason = "external_dial function set";
|
||||
$data = "$phone_code|$search|$preview|$focus|$vendor_id|$epoch|$dial_prefix|$group_alias|$caller_id_number";
|
||||
echo "$result: Dispo in Agent Screen FIRST.\n";
|
||||
// echo "$result: $result_reason - $value|$agent_user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "agent_user is not allowed to place manual dial calls";
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "agent_user is not paused";
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "agent_user is not logged in";
|
||||
echo "$result: $result_reason - $agent_user\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// external_dial
|
||||
################################################################################
|
||||
### END - external_dial
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $StarTtime);
|
||||
echo "\n<!-- script runtime: $RUNtime seconds -->";
|
||||
echo "\n</body>\n</html>\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
##### FUNCTIONS #####
|
||||
|
||||
##### Logging #####
|
||||
function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data)
|
||||
{
|
||||
if ($api_logging > 0)
|
||||
{
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user