mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Voicemail: Add bulk delete ability for Messages, instant saved indication when playing/downloading, and table row click to play.
Dashboard: Minor code cleanup.
This commit is contained in:
@@ -34,14 +34,36 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
echo "<pre>".print_r($_REQUEST, true)."</pre>";
|
||||
exit;
|
||||
*/
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the HTTP values and set them as variables
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
$voicemail_uuid = check_str($_GET["voicemail_uuid"]);
|
||||
//get submitted variables
|
||||
if (count($_REQUEST)>0) {
|
||||
$voicemail_messages = $_REQUEST["voicemail_messages"];
|
||||
}
|
||||
|
||||
//delete the voicemail message
|
||||
$deleted = 0;
|
||||
if (is_array($voicemail_messages) && sizeof($voicemail_messages) > 0) {
|
||||
require_once "resources/classes/voicemail.php";
|
||||
foreach ($voicemail_messages as $voicemail_uuid => $voicemail_message_uuids) {
|
||||
foreach ($voicemail_message_uuids as $voicemail_message_uuid) {
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->db = $db;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_uuid = check_str($voicemail_uuid);
|
||||
$voicemail->voicemail_message_uuid = check_str($voicemail_message_uuid);
|
||||
$result = $voicemail->message_delete();
|
||||
unset($voicemail);
|
||||
$deleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set the referrer
|
||||
@@ -49,26 +71,15 @@ else {
|
||||
$referer_path = $http_referer['path'];
|
||||
$referer_query = $http_referer['query'];
|
||||
|
||||
//delete the voicemail message
|
||||
if (strlen($id)>0) {
|
||||
require_once "resources/classes/voicemail.php";
|
||||
$voicemail = new voicemail;
|
||||
$voicemail->db = $db;
|
||||
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$voicemail->voicemail_uuid = $voicemail_uuid;
|
||||
$voicemail->voicemail_message_uuid = $id;
|
||||
$result = $voicemail->message_delete();
|
||||
unset($voicemail);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
$_SESSION["message"] = $text['message-delete'];
|
||||
if ($referer_path == "/app/voicemails/voicemail_messages.php") {
|
||||
if ($deleted > 0) {
|
||||
$_SESSION["message"] = $text['message-delete'].': '.$deleted;
|
||||
}
|
||||
if ($referer_path == PROJECT_PATH."/app/voicemails/voicemail_messages.php") {
|
||||
header("Location: voicemail_messages.php?".$referer_query);
|
||||
}
|
||||
else {
|
||||
header("Location: voicemails.php");
|
||||
}
|
||||
return;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user