Added Level 8 Disable Add option to system settings

Added Email Log Report
Small change to Lists campaign report to make it more efficient

git-svn-id: svn://192.168.202.10@1936 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2013-02-22 02:53:19 +00:00
parent 0256380fc3
commit e405cc5459
10 changed files with 3097 additions and 2047 deletions
+3
View File
@@ -167,6 +167,9 @@ OTHER CHANGES:
34. Added campaign options to send answering machine detected calls to a
Call Menu or In-Group.
35. Added System Settings option to disable Add/Copy admin functions for level
8 users.
@@ -1508,7 +1508,8 @@ svn_revision INT(9) default '0',
queuemetrics_socket VARCHAR(20) default 'NONE',
queuemetrics_socket_url TEXT,
enhanced_disconnect_logging ENUM('0','1') default '0',
allow_emails ENUM('0','1') default '0'
allow_emails ENUM('0','1') default '0',
level_8_disable_add ENUM('0','1') default '0'
);
CREATE TABLE vicidial_campaigns_list_mix (
@@ -3096,4 +3097,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='1340',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1341',db_schema_update_date=NOW();
+4
View File
@@ -309,3 +309,7 @@ ALTER TABLE vicidial_campaigns ADD amd_inbound_group VARCHAR(20) default '';
ALTER TABLE vicidial_campaigns ADD amd_callmenu VARCHAR(50) default '';
UPDATE system_settings SET db_schema_version='1340',db_schema_update_date=NOW() where db_schema_version < 1340;
ALTER TABLE system_settings ADD level_8_disable_add ENUM('0','1') default '0';
UPDATE system_settings SET db_schema_version='1341',db_schema_update_date=NOW() where db_schema_version < 1341;
@@ -180,6 +180,9 @@ AMD Inbound Group||
If CPD AMD Action is set to INGROUP, then this is the Inbound Group that the call will be sent to if an answering machine is detected||
AMD Call Menu||
If CPD AMD Action is set to CALLMENU, then this is the Call Menu that the call will be sent to if an answering machine is detected||
Level 8 Disable Add||
This setting if enabled will prevent any level 8 user from adding or copying any record in the system, no matter what their user settings are. Excluded from these restrictions are the ability to add DNC and Filter Phone Groups numbers and the Add a New Lead page. Default is 0 for disabled||
You do not have permission to add records on this system||
############################################################ CLIENT
@@ -1,7 +1,7 @@
<?php
# AST_LISTS_campaign_stats.php
#
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> 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
@@ -11,6 +11,7 @@
# 110703-1815 - Added download option
# 120224-0910 - Added HTML display option with bar graphs
# 120524-1754 - Fixed status categories issue
# 130221-1928 - small change to remove nested SQL query
#
header ("Content-type: text/html; charset=utf-8");
@@ -179,6 +180,15 @@ else
$group_SQL = "where campaign_id IN($group_SQL)";
}
# Get lists to query to avoid using a nested query
$lists_id_str="";
$list_stmt="SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand";
$list_rslt=mysql_query($list_stmt, $link);
while ($lrow=mysql_fetch_row($list_rslt)) {
$lists_id_str.="'$lrow[0]',";
}
$lists_id_str=substr($lists_id_str,0,-1);
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
@@ -200,7 +210,7 @@ while ($i < $statcats_to_print)
}
$category_statuses=substr($category_statuses, 0, -1);
$category_stmt="select count(*) from vicidial_list where status in ($category_statuses) and list_id IN( SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand)";
$category_stmt="select count(*) from vicidial_list where status in ($category_statuses) and list_id IN($lists_id_str)";
if ($DB) {echo "$category_stmt\n";}
$category_rslt=mysql_query($category_stmt, $link);
$category_row=mysql_fetch_row($category_rslt);
@@ -363,7 +373,15 @@ else
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LEADS</th>\n";
$GRAPH.="</tr>\n";
$stmt="select count(*),list_id from vicidial_list where list_id IN( SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand) group by list_id;";
$lists_id_str="";
$list_stmt="SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand";
$list_rslt=mysql_query($list_stmt, $link);
while ($lrow=mysql_fetch_row($list_rslt)) {
$lists_id_str.="'$lrow[0]',";
}
$lists_id_str=substr($lists_id_str,0,-1);
$stmt="select count(*),list_id from vicidial_list where list_id IN($lists_id_str) group by list_id;";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$listids_to_print = mysql_num_rows($rslt);
@@ -0,0 +1,86 @@
<?php
# AST_email_log_display - VICIDIAL administration page
#
# Copyright (C) 2013 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# This page displays emails from the log
#
# changes:
# 130221-2124 - First build
#
require("dbconnect.php");
require("functions.php");
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];}
elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];}
if (isset($_GET["email_log_id"])) {$email_log_id=$_GET["email_log_id"];}
elseif (isset($_POST["email_log_id"])) {$email_log_id=$_POST["email_log_id"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled,allow_emails FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
$custom_fields_enabled = $row[3];
$allow_emails = $row[4];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($allow_emails<1)
{
echo "Your system does not have the email setting enabled\n";
exit;
}
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
if ($email_log_id) {
$stmt="select * from vicidial_email_log where email_log_id='$email_log_id'";
$rslt=mysql_query($stmt, $link);
} else if ($email_row_id) {
$stmt="select * from vicidial_email_list where email_row_id='$email_row_id'";
$rslt=mysql_query($stmt, $link);
}
if (mysql_num_rows($rslt)>0) {
$row=mysql_fetch_array($rslt);
$row["message"]=preg_replace('/\r|\n/', "<BR/>", $row["message"]);
$EMAIL_form="<TABLE cellspacing=2 cellpadding=2 bgcolor='#CCCCCC' width='500'>\n";
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='100'>Date sent:</td><td align='left' valign='top' width='400'>$row[email_date]</td></tr>\n";
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='100'>Message:</td><td align='left' valign='top' width='400'>$row[message]</td></tr>\n";
$EMAIL_form.="</table>";
}
?>
<html>
<head>
<title>VICIDIAL email frame</title>
</head>
<body topmargin=0 leftmargin=0>
<?php echo $EMAIL_form; ?>
</body>
</html>
@@ -0,0 +1,516 @@
<?php
# AST_email_log_report.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# report of emails handled by the system
#
# CHANGELOG:
# 130221-2117 - First build
#
$version = '2.6-1';
$build = '130221-2117';
header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["RR"])) {$RR=$_GET["RR"];}
elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];}
if (isset($_GET["inbound"])) {$inbound=$_GET["inbound"];}
elseif (isset($_POST["inbound"])) {$inbound=$_POST["inbound"];}
if (isset($_GET["group"])) {$group=$_GET["group"];}
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];}
elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
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"];}
if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];}
elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];}
if (isset($_GET["email_type"])) {$email_type=$_GET["email_type"];}
elseif (isset($_POST["email_type"])) {$email_type=$_POST["email_type"];}
if (isset($_GET["date_type"])) {$date_type=$_GET["date_type"];}
elseif (isset($_POST["date_type"])) {$date_type=$_POST["date_type"];}
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
$report_name = 'Email Log Report';
$db_source = 'M';
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,email_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$outbound_autodial_active = $row[1];
$slave_db_server = $row[2];
$reports_use_slave_db = $row[3];
$email_enabled = $row[4];
}
##### END SETTINGS LOOKUP #####
###########################################
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
{
mysql_close($link);
$use_slave_server=1;
$db_source = 'S';
require("dbconnect.php");
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
}
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$gmt_conf_ct = mysql_num_rows($rslt);
$dst = date("I");
if ($gmt_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$local_gmt = $row[0];
$epoch_offset = (($local_gmt + $dst) * 3600);
}
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$reports_only_user=$row[0];
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;
}
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGuser_group = $row[0];
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
if ($DB) {$MAIN.="|$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];
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
exit;
}
$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')";
}
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = '';}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
$stmt="select group_id,group_name,8 from vicidial_inbound_groups where group_handling='EMAIL' $LOGadmin_viewable_groupsSQL order by group_id;";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$groups_to_print = mysql_num_rows($rslt);
$i=0;
$LISTgroups[$i]='---NONE---';
$i++;
$groups_to_print++;
$groups_string='|';
while ($i < $groups_to_print)
{
$row=mysql_fetch_row($rslt);
$LISTgroups[$i] = $row[0];
$LISTgroup_names[$i] = $row[1];
$LISTgroup_ids[$i] = $row[2];
$groups_string .= "$LISTgroups[$i]|";
$i++;
}
$i=0;
$group_string='|';
$group_ct = count($group);
while($i < $group_ct)
{
if ( (strlen($group[$i]) > 0) and (preg_match("/\|$group[$i]\|/",$groups_string)) )
{
$group_string .= "$group[$i]|";
$group_SQL .= "'$group[$i]',";
$groupQS .= "&group[]=$group[$i]";
}
$i++;
}
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
{
$group_SQL = "''";
# $group_SQL = "group_id IN('')";
}
else
{
$group_SQL = eregi_replace(",$",'',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)";
}
if (strlen($group_SQL)<3) {$group_SQL="''";}
$HEADER.="<HTML>\n";
$HEADER.="<HEAD>\n";
$HEADER.="<STYLE type=\"text/css\">\n";
$HEADER.="<!--\n";
$HEADER.=" .green {color: white; background-color: green}\n";
$HEADER.=" .red {color: white; background-color: red}\n";
$HEADER.=" .blue {color: white; background-color: blue}\n";
$HEADER.=" .purple {color: white; background-color: purple}\n";
$HEADER.="-->\n";
$HEADER.=" </STYLE>\n";
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
$HEADER.="<link rel=\"stylesheet\" href=\"verticalbargraph.css\">\n";
$HEADER.="<script language=\"JavaScript\" src=\"wz_jsgraphics.js\"></script>\n";
$HEADER.="<script language=\"JavaScript\" src=\"line.js\"></script>\n";
$HEADER.="<script language=\"JavaScript\" src=\"line.js\"></script>\n";
$HEADER.="<script language=\"JavaScript\">\n";
$HEADER.="function OpenWindow(URL) {\n";
$HEADER.="\tvar ns = navigator.appName == \"Netscape\";\n";
$HEADER.="\tif (ns)\n";
$HEADER.="\t\t{\n";
$HEADER.="\t\tBrowseWidth = window.innerWidth;\n";
$HEADER.="\t\tBrowseHeight = window.innerHeight;\n";
$HEADER.="\t\t}\n";
$HEADER.="\telse\n";
$HEADER.="\t\t{\n";
$HEADER.="\t\tBrowseWidth = document.body.clientWidth;\n";
$HEADER.="\t\tBrowseHeight = document.body.clientHeight;\n";
$HEADER.="\t\t}\n";
$HEADER.="\t\tvar params='width='+BrowseWidth+',height='+BrowseHeight+',menubar=1,resizable=1,toolbar=1,scrollbars=1';\n";
$HEADER.="\t\tEMAILWindow=window.open(URL,params);\n";
$HEADER.="\t\tEMAILWindow.moveTo(0,0);\n";
$HEADER.="\t\tEMAILWindow.resizeTo(500,500);\n";
$HEADER.="}\n";
$HEADER.="</script>\n";
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
$short_header=1;
#require("admin_header.php");
$MAIN.="<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
if ($DB > 0)
{
$MAIN.="<BR>\n";
$MAIN.="$group_ct|$group_string|$group_SQL\n";
$MAIN.="<BR>\n";
$MAIN.="$shift|$query_date|$end_date\n";
$MAIN.="<BR>\n";
}
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
$MAIN.="<TABLE BORDER=0><TR><TD VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>\n";
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
$MAIN.="Date Range:<BR>\n";
$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
$MAIN.="<script language=\"JavaScript\">\n";
$MAIN.="var o_cal = new tcal ({\n";
$MAIN.=" // form name\n";
$MAIN.=" 'formname': 'vicidial_report',\n";
$MAIN.=" // input name\n";
$MAIN.=" 'controlname': 'query_date'\n";
$MAIN.="});\n";
$MAIN.="o_cal.a_tpl.yearscroll = false;\n";
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.=" to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
$MAIN.="<script language=\"JavaScript\">\n";
$MAIN.="var o_cal = new tcal ({\n";
$MAIN.=" // form name\n";
$MAIN.=" 'formname': 'vicidial_report',\n";
$MAIN.=" // input name\n";
$MAIN.=" 'controlname': 'end_date'\n";
$MAIN.="});\n";
$MAIN.="o_cal.a_tpl.yearscroll = false;\n";
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.="</FONT></TD><TD VALIGN=TOP><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Email groups:<BR>\n";
$MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
$o=0;
while ($groups_to_print > $o)
{
if (ereg("\|$LISTgroups[$o]\|",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
$o++;
}
$MAIN.="</SELECT>\n";
$MAIN.="</FONT></TD><TD VALIGN=TOP>\n";
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ";
if ($DID!='Y')
{
$MAIN.="<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFY</a> | ";
$MAIN.="<a href=\"./AST_IVRstats.php?query_date=$query_date&end_date=$end_date&shift=$shift$groupQS\">IVR REPORT</a> | \n";
}
$MAIN.="<a href=\"./admin.php?ADD=999999\">REPORTS</a> | ";
$MAIN.="<BR><BR><BR><CENTER><INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT></CENTER>\n";
$MAIN.="</FONT>\n";
$MAIN.="</TD></TR>\n";
$MAIN.="<TR><TD><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>\n";
$MAIN.="<BR>Select date criteria:&nbsp;<BR>";
if (!$date_type || $date_type=="email_date") {$emailed="checked"; $date_title="received";}
if ($date_type=="call_date") {$called="checked"; $date_title="viewed";}
if ($date_type=="date_answered") {$answrd="checked"; $date_title="answered";}
$rpt_title.="from $query_date_BEGIN to $query_date_END ";
$MAIN.="<input type='radio' name='date_type' value='email_date' $emailed>Date email received<BR>\n";
$MAIN.="<input type='radio' name='date_type' value='call_date' $called>Date email viewed<BR>\n";
$MAIN.="<input type='radio' name='date_type' value='date_answered' $answrd>Date email answered<BR>\n";
$MAIN.="</FONT></TD><TD><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>\n";
$MAIN.="<BR>Select report type to display:&nbsp;<BR>";
if (!$email_type || $email_type=="received") {$rcvd="checked"; $date_type="email_date"; $email_title="received";}
if ($email_type=="viewed") {$view="checked"; $email_title="viewed";}
if ($email_type=="answered") {$answ="checked"; $email_title="answered";}
$MAIN.="<input type='radio' name='email_type' value='received' $rcvd>Emails received<BR>\n";
$MAIN.="<input type='radio' name='email_type' value='viewed' $view>Emails viewed<BR>\n";
$MAIN.="<input type='radio' name='email_type' value='answered' $answ>Emails answered<BR>\n";
$MAIN.="</FONT></TD></TR></TABLE>\n";
$MAIN.="</FORM>\n\n";
$MAIN.="<PRE><FONT SIZE=2>\n\n";
if ($groups_to_print < 1)
{
$MAIN.="\n\n";
$MAIN.="PLEASE SELECT AN EMAIL ACCOUNT AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
}
else
{
if ($shift == 'AM')
{
$time_BEGIN=$AM_shift_BEGIN;
$time_END=$AM_shift_END;
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
}
if ($shift == 'PM')
{
$time_BEGIN=$PM_shift_BEGIN;
$time_END=$PM_shift_END;
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
}
if ($shift == 'ALL')
{
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
}
$query_date_BEGIN = "$query_date 00:00:00";
$query_date_END = "$end_date 23:59:59";
$rpt_title="Showing emails $email_title that were $date_title from $query_date_BEGIN to $query_date_END\n\n";
$MAIN.=$rpt_title;
$MAIN.="Email log results: $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1&date_type=$date_type&email_type=$email_type\">DOWNLOAD</a>\n";
$CSV_text1.="\"Showing emails $email_title that were $date_title from $query_date_BEGIN to $query_date_END\"\n\n";
if ($email_type=="received")
{
$rpt_border="+---------------------+--------------------------------+----------------------+----------------------------------------------------+------------+\n";
$rpt_header="| DATE EMAIL RECEIVED | ".sprintf("%-30s", "ADDRESS FROM")." | ".sprintf("%-20s", "SENDER NAME")." | ".sprintf("%-50s", "MESSAGE")." | ".sprintf("%-10s", "STATUS")." |\n";
$CSV_text1.="\"DATE EMAIL RECEIVED\",\"ADDRESS FROM\",\"SENDER NAME\",\"MESSAGE\",\"STATUS\"\n";
if ($date_type=="email_date")
{
# $stmt="select vel.* from vicidial_email_list vel where $date_type>='$query_date_BEGIN' and $date_type<='$query_date_END' and group_id in ($group_SQL) order by $date_type asc";
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status from vicidial_email_list vel where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
# $stmt="select vel.*, vcl.call_date, from vicidial_email_list vel, vicidial_closer_log vcl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vcl.$date_type asc";
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status from vicidial_email_list vel where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
}
else if ($email_type=="viewed")
{
$rpt_border="+---------------------+--------------------------------+----------------------+----------------------------------------------------+---------------------+------------+\n";
$rpt_header="| DATE EMAIL RECEIVED | ".sprintf("%-30s", "ADDRESS FROM")." | ".sprintf("%-20s", "SENDER NAME")." | ".sprintf("%-50s", "MESSAGE")." | DATE EMAIL VIEWED | ".sprintf("%-10s", "STATUS")." |\n";
$CSV_text1.="\"DATE EMAIL RECEIVED\",\"ADDRESS FROM\",\"SENDER NAME\",\"MESSAGE\",\"DATE EMAIL VIEWED\",\"STATUS\"\n";
if ($date_type=="email_date")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
}
else if ($email_type=="answered")
{
$rpt_border="+---------------------+--------------------------------+----------------------+----------------------------------------------------+---------------------+---------------------+----------------------+----------------------------------------------------+------------+\n";
$rpt_header="| DATE EMAIL RECEIVED | ".sprintf("%-30s", "ADDRESS FROM")." | ".sprintf("%-20s", "SENDER NAME")." | ".sprintf("%-50s", "MESSAGE (click to view full text)")." | DATE EMAIL VIEWED | DATE EMAIL ANSWERED | ".sprintf("%-20s", "USER")." | ".sprintf("%-50s", "RESPONSE (click to view full text)")." | ".sprintf("%-10s", "STATUS")." |\n";
$CSV_text1.="\"DATE EMAIL RECEIVED\",\"ADDRESS FROM\",\"SENDER NAME\",\"MESSAGE\",\"DATE EMAIL VIEWED\",\"DATE EMAIL ANSWERED\",\"USER\",\"RESPONSE\",\"STATUS\"\n";
if ($date_type=="email_date")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
$stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'utf8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
}
#echo $stmt."\n";
$rslt=mysql_query($stmt, $link);
if (mysql_num_rows($rslt)>0) {
$i=0;
$rpt_str=$rpt_border;
$rpt_str.=$rpt_header;
$rpt_str.=$rpt_border;
while($row=mysql_fetch_array($rslt)) {
$email_row_id=$row["email_row_id"];
$email_log_id=$row["email_log_id"];
$lead_id=$row["lead_id"];
$email_date=$row["email_date"];
$email_from=$row["email_from"];
if (mb_strlen($email_from,'UTF-8')>27) {$email_from=mb_substr($email_from,0,27,'UTF-8')."...";}
$sender_name=$row["email_from_name"];
if (mb_strlen($sender_name,'UTF-8')>17) {$sender_name=mb_substr($sender_name,0,17,'UTF-8')."...";}
$message=preg_replace('/\r|\n/', '', strip_tags($row["message"]));
if (mb_strlen($message,'UTF-8')>47) {$message=mb_substr($message,0,47,'UTF-8')."...";}
$call_date=$row["call_date"];
$date_answered=$row["date_response_sent"];
$sent_message=preg_replace('/\r|\n/', ' ', strip_tags($row["sent_message"]));
if (mb_strlen($sent_message,'UTF-8')>47) {$sent_message=mb_substr($sent_message,0,47,'UTF-8')."...";}
$user=$row["sending_user"];
$status=$row["status"];
if ($email_type=="received") {
$rpt_line="| $email_date | ".sprintf("%-30s", "$email_from")." | ".sprintf("%-20s", "$sender_name")." | <a href='#' onClick=\"OpenWindow('./AST_email_log_display.php?email_row_id=$email_row_id')\">".sprintf("%-50s", "$message")."</a> | ".sprintf("%-10s", "$status")." |\n";
$CSV_text1.="\"$email_date\",\"$email_from\",\"$sender_name\",\"$message\",\"$status\"\n";
} else if ($email_type=="viewed") {
$rpt_line="| $email_date | ".sprintf("%-30s", "$email_from")." | ".sprintf("%-20s", "$sender_name")." | <a href='#' onClick=\"OpenWindow('./AST_email_log_display.php?email_row_id=$email_row_id')\">".sprintf("%-50s", "$message")."</a> | $call_date | ".sprintf("%-10s", "$status")." |\n";
$CSV_text1.="\"$email_date\",\"$email_from\",\"$sender_name\",\"$message\",\"$call_date\",\"$status\"\n";
} else if ($email_type=="answered") {
$rpt_line="| $email_date | ".sprintf("%-30s", "$email_from")." | ".sprintf("%-20s", "$sender_name")." | <a href='#' onClick=\"OpenWindow('./AST_email_log_display.php?email_row_id=$email_row_id')\">".sprintf("%-50s", "$message")."</a> | $call_date | $date_answered | ".sprintf("%-20s", $user)." | <a href='#' onClick=\"OpenWindow('./AST_email_log_display.php?email_log_id=$email_log_id')\">".sprintf("%-50s", "$sent_message")."</a> | ".sprintf("%-10s", "$status")." |\n";
$CSV_text1.="\"$email_date\",\"$email_from\",\"$sender_name\",\"$message\",\"$call_date\",\"$date_answered\",\"$user\",\"$sent_message\",\"$status\"\n";
}
$rpt_str.=$rpt_line;
}
$rpt_str.=$rpt_border;
} else {
$rpt_str="**NO RESULTS FOUND**\n\n";
}
$MAIN.=$rpt_str;
$ENDtime = date("U");
$RUNtime = ($ENDtime - $STARTtime);
$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
$MAIN.="</PRE>";
$MAIN.="</TD></TR></TABLE>";
$MAIN.="</BODY></HTML>";
if ($file_download>0) {
$FILE_TIME = date("Ymd-His");
$CSVfilename = "AST_email_log_report_$US$FILE_TIME.csv";
$CSV_var="CSV_text1";
$CSV_text=preg_replace('/^\s+/', '', $$CSV_var);
$CSV_text=preg_replace('/ +\"/', '"', $CSV_text);
$CSV_text=preg_replace('/\" +/', '"', $CSV_text);
// We'll be outputting a TXT file
header('Content-type: application/octet-stream');
// It will be called LIST_101_20090209-121212.txt
header("Content-Disposition: attachment; filename=\"$CSVfilename\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
echo "$CSV_text1";
exit;
} else {
echo $HEADER;
echo $JS_text;
require("admin_header.php");
echo $MAIN;
}
}
?>
File diff suppressed because one or more lines are too long
@@ -8,10 +8,11 @@
# changes:
# 121214-2245 - First Build
# 130102-1131 - Small admin log change
# 130221-1754 - Added level 8 disable add feature
#
$admin_version = '2.6-2';
$build = '130102-1131';
$admin_version = '2.6-3';
$build = '130221-1754';
$sh="emails";
@@ -75,7 +76,7 @@ if (isset($_GET["agent_search_method"])) {$agent_search_method=$_GET["agent_
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,allow_emails,allow_emails FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password,test_campaign_calls,active_voicemail_server,voicemail_timezones,default_voicemail_timezone,default_local_gmt,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,allow_emails,allow_emails,level_8_disable_add FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -115,6 +116,7 @@ if ($qm_conf_ct > 0)
$SStables_use_alt_log_db = $row[30];
$SSallow_emails = $row[31];
$SSemail_enabled = $row[32];
$SSlevel_8_disable_add = $row[33];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -144,7 +146,7 @@ else
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$add_copy_disabled=0;
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_email_accounts='1';";
if ($DB) {echo "|$stmt|\n";}
@@ -181,6 +183,9 @@ else
$LOGuser_group = $row[2];
$LOGemails_modify = $row[3];
if (($LOGuser_level < 9) and ($SSlevel_8_disable_add > 0))
{$add_copy_disabled++;}
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
@@ -339,25 +344,32 @@ if (($SUBMIT=="SUBMIT" || $SUBMIT=="UPDATE") && $email_account_id)
{
if ($SUBMIT=="SUBMIT")
{
$ins_stmt="INSERT INTO vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, email_replyto_address, protocol, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$email_account_id', '$email_account_name', '$email_account_description', '$user_group', '$email_replyto_address', '$protocol', '$email_account_server', '$email_account_user', '$email_account_pass', '$active', '$email_frequency_check_mins', '$group_id', '$default_list_id', '$email_account_type', '$call_handle_method', '$agent_search_method', '$list_id', '$campaign_id')";
$ins_rslt=mysql_query($ins_stmt, $link);
if (mysql_affected_rows($link)==0)
if ($add_copy_disabled > 0)
{
$error_msg.="- There was an unknown error when attempting to create the new account<BR/>";
if($DB>0) {$error_msg.="<B>$ins_stmt</B><BR>";}
echo "<br>You do not have permission to add records on this system -system_settings-\n";
}
else
else
{
$message="NEW ACCOUNT $email_account_id SUCCESSFULLY CREATED";
$eact="";
$ins_stmt="INSERT INTO vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, email_replyto_address, protocol, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$email_account_id', '$email_account_name', '$email_account_description', '$user_group', '$email_replyto_address', '$protocol', '$email_account_server', '$email_account_user', '$email_account_pass', '$active', '$email_frequency_check_mins', '$group_id', '$default_list_id', '$email_account_type', '$call_handle_method', '$agent_search_method', '$list_id', '$campaign_id')";
$ins_rslt=mysql_query($ins_stmt, $link);
if (mysql_affected_rows($link)==0)
{
$error_msg.="- There was an unknown error when attempting to create the new account<BR/>";
if($DB>0) {$error_msg.="<B>$ins_stmt</B><BR>";}
}
else
{
$message="NEW ACCOUNT $email_account_id SUCCESSFULLY CREATED";
$eact="";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
@@ -391,26 +403,33 @@ else if ($SUBMIT=="COPY")
$rslt=mysql_query($stmt, $link);
if (mysql_num_rows($rslt)>0)
{
$row=mysql_fetch_array($rslt);
$ins_stmt="insert into vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, protocol, email_replyto_address, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$new_account_id', '$email_account_name', '$row[email_account_description]', '$row[user_group]', '$row[protocol]', '$row[email_replyto_address]', '$row[email_account_server]', '$row[email_account_user]', '$row[email_account_pass]', '$row[active]', '$row[email_frequency_check_mins]', '$row[group_id]','$row[default_list_id]', '$row[email_account_type]', '$row[call_handle_method]','$row[agent_search_method]', '$row[list_id]', '$row[campaign_id]')";
$ins_rslt=mysql_query($ins_stmt, $link);
if (mysql_affected_rows($link)==0)
if ($add_copy_disabled > 0)
{
$error_msg.="- There was an unknown error when attempting to copy the new account<BR/>";
if($DB>0) {$error_msg.="<B>$ins_stmt</B><BR>";}
echo "<br>You do not have permission to add records on this system -system_settings-\n";
}
else
{
$message="NEW ACCOUNT $new_account_id SUCCESSFULLY COPIED FROM $source_email_account<BR/>";
$eact="";
$row=mysql_fetch_array($rslt);
$ins_stmt="insert into vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, protocol, email_replyto_address, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$new_account_id', '$email_account_name', '$row[email_account_description]', '$row[user_group]', '$row[protocol]', '$row[email_replyto_address]', '$row[email_account_server]', '$row[email_account_user]', '$row[email_account_pass]', '$row[active]', '$row[email_frequency_check_mins]', '$row[group_id]','$row[default_list_id]', '$row[email_account_type]', '$row[call_handle_method]','$row[agent_search_method]', '$row[list_id]', '$row[campaign_id]')";
$ins_rslt=mysql_query($ins_stmt, $link);
if (mysql_affected_rows($link)==0)
{
$error_msg.="- There was an unknown error when attempting to copy the new account<BR/>";
if($DB>0) {$error_msg.="<B>$ins_stmt</B><BR>";}
}
else
{
$message="NEW ACCOUNT $new_account_id SUCCESSFULLY COPIED FROM $source_email_account<BR/>";
$eact="";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
}
}
}
else
+46 -16
View File
@@ -1,7 +1,7 @@
<?php
# admin_header.php - VICIDIAL administration header
#
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
@@ -40,6 +40,7 @@
# 121116-1412 - Added QC functionality
# 121123-0911 - Added Call Times Holidays Inbound functionality
# 121214-2238 - Added email menus
# 130221-1830 - Added Level 8 disable add option
#
@@ -1058,7 +1059,7 @@ else
echo "<!-- INTERNATIONALIZATION-LINKS-PLACEHOLDER-VICIDIAL -->\n";
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails from system_settings;";
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$admin_home_url_LU = $row[0];
@@ -1066,6 +1067,9 @@ $SSenable_tts_integration = $row[1];
$SScallcard_enabled = $row[2];
$SScustom_fields_enabled = $row[3];
$SSemail_enabled = $row[4];
$SSlevel_8_disable_add = $row[5];
?>
<CENTER>
@@ -1086,10 +1090,12 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $users_color ?>><TD ALIGN=LEFT>
&nbsp; <a href="<?php echo $ADMIN ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Show Users </a>
</TR><TR BGCOLOR=<?php echo $users_color ?>><TD ALIGN=LEFT>
<?php if ($add_copy_disabled < 1) { ?>
&nbsp; <a href="<?php echo $ADMIN ?>?ADD=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Add A New User </a>
</TR><TR BGCOLOR=<?php echo $users_color ?>><TD ALIGN=LEFT>
&nbsp; <a href="<?php echo $ADMIN ?>?ADD=1A"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Copy User </a>
</TR><TR BGCOLOR=<?php echo $users_color ?>><TD ALIGN=LEFT>
<?php } ?>
&nbsp; <a href="<?php echo $ADMIN ?>?ADD=550"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>Search For A User </a>
</TR><TR BGCOLOR=<?php echo $users_color ?>><TD ALIGN=LEFT>
&nbsp; <a href="./user_stats.php?user=<?php echo $user ?>"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>>User Stats </a>
@@ -1186,8 +1192,10 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=100"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Lists </a>
</TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New List </a>
</TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT> &nbsp;
<?php } ?>
<a href="admin_search_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Search For A Lead </a>
</TR><TR BGCOLOR=<?php echo $lists_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="admin_modify_lead.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Lead </a>
@@ -1223,7 +1231,9 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $scripts_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Scripts </a>
</TR><TR BGCOLOR=<?php echo $scripts_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Script </a>
<?php } ?>
</TD></TR>
<?php }
?>
@@ -1240,7 +1250,9 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $filters_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=10000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Filters </a>
</TR><TR BGCOLOR=<?php echo $filters_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=11111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Filter </a>
<?php } ?>
</TD></TR>
<?php }
}
@@ -1258,9 +1270,11 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show In-Groups </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New In-Group </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1211"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy In-Group </a>
<?php } ?>
<HR>
<?php
if ($SSemail_enabled>0)
@@ -1269,9 +1283,11 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1800"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Email Groups </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1811"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add New Email Group </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1911"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy Email Group </a>
<?php } ?>
<HR>
<?php
}
@@ -1279,10 +1295,12 @@ $SSemail_enabled = $row[4];
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1300"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show DIDs </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1311"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New DID </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1411"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy DID </a>
<?php
}
if ($SSdid_ra_extensions_enabled > 0)
{
?>
@@ -1295,15 +1313,19 @@ $SSemail_enabled = $row[4];
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1500"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Call Menus </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1511"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Call Menu </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1611"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy Call Menu </a>
<?php } ?>
<HR>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=1700"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Filter Phone Groups </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=1711"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Filter Phone Group </a>
</TD></TR><TR BGCOLOR=<?php echo $ingroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php } ?>
<a href="<?php echo $ADMIN ?>?ADD=171"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo $FPGlink ?> </a>
</TD></TR>
<?php }
@@ -1319,8 +1341,10 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $usergroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=100000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show User Groups </a>
</TR><TR BGCOLOR=<?php echo $usergroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New User Group </a>
</TR><TR BGCOLOR=<?php echo $usergroups_color ?>><TD ALIGN=LEFT> &nbsp;
<?php } ?>
<a href="group_hourly_stats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Group Hourly Report </a>
</TR><TR BGCOLOR=<?php echo $usergroups_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="user_group_bulk_change.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Bulk Group Change </a>
@@ -1338,11 +1362,15 @@ $SSemail_enabled = $row[4];
<TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=10000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Remote Agents </a>
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=11111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add New Remote Agents </a>
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT> &nbsp;
<?php } ?>
<a href="<?php echo $ADMIN ?>?ADD=12000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Extension Groups </a>
</TR><TR BGCOLOR=<?php echo $remoteagent_color ?>><TD ALIGN=LEFT> &nbsp;
<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=12111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Extension Group </a>
<?php } ?>
</TD></TR>
<?php }
?>
@@ -1484,44 +1512,46 @@ $SSemail_enabled = $row[4];
<?php
if (strlen($list_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $subcamp_color ?>><TD ALIGN=LEFT COLSPAN=2><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Show Campaigns </a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="<?php echo $ADMIN ?>?ADD=11"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Add A New Campaign </a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="<?php echo $ADMIN ?>?ADD=12"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Copy Campaign </a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="./AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Real-Time Campaigns Summary </a></TD></TR>
<TR BGCOLOR=<?php echo $subcamp_color ?>><TD ALIGN=LEFT COLSPAN=2><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Show Campaigns </a> &nbsp; &nbsp; |<?php if ($add_copy_disabled < 1) { ?>
&nbsp; &nbsp; <a href="<?php echo $ADMIN ?>?ADD=11"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Add A New Campaign </a> &nbsp; &nbsp; | &nbsp; &nbsp; <a href="<?php echo $ADMIN ?>?ADD=12"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Copy Campaign </a> &nbsp; &nbsp; |<?php } ?> &nbsp; &nbsp; <a href="./AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subcamp_font_size ?>> Real-Time Campaigns Summary </a></TD></TR>
<?php }
if (strlen($times_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $times_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=100000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Call Times </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Call Time </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=1000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show State Call Times </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=1111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New State Call Time </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=1200000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Holidays </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=1211111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Holiday </a></TD></TR>
<TR BGCOLOR=<?php echo $times_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=100000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Call Times </a> &nbsp;|<?php if ($add_copy_disabled < 1) { ?>
<a href="<?php echo $ADMIN ?>?ADD=111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Call Time </a> &nbsp;|<?php } ?> <a href="<?php echo $ADMIN ?>?ADD=1000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show State Call Times </a> &nbsp;|<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=1111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New State Call Time </a> &nbsp;|<?php } ?> <a href="<?php echo $ADMIN ?>?ADD=1200000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Holidays </a> &nbsp;|<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=1211111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add Holiday </a><?php } ?></TD></TR>
<?php }
if (strlen($shifts_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $shifts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=130000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Shifts </a> &nbsp;| <a href="<?php echo $ADMIN ?>?ADD=131111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Shift </a></TD></TR>
<TR BGCOLOR=<?php echo $shifts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=130000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Shifts </a> &nbsp;|<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=131111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Shift </a><?php } ?></TD></TR>
<?php }
if (strlen($phones_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $phones_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Phones </a>&nbsp;|&nbsp;<a href="<?php echo $ADMIN ?>?ADD=11111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Phone </a>&nbsp;|&nbsp;<a href="<?php echo $ADMIN ?>?ADD=12000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Phone Alias List </a>&nbsp;|&nbsp;<a href="<?php echo $ADMIN ?>?ADD=12111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Phone Alias </a>&nbsp;|&nbsp;<a href="<?php echo $ADMIN ?>?ADD=13000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Group Alias List </a>&nbsp;|&nbsp;<a href="<?php echo $ADMIN ?>?ADD=13111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Group Alias </a></TD></TR>
<TR BGCOLOR=<?php echo $phones_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Phones </a>&nbsp;|<?php if ($add_copy_disabled < 1) { ?>&nbsp;<a href="<?php echo $ADMIN ?>?ADD=11111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Phone </a>&nbsp;|<?php } ?>&nbsp;<a href="<?php echo $ADMIN ?>?ADD=12000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Phone Alias List </a>&nbsp;|<?php if ($add_copy_disabled < 1) { ?>&nbsp;<a href="<?php echo $ADMIN ?>?ADD=12111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Phone Alias </a>&nbsp;|<?php } ?>&nbsp;<a href="<?php echo $ADMIN ?>?ADD=13000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Group Alias List </a>&nbsp;|<?php if ($add_copy_disabled < 1) { ?>&nbsp;<a href="<?php echo $ADMIN ?>?ADD=13111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Group Alias </a><?php } ?></TD></TR>
<?php }
if (strlen($conference_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $conference_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Conferences </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=1111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Conference </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show VICIDIAL Conferences </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=11111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New VICIDIAL Conference </a></TD></TR>
<TR BGCOLOR=<?php echo $conference_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=1000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Conferences </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=1111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Conference </a> &nbsp; |<?php } ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=10000000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show VICIDIAL Conferences </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=11111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New VICIDIAL Conference </a><?php } ?></TD></TR>
<?php }
if ( (strlen($server_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $server_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=100000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Servers </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Server </a></TD></TR>
<TR BGCOLOR=<?php echo $server_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=100000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Servers </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Server </a><?php } ?></TD></TR>
<?php }
if ( (strlen($templates_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $templates_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=130000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Templates </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=131111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Template </a></TD></TR>
<TR BGCOLOR=<?php echo $templates_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=130000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Templates </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=131111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Template </a><?php } ?></TD></TR>
<?php }
if ( (strlen($carriers_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy A Carrier </a></TD></TR>
<TR BGCOLOR=<?php echo $carriers_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=140000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Carriers </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=141111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Carrier </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=140111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy A Carrier </a><?php } ?></TD></TR>
<?php }
if ( (strlen($emails_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $emails_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="admin_email_accounts.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Email Accounts </a> &nbsp; | &nbsp; <a href="admin_email_accounts.php?eact=ADD"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2> Add A New Account </a> &nbsp; | &nbsp; <a href="admin_email_accounts.php?eact=COPY"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy An Account </a></TD></TR>
<TR BGCOLOR=<?php echo $emails_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="admin_email_accounts.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Email Accounts </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="admin_email_accounts.php?eact=ADD"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2> Add A New Account </a> &nbsp; | &nbsp; <a href="admin_email_accounts.php?eact=COPY"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Copy An Account </a><?php } ?></TD></TR>
<?php }
if ( (strlen($tts_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show TTS Entries </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New TTS Entry </a></TD></TR>
<TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show TTS Entries </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New TTS Entry </a><?php } ?></TD></TR>
<?php }
if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
@@ -1529,11 +1559,11 @@ $SSemail_enabled = $row[4];
<?php }
if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show MOH Entries </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Entry </a></TD></TR>
<TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show MOH Entries </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Entry </a><?php } ?></TD></TR>
<?php }
if ( (strlen($vm_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $vm_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=170000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Voicemail Entries </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=171111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Voicemail Entry </a></TD></TR>
<TR BGCOLOR=<?php echo $vm_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=170000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Voicemail Entries </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=171111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Voicemail Entry </a><?php } ?></TD></TR>
<?php }
if (strlen($settings_sh) > 1) {
?>
@@ -1541,11 +1571,11 @@ $SSemail_enabled = $row[4];
<?php }
if (strlen($label_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Screen Labels </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Screen Label </a></TD></TR>
<TR BGCOLOR=<?php echo $label_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Screen Labels </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=181111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Screen Label </a><?php } ?></TD></TR>
<?php }
if (strlen($cts_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Contact </a></TD></TR>
<TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Contact </a><?php } ?></TD></TR>
<?php }
if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) {
?>