diff --git a/UPGRADE b/UPGRADE
index bbdecf12..4baaddf2 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -84,6 +84,8 @@ OTHER CHANGES:
11. Added System Settings option to disable list counts in admin web screens
+12. Added callback user transfer page, linked from Admin Utilities in Reports
+
diff --git a/www/vicidial/AST_inbound_daily_report.php b/www/vicidial/AST_inbound_daily_report.php
index bb63f41b..23ea23b5 100644
--- a/www/vicidial/AST_inbound_daily_report.php
+++ b/www/vicidial/AST_inbound_daily_report.php
@@ -10,9 +10,16 @@
# 120224-0910 - Added HTML display option with bar graphs
# 120601-2235 - Added group name to header, added status breakdown counts to page and CSV with option to display them
# 120611-2200 - Added ability to filter output by call time
+# 120819-0118 - Formatting changes
+#
require("dbconnect.php");
+if (file_exists('options.php'))
+ {
+ require('options.php');
+ }
+
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
@@ -30,6 +37,8 @@ if (isset($_GET["hourly_breakdown"])) {$hourly_breakdown=$_GET["hourly_breakdo
elseif (isset($_POST["hourly_breakdown"])) {$hourly_breakdown=$_POST["hourly_breakdown"];}
if (isset($_GET["show_disposition_statuses"])) {$show_disposition_statuses=$_GET["show_disposition_statuses"];}
elseif (isset($_POST["show_disposition_statuses"])) {$show_disposition_statuses=$_POST["show_disposition_statuses"];}
+if (isset($_GET["ignore_afterhours"])) {$ignore_afterhours=$_GET["ignore_afterhours"];}
+ elseif (isset($_POST["ignore_afterhours"])) {$ignore_afterhours=$_POST["ignore_afterhours"];}
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
@@ -47,6 +56,8 @@ if (strlen($shift)<2) {$shift='ALL';}
$report_name = 'Inbound Daily Report';
$db_source = 'M';
+if ($ignore_afterhours=="checked") {$status_clause=" and status!='AFTHRS'";}
+
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
@@ -127,14 +138,34 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
}
-$LOGadmin_viewable_call_timesSQL='';
-$whereLOGadmin_viewable_call_timesSQL='';
-if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
+if ($IDR_calltime_available==1)
{
- $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
- $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
- $LOGadmin_viewable_call_timesSQL = "and call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
- $whereLOGadmin_viewable_call_timesSQL = "where call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
+ $LOGadmin_viewable_call_timesSQL='';
+ $whereLOGadmin_viewable_call_timesSQL='';
+ if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
+ {
+ $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
+ $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
+ $LOGadmin_viewable_call_timesSQL = "and call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
+ $whereLOGadmin_viewable_call_timesSQL = "where call_time_id IN('---ALL---','$rawLOGadmin_viewable_call_timesSQL')";
+ }
+
+ $stmt="select call_time_id,call_time_name from vicidial_call_times $whereLOGadmin_viewable_call_timesSQL order by call_time_id;";
+ $rslt=mysql_query($stmt, $link);
+ if ($DB) {$MAIN.="$stmt\n";}
+ $times_to_print = mysql_num_rows($rslt);
+ $i=0;
+ while ($i < $times_to_print)
+ {
+ $row=mysql_fetch_row($rslt);
+ $call_times[$i] = $row[0];
+ $call_time_names[$i] = $row[1];
+ $i++;
+ }
+ }
+else
+ {
+ $shift="24hours";
}
$NOW_DATE = date("Y-m-d");
@@ -242,18 +273,24 @@ $MAIN.=" ";
$MAIN.=" ";
-$MAIN.="\n";
+
$MAIN.="\n";
-$MAIN.="
Show hourly results Show disposition statuses | DOWNLOAD | MODIFY | REPORTS |
\n";
+$MAIN.="Show hourly results Show disposition statuses Ignore after-hours calls | DOWNLOAD | MODIFY | REPORTS |
\n";
$MAIN.="";
$MAIN.="\n\n";
@@ -454,13 +491,17 @@ else
$MAIN.="Inbound Daily Report $NOW_TIME\n";
$MAIN.="Selected in-group: $group - $group_name\n";
- if ($shift) {$MAIN.="Selected shift: $shift\n";}
- $MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END for $shift shift\n\n";
+ if ($shift && $IDR_calltime_available) {$MAIN.="Selected shift: $shift\n";}
+ $MAIN.="Time range $DURATIONday days: $query_date_BEGIN to $query_date_END";
+ if ($shift && $IDR_calltime_available) {$MAIN.="for $shift shift";}
+ $MAIN.="\n\n";
#echo "Time range day sec: $SQsec - $EQsec Day range in epoch: $SQepoch - $EQepoch Start: $SQepochDAY\n";
$CSV_text.="\"Inbound Daily Report\",\"$NOW_TIME\"\n";
$CSV_text.="Selected in-group: $group - $group_name\n";
- if ($shift) {$CSV_text.="Selected shift: $shift\n";}
- $CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END for $shift shift\"\n\n";
+ if ($shift && $IDR_calltime_available) {$CSV_text.="Selected shift: $shift\n";}
+ $CSV_text.="\"Time range $DURATIONday days:\",\"$query_date_BEGIN to $query_date_END\"";
+ if ($shift && $IDR_calltime_available) {$CSV_text.="for $shift shift";}
+ $CSV_text.="\n\n";
if ($show_disposition_statuses) {
$dispo_stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' $big_shift_time_SQL_clause order by status;";
@@ -490,7 +531,7 @@ else
$d=0; $q=0; $hr=0; $shift_hrs=0;
while ($d < $DURATIONday)
{
- $dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600) );
+ $dSQepoch = ($SQepoch + ($d * 86400) + ($hr * 3600));
if ($shift && $shift!="ALL" && $RECALC==1)
{
@@ -514,7 +555,7 @@ else
}
else
{
- $dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600) ) );
+ $dEQepoch = ($SQepochDAY + ($EQsec + ($d * 86400) + ($hr * 3600)) );
if ($EQsec < $SQsec)
{
$dEQepoch = ($dEQepoch + 86400);
@@ -525,7 +566,6 @@ else
$daySTART[$q] = date("Y-m-d H:i:s", $dSQepoch);
$dayEND[$q] = date("Y-m-d H:i:s", $dEQepoch);
- # || $time_END<=date("H:i:s", $dEQepoch)
if ($hr>=($hpd-1) || !$hourly_breakdown)
{
$d++;
@@ -806,10 +846,13 @@ else
for ($s=0; $sCarrier Log Report\n";
echo "Hangup Cause Report\n";
echo "Bulk Phone Insert Page\n";
+ echo "Callbacks Transferral Page\n";
echo "Send a Call With Custom CID Page\n";
echo "Speech Voice Lab Page\n";
echo "Webphone Only Page\n";
diff --git a/www/vicidial/callbacks_bulk_change.php b/www/vicidial/callbacks_bulk_change.php
new file mode 100644
index 00000000..67f056a0
--- /dev/null
+++ b/www/vicidial/callbacks_bulk_change.php
@@ -0,0 +1,285 @@
+ LICENSE: AGPLv2
+#
+# CHANGES
+# 120819-0119 - First build
+#
+
+header ("Content-type: text/html; charset=utf-8");
+
+require("dbconnect.php");
+
+$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
+$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
+$PHP_SELF=$_SERVER['PHP_SELF'];
+if (isset($_GET["old_user"])) {$old_user=$_GET["old_user"];}
+ elseif (isset($_POST["old_user"])) {$old_user=$_POST["old_user"];}
+if (isset($_GET["new_user"])) {$new_user=$_GET["new_user"];}
+ elseif (isset($_POST["new_user"])) {$new_user=$_POST["new_user"];}
+if (isset($_GET["group"])) {$group=$_GET["group"];}
+ elseif (isset($_POST["group"])) {$group=$_POST["group"];}
+if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
+ elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
+if (isset($_GET["confirm_transfer"])) {$confirm_transfer=$_GET["confirm_transfer"];}
+ elseif (isset($_POST["confirm_transfer"])) {$confirm_transfer=$_POST["confirm_transfer"];}
+if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
+ elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
+if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
+ elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
+if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
+ elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$qm_conf_ct = mysql_num_rows($rslt);
+$i=0;
+while ($i < $qm_conf_ct)
+ {
+ $row=mysql_fetch_row($rslt);
+ $non_latin = $row[0];
+ $webroot_writable = $row[1];
+ $SSoutbound_autodial_active = $row[2];
+ $i++;
+ }
+##### END SETTINGS LOOKUP #####
+###########################################
+
+$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
+$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
+
+$StarTtimE = date("U");
+$TODAY = date("Y-m-d");
+$NOW_TIME = date("Y-m-d H:i:s");
+$ip = getenv("REMOTE_ADDR");
+
+if (!isset($begin_date)) {$begin_date = $TODAY;}
+if (!isset($end_date)) {$end_date = $TODAY;}
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
+if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
+
+$fp = fopen ("./project_auth_entries.txt", "a");
+$date = date("r");
+$ip = getenv("REMOTE_ADDR");
+$browser = getenv("HTTP_USER_AGENT");
+
+if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+ {
+ Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+ Header("HTTP/1.0 401 Unauthorized");
+ echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
+ exit;
+ }
+else
+ {
+ if($auth>0)
+ {
+ $stmt="SELECT full_name,change_agent_campaign,modify_timeclock_log,user_group,user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
+ $rslt=mysql_query($stmt, $link);
+ $row=mysql_fetch_row($rslt);
+ $LOGfullname = $row[0];
+ $change_agent_campaign = $row[1];
+ $modify_timeclock_log = $row[2];
+ $LOGuser_group = $row[3];
+ $user_level=$row[4];
+ if ($user_level==9)
+ {
+ $ul_clause="where user_level<=9";
+ } else {
+ $ul_clause="where user_level<$user_level";
+ }
+ if ($webroot_writable > 0)
+ {
+ fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
+ fclose($fp);
+ }
+ }
+ else
+ {
+ if ($webroot_writable > 0)
+ {
+ fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
+ fclose($fp);
+ }
+ exit;
+ }
+ }
+
+$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
+if ($DB) {$HTML_text.="|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGallowed_campaigns = $row[0];
+$LOGallowed_reports = $row[1];
+$LOGadmin_viewable_groups = $row[2];
+$LOGadmin_viewable_call_times = $row[3];
+
+$LOGadmin_viewable_groupsSQL='';
+$whereLOGadmin_viewable_groupsSQL='';
+if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
+ {
+ $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
+ $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
+ $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
+ $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
+ }
+
+$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group desc;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$groups_to_print = mysql_num_rows($rslt);
+$i=0;
+while ($i < $groups_to_print)
+ {
+ $row=mysql_fetch_row($rslt);
+ $groups[$i] = $row[0];
+ $group_names[$i] = $row[1];
+ $i++;
+ }
+
+if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
+ $upd_stmt="update vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
+ $upd_rslt=mysql_query($upd_stmt, $link);
+ if ($DB) {echo "$upd_stmt\n";}
+}
+?>
+
+
+
+ADMINISTRATION: USERONLY Callbacks Transfer
+';
+$header_nonselected_bold='';
+$usergroups_color = '#FFFF99';
+$usergroups_font = 'BLACK';
+$usergroups_color = '#E6E6E6';
+$subcamp_color = '#C6C6C6';
+##### END Set variables to make header show properly #####
+
+require("admin_header.php");
+
+?>
+
+
+| USERONLY Callback Transfer | |
+
+
+
+
+ \n";
+
+### callbacks change form
+echo " |
|