Voicemail: Mods to make it work as expected, if non-admins/superadmins are given access to it.

This commit is contained in:
Nate Jones
2015-04-06 21:57:06 +00:00
parent b0dab63136
commit 23186f9bf5
6 changed files with 208 additions and 190 deletions

View File

@@ -230,12 +230,15 @@ else {
echo "<form action=\"\" method=\"POST\" enctype=\"multipart/form-data\" name=\"frm\" onSubmit=\"\">\n";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left' nowrap>\n";
echo " <span class='title'>".$text['title']."</span><br>\n";
echo " <td align='left' nowrap valign='top'>\n";
echo " <span class='title'>".$text['title']."</span>\n";
echo " <br><br>\n";
echo " ".$text['description']." <strong>".$voicemail_id."</strong>\n";
echo " </td>";
if (permission_exists('voicemail_greeting_upload')) {
echo " <td align='right' nowrap>\n";
echo " <td align='right' nowrap valign='top'>\n";
echo " <div valign='middle'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='".PROJECT_PATH."/app/voicemails/voicemails.php';\" value='".$text['button-back']."'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
echo " <input name=\"file\" type=\"file\" class=\"formfld fileinput\" id=\"file\">\n";
echo " <input name=\"type\" type=\"hidden\" value=\"rec\">\n";
@@ -244,13 +247,7 @@ else {
}
echo " </tr>";
echo " <tr>";
echo " <td align='left' colspan='2'>\n";
echo " ".$text['description']." $voicemail_id. <br />\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br />\n";
//get the number of rows in v_voicemail_greetings

View File

@@ -286,6 +286,11 @@
$text['message-required']['pt-pt'] = "Por favor indique";
$text['message-required']['fr-fr'] = "Merci d'indiquer: ";
$text['message-mailbox_not_found']['en-us'] = "No mailbox found.";
$text['message-mailbox_not_found']['es-cl'] = "No se encontró buzón de correo.";
$text['message-mailbox_not_found']['pt-pt'] = "Sem caixa de correio encontrado.";
$text['message-mailbox_not_found']['fr-fr'] = "Aucune boîte aux lettres trouvé.";
//Voicemail Messages
$text['title-voicemail_messages']['en-us'] = "Voicemail Messages";
$text['title-voicemail_messages']['es-cl'] = "Mensajes de correo de voz";
@@ -387,4 +392,9 @@
$text['description-message_priority']['pt-pt'] = "Prioridade";
$text['description-message_priority']['fr-fr'] = "Priorité";
$text['message-messages_not_found']['en-us'] = "No messages found.";
$text['message-messages_not_found']['es-cl'] = "No hay mensajes encontrados.";
$text['message-messages_not_found']['pt-pt'] = "Nenhuma mensagem encontrada.";
$text['message-messages_not_found']['fr-fr'] = "Aucun message trouvé.";
?>

View File

@@ -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-2014
Portions created by the Initial Developer are Copyright (C) 2008-2015
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -41,13 +41,18 @@
$voicemail_uuid = check_str($_REQUEST["id"]);
}
//set the voicemail_id array
foreach ($_SESSION['user']['extension'] as $row) {
//set the voicemail id and voicemail uuid arrays
foreach ($_SESSION['user']['extension'] as $index => $row) {
if (strlen($row['number_alias']) > 0) {
$voicemail_ids[]['voicemail_id'] = $row['number_alias'];
$voicemail_ids[$index]['voicemail_id'] = $row['number_alias'];
}
else {
$voicemail_ids[]['voicemail_id'] = $row['user'];
$voicemail_ids[$index]['voicemail_id'] = $row['user'];
}
}
foreach ($_SESSION['user']['voicemail'] as $row) {
if (strlen($row['voicemail_uuid']) > 0) {
$voicemail_uuids[]['voicemail_uuid'] = $row['voicemail_uuid'];
}
}
@@ -60,18 +65,18 @@
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
}
else {
//ensure that the requested voicemail id is assigned to this user
//ensure that the requested voicemail box is assigned to this user
$found = false;
foreach($voicemail_ids as $row) {
if ($voicemail_uuid == $row['voicemail_id']) {
$sql .= "and voicemail_id = '".$row['voicemail_id']."' ";
foreach($voicemail_uuids as $row) {
if ($voicemail_uuid == $row['voicemail_uuid']) {
$sql .= "and voicemail_uuid = '".$row['voicemail_uuid']."' ";
$found = true;
}
$x++;
}
//id requested is not owned by the user return no results
if (!$found) {
$sql .= "and voicemail_uuid = '' ";
$sql .= "and voicemail_uuid is null ";
}
}
}
@@ -93,7 +98,7 @@
}
else {
//no assigned voicemail ids so return no results
$sql .= "and voicemail_uuid = '' ";
$sql .= "and voicemail_uuid is null ";
}
}
$sql .= "order by voicemail_id asc ";

