CDR: Integrate existing permissions for Recording Playback and Download buttons.

Misc: Background visual adjustments for Playback and Download icons.
This commit is contained in:
Nate Jones 2015-04-03 21:07:24 +00:00
parent 697ef49c60
commit d68a273c64
8 changed files with 94 additions and 66 deletions

View File

@ -359,7 +359,7 @@ if ($_GET['act'] == "del" && permission_exists('music_on_hold_delete')) {
echo " <td class='".$row_style[$c]."'>".$file."</td>\n";
if (strlen($file) > 0) {
$row_uuid = uuid();
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
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);
@ -430,7 +430,7 @@ if ($_GET['act'] == "del" && permission_exists('music_on_hold_delete')) {
echo " <td class='".$row_style[$c]."'>".$file."</td>\n";
if (strlen($file) > 0) {
$row_uuid = uuid();
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
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($row['recording_filename'], PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);

View File

@ -40,7 +40,7 @@ require_once "resources/check_auth.php";
$order = $_GET["order"];
//download the recordings
if ($_GET['a'] == "download" && permission_exists('recording_download')) {
if ($_GET['a'] == "download" && (permission_exists('recording_play') || permission_exists('recording_download'))) {
session_cache_limiter('public');
if ($_GET['type'] = "rec") {
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.base64_decode($_GET['filename']))) {
@ -157,7 +157,7 @@ require_once "resources/check_auth.php";
echo " </td>\n";
echo " </tr>\n";
echo "</table>";
echo "<br />\n";
echo "<br /><br />\n";
if (permission_exists('recording_upload')) {
echo "<b>".$text['header']."</b>";
@ -228,7 +228,7 @@ require_once "resources/check_auth.php";
echo " </a>";
echo " </td>\n";
if (strlen($row['recording_filename']) > 0) {
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
echo " <td valign='top' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void'>";
$recording_file_path = $row['recording_filename'];
$recording_file_name = strtolower(pathinfo($recording_file_path, PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);

View File

@ -328,7 +328,7 @@ else {
echo " <td valign='top' class='".$row_style[$c]."'>".$row['greeting_name']."</td>\n";
if (permission_exists('voicemail_greeting_download')) {
if (strlen($row['greeting_name']) > 0) {
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
echo " <td valign='top' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void'>";
$recording_file_path = $row['greeting_name'];
$recording_file_name = strtolower(pathinfo($recording_file_path, PATHINFO_BASENAME));
$recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);

View File

@ -149,7 +149,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
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"]." tr_link_void'>";
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);

View File

@ -110,10 +110,10 @@
$text['label-duration']['pt-pt'] = "Duração";
$text['label-duration']['fr-fr'] = "Durée";
$text['label-tools']['en-us'] = "Tools";
$text['label-tools']['es-cl'] = "Herramientas";
$text['label-tools']['pt-pt'] = "Ferramentas";
$text['label-tools']['fr-fr'] = "Outils";
$text['label-recording']['en-us'] = "Recording";
$text['label-recording']['es-cl'] = "Grabación";
$text['label-recording']['pt-pt'] = "Gravação";
$text['label-recording']['fr-fr'] = "Enregistrement";
$text['label-play']['en-us'] = "Play";
$text['label-play']['es-cl'] = "Reproducir";

View File

@ -75,7 +75,7 @@ else {
//page title and description
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='50%' nowrap='nowrap' style='vertical-align: top;'><b>".$text['title']."</b><br><br><br></td>\n";
echo "<td align='left' nowrap='nowrap' style='vertical-align: top;'><b>".$text['title']."</b><br><br><br></td>\n";
echo "<td align='right' width='100%' style='vertical-align: top;'>\n";
echo " <form id='frm_export' method='post' action='xml_cdr_export.php'>\n";
echo " <input type='hidden' name='cdr_id' value='$cdr_id'>\n";
@ -319,7 +319,7 @@ else {
echo "<form name='frm' method='post' action='xml_cdr_delete.php'>\n";
echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
if (permission_exists('xml_cdr_delete')) {
if (permission_exists('xml_cdr_delete') && $result_count > 0) {
echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
}
echo "<th>&nbsp;</th>\n";
@ -329,7 +329,9 @@ else {
echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order, null, null, $param);
echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order, null, null, $param);
echo th_order_by('destination_number', $text['label-destination'], $order_by, $order, null, null, $param);
echo "<th>".$text['label-tools']."</th>\n";
if (permission_exists('recording_play') || permission_exists('recording_download')) {
echo "<th>".$text['label-recording']."</th>\n";
}
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param);
echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param);
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param);
@ -346,7 +348,7 @@ else {
echo th_order_by('hangup_cause', $text['label-status'], $order_by, $order, $param);
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
echo "<td class='list_control_icon'>";
if (permission_exists('xml_cdr_delete')) {
if (permission_exists('xml_cdr_delete') && $result_count > 0) {
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
}
echo "</td>\n";
@ -385,47 +387,49 @@ else {
$seconds = ($row['hangup_cause']=="ORIGINATOR_CANCEL") ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
//handle recordings
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if(!empty($row['recording_file']) && file_exists($row['recording_file'])){
$tmp_name=$row['recording_file'];
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.wav')) {
$tmp_name = $row['uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.wav')) {
$tmp_name = $row['uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.mp3')) {
$tmp_name = $row['uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.mp3')) {
$tmp_name = $row['uuid']."_1.mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.wav')) {
$tmp_name = $row['bridge_uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.wav')) {
$tmp_name = $row['bridge_uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.mp3')) {
$tmp_name = $row['bridge_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.mp3')) {
$tmp_name = $row['bridge_uuid']."_1.mp3";
}
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name) && $seconds > 0) {
$recording_file_path = '/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name;
$recording_file_name = strtolower(pathinfo($tmp_name, 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 (permission_exists('recording_play') || permission_exists('recording_download')) {
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if(!empty($row['recording_file']) && file_exists($row['recording_file'])){
$tmp_name=$row['recording_file'];
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.wav')) {
$tmp_name = $row['uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.wav')) {
$tmp_name = $row['uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'.mp3')) {
$tmp_name = $row['uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['uuid'].'_1.mp3')) {
$tmp_name = $row['uuid']."_1.mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.wav')) {
$tmp_name = $row['bridge_uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.wav')) {
$tmp_name = $row['bridge_uuid']."_1.wav";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'.mp3')) {
$tmp_name = $row['bridge_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.mp3')) {
$tmp_name = $row['bridge_uuid']."_1.mp3";
}
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name) && $seconds > 0) {
$recording_file_path = '/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name;
$recording_file_name = strtolower(pathinfo($tmp_name, 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;
}
}
else {
unset($recording_file_path);
}
}
else {
unset($recording_file_path);
}
if (if_group("admin") || if_group("superadmin") || if_group("cdr")) {
@ -509,18 +513,22 @@ else {
echo " </a>\n";
echo " </td>\n";
if ($recording_file_path != '') {
echo " <td valign='top' class='".$row_style["2"]." tr_link_void'>";
echo "<audio id='recording_audio_".$row['uuid']."' style='display: none;' preload='none' onended=\"recording_reset('".$row['uuid']."');\" src=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&filename=".base64_encode($recording_file_path)."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['uuid']."' onclick=\"recording_play('".$row['uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
echo "<a href=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode($recording_file_path)."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
if (permission_exists('recording_play') || permission_exists('recording_download')) {
if ($recording_file_path != '') {
echo " <td valign='top' align='center' class='".$row_style["2"]." ".((!$c) ? "row_style_hor_mir_grad" : null)." tr_link_void'>";
if (permission_exists('recording_play')) {
echo "<audio id='recording_audio_".$row['uuid']."' style='display: none;' preload='none' onended=\"recording_reset('".$row['uuid']."');\" src=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&filename=".base64_encode($recording_file_path)."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['uuid']."' onclick=\"recording_play('".$row['uuid']."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
}
if (permission_exists('recording_download')) {
echo "<a href=\"".PROJECT_PATH."/app/recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode($recording_file_path)."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
}
echo " </td>\n";
}
else {
echo " <td valign='top' align='center' class='".$row_style[$c]."'>&nbsp;</td>\n";
}
}
else {
echo " <td valign='top' class='".$row_style[$c]."'>";
echo "&nbsp;";
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".$tmp_start_epoch."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".(($row['tta'] > 0) ? $row['tta']."s" : "&nbsp;")."</td>\n";

View File

@ -450,6 +450,16 @@ table.tr_hover tr:hover td a {
white-space: nowrap;
}
.row_style_hor_mir_grad {
background: -moz-linear-gradient(left, #e5e9f0 0%, #ffffff 25%, #ffffff 75%, #e5e9f0 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#e5e9f0), color-stop(25%,#ffffff), color-stop(75%,#ffffff), color-stop(100%,#e5e9f0));
background: -webkit-linear-gradient(left, #e5e9f0 0%,#ffffff 25%,#ffffff 75%,#e5e9f0 100%);
background: -o-linear-gradient(left, #e5e9f0 0%,#ffffff 25%,#ffffff 75%,#e5e9f0 100%);
background: -ms-linear-gradient(left, #e5e9f0 0%,#ffffff 25%,#ffffff 75%,#e5e9f0 100%);
background: linear-gradient(to right, #e5e9f0 0%,#ffffff 25%,#ffffff 75%,#e5e9f0 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e9f0', endColorstr='#e5e9f0',GradientType=1 );
}
.row_stylebg {
border-bottom: 1px solid #b9c5d8;
background-color: #f0f2f6;

View File

@ -450,6 +450,16 @@ table.tr_hover tr:hover td a {
white-space: nowrap;
}
.row_style_hor_mir_grad {
background: -moz-linear-gradient(left, #e5e9f0 0%, #fff 25%, #fff 75%, #e5e9f0 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#e5e9f0), color-stop(25%,#fff), color-stop(75%,#fff), color-stop(100%,#e5e9f0));
background: -webkit-linear-gradient(left, #e5e9f0 0%,#fff 25%,#fff 75%,#e5e9f0 100%);
background: -o-linear-gradient(left, #e5e9f0 0%,#fff 25%,#fff 75%,#e5e9f0 100%);
background: -ms-linear-gradient(left, #e5e9f0 0%,#fff 25%,#fff 75%,#e5e9f0 100%);
background: linear-gradient(to right, #e5e9f0 0%,#fff 25%,#fff 75%,#e5e9f0 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e9f0', endColorstr='#e5e9f0',GradientType=1 );
}
.row_stylebg {
border-bottom: 1px solid #b9c5d8;
background-color: #f0f2f6;