diff --git a/app/call_recordings/call_recordings.php b/app/call_recordings/call_recordings.php index acf529e92e..9e2bc22752 100644 --- a/app/call_recordings/call_recordings.php +++ b/app/call_recordings/call_recordings.php @@ -42,6 +42,49 @@ $language = new text; $text = $language->get(); +//get the action + if (is_array($_POST["call_recordings"])) { + $call_recordings = $_POST["call_recordings"]; + foreach($call_recordings as $row) { + if ($row['action'] == 'download') { + $action = 'download'; + break; + } + if ($row['action'] == 'delete') { + $action = 'delete'; + break; + } + } + } + +//download recordings + if (permission_exists('call_recording_download')) { + if ($action == "download") { + //download + $obj = new call_recordings; + $obj->download($call_recordings); + //delete message + messages::add($text['message-add']); + } + } + +//delete the recordings + if (permission_exists('call_recording_delete')) { + if ($action == "delete") { + //set the array + $call_recordings = $_POST["call_recordings"]; + //download + $obj = new call_recordings; + $obj->delete($call_recordings); + //delete message + messages::add($text['message-delete']); + } + } + +//additional includes + require_once "resources/header.php"; + require_once "resources/paging.php"; + //get variables used to control the order $order_by = check_str($_GET["order_by"]); $order = check_str($_GET["order"]); @@ -57,23 +100,6 @@ $sql_search .= ") "; } -//delete the recordings - if (permission_exists('call_recording_delete')) { - if (is_array($_POST["call_recordings"])) { - //set the array - $call_recordings = $_POST["call_recordings"]; - //download - $obj = new call_recordings; - $obj->delete($call_recordings); - //delete message - messages::add($text['message-delete']); - } - } - -//additional includes - require_once "resources/header.php"; - require_once "resources/paging.php"; - //prepare to page the results $sql = "select count(call_recording_uuid) as num_rows from v_call_recordings "; $sql .= "where domain_uuid = '".$_SESSION["domain_uuid"]."' "; @@ -133,15 +159,18 @@ echo "\n"; //show the content + echo "
\n"; echo "\n"; echo " \n"; echo " \n"; - echo " \n"; echo " \n"; - echo " \n"; echo " \n"; echo " \n"; echo "
".$text['title-call_recordings']."\n"; + //if (permission_exists('call_recording_delete')) { + echo " \n"; + echo "       "; + //} echo " \n"; echo " \n"; echo "
\n"; @@ -160,10 +189,9 @@ //echo "\n"; echo "\n"; - echo "
\n"; echo "\n"; echo "\n"; - echo " \n"; echo th_order_by('call_recording_name', $text['label-call_recording_name'], $order_by, $order); @@ -183,7 +211,7 @@ } echo " \n"; echo "\n"; - + if (is_array($result)) { $x = 0; foreach($result as $row) { @@ -194,7 +222,7 @@ $tr_link = "href='call_recording_edit.php?id=".$row['call_recording_uuid']."'"; } echo "\n"; - echo " \n";
\n"; + echo " \n"; echo " \n"; echo "