Added admin Automated Reports section, allowing easier web configuration of scheduled reports being sent by Email or FTP.
git-svn-id: svn://192.168.202.10@2695 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -112,6 +112,9 @@ OTHER CHANGES:
|
||||
the following custom field types:
|
||||
TEXT, AREA, DATE, SELECT, MULTI, RADIO, CHECKBOX
|
||||
|
||||
19. Added admin Automated Reports section, allowing easier web configuration of
|
||||
scheduled reports being sent by Email or FTP.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -114,9 +114,10 @@
|
||||
# 161116-0658 - Added purge of vicidial_ajax_log records older than 7 days to end of day process
|
||||
# 161226-2218 - Added conf_qualify option
|
||||
# 170113-1645 - Added call menu in-group option DYNAMIC_INGROUP_VAR for use with cm_phonesearch.agi
|
||||
# 170304-2039 - Added automated reports triggering code
|
||||
#
|
||||
|
||||
$build = '170113-1645';
|
||||
$build = '170304-2039';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
$teodDB=0; # flag to log Timeclock End of Day processes to log file
|
||||
@@ -822,7 +823,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
|
||||
|
||||
##### Get the settings from system_settings #####
|
||||
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats FROM system_settings;";
|
||||
$stmtA = "SELECT sounds_central_control_active,active_voicemail_server,custom_dialplan_entry,default_codecs,generate_cross_server_exten,voicemail_timezones,default_voicemail_timezone,call_menu_qualify_enabled,allow_voicemail_greeting,reload_timestamp,meetme_enter_login_filename,meetme_enter_leave3way_filename,allow_chats,enable_auto_reports FROM system_settings;";
|
||||
# print "$stmtA\n";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -843,6 +844,7 @@ if ($sthArows > 0)
|
||||
$meetme_enter_login_filename = $aryA[10];
|
||||
$meetme_enter_leave3way_filename = $aryA[11];
|
||||
$SSallow_chats = $aryA[12];
|
||||
$SSenable_auto_reports = $aryA[13];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DBXXX > 0) {print "SYSTEM SETTINGS: $sounds_central_control_active|$active_voicemail_server|$SScustom_dialplan_entry|$SSdefault_codecs\n";}
|
||||
@@ -3941,6 +3943,55 @@ if ($sthBrows > 0)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
##### BEGIN automated reports
|
||||
################################################################################
|
||||
if ($SSenable_auto_reports > 0)
|
||||
{
|
||||
$THISserver_voicemailSQL='';
|
||||
if ($THISserver_voicemail > 0) {$THISserver_voicemailSQL=",'active_voicemail_server'";}
|
||||
$stmtA = "SELECT report_id FROM vicidial_automated_reports where ( (report_server IN('$server_ip'$THISserver_voicemailSQL) ) and ( ( (active='Y') and (report_times LIKE \"%$reset_test%\") and ( (report_weekdays LIKE \"%$wday%\") or (report_monthdays LIKE \"%$mday%\") ) ) or (run_now_trigger='Y') ) ) order by report_id limit 1000;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthBrows=$sthA->rows;
|
||||
if ($DB) {print "Checking for Automated Reports: |$sthBrows|$stmtA|\n";}
|
||||
$r=0;
|
||||
while ($sthBrows > $r)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$report_idARY[$r] = $aryA[0];
|
||||
$r++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
$r=0;
|
||||
while ($sthBrows > $r)
|
||||
{
|
||||
$temp_report = $report_idARY[$r];
|
||||
$ar_command = "$PATHhome/AST_email_web_report.pl --quiet --remove-images --remove-links --log-to-adminlog --report-id=$temp_report ";
|
||||
|
||||
if ($DB) {print "starting automated report process in a screen... |AR$temp_report|\n";}
|
||||
`/usr/bin/screen -d -m -S AR$temp_report $ar_command `;
|
||||
|
||||
$stmtA="UPDATE vicidial_automated_reports SET run_now_trigger='N' where run_now_trigger='Y' and report_server IN('$server_ip'$THISserver_voicemailSQL) and report_id='$report_idARY[$r]';";
|
||||
$ARaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "FINISHED: $ARaffected_rows|$stmtA|";}
|
||||
|
||||
$r++;
|
||||
}
|
||||
if ($DB) {print "Automated Reports DONE: $r\n";}
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
##### END automated reports
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
##### BEGIN reset lists
|
||||
################################################################################
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# AST_email_web_report.pl version: 2.12
|
||||
# AST_email_web_report.pl version: 2.14
|
||||
#
|
||||
# This script is designed to wget a web report and then email it as an attachment
|
||||
# This script is designed to wget a web report and then email it as an attachment or send it to an FTP server
|
||||
# this script should be run from a vicidial web server.
|
||||
#
|
||||
# NOTE: you need to alter the URL to change the report that is run by this script
|
||||
# NOTE: you need to either use Automated Reports in the admin web screens, or alter the URL within this script to change the report that is run by this script
|
||||
#
|
||||
# /usr/share/astguiclient/AST_email_web_report.pl --email-list=test@gmail.com --email-sender=test@test.com
|
||||
#
|
||||
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 90225-1247 - First version
|
||||
@@ -17,12 +17,15 @@
|
||||
# 111012-2220 - Added optional begin date flag
|
||||
# 111214-0922 - Added remove images and links options as well as email subject option
|
||||
# 160415-1421 - Fixed minor bug in file to attach to email
|
||||
# 170304-1400 - Added options for running a defined Automated Report, and admin logging
|
||||
#
|
||||
|
||||
$txt = '.txt';
|
||||
$html = '.html';
|
||||
$US = '_';
|
||||
$MT[0] = '';
|
||||
$log_to_adminlog=0;
|
||||
$report_id='';
|
||||
|
||||
|
||||
$secX = time();
|
||||
@@ -53,6 +56,12 @@ $TWOAMsecY = ($TWOAMsec - 86400);
|
||||
$TWOAMsecF = ($TWOAMsec - 518400);
|
||||
### find epoch of 2AM 7 days ago
|
||||
$TWOAMsecG = ($TWOAMsec - 604800);
|
||||
### find epoch of 2AM 13 days ago
|
||||
$TWOAMsecJ = ($TWOAMsec - 1123200);
|
||||
### find epoch of 2AM 14 days ago
|
||||
$TWOAMsecK = ($TWOAMsec - 1209600);
|
||||
### find epoch of 2AM 15 days ago
|
||||
$TWOAMsecL = ($TWOAMsec - 1296000);
|
||||
### find epoch of 2AM 30 days ago
|
||||
$TWOAMsecH = ($TWOAMsec - 2592000);
|
||||
|
||||
@@ -92,6 +101,33 @@ if ($Hhour < 10) {$Hhour = "0$Hhour";}
|
||||
if ($Hmin < 10) {$Hmin = "0$Hmin";}
|
||||
if ($Hsec < 10) {$Hsec = "0$Hsec";}
|
||||
|
||||
($Jsec,$Jmin,$Jhour,$Jmday,$Jmon,$Jyear,$Jwday,$Jyday,$Jisdst) = localtime($TWOAMsecJ);
|
||||
$Jyear = ($Jyear + 1900);
|
||||
$Jmon++;
|
||||
if ($Jmon < 10) {$Jmon = "0$Jmon";}
|
||||
if ($Jmday < 10) {$Jmday = "0$Jmday";}
|
||||
if ($Jhour < 10) {$Jhour = "0$Jhour";}
|
||||
if ($Jmin < 10) {$Jmin = "0$Jmin";}
|
||||
if ($Jsec < 10) {$Jsec = "0$Jsec";}
|
||||
|
||||
($Ksec,$Kmin,$Khour,$Kmday,$Kmon,$Kyear,$Kwday,$Kyday,$Kisdst) = localtime($TWOAMsecK);
|
||||
$Kyear = ($Kyear + 1900);
|
||||
$Kmon++;
|
||||
if ($Kmon < 10) {$Kmon = "0$Kmon";}
|
||||
if ($Kmday < 10) {$Kmday = "0$Kmday";}
|
||||
if ($Khour < 10) {$Khour = "0$Khour";}
|
||||
if ($Kmin < 10) {$Kmin = "0$Kmin";}
|
||||
if ($Ksec < 10) {$Ksec = "0$Ksec";}
|
||||
|
||||
($Lsec,$Lmin,$Lhour,$Lmday,$Lmon,$Lyear,$Lwday,$Lyday,$Lisdst) = localtime($TWOAMsecL);
|
||||
$Lyear = ($Lyear + 1900);
|
||||
$Lmon++;
|
||||
if ($Lmon < 10) {$Lmon = "0$Lmon";}
|
||||
if ($Lmday < 10) {$Lmday = "0$Lmday";}
|
||||
if ($Lhour < 10) {$Lhour = "0$Lhour";}
|
||||
if ($Lmin < 10) {$Lmin = "0$Lmin";}
|
||||
if ($Lsec < 10) {$Lsec = "0$Lsec";}
|
||||
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
@@ -112,6 +148,9 @@ if (length($ARGV[0])>1)
|
||||
print " [--debugX] = Super debugging messages\n";
|
||||
print " [--remove-images] = Will parse through the output file and remove any images in the HTML\n";
|
||||
print " [--remove-links] = Will parse through the output file and remove any links in the HTML\n";
|
||||
print " [--log-to-adminlog] = Put an entry in the admin log after this report runs\n";
|
||||
print " [--report-id=XXXXXXXX] = Report ID in the system to gather settings from\n";
|
||||
print " NOTE: this will override any other options set below this one\n";
|
||||
print " [--email-subject=XYZ] = Email message subject, which will be followed by the date of the report\n";
|
||||
print " [--email-list=test@test.com:test2@test.com] = send email results to these addresses\n";
|
||||
print " [--email-sender=vicidial@localhost] = sender for the email results\n";
|
||||
@@ -156,162 +195,178 @@ if (length($ARGV[0])>1)
|
||||
$remove_links=1;
|
||||
if ($DB > 0) {print "\n----- REMOVE LINKS -----\n\n";}
|
||||
}
|
||||
if ($args =~ /--ftp-server=/i)
|
||||
if ($args =~ /--log-to-adminlog/)
|
||||
{
|
||||
@data_in = split(/--ftp-server=/,$args);
|
||||
$VARREPORT_host = $data_in[1];
|
||||
$VARREPORT_host =~ s/ .*//gi;
|
||||
$VARREPORT_host =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP SERVER: $VARREPORT_host -----\n\n";}
|
||||
$log_to_adminlog=1;
|
||||
if ($DB > 0) {print "\n----- LOGGING TO THE ADMIN LOG -----\n\n";}
|
||||
}
|
||||
if ($args =~ /--report-id=/i)
|
||||
{
|
||||
@data_in = split(/--report-id=/,$args);
|
||||
$report_id = $data_in[1];
|
||||
$report_id =~ s/ .*//gi;
|
||||
$report_id =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- REPORT ID: $report_id -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_host = '';}
|
||||
if ($args =~ /--ftp-login=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-login=/,$args);
|
||||
$VARREPORT_user = $data_in[1];
|
||||
$VARREPORT_user =~ s/ .*//gi;
|
||||
$VARREPORT_user =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP LOGIN: $VARREPORT_user -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_user = '';}
|
||||
if ($args =~ /--ftp-pass=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-pass=/,$args);
|
||||
$VARREPORT_pass = $data_in[1];
|
||||
$VARREPORT_pass =~ s/ .*//gi;
|
||||
$VARREPORT_pass =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP PASS: <SET> -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_pass = '';}
|
||||
if ($args =~ /--ftp-dir=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-dir=/,$args);
|
||||
$VARREPORT_dir = $data_in[1];
|
||||
$VARREPORT_dir =~ s/ .*//gi;
|
||||
$VARREPORT_dir =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP DIR: $VARREPORT_dir -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_dir = '';}
|
||||
if ($args =~ /--ftp-server=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-server=/,$args);
|
||||
$VARREPORT_host = $data_in[1];
|
||||
$VARREPORT_host =~ s/ .*//gi;
|
||||
$VARREPORT_host =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP SERVER: $VARREPORT_host -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_host = '';}
|
||||
if ($args =~ /--ftp-login=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-login=/,$args);
|
||||
$VARREPORT_user = $data_in[1];
|
||||
$VARREPORT_user =~ s/ .*//gi;
|
||||
$VARREPORT_user =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP LOGIN: $VARREPORT_user -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_user = '';}
|
||||
if ($args =~ /--ftp-pass=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-pass=/,$args);
|
||||
$VARREPORT_pass = $data_in[1];
|
||||
$VARREPORT_pass =~ s/ .*//gi;
|
||||
$VARREPORT_pass =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP PASS: <SET> -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_pass = '';}
|
||||
if ($args =~ /--ftp-dir=/i)
|
||||
{
|
||||
@data_in = split(/--ftp-dir=/,$args);
|
||||
$VARREPORT_dir = $data_in[1];
|
||||
$VARREPORT_dir =~ s/ .*//gi;
|
||||
$VARREPORT_dir =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- FTP DIR: $VARREPORT_dir -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$VARREPORT_dir = '';}
|
||||
|
||||
if ($args =~ /--email-subject=/i)
|
||||
{
|
||||
@data_in = split(/--email-subject=/,$args);
|
||||
$email_subject = $data_in[1];
|
||||
$email_subject =~ s/ .*//gi;
|
||||
$email_subject =~ s/\+/ /gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL SUBJECT: $email_subject -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_subject = 'VICIDIAL REPORT';}
|
||||
if ($args =~ /--email-list=/i)
|
||||
{
|
||||
@data_in = split(/--email-list=/,$args);
|
||||
$email_list = $data_in[1];
|
||||
$email_list =~ s/ .*//gi;
|
||||
$email_list =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL NOTIFICATION: $email_list -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_list = '';}
|
||||
if ($args =~ /--email-sender=/i)
|
||||
{
|
||||
@data_in = split(/--email-sender=/,$args);
|
||||
$email_sender = $data_in[1];
|
||||
$email_sender =~ s/ .*//gi;
|
||||
$email_sender =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL NOTIFICATION SENDER: $email_sender -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_sender = 'vicidial@localhost';}
|
||||
if ($args =~ /--date=/i)
|
||||
{
|
||||
@data_in = split(/--date=/,$args);
|
||||
$shipdate = $data_in[1];
|
||||
$shipdate =~ s/ .*//gi;
|
||||
if ($shipdate =~ /today/)
|
||||
if ($args =~ /--email-subject=/i)
|
||||
{
|
||||
$shipdate="$year-$mon-$mday";
|
||||
$time = $TWOAMsec;
|
||||
@data_in = split(/--email-subject=/,$args);
|
||||
$email_subject = $data_in[1];
|
||||
$email_subject =~ s/ .*//gi;
|
||||
$email_subject =~ s/\+/ /gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL SUBJECT: $email_subject -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_subject = 'VICIDIAL REPORT';}
|
||||
if ($args =~ /--email-list=/i)
|
||||
{
|
||||
if ($shipdate =~ /yesterday/)
|
||||
@data_in = split(/--email-list=/,$args);
|
||||
$email_list = $data_in[1];
|
||||
$email_list =~ s/ .*//gi;
|
||||
$email_list =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL NOTIFICATION: $email_list -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_list = '';}
|
||||
if ($args =~ /--email-sender=/i)
|
||||
{
|
||||
@data_in = split(/--email-sender=/,$args);
|
||||
$email_sender = $data_in[1];
|
||||
$email_sender =~ s/ .*//gi;
|
||||
$email_sender =~ s/:/,/gi;
|
||||
if ($DB > 0) {print "\n----- EMAIL NOTIFICATION SENDER: $email_sender -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$email_sender = 'vicidial@localhost';}
|
||||
if ($args =~ /--date=/i)
|
||||
{
|
||||
@data_in = split(/--date=/,$args);
|
||||
$shipdate = $data_in[1];
|
||||
$shipdate =~ s/ .*//gi;
|
||||
if ($shipdate =~ /today/)
|
||||
{
|
||||
$shipdate="$Tyear-$Tmon-$Tmday";
|
||||
$year = $Tyear;
|
||||
$mon = $Tmon;
|
||||
$mday = $Tmday;
|
||||
$time=$TWOAMsecY;
|
||||
$shipdate="$year-$mon-$mday";
|
||||
$time = $TWOAMsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
@cli_date = split("-",$shipdate);
|
||||
$year = $cli_date[0];
|
||||
$mon = $cli_date[1];
|
||||
$mday = $cli_date[2];
|
||||
$cli_date[1] = ($cli_date[1] - 1);
|
||||
$time = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
|
||||
}
|
||||
}
|
||||
$start_date = $shipdate;
|
||||
$start_date =~ s/-//gi;
|
||||
if (!$Q) {print "\n----- DATE OVERRIDE: $shipdate($start_date) -----\n\n";}
|
||||
}
|
||||
else
|
||||
{
|
||||
$time=$TWOAMsec;
|
||||
}
|
||||
if ($args =~ /--begin-date=/i)
|
||||
{
|
||||
@data_in = split(/--begin-date=/,$args);
|
||||
$begindate = $data_in[1];
|
||||
$begindate =~ s/ .*//gi;
|
||||
if ($begindate =~ /6days/)
|
||||
{
|
||||
$begindate="$Fyear-$Fmon-$Fmday";
|
||||
$Byear = $Fyear;
|
||||
$Bmon = $Fmon;
|
||||
$Bmday = $Fmday;
|
||||
$Btime=$TWOAMsecF;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($begindate =~ /7days/)
|
||||
{
|
||||
$begindate="$Gyear-$Gmon-$Gmday";
|
||||
$Byear = $Gyear;
|
||||
$Bmon = $Gmon;
|
||||
$Bmday = $Gmday;
|
||||
$Btime=$TWOAMsecG;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($begindate =~ /30days/)
|
||||
if ($shipdate =~ /yesterday/)
|
||||
{
|
||||
$begindate="$Hyear-$Hmon-$Hmday";
|
||||
$Byear = $Hyear;
|
||||
$Bmon = $Hmon;
|
||||
$Bmday = $Hmday;
|
||||
$Btime=$TWOAMsecH;
|
||||
$shipdate="$Tyear-$Tmon-$Tmday";
|
||||
$year = $Tyear;
|
||||
$mon = $Tmon;
|
||||
$mday = $Tmday;
|
||||
$time=$TWOAMsecY;
|
||||
}
|
||||
else
|
||||
{
|
||||
@cli_date = split("-",$begindate);
|
||||
$Byear = $cli_date[0];
|
||||
$Bmon = $cli_date[1];
|
||||
$Bmday = $cli_date[2];
|
||||
@cli_date = split("-",$shipdate);
|
||||
$year = $cli_date[0];
|
||||
$mon = $cli_date[1];
|
||||
$mday = $cli_date[2];
|
||||
$cli_date[1] = ($cli_date[1] - 1);
|
||||
$Btime = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
|
||||
$time = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
|
||||
}
|
||||
}
|
||||
$start_date = $shipdate;
|
||||
$start_date =~ s/-//gi;
|
||||
if (!$Q) {print "\n----- DATE OVERRIDE: $shipdate($start_date) -----\n\n";}
|
||||
}
|
||||
else
|
||||
{
|
||||
$time=$TWOAMsec;
|
||||
}
|
||||
if ($args =~ /--begin-date=/i)
|
||||
{
|
||||
@data_in = split(/--begin-date=/,$args);
|
||||
$begindate = $data_in[1];
|
||||
$begindate =~ s/ .*//gi;
|
||||
if ($begindate =~ /6days/)
|
||||
{
|
||||
$begindate="$Fyear-$Fmon-$Fmday";
|
||||
$Byear = $Fyear;
|
||||
$Bmon = $Fmon;
|
||||
$Bmday = $Fmday;
|
||||
$Btime=$TWOAMsecF;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($begindate =~ /7days/)
|
||||
{
|
||||
$begindate="$Gyear-$Gmon-$Gmday";
|
||||
$Byear = $Gyear;
|
||||
$Bmon = $Gmon;
|
||||
$Bmday = $Gmday;
|
||||
$Btime=$TWOAMsecG;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($begindate =~ /30days/)
|
||||
{
|
||||
$begindate="$Hyear-$Hmon-$Hmday";
|
||||
$Byear = $Hyear;
|
||||
$Bmon = $Hmon;
|
||||
$Bmday = $Hmday;
|
||||
$Btime=$TWOAMsecH;
|
||||
}
|
||||
else
|
||||
{
|
||||
@cli_date = split("-",$begindate);
|
||||
$Byear = $cli_date[0];
|
||||
$Bmon = $cli_date[1];
|
||||
$Bmday = $cli_date[2];
|
||||
$cli_date[1] = ($cli_date[1] - 1);
|
||||
$Btime = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$Bstart_date = $begindate;
|
||||
$Bstart_date =~ s/-//gi;
|
||||
if (!$Q) {print "\n----- DATE OVERRIDE: $begindate($Bstart_date) -----\n\n";}
|
||||
}
|
||||
$Bstart_date = $begindate;
|
||||
$Bstart_date =~ s/-//gi;
|
||||
if (!$Q) {print "\n----- DATE OVERRIDE: $begindate($Bstart_date) -----\n\n";}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,30 +440,127 @@ if (!$Q)
|
||||
print "\n";
|
||||
}
|
||||
|
||||
if ( (length($report_id) > 1) || ($log_to_adminlog > 0) )
|
||||
{
|
||||
use DBI;
|
||||
|
||||
######################################################
|
||||
##### CHANGE REPORT NAME AND URL HERE!!!!!!!!!
|
||||
######################################################
|
||||
#$HTMLfile = "Outbound_Report_ALL_$shipdate$html";
|
||||
$HTMLfile = "DISCH_SURVEY_$start_date$txt";
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
}
|
||||
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/fcstats.php?db_log=1\\&query_date=$shipdate\\&group=$group\\&shift=$shift\\&archive=1";
|
||||
#$location = "http://6666:1234\@192.168.1.101/vicidial/AST_VDADstats.php?query_date=$shipdate\\&end_date=$shipdate\\&group[]=--ALL--\\&shift=ALL";
|
||||
#$location = "http://8888:8888\@127.0.0.1/vicidial/AST_VDADstats.php?query_date=$shipdate\\&end_date=$shipdate\\&group[]=--ALL--\\&shift=ALL";
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/AST_inbound_daily_report.php?query_date=$shipdate\\&end_date=$shipdate\\&group=5001\\&shift=ALL\\&SUBMIT=SUBMIT\\&hourly_breakdown=checked";
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/AST_agent_performance_detail.php?DB=\\&query_date=$shipdate\\&end_date=$shipdate\\&group[]=2001\\&user_group[]=--ALL--\\&shift=ALL\\&SUBMIT=SUBMIT";
|
||||
if (length($report_id) > 1)
|
||||
{
|
||||
### Grab Server values from the database
|
||||
$stmtA = "SELECT report_destination,email_from,email_to,email_subject,ftp_server,ftp_user,ftp_pass,ftp_directory,report_url from vicidial_automated_reports where report_id='$report_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$report_destination = $aryA[0];
|
||||
if ($report_destination =~ /EMAIL/)
|
||||
{
|
||||
$email_sender = $aryA[1];
|
||||
$email_list = $aryA[2];
|
||||
$email_subject = $aryA[3];
|
||||
$email_subject =~ s/--A--date--B--/$year-$mon-$mday/gi;
|
||||
$email_subject =~ s/--A--datetime--B--/$year-$mon-$mday $hour:$min:$sec/gi;
|
||||
}
|
||||
if ($report_destination =~ /FTP/)
|
||||
{
|
||||
$VARREPORT_host = $aryA[4];
|
||||
$VARREPORT_user = $aryA[5];
|
||||
$VARREPORT_pass = $aryA[6];
|
||||
$VARREPORT_dir = $aryA[7];
|
||||
}
|
||||
$location = $aryA[8];
|
||||
if ($DB) {print "RAW LOCATION: |$location|\n";}
|
||||
$location =~ s/\&/\\&/gi;
|
||||
$location =~ s/--A--today--B--/$year-$mon-$mday/gi;
|
||||
$location =~ s/--A--yesterday--B--/$Tyear-$Tmon-$Tmday/gi;
|
||||
$location =~ s/--A--6days--B--/$Fyear-$Fmon-$Fmday/gi;
|
||||
$location =~ s/--A--7days--B--/$Gyear-$Gmon-$Gmday/gi;
|
||||
$location =~ s/--A--13days--B--/$Jyear-$Jmon-$Jmday/gi;
|
||||
$location =~ s/--A--14days--B--/$Kyear-$Kmon-$Kmday/gi;
|
||||
$location =~ s/--A--15days--B--/$Lyear-$Lmon-$Lmday/gi;
|
||||
$location =~ s/--A--30days--B--/$Hyear-$Hmon-$Hmday/gi;
|
||||
if ($DB) {print "FINAL LOCATION: |$location|\n";}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$Q) {print "ERROR: Report not found: $report_id\n";}
|
||||
exit;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
# Outbound IVR Export Report:
|
||||
$location = "http://127.0.0.1/vicidial/call_report_export.php?query_date=$begindate\\&end_date=$shipdate\\&list_id[]=--ALL--\\&status[]=--ALL--\\&campaign[]=RSIDESVY\\&run_export=1\\&ivr_export=YES\\&export_fields=EXTENDED\\&header_row=NO\\&rec_fields=NONE\\&custom_fields=NO\\&call_notes=NO";
|
||||
### gather user information for last manager who edited the automated report
|
||||
$stmtA = "SELECT user from vicidial_admin_log where event_section='AUTOREPORTS' and record_id='$report_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$http_user = $aryA[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$Q) {print "ERROR: No report manager user found: $report_id\n";}
|
||||
exit;
|
||||
}
|
||||
$sthA->finish();
|
||||
### gather user information for last manager who edited the automated report
|
||||
$stmtA = "SELECT pass,custom_five from vicidial_users where user='$http_user';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$http_pass = $aryA[0];
|
||||
if (length($http_pass) < 1)
|
||||
{$http_pass = $aryA[1];}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$Q) {print "ERROR: No report manager user found: $http_user\n";}
|
||||
exit;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
######################################################
|
||||
######################################################
|
||||
$HTMLfile = $report_id . "_" . $start_date . "_" . $hms . '' . $html;
|
||||
$HTMLfileLOG = $report_id . "_" . $start_date . "_" . $hms . '' . $txt;
|
||||
$shipdate='';
|
||||
}
|
||||
else
|
||||
{
|
||||
######################################################
|
||||
##### CHANGE REPORT NAME AND URL HERE!!!!!!!!!
|
||||
######################################################
|
||||
#$HTMLfile = "Outbound_Report_ALL_$shipdate$html";
|
||||
$HTMLfile = "DISCH_SURVEY_$start_date$html";
|
||||
$HTMLfileLOG = "DISCH_SURVEY_$start_date$txt";
|
||||
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/fcstats.php?db_log=1\\&query_date=$shipdate\\&group=$group\\&shift=$shift\\&archive=1";
|
||||
#$location = "http://6666:1234\@192.168.1.101/vicidial/AST_VDADstats.php?query_date=$shipdate\\&end_date=$shipdate\\&group[]=--ALL--\\&shift=ALL";
|
||||
#$location = "http://8888:8888\@127.0.0.1/vicidial/AST_VDADstats.php?query_date=$shipdate\\&end_date=$shipdate\\&group[]=--ALL--\\&shift=ALL";
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/AST_inbound_daily_report.php?query_date=$shipdate\\&end_date=$shipdate\\&group=5001\\&shift=ALL\\&SUBMIT=SUBMIT\\&hourly_breakdown=checked";
|
||||
#$location = "http://6666:1234\@127.0.0.1/vicidial/AST_agent_performance_detail.php?DB=\\&query_date=$shipdate\\&end_date=$shipdate\\&group[]=2001\\&user_group[]=--ALL--\\&shift=ALL\\&SUBMIT=SUBMIT";
|
||||
|
||||
# Outbound IVR Export Report:
|
||||
$location = "http://127.0.0.1/vicidial/call_report_export.php?query_date=$begindate\\&end_date=$shipdate\\&list_id[]=--ALL--\\&status[]=--ALL--\\&campaign[]=RSIDESVY\\&run_export=1\\&ivr_export=YES\\&export_fields=EXTENDED\\&header_row=NO\\&rec_fields=NONE\\&custom_fields=NO\\&call_notes=NO";
|
||||
|
||||
$http_user = '6666';
|
||||
$http_pass = '1234';
|
||||
######################################################
|
||||
######################################################
|
||||
}
|
||||
|
||||
### GRAB THE REPORT
|
||||
if (!$Q) {print "Running Report $ship_date\n$location\n";}
|
||||
|
||||
`/usr/bin/wget --auth-no-challenge --http-user=6666 --http-password=1234 --output-document=/tmp/X$HTMLfile $location `;
|
||||
`/usr/bin/wget --auth-no-challenge --http-user=$http_user --http-password=$http_pass --output-document=/tmp/X$HTMLfile --output-file=/tmp/Y$HTMLfileLOG $location `;
|
||||
|
||||
if ( ($remove_images > 0) || ($remove_links > 0) )
|
||||
{
|
||||
@@ -491,6 +643,8 @@ if (length($email_list) > 3)
|
||||
|
||||
if (length($VARREPORT_host) > 7)
|
||||
{
|
||||
if (length($VARREPORT_port) < 1) {$VARREPORT_port = '21';}
|
||||
|
||||
use Net::FTP;
|
||||
|
||||
if (!$Q) {print "Sending File Over FTP: $HTMLfile\n";}
|
||||
@@ -503,4 +657,32 @@ if (length($VARREPORT_host) > 7)
|
||||
###### END FTP SECTION #####
|
||||
|
||||
|
||||
$secY = time();
|
||||
$secRUN = ($secY - $secX);
|
||||
if ($secRUN < 1) {$secRUN=1;}
|
||||
|
||||
if (length($report_id) > 1)
|
||||
{
|
||||
$stmtA="UPDATE vicidial_automated_reports set report_last_run=NOW(), report_last_length='$secRUN' where report_id='$report_id';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
if ($log_to_adminlog > 0)
|
||||
{
|
||||
$location =~ s/;|\\|\'|\"//gi;
|
||||
$stmtB="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$http_user', ip_address='$server_ip', event_section='AUTOREPORTS', event_type='EXPORT', record_id='$report_id', event_code='ADMIN REPORT EXPORT RUN $report_destination', event_sql=\"$location\", event_notes='Run time: $secRUN seconds. Sent $report_destination';";
|
||||
$Iaffected_rows = $dbhA->do($stmtB);
|
||||
if ($DB) {print "ADMIN LOGGING FINISHED: $affected_rows|$Iaffected_rows|$stmtA|$stmtB\n";}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($log_to_adminlog > 0)
|
||||
{
|
||||
$location =~ s/;|\\|\'|\"//gi;
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$http_user', ip_address='$server_ip', event_section='REPORTS', event_type='EXPORT', record_id='email_web_report', event_code='ADMIN REPORT EXPORT RUN', event_sql=\"$location\", event_notes='Run time: $secRUN seconds';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "ADMIN LOGGING FINISHED: $Iaffected_rows|$stmtA\n";}
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
@@ -655,7 +655,8 @@ access_recordings ENUM('0', '1') default '0',
|
||||
modify_colors ENUM('1','0') default '0',
|
||||
user_nickname VARCHAR(50) default '',
|
||||
user_new_lead_limit SMALLINT(5) default '-1',
|
||||
api_only_user ENUM('0','1') default '0'
|
||||
api_only_user ENUM('0','1') default '0',
|
||||
modify_auto_reports ENUM('1','0') default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE UNIQUE INDEX user ON vicidial_users (user);
|
||||
@@ -1691,7 +1692,8 @@ agent_soundboards ENUM('1','0') default '0',
|
||||
web_loader_phone_length VARCHAR(10) default 'DISABLED',
|
||||
agent_script VARCHAR(50) default 'vicidial.php',
|
||||
vdad_debug_logging ENUM('1','0') default '0',
|
||||
agent_chat_screen_colors VARCHAR(20) default 'default'
|
||||
agent_chat_screen_colors VARCHAR(20) default 'default',
|
||||
enable_auto_reports ENUM('1','0') default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -3612,6 +3614,31 @@ areacode VARCHAR(6) NOT NULL,
|
||||
index(group_id)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_automated_reports (
|
||||
report_id VARCHAR(30) UNIQUE NOT NULL,
|
||||
report_name VARCHAR(100),
|
||||
report_last_run DATETIME,
|
||||
report_last_length SMALLINT(5) default '0',
|
||||
report_server VARCHAR(30) default 'active_voicemail_server',
|
||||
report_times VARCHAR(100) default '',
|
||||
report_weekdays VARCHAR(7) default '',
|
||||
report_monthdays VARCHAR(100) default '',
|
||||
report_destination ENUM('EMAIL','FTP') default 'EMAIL',
|
||||
email_from VARCHAR(255) default '',
|
||||
email_to VARCHAR(255) default '',
|
||||
email_subject VARCHAR(255) default '',
|
||||
ftp_server VARCHAR(255) default '',
|
||||
ftp_user VARCHAR(255) default '',
|
||||
ftp_pass VARCHAR(255) default '',
|
||||
ftp_directory VARCHAR(255) default '',
|
||||
report_url TEXT,
|
||||
run_now_trigger ENUM('N','Y') default 'N',
|
||||
active ENUM('N','Y') default 'N',
|
||||
user_group VARCHAR(20) default '---ALL---',
|
||||
index (report_times),
|
||||
index (run_now_trigger)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
|
||||
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
||||
|
||||
@@ -3870,4 +3897,4 @@ 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='1491',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1492',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -78,3 +78,34 @@ UPDATE system_settings SET db_schema_version='1490',db_schema_update_date=NOW()
|
||||
ALTER TABLE vicidial_lists_fields MODIFY field_required ENUM('Y','N','INBOUND_ONLY') default 'N';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1491',db_schema_update_date=NOW() where db_schema_version < 1491;
|
||||
|
||||
ALTER TABLE system_settings ADD enable_auto_reports ENUM('1','0') default '0';
|
||||
|
||||
ALTER TABLE vicidial_users ADD modify_auto_reports ENUM('1','0') default '0';
|
||||
|
||||
CREATE TABLE vicidial_automated_reports (
|
||||
report_id VARCHAR(30) UNIQUE NOT NULL,
|
||||
report_name VARCHAR(100),
|
||||
report_last_run DATETIME,
|
||||
report_last_length SMALLINT(5) default '0',
|
||||
report_server VARCHAR(30) default 'active_voicemail_server',
|
||||
report_times VARCHAR(100) default '',
|
||||
report_weekdays VARCHAR(7) default '',
|
||||
report_monthdays VARCHAR(100) default '',
|
||||
report_destination ENUM('EMAIL','FTP') default 'EMAIL',
|
||||
email_from VARCHAR(255) default '',
|
||||
email_to VARCHAR(255) default '',
|
||||
email_subject VARCHAR(255) default '',
|
||||
ftp_server VARCHAR(255) default '',
|
||||
ftp_user VARCHAR(255) default '',
|
||||
ftp_pass VARCHAR(255) default '',
|
||||
ftp_directory VARCHAR(255) default '',
|
||||
report_url TEXT,
|
||||
run_now_trigger ENUM('N','Y') default 'N',
|
||||
active ENUM('N','Y') default 'N',
|
||||
user_group VARCHAR(20) default '---ALL---',
|
||||
index (report_times),
|
||||
index (run_now_trigger)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1492',db_schema_update_date=NOW() where db_schema_version < 1492;
|
||||
|
||||
@@ -437,7 +437,7 @@ if ($file_download < 1)
|
||||
|
||||
echo "</span>\n";
|
||||
echo "<span style=\"position:absolute;left:3px;top:30px;z-index:19;\" id=agent_status_stats>\n";
|
||||
echo "<b>"._QXZ("$report_name")."</b> $NWB#agent_status_detail$NWE";
|
||||
echo "<b>"._QXZ("$report_name")."</b> $NWB#agent_status_detail$NWE\n";
|
||||
echo "<PRE><FONT SIZE=2>";
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -69,6 +69,7 @@
|
||||
# 161101-2129 - Added user_new_lead_limit Users subhead
|
||||
# 161103-2136 - Added agent_soundboards option
|
||||
# 170113-1633 - Added dynamic call menu in-group option DYNAMIC_INGROUP_VAR for use with cm_phonesearch.agi
|
||||
# 170304-1354 - Added Automated Reports section to Admin
|
||||
#
|
||||
|
||||
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards from system_settings;";
|
||||
@@ -1929,6 +1930,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';}
|
||||
$sc_sh="CLASS=\"subhead_style\"";
|
||||
$sg_sh="CLASS=\"subhead_style\"";
|
||||
$emails_sh="CLASS=\"subhead_style\"";
|
||||
$ar_sh="CLASS=\"subhead_style\"";
|
||||
|
||||
if ($sh=='times') {$times_sh="CLASS=\"subhead_style_selected\"";}
|
||||
if ($sh=='shifts') {$shifts_sh="CLASS=\"subhead_style_selected\"";}
|
||||
@@ -1952,6 +1954,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';}
|
||||
if ($sh=='sc') {$sc_sh="CLASS=\"subhead_style_selected\"";}
|
||||
if ($sh=='sg') {$sg_sh="CLASS=\"subhead_style_selected\"";}
|
||||
if ($sh=='emails') {$emails_sh="CLASS=\"subhead_style_selected\"";}
|
||||
if ($sh=='ar') {$ar_sh="CLASS=\"subhead_style_selected\"";}
|
||||
|
||||
?>
|
||||
<TR <?php echo $times_sh ?><?php if ($SSadmin_row_click > 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=100000000';\"";} ?>>
|
||||
@@ -2040,6 +2043,13 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';}
|
||||
<a href="<?php echo $ADMIN ?>?ADD=192000000000" STYLE="text-decoration:none;"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <img src="images/icon_settingscontainer.png" border=0 alt=\"Users\" width=14 height=14 valign=middle> <?php echo _QXZ("Settings Containers"); ?> </a></TD>
|
||||
</TR>
|
||||
<?php
|
||||
if ($SSenable_auto_reports > 0)
|
||||
{ ?>
|
||||
<TR <?php echo $ar_sh ?><?php if ($SSadmin_row_click > 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=194000000000';\"";} ?>><TD ALIGN=LEFT <?php echo $ar_sh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=194000000000" STYLE="text-decoration:none;"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <img src="images/icon_autoreports.png" border=0 alt=\"Users\" width=14 height=14 valign=middle> <?php echo _QXZ("Automated Reports"); ?> </a></TD>
|
||||
</TR>
|
||||
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2208,6 +2218,10 @@ if ($SSenable_languages == '1')
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $sc_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=192000000000"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Settings Containers"); ?> </a> |<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=192111111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Add A Settings Container"); ?> </a><?php } ?></TD></TR>
|
||||
<?php }
|
||||
if (strlen($ar_sh) > 25) {
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $ar_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=194000000000"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Automated Reports"); ?> </a> |<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=194111111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Add An Automated Report"); ?> </a><?php } ?></TD></TR>
|
||||
<?php }
|
||||
if (strlen($sg_sh) > 25) {
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $sg_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=193000000000"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Status Groups"); ?> </a> |<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=193111111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Add A Status Group"); ?> </a><?php } ?></TD></TR>
|
||||
|
||||
@@ -111,6 +111,7 @@
|
||||
# 170217-1353 - Added dead_to_dispo entry
|
||||
# 170220-1811 - Added areacode_filter entries
|
||||
# 170301-1337 - Updated entry for custom fields required setting
|
||||
# 170304-1346 - Added auto_reports section
|
||||
#
|
||||
|
||||
|
||||
@@ -5263,6 +5264,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Log Recording Access"); ?> -</B><?php echo _QXZ("This option if enabled allows the logging of user access to call recordings. It also requires the User setting Access Recordings to be set to 1 to allow a user to access call recordings. Default is 0 for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-enable_auto_reports">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Enable Automated Reports"); ?> -</B><?php echo _QXZ("This option if enabled allows you access to the Automated Reports section where you can set up reports to run at scheduled times and be delivered by email or FTP. Default is 0 for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-first_login_trigger">
|
||||
<BR>
|
||||
@@ -5652,6 +5658,112 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>AUTOMATED REPORTS TABLE</FONT></B><BR><BR>
|
||||
<A NAME="auto_reports">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Automated Reports allow for a simplified way of configuring reports to be run on a scheduled and recurring basis, and to have the results sent by email or uploaded to an FTP server."); ?></B>
|
||||
|
||||
<A NAME="auto_reports-report_id">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report ID"); ?> -</B><?php echo _QXZ("This field needs to be at least 2 characters in length and no more than 30 characters in length, no spaces or special characters. This is the ID that will be used to identify the Automated Report throughout the system."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_name">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Name"); ?> -</B><?php echo _QXZ("This is the descriptive name of the Automated Report entry."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-user_group">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Admin User Group"); ?> -</B><?php echo _QXZ("This is the administrative user group for this record, this allows admin viewing of this record restricted by user group. Default is --ALL-- which allows any admin user with Modify Automated Reports permissions to view this record."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_last_run">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Last Run Time"); ?> -</B><?php echo _QXZ("This is the date and time of the last run of this automated report process. Also included is the number of seconds it took for this process to run the last time."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_server">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Server"); ?> -</B><?php echo _QXZ("This is the machine that you want to use to run this automated report. You must choose a server that runs the keepalive process every minute in the crontab. The default is to use the active voicemail server as defined in System Settings."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_times">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Times"); ?> -</B><?php echo _QXZ("This is the list of times in HHMM format when you want the automated report to run. You can specify multiple times by separating them with a dash, like how the List Reset Times feature works."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_weekdays">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Weekdays"); ?> -</B><?php echo _QXZ("This is the list of days of the week when you want the automated report to run. Either this option or the Month Days field below must be set for the report to run automatically."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_monthdays">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Month Days"); ?> -</B><?php echo _QXZ("This is the list of days of the month in DD format when you want the automated report to run. You can specify multiple month days by separating them with a dash. Either this option or the Weekdays field above must be set for the report to run automatically."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_destination">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Destination"); ?> -</B><?php echo _QXZ("This option will determine how you want the automated report to be delivered, by EMAIL or FTP. Depending on the destination you choose, you must fill in the configuration fields below for it to work properly. Default is EMAIL."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-email_from">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Email From"); ?> -</B><?php echo _QXZ("If the EMAIL destination is chosen above, then this field must be filled in with the email address that you want the automated report email to come from. Note: some email servers may require certain registered email address to be used for delivery to be accepted by them. You may also have to set up a reverse domain name lookup with your network provider for the server you have chosen to send emails from."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-email_to">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Email To"); ?> -</B><?php echo _QXZ("If the EMAIL destination is chosen above, then this field must be filled in with the email address that you want to receive the automated report email. You can define more than one email address by separating them with a colon."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-email_subject">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Email Subject"); ?> -</B><?php echo _QXZ("If the EMAIL destination is chosen above, then this field must be filled in with the subject of the email. As an option, you can use the --A--date--B-- or --A--datetime--B-- flag in this field to populate the current date or date-time."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-ftp_server">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("FTP Server"); ?> -</B><?php echo _QXZ("If the FTP destination is chosen above, then this field must be filled in with the FTP server address. Note: this works only for standard FTP servers, not SFTP or FTP over SSL."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-ftp_user">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("FTP User"); ?> -</B><?php echo _QXZ("If the FTP destination is chosen above, then this field must be filled in with the FTP login user."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-ftp_pass">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("FTP Pass"); ?> -</B><?php echo _QXZ("If the FTP destination is chosen above, then this field must be filled in with the FTP login password."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-ftp_directory">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("FTP Directory"); ?> -</B><?php echo _QXZ("If the FTP destination is chosen above, then this field can be filled in with the FTP folder directory that you want the automated reports to be uploaded into. Note: the folder must already exist, this process will not try to create the folder."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-active">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Active"); ?> -</B><?php echo _QXZ("The automated report will only run on the set schedule above if active is set to Y. Default is N."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-run_now_trigger">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Run Now Trigger"); ?> -</B><?php echo _QXZ("This option offers a way to test this automated report process before setting it to active. It can take up to one minute for the process to start running after submitting this page with this field set to Y. Default is N."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="auto_reports-report_url">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report URL"); ?> -</B><?php echo _QXZ("This is the field where you will put the full web address, or URL, for the report that you want to run. The easiest way to figure out what address to use is to run the report normally, then go to the Reports, Admin Utilities, Admin Report Log Viewer to see the full URL that was used to run that report. Once you have copied that URL, you can replace the dates that you see with one of these variables in the standard format that is used within this system, for example, --A--today--B--. You can use: today, yesterday, 6days, 7days, 13days, 14days, 15days, 30days. Note: some networks may require that you use a local server address in this URL if that is the only way that a server on your network can access the webserver used for reporting. Related to this, you may also have to use a local IP address if a full domain name is not accessible from within your system network. Also, it is recommended that you run reports in TEXT format for best display results."); ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>STATUS_CATEGORIES TABLE</FONT></B><BR><BR>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user