diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE
index 70f9ae68..be6768d3 100644
--- a/agc_2-X/trunk/UPGRADE
+++ b/agc_2-X/trunk/UPGRADE
@@ -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.
+
diff --git a/agc_2-X/trunk/docs/QC_PROCESS.txt b/agc_2-X/trunk/docs/QC_PROCESS.txt
index f53f14ef..66f7772f 100644
--- a/agc_2-X/trunk/docs/QC_PROCESS.txt
+++ b/agc_2-X/trunk/docs/QC_PROCESS.txt
@@ -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 **
diff --git a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt
index a2dd7323..a0838fdf 100644
--- a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt
+++ b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt
@@ -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
diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
index 21466cb7..cd0d04ea 100644
--- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
+++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql
@@ -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();
diff --git a/agc_2-X/trunk/extras/upgrade_2.6.sql b/agc_2-X/trunk/extras/upgrade_2.6.sql
index 6daa345e..5f1a3a65 100644
--- a/agc_2-X/trunk/extras/upgrade_2.6.sql
+++ b/agc_2-X/trunk/extras/upgrade_2.6.sql
@@ -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;
diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
index d81b56f6..4f991b3b 100644
--- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
+++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
@@ -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
diff --git a/agc_2-X/trunk/www/agc/audit_comments.php b/agc_2-X/trunk/www/agc/audit_comments.php
new file mode 100644
index 00000000..141ef589
--- /dev/null
+++ b/agc_2-X/trunk/www/agc/audit_comments.php
@@ -0,0 +1,98 @@
+";
+ }
+ $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";
+ }
+ $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";
+ }
+ $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";
+ }
+ }
+ }
+}
+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";
+ }
+ $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;
+ }
+}
+?>
diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php
index 372adac8..6e493cf9 100644
--- a/agc_2-X/trunk/www/agc/vdc_db_query.php
+++ b/agc_2-X/trunk/www/agc/vdc_db_query.php
@@ -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";}
$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);
diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php
index a3efd9fe..ca81c28f 100644
--- a/agc_2-X/trunk/www/agc/vicidial.php
+++ b/agc_2-X/trunk/www/agc/vicidial.php
@@ -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='';
var deactivated_old_session='';
var owner_populate='';
+ var qc_enabled='';
var DiaLControl_auto_HTML = "
";
var DiaLControl_auto_HTML_ready = "
";
var DiaLControl_auto_HTML_OFF = "
";
@@ -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 = "Manual Queue is Off
";}
+ 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 = "";
+ }
+ else
+ {
+ hideDiv('ViewCommentsBox');
+ //view_comments_active = 0;
+ document.getElementById("viewcommentsdisplay").innerHTML = "";
+ 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:
| View Comment History: | +
| + |