Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes require_once "root.php"; require_once "resources/require.php"; //check permissions if (!(check_str($_REQUEST["action"]) == "download" && check_str($_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(); //set the voicemail_uuid if (strlen($_REQUEST["id"]) > 0) { $voicemail_uuid = check_str($_REQUEST["id"]); } //required class require_once "app/voicemails/resources/classes/voicemail.php"; //download the message if (check_str($_REQUEST["action"]) == "download") { $voicemail_message_uuid = check_str($_REQUEST["uuid"]); $voicemail_id = check_str($_REQUEST["id"]); $voicemail_uuid = check_str($_REQUEST["voicemail_uuid"]); if ($voicemail_message_uuid != '' && $voicemail_id != '' && $voicemail_uuid != '') { $voicemail = new voicemail; $voicemail->db = $db; $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); } exit; } //get the html values and set them as variables $order_by = check_str($_GET["order_by"]); $order = check_str($_GET["order"]); //get the voicemail $vm = new voicemail; $vm->db = $db; $vm->domain_uuid = $_SESSION['domain_uuid']; $vm->voicemail_uuid = $voicemail_uuid; $vm->order_by = $order_by; $vm->order = $order; $voicemails = $vm->messages(); //additional includes $document['title'] = $text['title-voicemail_messages']; require_once "resources/header.php"; require_once "resources/paging.php"; //show the content echo "".$text['title-voicemail_messages'].""; echo "

"; echo $text['description-voicemail_message']; echo "

"; $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; //loop through the voicemail messages if (count($voicemails) > 0) { echo "
\n"; echo "
"; echo "\n"; $previous_voicemail_id = ''; foreach($voicemails as $field) { if ($previous_voicemail_id != $field['voicemail_id']) { if ($previous_voicemail_id != '') { echo "\n"; } echo " \n"; echo " \n"; echo " \n"; echo "\n"; if (count($field['messages']) > 0) { echo "\n"; if (permission_exists('voicemail_message_delete')) { echo ""; } 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 "\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 "\n"; } if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') { echo "\n"; } if (permission_exists('voicemail_message_delete')) { echo ""; } echo "\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 "\n"; $tr_link = "href=\"javascript:recording_play('".$row['voicemail_message_uuid']."');\""; echo "\n"; if (permission_exists('voicemail_message_delete')) { echo " "; $vm_msg_ids[$row['voicemail_id']][] = 'checkbox_'.$row['voicemail_message_uuid']; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') { echo " \n"; } if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') { echo " \n"; } if (permission_exists('voicemail_message_delete')) { echo " \n"; } echo "\n"; $c = ($c) ? 0 : 1; } } else { echo ""; }//end foreach unset($row); $previous_voicemail_id = $field['voicemail_id']; unset($sql, $result, $result_count); } echo "



\n"; echo " ".$text['label-mailbox'].": ".$field['voicemail_id']." ".$field['voicemail_description']."
 \n"; echo "
\n"; echo " \n"; if (permission_exists('voicemail_greeting_view')) { echo " \n"; } if (permission_exists('voicemail_edit')) { echo " \n"; } echo "

"; echo "
 
".$text['label-tools']."".$text['label-message_size']."".$text['label-transcription'].""; echo "".$v_link_label_delete.""; echo "
".$row['created_date']."".$row['caller_id_name']." ".$row['caller_id_number']." ".$row['message_length_label']." ".$row['file_size_label']."".$row['message_transcription'].""; echo "".$v_link_label_delete.""; echo "
".$text['message-messages_not_found']."
"; echo "

"; echo "
"; } else { echo "
".$text['message-messages_not_found']."

"; } echo "
"; //autoplay message if (check_str($_REQUEST["action"]) == "autoplay" && check_str($_REQUEST["uuid"]) != '') { echo ""; } //check or uncheck all voicemail checkboxes if (sizeof($vm_msg_ids) > 0) { echo "\n"; } //$(this).children('td:not(.tr_link_void)').css('font-weight','normal'); ?>