From 1b512ac01a68cd6aebeac338730d322e39d78fee Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 30 Mar 2021 21:00:38 +0000 Subject: [PATCH] Added extra warnings and forced confirmation before running List Pass report git-svn-id: svn://192.168.202.10@3413 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/AST_LISTS_pass_report.php | 55 +++++++++++++++----------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/www/vicidial/AST_LISTS_pass_report.php b/www/vicidial/AST_LISTS_pass_report.php index 89f76964..028db052 100644 --- a/www/vicidial/AST_LISTS_pass_report.php +++ b/www/vicidial/AST_LISTS_pass_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2021 Matt Florell LICENSE: AGPLv2 # # This is a list inventory report, not a calling report. This report will show # statistics for all of the lists in the selected campaigns @@ -24,6 +24,7 @@ # 171012-2015 - Fixed javascript/apache errors with graphs # 180507-2315 - Added new help display # 191013-0828 - Fixes for PHP7 +# 210330-1659 - Added extra warnings and forced confirmation before running report # $startMS = microtime(); @@ -40,6 +41,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["confirm_run"])) {$confirm_run=$_GET["confirm_run"];} + elseif (isset($_POST["confirm_run"])) {$confirm_run=$_POST["confirm_run"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -474,13 +477,15 @@ $MAIN.=""._QXZ("$report_name")." $NWB#LISTS_pass_report$NWE\n"; $MAIN.="
"; $MAIN.="
\n"; -$MAIN.="
"; +$MAIN.=""; +$MAIN.=""; +$MAIN.="
** Due to the complexity of this report, it is strongly recommended that it not be run during production as it can interfere with dialing. **
"; $MAIN.="\n"; $MAIN.="\n"; if ($use_lists > 0) { - $MAIN.=" "._QXZ("Lists").":
"; + $MAIN.="
"._QXZ("Lists").":
"; $MAIN.="
"._QXZ("Campaigns").":
"; + $MAIN.="
"._QXZ("Campaigns").":
"; $MAIN.="\n
\n"; $MAIN.=""._QXZ("SWITCH TO LISTS").""; } -$MAIN.="
"; +$MAIN.=""; $MAIN.=_QXZ("Display as").":
"; $MAIN.="\n"; -$MAIN.="
        "; -$MAIN.=""; +$MAIN.="         "; if ($use_lists > 0) { if (strlen($group[0]) > 1) { $MAIN.=" "._QXZ("MODIFY")." | \n"; - $MAIN.=" "._QXZ("REPORTS")." \n"; + $MAIN.=" "._QXZ("REPORTS")."\n"; } else { $MAIN.=" "._QXZ("LISTS")." | \n"; - $MAIN.=" "._QXZ("REPORTS")." \n"; + $MAIN.=" "._QXZ("REPORTS")."\n"; } } else @@ -545,12 +549,12 @@ else if (strlen($group[0]) > 1) { $MAIN.=" "._QXZ("MODIFY")." | \n"; - $MAIN.=" "._QXZ("REPORTS")." \n"; + $MAIN.=" "._QXZ("REPORTS")."\n"; } else { $MAIN.=" "._QXZ("CAMPAIGNS")." | \n"; - $MAIN.=" "._QXZ("REPORTS")." \n"; + $MAIN.=" "._QXZ("REPORTS")."\n"; } } $MAIN.="
"; @@ -564,7 +568,10 @@ if (strlen($group[0]) < 1) $MAIN.="\n\n"; $MAIN.=_QXZ("PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT")."\n"; } - +else if (strlen($group[0]) >= 1 && !$confirm_run) + { + $MAIN.=""._QXZ("REMINDER - THIS REPORT CAN TAKE A LONG TIME TO RUN AND WILL INTERFERE WITH DIALING IF EXECUTED DURING PRODUCTION.")."
"._QXZ("IF YOU ARE SURE YOU WOULD LIKE TO RUN THE REPORT AT THIS TIME")." "._QXZ("CLICK HERE")."
"; + } else { $OUToutput = ''; @@ -878,13 +885,13 @@ else $SA_three_results = mysqli_num_rows($rslt); if ($SA_three_results > 0) {$row=mysqli_fetch_row($rslt); $SA_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $SA_four_results = mysqli_num_rows($rslt); if ($SA_four_results > 0) {$row=mysqli_fetch_row($rslt); $SA_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $SA_five_results = mysqli_num_rows($rslt); @@ -987,13 +994,13 @@ else $DN_three_results = mysqli_num_rows($rslt); if ($DN_three_results > 0) {$row=mysqli_fetch_row($rslt); $DN_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $DN_four_results = mysqli_num_rows($rslt); if ($DN_four_results > 0) {$row=mysqli_fetch_row($rslt); $DN_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $DN_five_results = mysqli_num_rows($rslt); @@ -1096,13 +1103,13 @@ else $CC_three_results = mysqli_num_rows($rslt); if ($CC_three_results > 0) {$row=mysqli_fetch_row($rslt); $CC_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $CC_four_results = mysqli_num_rows($rslt); if ($CC_four_results > 0) {$row=mysqli_fetch_row($rslt); $CC_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $CC_five_results = mysqli_num_rows($rslt); @@ -1205,13 +1212,13 @@ else $UW_three_results = mysqli_num_rows($rslt); if ($UW_three_results > 0) {$row=mysqli_fetch_row($rslt); $UW_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $UW_four_results = mysqli_num_rows($rslt); if ($UW_four_results > 0) {$row=mysqli_fetch_row($rslt); $UW_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $UW_five_results = mysqli_num_rows($rslt); @@ -1314,13 +1321,13 @@ else $BA_three_results = mysqli_num_rows($rslt); if ($BA_three_results > 0) {$row=mysqli_fetch_row($rslt); $BA_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $BA_four_results = mysqli_num_rows($rslt); if ($BA_four_results > 0) {$row=mysqli_fetch_row($rslt); $BA_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $BA_five_results = mysqli_num_rows($rslt); @@ -1423,13 +1430,13 @@ else $MP_three_results = mysqli_num_rows($rslt); if ($MP_three_results > 0) {$row=mysqli_fetch_row($rslt); $MP_three_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=4 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $MP_four_results = mysqli_num_rows($rslt); if ($MP_four_results > 0) {$row=mysqli_fetch_row($rslt); $MP_four_count = $row[0];} - $stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';"; + $stmt="select count(*) from ".$vicidial_log_table." where called_count=5 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $MP_five_results = mysqli_num_rows($rslt);