Added Fronter - Closer Detail Report

Fixed admin logging bug
Added lead_age option to dispo_move_list.php

git-svn-id: svn://192.168.202.10@2599 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-10-21 17:35:33 +00:00
parent 4c74dd2734
commit f309fb9971
4 changed files with 1520 additions and 32 deletions
+2
View File
@@ -297,6 +297,8 @@ OTHER CHANGES:
82. Added List Merge admin utility
83. Added Fronter - Closer Detail Report
+72 -20
View File
@@ -31,6 +31,7 @@
# - exclude_status - (Y,N) if set to Y, will trigger for all statuses EXCEPT for those listed in sale_status, default is N
# - talk_time_trigger - (0,1,2,3,...) if set to number greater than 0, will only trigger for talk_time at or above set number, default is 0
# - called_count_trigger - (1,2,3,...) if set to number greater than 0, will only trigger for called_count at or above set number, default is 0
# - lead_age - (1,2,3,...) if set to number greater than 0, will only trigger for a lead entry_date this number of days old or older, default is 0
# - new_list_id - (999,etc...) the list_id that you want the matching status leads to be moved to
# - reset_dialed - (Y,N) if set to Y, will reset the called_since_last_reset flag on the lead
# - populate_sp_old_list - (Y,N) if set to Y, will populate the security_phrase field of the lead with the old list_id
@@ -53,6 +54,7 @@
# 160309-1239 - Added talk_time_trigger and exclude_status options
# 160801-1032 - Added called_count_trigger options
# 160910-1354 - Added populate_... options
# 161021-1016 - Added lead_age option
#
$api_script = 'movelist';
@@ -102,6 +104,10 @@ if (isset($_GET["populate_sp_old_list"])) {$populate_sp_old_list=$_GET["popula
elseif (isset($_POST["populate_sp_old_list"])) {$populate_sp_old_list=$_POST["populate_sp_old_list"];}
if (isset($_GET["populate_comm_old_date"])) {$populate_comm_old_date=$_GET["populate_comm_old_date"];}
elseif (isset($_POST["populate_comm_old_date"])) {$populate_comm_old_date=$_POST["populate_comm_old_date"];}
if (isset($_GET["lead_age"])) {$lead_age=$_GET["lead_age"];}
elseif (isset($_POST["lead_age"])) {$lead_age=$_POST["lead_age"];}
if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];}
elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];}
#$DB = '1'; # DEBUG override
@@ -113,10 +119,12 @@ $sale_status = "$TD$sale_status$TD";
$search_value='';
$match_found=0;
$primary_match_found=0;
$age_trigger=0;
$k=0;
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
$lead_age = preg_replace('/[^_0-9]/', '', $lead_age);
#############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
@@ -152,14 +160,34 @@ if ($non_latin < 1)
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
}
if ($DB>0) {echo "$lead_id|$search_field|$campaign_check|$sale_status|$dispo|$new_status|$user|$pass|$DB|$log_to_file|$talk_time|$talk_time_trigger|$exclude_status|$called_count|$called_count_trigger|\n";}
if ( ( (strlen($called_count_trigger)>0) and ($called_count >= $called_count_trigger) ) or (strlen($called_count_trigger)<1) or ($called_count_trigger < 1) )
if ($lead_age > 0)
{
if ( ( (strlen($talk_time_trigger)>0) and ($talk_time >= $talk_time_trigger) ) or (strlen($talk_time_trigger)<1) or ($talk_time_trigger < 1) )
if (strlen($entry_date) < 10)
{if ($DB>0) {echo "Entry date not set: |$entry_date|\n";}}
else
{
if ( ( (preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status!='Y') ) or ( (!preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status=='Y') ) )
{$primary_match_found=1;}
$entry_date_time = explode(' ',$entry_date);
$entry_YYYYMMDD = explode('-',$entry_date_time[0]);
$entry_HHMMSS = explode(':',$entry_date_time[1]);
$entry_epoch = mktime($entry_YYYYMMDD[0], $entry_YYYYMMDD[1], $entry_YYYYMMDD[2], $entry_YYYYMMDD[1], $entry_YYYYMMDD[2]-1, $entry_YYYYMMDD[0]);
$entry_age = (($STARTtime - $entry_epoch) / 86400);
if ($lead_age < $entry_age)
{$age_trigger=1;}
if ($DB>0) {echo "Lead age debug: |$entry_date|$lead_age|$entry_age|$entry_YYYYMMDD[0]|$entry_YYYYMMDD[1]|$entry_YYYYMMDD[2]|$entry_HHMMSS[0]|$entry_HHMMSS[1]|$entry_HHMMSS[2]|($entry_epoch <> $STARTtime)|\n";}
}
}
if ($DB>0) {echo "$lead_id|$search_field|$campaign_check|$sale_status|$dispo|$new_status|$user|$pass|$DB|$log_to_file|$talk_time|$talk_time_trigger|$exclude_status|$called_count|$called_count_trigger|$lead_age|$age_trigger|\n";}
if ( ( ($lead_age > 0) and ($age_trigger > 0) ) or ($lead_age < 1) or (strlen($lead_age) < 1) )
{
if ( ( (strlen($called_count_trigger)>0) and ($called_count >= $called_count_trigger) ) or (strlen($called_count_trigger)<1) or ($called_count_trigger < 1) )
{
if ( ( (strlen($talk_time_trigger)>0) and ($talk_time >= $talk_time_trigger) ) or (strlen($talk_time_trigger)<1) or ($talk_time_trigger < 1) )
{
if ( ( (preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status!='Y') ) or ( (!preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status=='Y') ) )
{$primary_match_found=1;}
}
}
}
$first_pass_vars = "$new_list_id|$reset_dialed|$sale_status|$talk_time_trigger|$exclude_status$called_count_trigger|";
@@ -180,38 +208,62 @@ else
$exclude_status='';
$talk_time_trigger='';
$called_count_trigger='';
$lead_age=0;
$statusfield = "sale_status_$k";
$excludefield = "exclude_status_$k";
$talktriggerfield = "talk_time_trigger_$k";
$counttriggerfield = "called_count_trigger_$k";
$agetriggerfield = "lead_age_$k";
if (isset($_GET["$excludefield"])) {$exclude_status=$_GET["$excludefield"];}
elseif (isset($_POST["$excludefield"])) {$exclude_status=$_POST["$excludefield"];}
if (isset($_GET["$talktriggerfield"])) {$talk_time_trigger=$_GET["$talktriggerfield"];}
elseif (isset($_POST["$talktriggerfield"])) {$talk_time_trigger=$_POST["$talktriggerfield"];}
if (isset($_GET["$counttriggerfield"])) {$called_count_trigger=$_GET["$counttriggerfield"];}
elseif (isset($_POST["$counttriggerfield"])) {$called_count_trigger=$_POST["$counttriggerfield"];}
if (isset($_GET["$agetriggerfield"])) {$lead_age=$_GET["$agetriggerfield"];}
elseif (isset($_POST["$agetriggerfield"])) {$lead_age=$_POST["$agetriggerfield"];}
if (isset($_GET["$statusfield"])) {$sale_status=$_GET["$statusfield"];}
elseif (isset($_POST["$statusfield"])) {$sale_status=$_POST["$statusfield"];}
$sale_status = "$TD$sale_status$TD";
if ($DB) {echo _QXZ("MULTI_MATCH CHECK:")." $k|$sale_status|$statusfield|$exclude_status|$excludefield|$talk_time_trigger|$talktriggerfield|$called_count_trigger|$counttriggerfield|\n";}
if ( ( (strlen($called_count_trigger)>0) and ($called_count >= $called_count_trigger) ) or (strlen($called_count_trigger)<1) or ($called_count_trigger < 1) )
if ($lead_age > 0)
{
if ( ( (strlen($talk_time_trigger)>0) and ($talk_time >= $talk_time_trigger) ) or (strlen($talk_time_trigger)<1) or ($talk_time_trigger < 1) )
if (strlen($entry_date) < 10)
{if ($DB>0) {echo "Entry date not set: |$entry_date|\n";}}
else
{
if (strlen($sale_status)>0)
$entry_date_time = explode(' ',$entry_date);
$entry_YYYYMMDD = explode('-',$entry_date_time[0]);
$entry_HHMMSS = explode(':',$entry_date_time[1]);
$entry_epoch = mktime($entry_YYYYMMDD[0], $entry_YYYYMMDD[1], $entry_YYYYMMDD[2], $entry_YYYYMMDD[1], $entry_YYYYMMDD[2]-1, $entry_YYYYMMDD[0]);
$entry_age = (($STARTtime - $entry_epoch) / 86400);
if ($lead_age < $entry_age)
{$age_trigger=1;}
if ($DB>0) {echo "Lead age debug: |$entry_date|$lead_age|$entry_age|$entry_YYYYMMDD[0]|$entry_YYYYMMDD[1]|$entry_YYYYMMDD[2]|$entry_HHMMSS[0]|$entry_HHMMSS[1]|$entry_HHMMSS[2]|($entry_epoch <> $STARTtime)|\n";}
}
}
if ($DB) {echo _QXZ("MULTI_MATCH CHECK:")." $k|$sale_status|$statusfield|$exclude_status|$excludefield|$talk_time_trigger|$talktriggerfield|$called_count_trigger|$counttriggerfield|$lead_age|$agetriggerfield|\n";}
if ( ( ($lead_age > 0) and ($age_trigger > 0) ) or ($lead_age < 1) or (strlen($lead_age) < 1) )
{
if ( ( (strlen($called_count_trigger)>0) and ($called_count >= $called_count_trigger) ) or (strlen($called_count_trigger)<1) or ($called_count_trigger < 1) )
{
if ( ( (strlen($talk_time_trigger)>0) and ($talk_time >= $talk_time_trigger) ) or (strlen($talk_time_trigger)<1) or ($talk_time_trigger < 1) )
{
if ( ( (preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status!='Y') ) or ( (!preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status=='Y') ) )
if (strlen($sale_status)>0)
{
$match_found=1;
$newlistfield = "new_list_id_$k";
$resetfield = "reset_dialed_$k";
if (isset($_GET["$newlistfield"])) {$new_list_id=$_GET["$newlistfield"];}
elseif (isset($_POST["$newlistfield"])) {$new_list_id=$_POST["$newlistfield"];}
if (isset($_GET["$resetfield"])) {$reset_dialed=$_GET["$resetfield"];}
elseif (isset($_POST["$resetfield"])) {$reset_dialed=$_POST["$resetfield"];}
if ($DB) {echo _QXZ("MULTI_MATCH:")." $k|$sale_status|$new_list_id|$reset_dialed|$exclude_status|$talk_time_trigger|$called_count_trigger|\n";}
if ( ( (preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status!='Y') ) or ( (!preg_match("/$TD$dispo$TD/",$sale_status)) and ($exclude_status=='Y') ) )
{
$match_found=1;
$newlistfield = "new_list_id_$k";
$resetfield = "reset_dialed_$k";
if (isset($_GET["$newlistfield"])) {$new_list_id=$_GET["$newlistfield"];}
elseif (isset($_POST["$newlistfield"])) {$new_list_id=$_POST["$newlistfield"];}
if (isset($_GET["$resetfield"])) {$reset_dialed=$_GET["$resetfield"];}
elseif (isset($_POST["$resetfield"])) {$reset_dialed=$_POST["$resetfield"];}
if ($DB) {echo _QXZ("MULTI_MATCH:")." $k|$sale_status|$new_list_id|$reset_dialed|$exclude_status|$talk_time_trigger|$called_count_trigger|\n";}
}
}
}
}
+15 -12
View File
@@ -118,9 +118,9 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
$QUERY_STRING = getenv("QUERY_STRING");
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report';
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report';
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report';
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report';
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
@@ -3871,12 +3871,13 @@ else
# 160827-0917 - Added the User Group Hourly Report
# 161014-0902 - Added List Merge utility and User List NEW Lead Limit options
# 161018-2249 - Added allow_required_fields campaign option
# 161021-1320 - Added Fronter - Closer Detail Report, Fixed admin logging bug
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
$admin_version = '2.12-567a';
$build = '161018-2249';
$admin_version = '2.12-568a';
$build = '161021-1320';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -15476,24 +15477,24 @@ if ($ADD==471111111111)
{
if ( ($voicemail_greeting == '') and (strlen($old_voicemail_greeting) > 0) )
{$voicemail_greeting = '---DELETE---';}
$stmt="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options',user_group='$user_group',voicemail_greeting='$voicemail_greeting',on_login_report='$show_vm_on_summary' where voicemail_id='$voicemail_id';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "|$stmt|";}
$stmtA="UPDATE vicidial_voicemail set fullname='$fullname',active='$active',pass='$pass',email='$email',delete_vm_after_email='$delete_vm_after_email',voicemail_timezone='$voicemail_timezone',voicemail_options='$voicemail_options',user_group='$user_group',voicemail_greeting='$voicemail_greeting',on_login_report='$show_vm_on_summary' where voicemail_id='$voicemail_id';";
$rslt=mysql_to_mysqli($stmtA, $link);
if ($DB) {echo "|$stmtA|";}
$stmt="SELECT active_voicemail_server from system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
$stmtB="SELECT active_voicemail_server from system_settings;";
$rslt=mysql_to_mysqli($stmtB, $link);
$row=mysqli_fetch_row($rslt);
$active_voicemail_server = $row[0];
$sounds_updateSQL='';
if ($SSallow_voicemail_greeting > 0) {$sounds_updateSQL = ",sounds_update='Y'";}
$stmtA="UPDATE servers SET rebuild_conf_files='Y'$sounds_updateSQL where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';";
$rslt=mysql_to_mysqli($stmtA, $link);
$stmtC="UPDATE servers SET rebuild_conf_files='Y'$sounds_updateSQL where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$active_voicemail_server';";
$rslt=mysql_to_mysqli($stmtC, $link);
echo "<br>"._QXZ("VOICEMAIL BOX MODIFIED").": $voicemail_id\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|";
$SQL_log = "$stmtA|$stmtB|$stmtC|";
$SQL_log = preg_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='VOICEMAIL', event_type='MODIFY', record_id='$voicemail_id', event_code='ADMIN MODIFY VOICEMAIL', event_sql=\"$SQL_log\", event_notes='';";
@@ -36591,6 +36592,8 @@ if ($ADD==999999)
}
if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"fcstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK size=2>"._QXZ("Fronter - Closer Report")."</a></FONT>\n";}
if ( (preg_match("/Fronter - Closer Detail Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo " - <a href=\"fcstats_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK size=2>"._QXZ("Detail")."</a></FONT>\n";}
if ( (preg_match("/Lists Pass Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_LISTS_pass_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK size=2>"._QXZ("Lists Pass Report")."</a></FONT>\n";}
if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
File diff suppressed because it is too large Load Diff