mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 10:43:49 +00:00
Voicemail Messages: List view updates. Voicemail Edit: Hide Listen Link option.
This commit is contained in:
@@ -941,25 +941,25 @@ $text['label-destination']['ru-ru'] = "Место назначения";
|
||||
$text['label-destination']['sv-se'] = "Destination";
|
||||
$text['label-destination']['uk-ua'] = "Номер";
|
||||
|
||||
$text['label-created_epoch']['en-us'] = "Created";
|
||||
$text['label-created_epoch']['ar-eg'] = "";
|
||||
$text['label-created_epoch']['de-at'] = "Erstellt"; //copied from de-de
|
||||
$text['label-created_epoch']['de-ch'] = "Erstellt"; //copied from de-de
|
||||
$text['label-created_epoch']['de-de'] = "Erstellt";
|
||||
$text['label-created_epoch']['es-cl'] = "Creación";
|
||||
$text['label-created_epoch']['es-mx'] = "Creación"; //copied from es-cl
|
||||
$text['label-created_epoch']['fr-ca'] = "Créé"; //copied from fr-fr
|
||||
$text['label-created_epoch']['fr-fr'] = "Créé";
|
||||
$text['label-created_epoch']['he-il'] = "נוצר";
|
||||
$text['label-created_epoch']['it-it'] = "Creato";
|
||||
$text['label-created_epoch']['nl-nl'] = "Gemaakt";
|
||||
$text['label-created_epoch']['pl-pl'] = "Stworzono";
|
||||
$text['label-created_epoch']['pt-br'] = "Criado";
|
||||
$text['label-created_epoch']['pt-pt'] = "Criada";
|
||||
$text['label-created_epoch']['ro-ro'] = "";
|
||||
$text['label-created_epoch']['ru-ru'] = "Создано";
|
||||
$text['label-created_epoch']['sv-se'] = "Skapad";
|
||||
$text['label-created_epoch']['uk-ua'] = "Створено";
|
||||
$text['label-received']['en-us'] = "Received";
|
||||
$text['label-received']['ar-eg'] = "";
|
||||
$text['label-received']['de-at'] = "Erstellt"; //copied from de-de
|
||||
$text['label-received']['de-ch'] = "Erstellt"; //copied from de-de
|
||||
$text['label-received']['de-de'] = "Erstellt";
|
||||
$text['label-received']['es-cl'] = "Creación";
|
||||
$text['label-received']['es-mx'] = "Creación"; //copied from es-cl
|
||||
$text['label-received']['fr-ca'] = "Créé"; //copied from fr-fr
|
||||
$text['label-received']['fr-fr'] = "Créé";
|
||||
$text['label-received']['he-il'] = "נוצר";
|
||||
$text['label-received']['it-it'] = "Creato";
|
||||
$text['label-received']['nl-nl'] = "Gemaakt";
|
||||
$text['label-received']['pl-pl'] = "Stworzono";
|
||||
$text['label-received']['pt-br'] = "Criado";
|
||||
$text['label-received']['pt-pt'] = "Criada";
|
||||
$text['label-received']['ro-ro'] = "";
|
||||
$text['label-received']['ru-ru'] = "Создано";
|
||||
$text['label-received']['sv-se'] = "Skapad";
|
||||
$text['label-received']['uk-ua'] = "Створено";
|
||||
|
||||
$text['label-count']['en-us'] = "Count";
|
||||
$text['label-count']['ar-eg'] = "";
|
||||
|
||||
@@ -245,15 +245,11 @@
|
||||
$row['file_size'] = filesize($row['file_path']);
|
||||
$row['file_size_label'] = byte_convert($row['file_size']);
|
||||
$row['file_ext'] = substr($row['file_path'], -3);
|
||||
|
||||
$message_length = $row['message_length'];
|
||||
if ($message_length < 60 ) {
|
||||
$message_length = $message_length. " sec";
|
||||
}
|
||||
else {
|
||||
$message_length = round(($message_length/60), 2). " min";
|
||||
}
|
||||
$row['message_length_label'] = $message_length;
|
||||
|
||||
$message_minutes = floor($row['message_length'] / 60);
|
||||
$message_seconds = $row['message_length'] % 60;
|
||||
//use International System of Units (SI) - Source: https://en.wikipedia.org/wiki/International_System_of_Units
|
||||
$row['message_length_label'] = ($message_minutes > 0 ? $message_minutes.' min' : null).($message_seconds > 0 ? ' '.$message_seconds.' s' : null);
|
||||
$row['created_date'] = date("j M Y g:i a",$row['created_epoch']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,7 +588,8 @@
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='voicemail_file' id='voicemail_file' onchange=\"if (this.selectedIndex != 2) { document.getElementById('voicemail_local_after_email').selectedIndex = 0; }\">\n";
|
||||
echo " <option value='' ".(($voicemail_file == "listen") ? "selected='selected'" : null).">".$text['option-voicemail_file_listen']."</option>\n";
|
||||
//disable as doesn't work without post-login redirect
|
||||
//echo " <option value='' ".(($voicemail_file == "listen") ? "selected='selected'" : null).">".$text['option-voicemail_file_listen']."</option>\n";
|
||||
echo " <option value='link' ".(($voicemail_file == "link") ? "selected='selected'" : null).">".$text['option-voicemail_file_link']."</option>\n";
|
||||
echo " <option value='attach' ".(($voicemail_file == "attach") ? "selected='selected'" : null).">".$text['option-voicemail_file_attach']."</option>\n";
|
||||
echo " </select>\n";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2018
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -27,48 +27,133 @@
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
if (!($_REQUEST["action"] == "download" && $_REQUEST["src"] == "email")) {
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('voicemail_message_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//set the voicemail_uuid
|
||||
if (is_uuid($_REQUEST["id"])) {
|
||||
$voicemail_uuid = $_REQUEST["id"];
|
||||
}
|
||||
|
||||
//required class
|
||||
require_once "app/voicemails/resources/classes/voicemail.php";
|
||||
|
||||
//download the message
|
||||
if ($_REQUEST["action"] == "download") {
|
||||
$voicemail_message_uuid = $_REQUEST["uuid"];
|
||||
$voicemail_id = $_REQUEST["id"];
|
||||
$voicemail_uuid = $_REQUEST["voicemail_uuid"];
|
||||
if (is_uuid($voicemail_message_uuid) && $voicemail_id != '' && is_uuid($voicemail_uuid)) {
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_id = $voicemail_id;
|
||||
$voicemail->voicemail_uuid = $voicemail_uuid;
|
||||
$voicemail->voicemail_message_uuid = $voicemail_message_uuid;
|
||||
$result = $voicemail->message_download();
|
||||
unset($voicemail);
|
||||
}
|
||||
if (
|
||||
$_REQUEST["action"] == "download"
|
||||
&& is_numeric($_REQUEST["id"])
|
||||
&& is_uuid($_REQUEST["uuid"])
|
||||
&& is_uuid($_REQUEST["voicemail_uuid"])
|
||||
) {
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_id = $_REQUEST["id"];
|
||||
$voicemail->voicemail_uuid = $_REQUEST["voicemail_uuid"];
|
||||
$voicemail->voicemail_message_uuid = $_REQUEST["uuid"];
|
||||
$result = $voicemail->message_download();
|
||||
unset($voicemail);
|
||||
exit;
|
||||
}
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('voicemail_message_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the http post data
|
||||
if (is_array($_POST['voicemail_messages'])) {
|
||||
$action = $_POST['action'];
|
||||
$voicemail_messages = $_POST['voicemail_messages'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($voicemail_messages) && @sizeof($voicemail_messages) != 0) {
|
||||
|
||||
//set the referrer
|
||||
$http_referer = parse_url($_SERVER["HTTP_REFERER"]);
|
||||
$referer_path = $http_referer['path'];
|
||||
$referer_query = $http_referer['query'];
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
if ($referer_path == PROJECT_PATH."/app/voicemails/voicemail_messages.php") {
|
||||
header('Location: voicemail_messages.php?'.$referer_query);
|
||||
}
|
||||
else {
|
||||
header('Location: voicemails.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
//handle action
|
||||
switch ($action) {
|
||||
case 'toggle':
|
||||
if (is_array($voicemail_messages) && @sizeof($voicemail_messages) != 0) {
|
||||
$messages_toggled = 0;
|
||||
foreach ($voicemail_messages as $voicemail_message) {
|
||||
if ($voicemail_message['checked'] == 'true' && is_uuid($voicemail_message['uuid']) && is_uuid($voicemail_message['voicemail_uuid'])) {
|
||||
//delete voicemail message
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->db = $db;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_uuid = $voicemail_message['voicemail_uuid'];
|
||||
$voicemail->voicemail_message_uuid = $voicemail_message['uuid'];
|
||||
$voicemail->message_toggle();
|
||||
unset($voicemail);
|
||||
//increment counter
|
||||
$messages_toggled++;
|
||||
}
|
||||
}
|
||||
//set message
|
||||
if ($messages_toggled != 0) {
|
||||
message::add($text['message-toggle'].': '.$messages_toggled);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
if (is_array($voicemail_messages) && @sizeof($voicemail_messages) != 0) {
|
||||
$messages_deleted = 0;
|
||||
foreach ($voicemail_messages as $voicemail_message) {
|
||||
if ($voicemail_message['checked'] == 'true' && is_uuid($voicemail_message['uuid']) && is_uuid($voicemail_message['voicemail_uuid'])) {
|
||||
//delete voicemail message
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->db = $db;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_uuid = $voicemail_message['voicemail_uuid'];
|
||||
$voicemail->voicemail_message_uuid = $voicemail_message['uuid'];
|
||||
$voicemail->message_delete();
|
||||
unset($voicemail);
|
||||
//increment counter
|
||||
$messages_deleted++;
|
||||
}
|
||||
}
|
||||
//set message
|
||||
if ($messages_deleted != 0) {
|
||||
message::add($text['message-delete'].': '.$messages_deleted);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
if ($referer_path == PROJECT_PATH."/app/voicemails/voicemail_messages.php") {
|
||||
header('Location: voicemail_messages.php?'.$referer_query);
|
||||
}
|
||||
else {
|
||||
header('Location: voicemails.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the html values and set them as variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
@@ -81,136 +166,161 @@
|
||||
$vm->order = $order;
|
||||
$voicemails = $vm->messages();
|
||||
|
||||
//count messages
|
||||
$new_messages = 0;
|
||||
if (is_array($voicemails) && @sizeof($voicemails) != 0) {
|
||||
foreach ($voicemails as $voicemail) {
|
||||
if (is_array($voicemail['messages'])) {
|
||||
$num_rows += sizeof($voicemail['messages']);
|
||||
foreach ($voicemail['messages'] as $message) {
|
||||
if ($message['message_status'] != 'saved') {
|
||||
$new_messages++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//additional includes
|
||||
$document['title'] = $text['title-voicemail_messages'];
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//show the content
|
||||
echo "<b>".$text['title-voicemail_messages']."</b>";
|
||||
echo "<br><br>";
|
||||
echo $text['description-voicemail_message'];
|
||||
echo "<br><br>";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-voicemail_messages']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if ($num_rows > 0) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'collapse'=>'hide-xs','onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('voicemail_message_delete') && $num_rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'collapse'=>'hide-xs','onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
//set the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
echo $text['description-voicemail_message']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
//loop through the voicemail messages
|
||||
if (is_array($voicemails) && @sizeof($voicemails) != 0) {
|
||||
|
||||
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
|
||||
echo "<br />";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr style='display: none;'><td></td></tr>\n"; // dummy row to adjust the alternating background color
|
||||
|
||||
$x = 0;
|
||||
$previous_voicemail_id = '';
|
||||
foreach ($voicemails as $field) {
|
||||
if ($previous_voicemail_id != $field['voicemail_id']) {
|
||||
if ($previous_voicemail_id != '') {
|
||||
echo "<tr><td colspan='20'><br /><br /><br /></td></tr>\n";
|
||||
echo "<tr><td class='no-link' colspan='20'><br /><br /></td></tr>\n";
|
||||
}
|
||||
echo " <td colspan='4' align='left' valign='top'>\n";
|
||||
echo " <b>".$text['label-mailbox'].": ".$field['voicemail_id']." ".$field['voicemail_description']." </b><br /> \n";
|
||||
echo " </td>\n";
|
||||
echo " <td colspan='".(($_SESSION['voicemail']['storage_type']['text'] != 'base64') ? 3 : 2)."' valign='bottom' align='right'>\n";
|
||||
echo " <input type='button' class='btn' alt='".$text['button-toggle']."' onclick=\"$('#frm').attr('action', 'voicemail_message_toggle.php').submit();\" value='".$text['button-toggle']."'>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td class='no-link' colspan='20' style='padding: 0;'>\n";
|
||||
|
||||
echo " <div class='action_bar sub'>\n";
|
||||
echo " <div class='heading'><b>".$text['label-mailbox'].": ".$field['voicemail_id']." ".$field['voicemail_description']."</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('voicemail_greeting_view')) {
|
||||
echo " <input type='button' class='btn' alt='".$text['button-greetings']."' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$field['voicemail_id']."&back=".urlencode($_SERVER["REQUEST_URI"])."'\" value='".$text['button-greetings']."'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-greetings'],'icon'=>'handshake','collapse'=>'hide-xs','link'=>PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$field['voicemail_id']."&back=".urlencode($_SERVER["REQUEST_URI"])]);
|
||||
}
|
||||
if (permission_exists('voicemail_edit')) {
|
||||
echo " <input type='button' class='btn' alt='".$text['button-settings']."' onclick=\"document.location.href='voicemail_edit.php?id=".$field['voicemail_uuid']."'\" value='".$text['button-settings']."'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-settings'],'icon'=>'sliders-h','collapse'=>'hide-xs','link'=>'voicemail_edit.php?id='.urlencode($field['voicemail_uuid'])]);
|
||||
}
|
||||
echo " <br /><br />";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo " </div>\n";
|
||||
|
||||
echo " </td>\n";
|
||||
echo " <td> </td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (count($field['messages']) > 0) {
|
||||
echo "<tr>\n";
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all_".$field['voicemail_id']."' onchange=\"(this.checked) ? check('all', '".$field['voicemail_id']."') : check('none', '".$field['voicemail_id']."');\"></th>";
|
||||
}
|
||||
echo th_order_by('created_epoch', $text['label-created_epoch'], $order_by, $order);
|
||||
echo th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order);
|
||||
echo th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order);
|
||||
echo "<th>".$text['label-tools']."</th>\n";
|
||||
echo th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "style='text-align: right;'");
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') {
|
||||
echo "<th style='text-align: right;'>".$text['label-message_size']."</th>\n";
|
||||
}
|
||||
if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') {
|
||||
echo "<th>".$text['label-transcription']."</th>\n";
|
||||
}
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo "<td class='list_control_icons' style='width: 25px;'>";
|
||||
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { $('#frm').attr('action', 'voicemail_message_delete.php').submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
$col_count = 0;
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all_".$field['voicemail_id']."' name='checkbox_all_".$field['voicemail_id']."' onclick=\"list_all_toggle('".$field['voicemail_id']."');\" ".(is_array($field['messages']) && @sizeof($field['messages']) > 0 ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
echo th_order_by('created_epoch', $text['label-received'], $order_by, $order, null, "class='pct-30'");
|
||||
$col_count++;
|
||||
echo th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order, null, "class='pct-20'");
|
||||
$col_count++;
|
||||
echo th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order, null, "class='hide-xs pct-15'");
|
||||
$col_count++;
|
||||
echo "<th class='center shrink'>".$text['label-tools']."</th>\n";
|
||||
$col_count++;
|
||||
echo th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "class='hide-xs right pct-15'");
|
||||
$col_count++;
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') {
|
||||
echo "<th class='right pct-15 hide-sm-dn'>".$text['label-message_size']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') {
|
||||
echo "<th class='pct-10'>".$text['label-transcription']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (count($field['messages']) > 0) {
|
||||
foreach ($field['messages'] as &$row) {
|
||||
$style = ($row['message_status'] == '' && $_REQUEST["uuid"] != $row['voicemail_message_uuid']) ? "font-weight: bold;" : null;
|
||||
|
||||
//playback progress bar
|
||||
echo "<tr id='recording_progress_bar_".escape($row['voicemail_message_uuid'])."' style='display: none;'><td colspan='".((permission_exists('voicemail_message_delete')) ? 7 : 6)."' class='".$row_style[$c]." playback_progress_bar_background' style='padding: 0px; border: none;'><span class='playback_progress_bar' id='recording_progress_".escape($row['voicemail_message_uuid'])."'></span></td></tr>\n";
|
||||
|
||||
$tr_link = "href=\"javascript:recording_play('".escape($row['voicemail_message_uuid'])."');\"";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_checkbox tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
|
||||
echo " <input type='checkbox' name='voicemail_messages[".escape($row['voicemail_uuid'])."][]' id='checkbox_".$row['voicemail_message_uuid']."' value='".escape($row['voicemail_message_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all_".escape($row['voicemail_id'])."').checked = false; }\">";
|
||||
echo " </td>";
|
||||
$vm_msg_ids[$row['voicemail_id']][] = 'checkbox_'.$row['voicemail_message_uuid'];
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\" nowrap='nowrap'>".escape($row['created_date'])."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".escape($row['caller_id_name'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".escape($row['caller_id_number'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]." row_style_slim tr_link_void' onclick=\"$(this).closest('tr').children('td').css('font-weight','normal');\">";
|
||||
$recording_file_path = $file;
|
||||
$recording_file_name = strtolower(pathinfo($recording_file_path, PATHINFO_BASENAME));
|
||||
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
|
||||
switch ($recording_file_ext) {
|
||||
case "wav" : $recording_type = "audio/wav"; break;
|
||||
case "mp3" : $recording_type = "audio/mpeg"; break;
|
||||
case "ogg" : $recording_type = "audio/ogg"; break;
|
||||
if (is_array($field['messages']) && @sizeof($field['messages']) > 0) {
|
||||
foreach ($field['messages'] as $row) {
|
||||
//responsive date
|
||||
$array = explode(' ', $row['created_date']);
|
||||
if ($array[0].' '.$array[1].' '.$array[2] == date('j M Y')) { //today
|
||||
$created_date = escape($array[3].' '.$array[4]); //only show time
|
||||
}
|
||||
echo "<audio id='recording_audio_".escape($row['voicemail_message_uuid'])."' style='display: none;' ontimeupdate=\"update_progress('".escape($row['voicemail_message_uuid'])."')\" preload='none' onended=\"recording_reset('".escape($row['voicemail_message_uuid'])."');\" src=\"voicemail_messages.php?action=download&id=".escape($row['voicemail_id'])."&voicemail_uuid=".escape($row['voicemail_uuid'])."&uuid=".escape($row['voicemail_message_uuid'])."\" type='".$recording_type."'></audio>";
|
||||
echo "<a id='recording_button_".escape($row['voicemail_message_uuid'])."' onclick=\"recording_play('".escape($row['voicemail_message_uuid'])."');\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</a>";
|
||||
echo "<a href=\"voicemail_messages.php?action=download&t=bin&id=".escape($row['voicemail_id'])."&voicemail_uuid=".escape($row['voicemail_uuid'])."&uuid=".escape($row['voicemail_message_uuid'])."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
|
||||
else {
|
||||
$created_date = escape($array[0].' '.$array[1].' '.$array[2])." <span class='hide-xs' title=\"".escape($array[3].' '.$array[4])."\">".escape($array[3].' '.$array[4])."</span>";
|
||||
}
|
||||
//playback progress bar
|
||||
echo "<tr class='list-row' id='recording_progress_bar_".escape($row['voicemail_message_uuid'])."' style='display: none;'><td class='playback_progress_bar_background' style='padding: 0; border: none;' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".escape($row['voicemail_message_uuid'])."'></span></td></tr>\n";
|
||||
echo "<tr style='display: none;'><td></td></tr>\n"; // dummy row to maintain alternating background color
|
||||
$style = ($row['message_status'] == '' && $_REQUEST["uuid"] != $row['voicemail_message_uuid']) ? "style='font-weight: bold;'" : null;
|
||||
$list_row_link = "javascript:recording_play('".escape($row['voicemail_message_uuid'])."');";
|
||||
echo "<tr class='list-row' href=\"".$list_row_link."\">\n";
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='voicemail_messages[$x][checked]' id='checkbox_".$x."' class='checkbox_".$field['voicemail_id']."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all_".$field['voicemail_id']."').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='voicemail_messages[$x][uuid]' value='".escape($row['voicemail_message_uuid'])."' />\n";
|
||||
echo " <input type='hidden' name='voicemail_messages[$x][voicemail_uuid]' value='".escape($row['voicemail_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".escape($row['message_length_label'])." </td>\n";
|
||||
echo " <td class='no-wrap' ".$style.">".$created_date."</td>\n";
|
||||
echo " <td class='overflow' ".$style.">".escape($row['caller_id_name'])." </td>\n";
|
||||
echo " <td class='hide-xs' ".$style.">".escape($row['caller_id_number'])." </td>\n";
|
||||
echo " <td class='button center no-link no-wrap'>";
|
||||
echo "<audio id='recording_audio_".escape($row['voicemail_message_uuid'])."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".escape($row['voicemail_message_uuid'])."')\" onended=\"recording_reset('".escape($row['voicemail_message_uuid'])."');\" src='voicemail_messages.php?action=download&id=".urlencode($row['voicemail_id'])."&voicemail_uuid=".urlencode($row['voicemail_uuid'])."&uuid=".urlencode($row['voicemail_message_uuid'])."&r=".uuid()."'></audio>";
|
||||
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.escape($row['voicemail_message_uuid']),'onclick'=>"recording_play('".escape($row['voicemail_message_uuid'])."');"]);
|
||||
echo button::create(['type'=>'button','title'=>$text['label-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>"voicemail_messages.php?action=download&t=bin&id=".urlencode($row['voicemail_id'])."&voicemail_uuid=".escape($row['voicemail_uuid'])."&uuid=".escape($row['voicemail_message_uuid']),'onclick'=>"$(this).closest('tr').children('td').css('font-weight','normal');"]);
|
||||
echo " </td>\n";
|
||||
echo " <td class='right no-wrap hide-xs' ".$style.">".escape($row['message_length_label'])."</td>\n";
|
||||
if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') {
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".escape($row['file_size_label'])."</td>\n";
|
||||
echo " <td class='right no-wrap hide-sm-dn' ".$style.">".escape($row['file_size_label'])."</td>\n";
|
||||
}
|
||||
if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') {
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".escape($row['message_transcription'])."</td>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('voicemail_message_delete')) {
|
||||
echo " <td class='list_control_icon' style='width: 25px;'>";
|
||||
echo "<a href='voicemail_message_delete.php?voicemail_messages[".escape($row['voicemail_uuid'])."][]=".escape($row['voicemail_message_uuid'])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
|
||||
echo " </td>\n";
|
||||
echo " <td ".$style.">".escape($row['message_transcription'])."</td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$c = ($c) ? 0 : 1;
|
||||
$x++;
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
else {
|
||||
echo "<tr><td colspan='20'>".$text['message-messages_not_found']."<br /></td></tr>";
|
||||
echo "<tr><td colspan='20' style='text-align: center; font-size: 90%; padding-top: 10px;'>".$text['message-messages_not_found']."<br /></td></tr>";
|
||||
}
|
||||
unset($row);
|
||||
|
||||
$previous_voicemail_id = $field['voicemail_id'];
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<br /><br />";
|
||||
|
||||
echo "</form>";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -223,37 +333,21 @@
|
||||
echo "<script>recording_play('".$_REQUEST["uuid"]."');</script>";
|
||||
}
|
||||
|
||||
//check or uncheck all voicemail checkboxes
|
||||
if (is_array($vm_msg_ids) && sizeof($vm_msg_ids) > 0) {
|
||||
echo "<script>\n";
|
||||
echo " function check(what, voicemail_id) {\n";
|
||||
foreach ($vm_msg_ids as $voicemail_id => $checkbox_ids) {
|
||||
echo "if (voicemail_id == '".$voicemail_id."') {\n";
|
||||
foreach ($checkbox_ids as $index => $checkbox_id) {
|
||||
echo "document.getElementById('".$checkbox_id."').checked = (what == 'all') ? true : false;\n";
|
||||
}
|
||||
echo "}\n";
|
||||
}
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
|
||||
//$(this).children('td:not(.tr_link_void)').css('font-weight','normal');
|
||||
?>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.tr_hover tr').each(function(i,e) {
|
||||
$(e).children('td:not(.list_control_icon,.list_control_icons,.tr_checkbox)').on('click',function() {
|
||||
$(this).closest('tr').children('td').css('font-weight','normal');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
//unbold new message rows when clicked/played/downloaded
|
||||
echo "<script>\n";
|
||||
echo " $(document).ready(function() {\n";
|
||||
echo " $('.list-row').each(function(i,e) {\n";
|
||||
echo " $(e).children('td:not(.checkbox,.no-link)').on('click',function() {\n";
|
||||
echo " $(this).closest('tr').children('td').css('font-weight','normal');\n";
|
||||
echo " });\n";
|
||||
echo " $(e).children('td').children('button').on('click',function() {\n";
|
||||
echo " $(this).closest('tr').children('td').css('font-weight','normal');\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo "</script>\n";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user