View File

@@ -84,117 +84,108 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
require_once "resources/paging.php";
//show the content
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap' valign='top'>";
echo " <b>".$text['title-voicemail_messages']."</b>";
echo " <br><br>";
echo " ".$text['description-voicemail_message'];
echo " <br><br>";
echO " </td>\n";
echo " <td width='50%' align='right' valign='top'>&nbsp;</td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<b>".$text['title-voicemail_messages']."</b>";
echo "<br><br>";
echo $text['description-voicemail_message'];
echo "<br><br>";
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
$row_style["2"] = "row_style2";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
//set the table header
$table_header = "<tr>\n";
$table_header .= th_order_by('created_epoch', $text['label-created_epoch'], $order_by, $order);
$table_header .= th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order);
$table_header .= th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order);
$table_header .= "<th>".$text['label-tools']."</th>\n";
$table_header .= th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "style='text-align: right;'");
$table_header .= "<th style='text-align: right;'>".$text['label-message_size']."</th>\n";
$table_header .= "<td align='right' width='21'>\n";
$table_header .= " &nbsp;\n";
$table_header .= "</td>\n";
$table_header .= "</tr>\n";
//loop through the voicemail messages
if (count($voicemails) > 0) {
echo "<br />";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
//set the table header
$table_header = "<tr>\n";
$table_header .= th_order_by('created_epoch', $text['label-created_epoch'], $order_by, $order);
$table_header .= th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order);
$table_header .= th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order);
$table_header .= "<th>".$text['label-tools']."</th>\n";
$table_header .= th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "style='text-align: right;'");
$table_header .= "<th style='text-align: right;'>".$text['label-message_size']."</th>\n";
$table_header .= "<td style='width: 25px;'>&nbsp;</td>";
$table_header .= "</tr>\n";
$previous_voicemail_id = '';
foreach($voicemails as $field) {
if ($previous_voicemail_id != $field['voicemail_id']) {
echo "<tr>\n";
echo " <td colspan='3' align='left'>\n";
echo " <br>";
if ($previous_voicemail_id != '') {
echo " <br /><br /><br />\n";
echo "<tr><td colspan='20'><br /><br /><br /></td></tr>\n";
}
echo "<tr>\n";
echo " <td colspan='3' align='left' valign='top'>\n";
echo " <b>".$text['label-mailbox'].": ".$field['voicemail_id']." </b><br />&nbsp;\n";
echo " </td>\n";
echo " <td colspan='3' valign='bottom' align='right'>\n";
if (permission_exists('voicemail_greeting_view')) {
echo " <input type='button' class='btn' name='' alt='greetings' onclick=\"window.location='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$field['voicemail_id']."'\" value='".$text['button-greetings']."'>\n";
}
if (permission_exists('voicemail_view')) {
if (permission_exists('voicemail_edit')) {
echo " <input type='button' class='btn' name='' alt='settings' onclick=\"window.location='".PROJECT_PATH."/app/voicemails/voicemail_edit.php?id=".$field['voicemail_uuid']."'\" value='".$text['button-settings']."'>\n";
}
echo " <br /><br /></td>\n";
echo " <td>&nbsp;</td>\n";
echo "</tr>\n";
echo $table_header;
if (count($field['messages']) > 0) {
echo $table_header;
}
}
foreach($field['messages'] as &$row) {
if ($row['message_status'] == '') { $style = "font-weight: bold;"; } else { $style = ''; }
echo "<td valign='top' class='".$row_style[$c]."' style=\"".$style."\" nowrap=\"nowrap\">";
echo " ".$row['created_date'];
echo "</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_number']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void'>";
$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 (count($field['messages']) > 0) {
foreach($field['messages'] as &$row) {
if ($row['message_status'] == '') { $style = "font-weight: bold;"; } else { $style = ''; }
echo "<tr>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\" nowrap='nowrap'>".$row['created_date']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style."\">".$row['caller_id_number']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void'>";
$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;
}
echo "<audio id='recording_audio_".$row['voicemail_message_uuid']."' style='display: none;' preload='none' onended=\"recording_reset('".$row['voicemail_message_uuid']."');\" src=\"voicemail_messages.php?action=download&type=vm&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['voicemail_message_uuid']."' onclick=\"recording_play('".$row['voicemail_message_uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
echo "<a href=\"voicemail_messages.php?action=download&type=vm&t=bin&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['message_length_label']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\" nowrap='nowrap'>".$row['file_size_label']."</td>\n";
echo " <td class='list_control_icon' style='width: 25px;'>";
if (permission_exists('voicemail_message_delete')) {
echo "<a href='voicemail_message_delete.php?voicemail_uuid=".$row['voicemail_uuid']."&id=".$row['voicemail_message_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo "<audio id='recording_audio_".$row['voicemail_message_uuid']."' style='display: none;' preload='none' onended=\"recording_reset('".$row['voicemail_message_uuid']."');\" src=\"voicemail_messages.php?action=download&type=vm&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['voicemail_message_uuid']."' onclick=\"recording_play('".$row['voicemail_message_uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
echo "<a href=\"voicemail_messages.php?action=download&type=vm&t=bin&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['message_length_label']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['file_size_label']."</td>\n";
echo " <td class='list_control_icon'>\n";
if (permission_exists('voicemail_message_delete')) {
echo " <a href='voicemail_message_delete.php?voicemail_uuid=".$row['voicemail_uuid']."&id=".$row['voicemail_message_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo "</tr>\n";
$c = ($c) ? 0 : 1;
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
}
else {
echo "<tr><td colspan='20'>".$text['message-messages_not_found']."<br /></td></tr>";
}//end foreach
unset($row);
$previous_voicemail_id = $field['voicemail_id'];
unset($sql, $result, $result_count);
}
} //end if results
echo "<tr>\n";
echo "<td colspan='9' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='right'>\n";
echo " &nbsp;\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
echo "</table>";
echo "<br /><br />";
}
else {
echo "<br />".$text['message-messages_not_found']."<br /><br />";
}
echo "<br />";
//autoplay message
if (check_str($_REQUEST["action"]) == "autoplay" && check_str($_REQUEST["uuid"]) != '') {

View File

@@ -38,19 +38,20 @@ else {
$language = new text;
$text = $language->get();
//set the voicemail_id array
foreach ($_SESSION['user']['extension'] as $row) {
//set the voicemail id and voicemail uuid arrays
foreach ($_SESSION['user']['extension'] as $index => $row) {
if (strlen($row['number_alias']) > 0) {
$voicemail_ids[]['voicemail_id'] = $row['number_alias'];
$voicemail_ids[$index]['voicemail_id'] = $row['number_alias'];
}
else {
$voicemail_ids[]['voicemail_id'] = $row['user'];
$voicemail_ids[$index]['voicemail_id'] = $row['user'];
}
}
foreach ($_SESSION['user']['voicemail'] as $row) {
if (strlen($row['voicemail_uuid']) > 0) {
$voicemail_uuids[]['voicemail_uuid'] = $row['voicemail_uuid'];
}
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//additional includes
require_once "resources/header.php";
@@ -88,21 +89,23 @@ else {
}
if (!permission_exists('voicemail_delete')) {
$x = 0;
if (count($voicemail_ids) > 0) {
if (count($voicemail_uuids) > 0) {
$sql .= "and (";
foreach($voicemail_ids as $row) {
foreach($voicemail_uuids as $row) {
if ($x == 0) {
$sql .= "voicemail_id = '".$row['voicemail_id']."' ";
$sql .= "voicemail_uuid = '".$row['voicemail_uuid']."' ";
}
else {
$sql .= " or voicemail_id = '".$row['voicemail_id']."'";
$sql .= " or voicemail_uuid = '".$row['voicemail_uuid']."'";
}
$x++;
}
$sql .= ")";
}
else {
$sql .= "and voicemail_uuid is null ";
}
}
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
@@ -118,46 +121,17 @@ else {
//prepare to page the results
$rows_per_page = 150;
$param = "";
if ($search != '') { $param .= "&search=".$search; }
if ($order_by != '') { $param .= "&order_by=".$order_by."&order=".$order; }
$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);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_voicemails ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($search) > 0) {
$sql .= "and (";
$sql .= " voicemail_id like '%".$search."%' ";
$sql .= " or voicemail_mail_to like '%".$search."%' ";
$sql .= " or voicemail_local_after_email like '%".$search."%' ";
$sql .= " or voicemail_enabled like '%".$search."%' ";
$sql .= " or voicemail_description like '%".$search."%' ";
$sql .= ") ";
}
if (!permission_exists('voicemail_delete')) {
$x = 0;
if (count($voicemail_ids) > 0) {
$sql .= "and (";
foreach($voicemail_ids as $row) {
if ($x == 0) {
$sql .= "voicemail_id = '".$row['voicemail_id']."' ";
}
else {
$sql .= " or voicemail_id = '".$row['voicemail_id']."'";
}
$x++;
}
$sql .= ")";
}
}
if (strlen($order_by) == 0) {
$sql .= "order by voicemail_id asc ";
}
else {
$sql .= "order by $order_by $order ";
}
$sql .= "limit $rows_per_page offset $offset ";
$sql = str_replace('count(*) as num_rows', '*', $sql);
$sql .= ($order_by != '') ? "order by ".$order_by." ".$order." " : "order by voicemail_id asc ";
$sql .= "limit ".$rows_per_page." offset ".$offset." ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@@ -168,23 +142,29 @@ else {
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by, $order);
echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order);
echo th_order_by('voicemail_file', $text['label-voicemail_file_attached'], $order_by, $order);
echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order);
echo th_order_by('voicemail_description', $text['label-voicemail_description'], $order_by, $order);
echo "<td class='list_control_icons'>";
if (permission_exists('voicemail_add')) {
echo "<a href='voicemail_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
echo "</td>\n";
echo "</tr>\n";
if ($result_count > 0) {
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by, $order);
echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order);
echo th_order_by('voicemail_file', $text['label-voicemail_file_attached'], $order_by, $order);
echo th_order_by('voicemail_local_after_email', $text['label-voicemail_local_after_email'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('voicemail_enabled', $text['label-voicemail_enabled'], $order_by, $order);
echo th_order_by('voicemail_description', $text['label-voicemail_description'], $order_by, $order);
if (permission_exists('voicemail_add') || permission_exists('voicemail_edit') || permission_exists('voicemail_delete')) {
echo "<td class='list_control_icons' style='width: 25px;'>";
if (permission_exists('voicemail_add')) {
echo "<a href='voicemail_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
else {
echo "&nbsp;";
}
}
echo "</td>\n";
echo "</tr>\n";
foreach($result as $row) {
$tr_link = (permission_exists('voicemail_edit')) ? "href='voicemail_edit.php?id=".$row['voicemail_uuid']."'" : null;
echo "<tr ".$tr_link.">\n";
@@ -200,42 +180,54 @@ else {
echo " <td valign='top' class='".$row_style[$c]."'>".(($row['voicemail_file'] == 'attach') ? $text['label-true'] : $text['label-false'])."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['voicemail_local_after_email'])."&nbsp;</td>\n";
echo " <td valign='middle' class='".$row_style[$c]."' style='white-space: nowrap;'>\n";
echo " <a href='voicemail_messages.php?id=".$row['voicemail_uuid']."'>".$text['label-view']."</a>&nbsp;&nbsp;\n";
echo " <a href='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$row['voicemail_id']."'>".$text['label-greetings']."</a>\n";
if (permission_exists('voicemail_message_view')) {
echo " <a href='voicemail_messages.php?id=".$row['voicemail_uuid']."'>".$text['label-view']."</a>&nbsp;&nbsp;\n";
}
if (permission_exists('voicemail_greeting_view')) {
echo " <a href='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$row['voicemail_id']."'>".$text['label-greetings']."</a>\n";
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['voicemail_enabled'])."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg' width='30%'>".$row['voicemail_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('voicemail_edit')) {
echo "<a href='voicemail_edit.php?id=".$row['voicemail_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
if (permission_exists('voicemail_edit') || permission_exists('voicemail_delete')) {
echo " <td class='list_control_icons' style='width: 25px;'>";
if (permission_exists('voicemail_edit')) {
echo "<a href='voicemail_edit.php?id=".$row['voicemail_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('voicemail_delete')) {
echo "<a href='voicemail_delete.php?id=".$row['voicemail_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
}
if (permission_exists('voicemail_delete')) {
echo "<a href='voicemail_delete.php?id=".$row['voicemail_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('voicemail_add')) {
echo "<a href='voicemail_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('voicemail_add')) {
echo "<a href='voicemail_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
}
else {
echo "<br />";
echo $text['message-mailbox_not_found'];
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "<br /><br />";
//include the footer