Email Logs: List view updates, search, bulk resend, download, delete.
This commit is contained in:
parent
3bb6ead7dd
commit
82a07205b6
|
|
@ -61,7 +61,7 @@ $text['message-resend_failed']['ru-ru'] = "Повторная отправка
|
|||
$text['message-resend_failed']['sv-se'] = "Skicka Misslyckade Igen";
|
||||
$text['message-resend_failed']['uk-ua'] = "";
|
||||
|
||||
$text['message-message_resent']['en-us'] = "Message Resent";
|
||||
$text['message-message_resent']['en-us'] = "Message(s) Resent";
|
||||
$text['message-message_resent']['ar-eg'] = "";
|
||||
$text['message-message_resent']['de-at'] = "Nachricht erneut gesendet"; //copied from de-de
|
||||
$text['message-message_resent']['de-ch'] = "Nachricht erneut gesendet"; //copied from de-de
|
||||
|
|
@ -121,6 +121,26 @@ $text['message-decoding_error']['ru-ru'] = "Ошибка декодирован
|
|||
$text['message-decoding_error']['sv-se'] = "MIME Message Decoding Erro";
|
||||
$text['message-decoding_error']['uk-ua'] = "";
|
||||
|
||||
$text['message-download_failed']['en-us'] = "Download Failed";
|
||||
$text['message-download_failed']['ar-eg'] = "Download Failed";
|
||||
$text['message-download_failed']['de-at'] = "Download Failed";
|
||||
$text['message-download_failed']['de-ch'] = "Download Failed";
|
||||
$text['message-download_failed']['de-de'] = "Download Failed";
|
||||
$text['message-download_failed']['es-cl'] = "Download Failed";
|
||||
$text['message-download_failed']['es-mx'] = "Download Failed";
|
||||
$text['message-download_failed']['fr-ca'] = "Download Failed";
|
||||
$text['message-download_failed']['fr-fr'] = "Download Failed";
|
||||
$text['message-download_failed']['he-il'] = "Download Failed";
|
||||
$text['message-download_failed']['it-it'] = "Download Failed";
|
||||
$text['message-download_failed']['nl-nl'] = "Download Failed";
|
||||
$text['message-download_failed']['pl-pl'] = "Download Failed";
|
||||
$text['message-download_failed']['pt-br'] = "Download Failed";
|
||||
$text['message-download_failed']['pt-pt'] = "Download Failed";
|
||||
$text['message-download_failed']['ro-ro'] = "Download Failed";
|
||||
$text['message-download_failed']['ru-ru'] = "Download Failed";
|
||||
$text['message-download_failed']['sv-se'] = "Download Failed";
|
||||
$text['message-download_failed']['uk-ua'] = "Download Failed";
|
||||
|
||||
$text['label-type_voicemail']['en-us'] = "Voicemail";
|
||||
$text['label-type_voicemail']['ar-eg'] = "";
|
||||
$text['label-type_voicemail']['de-at'] = "Mailbox"; //copied from de-de
|
||||
|
|
@ -141,6 +161,26 @@ $text['label-type_voicemail']['ru-ru'] = "Голосовая Почта";
|
|||
$text['label-type_voicemail']['sv-se'] = "Röstbrevlåda";
|
||||
$text['label-type_voicemail']['uk-ua'] = "";
|
||||
|
||||
$text['label-type_missed']['en-us'] = "Missed Call";
|
||||
$text['label-type_missed']['ar-eg'] = "";
|
||||
$text['label-type_missed']['de-at'] = "Verpasster Anruf"; //copied from de-de
|
||||
$text['label-type_missed']['de-ch'] = "Verpasster Anruf"; //copied from de-de
|
||||
$text['label-type_missed']['de-de'] = "Verpasster Anruf";
|
||||
$text['label-type_missed']['es-cl'] = "Llamada Perdida";
|
||||
$text['label-type_missed']['es-mx'] = "Llamada Perdida"; //copied from es-cl
|
||||
$text['label-type_missed']['fr-ca'] = "Appel Manqué"; //copied from fr-fr
|
||||
$text['label-type_missed']['fr-fr'] = "Appel Manqué";
|
||||
$text['label-type_missed']['he-il'] = "שיחה שלא נענתה";
|
||||
$text['label-type_missed']['it-it'] = "Chiamata Persa";
|
||||
$text['label-type_missed']['nl-nl'] = "";
|
||||
$text['label-type_missed']['pl-pl'] = "Nieodebrane Połączenie";
|
||||
$text['label-type_missed']['pt-br'] = "Chamada Perdida"; //copied from pt-pt
|
||||
$text['label-type_missed']['pt-pt'] = "Chamada Perdida";
|
||||
$text['label-type_missed']['ro-ro'] = "";
|
||||
$text['label-type_missed']['ru-ru'] = "Пропущенный вызов";
|
||||
$text['label-type_missed']['sv-se'] = "Missat Samtal";
|
||||
$text['label-type_missed']['uk-ua'] = "пропущений Дзвінок";
|
||||
|
||||
$text['label-type_email2fax']['en-us'] = "Email to fax report";
|
||||
$text['label-type_email2fax']['ar-eg'] = "";
|
||||
$text['label-type_email2fax']['de-at'] = "Email zu Fax Auswertung"; //copied from de-de
|
||||
|
|
@ -641,4 +681,25 @@ $text['button-resend']['ru-ru'] = "Повторно Отправить";
|
|||
$text['button-resend']['sv-se'] = "Skicka Igen";
|
||||
$text['button-resend']['uk-ua'] = "";
|
||||
|
||||
?>
|
||||
$text['confirm-resend']['en-us'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['ar-eg'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['de-at'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['de-ch'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['de-de'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['es-cl'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['es-mx'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['fr-ca'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['fr-fr'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['he-il'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['it-it'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['nl-nl'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['pl-pl'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['pt-br'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['pt-pt'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['ro-ro'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['ru-ru'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['sv-se'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['uk-ua'] = "Do you really want to resend this?";
|
||||
$text['confirm-resend']['tr-tr'] = "Do you really want to resend this?";
|
||||
|
||||
?>
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('email_log_view')) {
|
||||
|
|
@ -33,47 +34,54 @@
|
|||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get variables used to control the order
|
||||
$order_by = ($_GET["order_by"] != '') ? $_GET["order_by"] : 'sent_date';
|
||||
$order = ($_GET["order"] != '') ? $_GET["order"] : 'desc';
|
||||
//get posted data
|
||||
if (is_array($_POST['emails'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$emails = $_POST['emails'];
|
||||
}
|
||||
|
||||
//download email
|
||||
if ($_REQUEST['a'] == 'download' && permission_exists('email_log_download')) {
|
||||
$email_log_uuid = $_REQUEST["id"];
|
||||
|
||||
$msg_found = false;
|
||||
|
||||
if (is_uuid($email_log_uuid)) {
|
||||
$sql = "select ";
|
||||
$sql .= "call_uuid, ";
|
||||
$sql .= "email ";
|
||||
$sql .= "from v_email_logs ";
|
||||
$sql .= "where email_log_uuid = :email_log_uuid ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['email_log_uuid'] = $email_log_uuid;
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$call_uuid = $row['call_uuid'];
|
||||
$email = $row['email'];
|
||||
$msg_found = true;
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
}
|
||||
|
||||
if ($msg_found) {
|
||||
header("Content-Type: message/rfc822");
|
||||
header('Content-Disposition: attachment; filename="'.$call_uuid.'.eml"');
|
||||
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
||||
header("Content-Length: ".strlen($email));
|
||||
echo $email;
|
||||
exit;
|
||||
//download the emails
|
||||
if (permission_exists('email_log_download')) {
|
||||
if ($action == 'download' && is_array($emails) && @sizeof($emails) != 0) {
|
||||
//download
|
||||
$obj = new email_logs;
|
||||
$obj->download($emails);
|
||||
//set message (download failed)
|
||||
message::add($text['message-download_failed'],'negative',7000);
|
||||
//redirect
|
||||
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//resend email
|
||||
//resend the emails
|
||||
if (permission_exists('email_log_resend')) {
|
||||
if ($action == 'resend' && is_array($emails) && @sizeof($emails) != 0) {
|
||||
//resend
|
||||
$obj = new email_logs;
|
||||
$obj->resend($emails);
|
||||
//exit
|
||||
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//delete the emails
|
||||
if (permission_exists('email_log_delete')) {
|
||||
if ($action == 'delete' && is_array($emails) && @sizeof($emails) != 0) {
|
||||
//delete
|
||||
$obj = new email_logs;
|
||||
$obj->delete($emails);
|
||||
//redirect
|
||||
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//resend email (previous method)
|
||||
/*
|
||||
if ($_REQUEST['a'] == 'resend' && permission_exists('email_log_resend')) {
|
||||
$email_log_uuid = $_REQUEST["id"];
|
||||
$resend = true;
|
||||
|
|
@ -112,62 +120,85 @@
|
|||
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
//get order and order by and sanatize the values
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//add the search term
|
||||
$search = strtolower($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_search = "and (";
|
||||
$sql_search .= "lower(type) like :search ";
|
||||
$sql_search .= "or lower(email) like :search ";
|
||||
$sql_search .= ") ";
|
||||
$parameters['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
require_once "resources/paging.php";
|
||||
$sql = "select count(*) from v_email_logs ";
|
||||
if (permission_exists('email_log_all') && $_REQUEST['showall'] != 'true') {
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "where true ";
|
||||
if (permission_exists('email_log_all') && $_REQUEST['show'] != 'all') {
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
$sql .= $sql_search;
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
if (permission_exists('email_log_all') && $_REQUEST['showall'] == 'true') {
|
||||
$param .= "&showall=true";
|
||||
}
|
||||
else {
|
||||
$param = "";
|
||||
$param = "search=".$search;
|
||||
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_email_logs ";
|
||||
if (permission_exists('email_log_all') && $_REQUEST['showall'] == 'true') {
|
||||
$sql .= "join v_domains on v_email_logs.domain_uuid = v_domains.domain_uuid ";
|
||||
}
|
||||
else {
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
$sql = str_replace('count(*)', '*', $sql);
|
||||
$sql .= order_by($order_by, $order, 'sent_date', 'desc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//set the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
//get call details
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $row) {
|
||||
$sql = "select caller_id_name, caller_id_number, destination_number ";
|
||||
$sql .= "from v_xml_cdr ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and uuid = :uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['uuid'] = $row['call_uuid'];
|
||||
$database = new database;
|
||||
$result2 = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result2) && @sizeof($result2) != 0) {
|
||||
foreach($result2 as $row2) {
|
||||
$call[$row['call_uuid']]['caller_id_name'] = $row2['caller_id_name'];
|
||||
$call[$row['call_uuid']]['caller_id_number'] = $row2['caller_id_number'];
|
||||
$call[$row['call_uuid']]['destination_number'] = $row2['destination_number'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $result2, $row2);
|
||||
}
|
||||
}
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create('/app/email_logs/email_logs.php');
|
||||
|
||||
//additional includes
|
||||
//include the header
|
||||
$document['title'] = $text['title-emails'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//styles
|
||||
//test result layer
|
||||
echo "<style>\n";
|
||||
|
||||
echo " #test_result_layer {\n";
|
||||
echo " z-index: 999999;\n";
|
||||
echo " position: absolute;\n";
|
||||
|
|
@ -177,8 +208,7 @@
|
|||
echo " bottom: 0px;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " vertical-align: middle;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " }\n";
|
||||
echo " #test_result_container {\n";
|
||||
echo " display: block;\n";
|
||||
echo " overflow: auto;\n";
|
||||
|
|
@ -194,11 +224,9 @@
|
|||
echo " -webkit-box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " -moz-box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " }\n";
|
||||
echo "</style>\n";
|
||||
|
||||
//test result layer
|
||||
echo "<div id='test_result_layer' style='display: none;'>\n";
|
||||
echo " <table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
|
|
@ -210,6 +238,51 @@
|
|||
echo "</div>\n";
|
||||
|
||||
//show the content
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-emails']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo "<form id='form_test' class='inline' method='post' action='email_test.php' target='_blank'>\n";
|
||||
echo button::create(['label'=>$text['button-test'],'icon'=>'tools','type'=>'button','id'=>'test_button','style'=>'margin-right: 15px;','onclick'=>"$(this).fadeOut(400, function(){ $('span#form_test').fadeIn(400); $('#to').trigger('focus'); });"]);
|
||||
echo " <span id='form_test' style='display: none;'>\n";
|
||||
echo " <input type='text' class='txt' style='width: 150px;' name='to' id='to' placeholder='recipient@domain.com'>";
|
||||
echo button::create(['label'=>$text['button-send'],'icon'=>'envelope','type'=>'submit','id'=>'send_button','style'=>'margin-right: 15px;']);
|
||||
echo " </span>\n";
|
||||
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo " </form>";
|
||||
if (permission_exists('email_log_resend') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-resend'],'icon'=>'paper-plane','onclick'=>"if (confirm('".$text['confirm-resend']."')) { list_action_set('resend'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('email_log_download') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'onclick'=>"list_action_set('download'); list_form_submit('form_list');"]);
|
||||
}
|
||||
if (permission_exists('email_log_delete') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('email_log_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
||||
}
|
||||
}
|
||||
echo button::create(['label'=>$text['button-refresh'],'icon'=>$_SESSION['theme']['button_icon_refresh'],'type'=>'button','onclick'=>'document.location.reload();']);
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'email_logs.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
||||
}
|
||||
echo " </form>\n";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo $text['description-emails']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
/*
|
||||
echo "<form id='test_form' method='post' action='email_test.php' target='_blank'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
|
|
@ -236,104 +309,88 @@
|
|||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
echo "<br />\n";
|
||||
*/
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('email_log_download') || permission_exists('email_log_resend') || permission_exists('email_log_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
|
||||
}
|
||||
echo th_order_by('sent_date', $text['label-sent'], $order_by, $order, null, null, $param);
|
||||
echo th_order_by('type', $text['label-type'], $order_by, $order, null, null, $param);
|
||||
echo th_order_by('status', $text['label-status'], $order_by, $order, null, null, $param);
|
||||
echo "<th>".$text['label-message']."</th>\n";
|
||||
echo "<th>".$text['label-reference']."</th>\n";
|
||||
echo "<td class='list_control_icons'> </td>\n";
|
||||
echo "<th class='center'>".$text['label-actions']."</th>\n";
|
||||
echo "<th class='hide-sm-dn'>".$text['label-reference']."</th>\n";
|
||||
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
$x = 0;
|
||||
foreach($result as $row) {
|
||||
|
||||
//get call details
|
||||
$sql = "select caller_id_name, caller_id_number, destination_number ";
|
||||
$sql .= "from v_xml_cdr ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and uuid = :uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['uuid'] = $row['call_uuid'];
|
||||
$database = new database;
|
||||
$result2 = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result2) && @sizeof($result2) != 0) {
|
||||
foreach($result2 as $row2) {
|
||||
$caller_id_name = ($row2['caller_id_name'] != '') ? $row2['caller_id_name'] : null;
|
||||
$caller_id_number = ($row2['caller_id_number'] != '') ? $row2['caller_id_number'] : null;
|
||||
$destination_number = ($row2['destination_number'] != '') ? $row2['destination_number'] : null;
|
||||
}
|
||||
$list_row_url = "email_log_view.php?id=".urlencode($row['email_log_uuid']);
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('email_log_download') || permission_exists('email_log_resend') || permission_exists('email_log_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='emails[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='emails[$x][uuid]' value='".escape($row['email_log_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
unset($sql, $parameters, $result2, $row2);
|
||||
|
||||
$tr_link = "href='email_log_view.php?id=".$row['email_log_uuid']."'";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['domain_name'])."</td>\n";
|
||||
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
||||
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
|
||||
}
|
||||
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
$sent_date = explode('.', $row['sent_date']);
|
||||
echo $sent_date[0];
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-type_'.escape($row['type'])]."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-status_'.escape($row['status'])]."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void'>";
|
||||
echo " <a href='email_log_view.php?id=".escape($row['email_log_uuid'])."'>".$text['label-message_view']."</a> ";
|
||||
if (permission_exists('email_log_download')) {
|
||||
echo " <a href='?id=".escape($row['email_log_uuid'])."&a=download'>".$text['label-download']."</a> ";
|
||||
}
|
||||
echo " <td><a href='".$list_row_url."' title=\"".$text['label-message_view']."\">".$sent_date[0]."</td>\n";
|
||||
echo " <td>".$text['label-type_'.escape($row['type'])]."</td>\n";
|
||||
echo " <td>".$text['label-status_'.escape($row['status'])]."</td>\n";
|
||||
echo " <td class='middle button center no-link no-wrap'>";
|
||||
if (permission_exists('email_log_resend')) {
|
||||
echo " <a href='?id=".$row['email_log_uuid']."&a=resend";
|
||||
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
||||
echo "&showall=true";
|
||||
}
|
||||
echo "'>" . $text['label-resend']."</a>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-resend'],'icon'=>'paper-plane','onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('resend'); list_form_submit('form_list')"]);
|
||||
}
|
||||
if (permission_exists('email_log_download')) {
|
||||
echo button::create(['type'=>'button','title'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('download'); list_form_submit('form_list')"]);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='row_stylebg tr_link_void' style='white-space: nowrap; vertical-align: top;'>";
|
||||
echo " <a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr_details.php?id=".escape($row['call_uuid'])."'>".$text['label-reference_cdr']."</a>";
|
||||
echo " ".($caller_id_name != '') ? " ".$caller_id_name." (".format_phone($caller_id_number).")" : $caller_id_number;
|
||||
echo " <span style='font-size: 150%; line-height: 10px;'>⇢</span> ".$destination_number;
|
||||
echo " </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
echo "<a href='email_log_view.php?id=".escape($row['email_log_uuid'])."' alt='".$text['label-message_view']."'>$v_link_label_view</a>";
|
||||
if (permission_exists('email_log_delete')) {
|
||||
echo "<a href='email_log_delete.php?id=".escape($row['email_log_uuid']).($_REQUEST['showall'] == true ? '&showall=true' : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
echo " <td class='description overflow hide-sm-dn no-link'>";
|
||||
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-reference_cdr'],'link'=>PROJECT_PATH.'/app/xml_cdr/xml_cdr_details.php?id='.urlencode($row['call_uuid'])]);
|
||||
echo " ".($call[$row['call_uuid']]['caller_id_name'] != '' ? " ".$call[$row['call_uuid']]['caller_id_name'].(is_numeric($call[$row['call_uuid']]['caller_id_number']) ? ' ('.format_phone($call[$row['call_uuid']]['caller_id_number']).')' : null) : $call[$row['call_uuid']]['caller_id_number']);
|
||||
if ($call[$row['call_uuid']]['destination_number']) {
|
||||
echo " <span style='font-size: 150%; line-height: 10px;'>⇢</span> ".$call[$row['call_uuid']]['destination_number'];
|
||||
}
|
||||
echo " </td>\n";
|
||||
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['label-message_view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
$x++;
|
||||
|
||||
}
|
||||
unset($result, $row);
|
||||
unset($result);
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='21' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "<br /><br />";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>\n";
|
||||
|
||||
//test script
|
||||
echo "<script>\n";
|
||||
|
||||
echo " $('#test_form').submit(function(event) {\n";
|
||||
echo " $('#form_test').submit(function(event) {\n";
|
||||
echo " event.preventDefault();\n";
|
||||
echo " $.ajax({\n";
|
||||
echo " url: $(this).attr('action'),\n";
|
||||
|
|
@ -345,16 +402,16 @@
|
|||
echo " success: function(response){\n";
|
||||
echo " $('#test_result_container').html(response);\n";
|
||||
echo " $('#test_result_layer').fadeIn(400);\n";
|
||||
echo " $('span#test_form').fadeOut(400);\n";
|
||||
echo " $('#test_button').fadeIn(400);\n";
|
||||
echo " $('#to').val('');\n";
|
||||
echo " $('span#form_test').fadeOut(400, function(){\n";
|
||||
echo " $('#test_button').fadeIn(400);\n";
|
||||
echo " $('#to').val('');\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
|
||||
echo "</script>\n";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -28,11 +28,21 @@
|
|||
if (!class_exists('message')) {
|
||||
class message {
|
||||
|
||||
static function add($message, $mood = NULL, $delay = NULL) {
|
||||
$mood = $mood ?: 'positive';
|
||||
$delay = $delay ?: (1000 * (float) $_SESSION['theme']['message_delay']['text']);
|
||||
$_SESSION["messages"][$mood]['message'][] = $message;
|
||||
$_SESSION["messages"][$mood]['delay'][] = $delay;
|
||||
static function add($message, $mood = null, $delay = null) {
|
||||
//set mood and delay
|
||||
$mood = $mood ?: 'positive';
|
||||
$delay = $delay ?: (1000 * (float) $_SESSION['theme']['message_delay']['text']);
|
||||
//ignore duplicate messages
|
||||
if (is_array($_SESSION["messages"][$mood]['message']) && @sizeof($_SESSION["messages"][$mood]['message']) != 0) {
|
||||
if (!in_array($message, $_SESSION["messages"][$mood]['message'])) {
|
||||
$_SESSION["messages"][$mood]['message'][] = $message;
|
||||
$_SESSION["messages"][$mood]['delay'][] = $delay;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_SESSION["messages"][$mood]['message'][] = $message;
|
||||
$_SESSION["messages"][$mood]['delay'][] = $delay;
|
||||
}
|
||||
}
|
||||
|
||||
static function count() {
|
||||
|
|
|
|||
|
|
@ -35,22 +35,24 @@
|
|||
}
|
||||
|
||||
//includes
|
||||
if (!defined('STDIN')) { include "root.php"; }
|
||||
if (!defined('STDIN')) { include_once "root.php"; }
|
||||
require_once "resources/require.php";
|
||||
|
||||
//define a function to remove html tags
|
||||
function remove_tags($string) {
|
||||
//remove HTML tags
|
||||
$string = preg_replace ('/<[^>]*>/', ' ', $string);
|
||||
if (!function_exists('remove_tags')) {
|
||||
function remove_tags($string) {
|
||||
//remove HTML tags
|
||||
$string = preg_replace ('/<[^>]*>/', ' ', $string);
|
||||
|
||||
//remove control characters
|
||||
$string = str_replace("\r", '', $string); // --- replace with empty space
|
||||
$string = str_replace("\n", ' ', $string); // --- replace with space
|
||||
$string = str_replace("\t", ' ', $string); // --- replace with space
|
||||
//remove control characters
|
||||
$string = str_replace("\r", '', $string); // --- replace with empty space
|
||||
$string = str_replace("\n", ' ', $string); // --- replace with space
|
||||
$string = str_replace("\t", ' ', $string); // --- replace with space
|
||||
|
||||
//remove multiple spaces
|
||||
$string = trim(preg_replace('/ {2,}/', ' ', $string));
|
||||
return $string;
|
||||
//remove multiple spaces
|
||||
$string = trim(preg_replace('/ {2,}/', ' ', $string));
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
//set init settings
|
||||
|
|
@ -75,8 +77,8 @@
|
|||
//echo "Message: \n".$msg."\n";
|
||||
|
||||
//includes
|
||||
require('resources/pop3/mime_parser.php');
|
||||
require('resources/pop3/rfc822_addresses.php');
|
||||
require_once('resources/pop3/mime_parser.php');
|
||||
require_once('resources/pop3/rfc822_addresses.php');
|
||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/emails/email_transcription.php")) {
|
||||
require_once($_SERVER["PROJECT_ROOT"]."/app/emails/email_transcription.php");
|
||||
}
|
||||
|
|
@ -186,8 +188,8 @@
|
|||
$smtp['username'] = ($smtp['username'] != '') ? $smtp['username'] : null;
|
||||
|
||||
//send the email
|
||||
include "resources/phpmailer/class.phpmailer.php";
|
||||
include "resources/phpmailer/class.smtp.php";
|
||||
include_once "resources/phpmailer/class.phpmailer.php";
|
||||
include_once "resources/phpmailer/class.smtp.php";
|
||||
$mail = new PHPMailer();
|
||||
if (isset($_SESSION['email']['method'])) {
|
||||
switch($_SESSION['email']['method']['text']) {
|
||||
|
|
|
|||
|
|
@ -1894,6 +1894,22 @@
|
|||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "9dc8723c-22a1-4b93-910e-5019a0a84a01";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_refresh";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-redo-alt";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0ff96605-f516-47f4-9c20-9d034057d08c";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_reload";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-redo-alt";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5c49d82e-f483-4b2a-b3af-6e8ba8cfa5db";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_search";
|
||||
|
|
|
|||
Loading…
Reference in New Issue