diff --git a/app/voicemails/app_languages.php b/app/voicemails/app_languages.php index 429e76abeb..c4a9d0daf1 100644 --- a/app/voicemails/app_languages.php +++ b/app/voicemails/app_languages.php @@ -64,9 +64,21 @@ $text['label-tools']['en-us'] = 'Tools'; $text['label-tools']['pt-pt'] = 'Ferramentas'; + $text['label-message_size']['en-us'] = 'Size'; + $text['label-message_size']['pt-pt'] = ''; + + $text['label-play']['en-us'] = 'Play'; + $text['label-play']['pt-pt'] = ''; + + $text['label-download']['en-us'] = 'Download'; + $text['label-download']['pt-pt'] = ''; + $text['label-view']['en-us'] = 'View'; $text['label-view']['pt-pt'] = ''; + $text['label-greetings']['en-us'] = 'Greetings'; + $text['label-greetings']['pt-pt'] = ''; + $text['label-true']['en-us'] = 'true'; $text['label-true']['pt-pt'] = ''; @@ -122,16 +134,16 @@ $text['description-voicemail_uuid']['en-us'] = 'Voicemail UUID'; $text['description-voicemail_uuid']['pt-pt'] = ''; - $text['label-created_epoch']['en-us'] = 'Created Epoch'; + $text['label-created_epoch']['en-us'] = 'Created'; $text['label-created_epoch']['pt-pt'] = ''; - $text['description-created_epoch']['en-us'] = 'Created Epoch'; + $text['description-created_epoch']['en-us'] = 'Created'; $text['description-created_epoch']['pt-pt'] = ''; - $text['label-read_epoch']['en-us'] = 'Read Epoch'; + $text['label-read_epoch']['en-us'] = 'Read'; $text['label-read_epoch']['pt-pt'] = ''; - $text['description-read_epoch']['en-us'] = 'Read Epoch'; + $text['description-read_epoch']['en-us'] = 'Read'; $text['description-read_epoch']['pt-pt'] = ''; $text['label-caller_id_name']['en-us'] = 'Caller ID Name'; diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index 3d16893e9d..f6e5f79049 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -33,21 +33,37 @@ else { echo "access denied"; exit; } + //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } +//get the uuid + $voicemail_uuid = check_str($_REQUEST["id"]); + +//get the voicemail_id + $sql = "select * from v_voicemails "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and voicemail_uuid = '$voicemail_uuid' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + foreach ($result as &$row) { + $voicemail_id = $row["voicemail_id"]; + } + unset ($prep_statement); + //download the voicemail if ($_GET['a'] == "download") { session_cache_limiter('public'); - $uuid = check_str($_GET["uuid"]); + $voicemail_message_uuid = check_str($_GET["uuid"]); $sql = "select * from v_voicemail_messages "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and voicemail_message_uuid = '$uuid' "; + $sql .= "and voicemail_message_uuid = '$voicemail_message_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -63,20 +79,9 @@ else { } unset ($prep_statement); - $sql = "select * from v_voicemails "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and voicemail_uuid = '$voicemail_uuid' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - foreach ($result as &$row) { - $voicemail_id = $row["voicemail_id"]; - } - unset ($prep_statement); - if ($_GET['type'] = "vm") { - file_path = $_SESSION['switch']['storage']['dir']."/voicemail/default/".$_SESSION['domain_name']."/".$voicemail_id."/msg_".$voicemail_uuid.".wav"; - if (file_exists($file_path)) { + $file_path = $_SESSION['switch']['storage']['dir']."/voicemail/default/".$_SESSION['domain_name']."/".$voicemail_id."/msg_".$voicemail_message_uuid.".wav"; + if (file_exists($file_path)) { $fd = fopen($file_path, "rb"); if ($_GET['t'] == "bin") { header("Content-Type: application/force-download"); @@ -110,10 +115,10 @@ else { } //get the html values and set them as variables - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; + $order_by = check_str($_GET["order_by"]); + $order = check_str($_GET["order"]); if (strlen($_GET["id"]) > 0) { - $voicemail_uuid = $_GET["id"]; + $voicemail_uuid = check_str($_GET["id"]); } //additional includes @@ -195,6 +200,8 @@ else { echo th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order); echo th_order_by('message_length', $text['label-message_length'], $order_by, $order); echo th_order_by('message_status', $text['label-message_status'], $order_by, $order); + echo "".$text['label-message_size']."\n"; + echo "".$text['label-tools']."\n"; //echo th_order_by('message_priority', $text['label-message_priority'], $order_by, $order); echo "\n"; if (permission_exists('voicemail_message_add')) { @@ -208,6 +215,21 @@ else { if ($result_count > 0) { foreach($result as $row) { + + //set the greeting directory + $file_path = $_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$voicemail_id.'/msg_'.$row['voicemail_message_uuid'].'.wav'; + $file_size = filesize($file_path); + $file_size = byte_convert($file_size); + $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"; + } + echo "\n"; //echo " ".$row['voicemail_uuid']." \n"; echo ""; @@ -216,8 +238,18 @@ else { //echo " ".$row['read_epoch']." \n"; echo " ".$row['caller_id_name']." \n"; echo " ".$row['caller_id_number']." \n"; - echo " ".$row['message_length']." \n"; + echo " ".$message_length." \n"; echo " ".$row['message_status']." \n"; + echo " ".$file_size."\n"; + echo " \n"; + //echo " \n"; + //echo " ".$text['label-play']."\n"; + //echo " \n"; + echo "   \n"; + echo " \n"; + echo " ".$text['label-download']."\n"; + echo " \n"; + echo " \n"; //echo " ".$row['message_priority']." \n"; echo " \n"; if (permission_exists('voicemail_message_edit')) { diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index f88982639f..ced670489e 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -144,7 +144,8 @@ else { echo " ".$row['voicemail_local_after_email']." \n"; //echo "  \n"; echo " \n"; - echo " ".$text['label-view']." \n"; + echo " ".$text['label-view']."  \n"; + echo " ".$text['label-greetings']."\n"; echo " \n"; echo " ".$row['voicemail_enabled']." \n"; echo " ".$row['voicemail_description']." \n";