Theme: Replace image-based control icons with Bootstra Glyphicon buttons.

Voicemail Messsages: Added ability to toggle message status (saved/new).
This commit is contained in:
reliberate
2016-03-28 17:50:07 -06:00
parent 785279d62b
commit fd54066540
12 changed files with 215 additions and 24 deletions

View File

@@ -250,11 +250,11 @@
public function message_waiting() {
//send the message waiting status
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd .= "luarun app.lua voicemail mwi ".$this->voicemail_id."@".$_SESSION['domain_name'];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd .= "luarun app.lua voicemail mwi ".$this->voicemail_id."@".$_SESSION['domain_name'];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
}
public function message_delete() {
@@ -300,13 +300,54 @@
$this->message_waiting();
}
public function message_toggle() {
//get the voicemail_id
if (!isset($this->voicemail_id)) {
$sql = "select voicemail_id from v_voicemails ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$this->voicemail_id = $row["voicemail_id"];
}
unset ($prep_statement);
}
//get message status
$sql = "select message_status from v_voicemail_messages ";
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
$sql .= "and voicemail_message_uuid = '".$this->voicemail_message_uuid."' ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_NAMED);
$new_status = ($row['message_status'] == 'saved') ? 'null' : "'saved'";
unset($sql, $prep_statement, $row);
//set message status
$sql = "update v_voicemail_messages set ";
$sql .= "message_status = ".$new_status." ";
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
$sql .= "and voicemail_message_uuid = '".$this->voicemail_message_uuid."' ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql, $prep_statement);
//check the message waiting status
$this->message_waiting();
}
public function message_saved() {
//set the voicemail status to saved
$sql = "update v_voicemail_messages set ";
$sql .= "message_status = 'saved' ";
$sql .= "where domain_uuid = '$this->domain_uuid' ";
$sql .= "and voicemail_uuid = '$this->voicemail_uuid' ";
$sql .= "and voicemail_message_uuid = '$this->voicemail_message_uuid'";
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
$sql .= "and voicemail_uuid = '".$this->voicemail_uuid."' ";
$sql .= "and voicemail_message_uuid = '".$this->voicemail_message_uuid."' ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql, $prep_statement);

View File

@@ -0,0 +1,78 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
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();
//get submitted variables
$voicemail_messages = $_REQUEST["voicemail_messages"];
//toggle the voicemail message
$toggled = 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_toggle();
unset($voicemail);
$toggled++;
}
}
}
//set the referrer
$http_referer = parse_url($_SERVER["HTTP_REFERER"]);
$referer_path = $http_referer['path'];
$referer_query = $http_referer['query'];
//redirect the user
if ($toggled > 0) {
$_SESSION["message"] = $text['message-toggled'].': '.$toggled;
}
if ($referer_path == PROJECT_PATH."/app/voicemails/voicemail_messages.php") {
header("Location: voicemail_messages.php?".$referer_query);
}
else {
header("Location: voicemails.php");
}
?>

View File

@@ -98,7 +98,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
//loop through the voicemail messages
if (count($voicemails) > 0) {
echo "<form name='frm' id='frm' method='post' action='voicemail_message_delete.php'>\n";
echo "<form name='frm' id='frm' method='post' action=''>\n";
echo "<br />";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
@@ -113,11 +113,12 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
echo " <b>".$text['label-mailbox'].": ".$field['voicemail_id']." </b><br />&nbsp;\n";
echo " </td>\n";
echo " <td colspan='".(($_SESSION['voicemail']['storage_type']['text'] != 'base64') ? 3 : 2)."' valign='bottom' align='right'>\n";
echo " <input type='button' class='btn' alt='".$text['button-toggle']."' onclick=\"$('#frm').attr('action', 'voicemail_message_toggle.php').submit();\" value='".$text['button-toggle']."'>\n";
if (permission_exists('voicemail_greeting_view')) {
echo " <input type='button' class='btn' alt='greetings' onclick=\"window.location='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$field['voicemail_id']."'\" value='".$text['button-greetings']."'>\n";
echo " <input type='button' class='btn' alt='".$text['button-greetings']."' onclick=\"document.location.href='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$field['voicemail_id']."'\" value='".$text['button-greetings']."'>\n";
}
if (permission_exists('voicemail_edit')) {
echo " <input type='button' class='btn' alt='settings' onclick=\"window.location='".PROJECT_PATH."/app/voicemails/voicemail_edit.php?id=".$field['voicemail_uuid']."'\" value='".$text['button-settings']."'>\n";
echo " <input type='button' class='btn' alt='".$text['button-settings']."' onclick=\"document.location.href='voicemail_edit.php?id=".$field['voicemail_uuid']."'\" value='".$text['button-settings']."'>\n";
}
echo " <br /><br />";
echo " </td>\n";
@@ -139,7 +140,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
}
if (permission_exists('voicemail_message_delete')) {
echo "<td class='list_control_icons' style='width: 25px;'>";
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 "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { $('#frm').attr('action', 'voicemail_message_delete.php').submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
echo "</td>";
}
echo "</tr>\n";
@@ -174,7 +175,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"]
case "ogg" : $recording_type = "audio/ogg"; break;
}
echo "<audio id='recording_audio_".$row['voicemail_message_uuid']."' style='display: none;' ontimeupdate=\"update_progress('".$row['voicemail_message_uuid']."')\" preload='none' onended=\"recording_reset('".$row['voicemail_message_uuid']."');\" src=\"voicemail_messages.php?action=download&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" type='".$recording_type."'></audio>";
echo "<span id='recording_button_".$row['voicemail_message_uuid']."' onclick=\"recording_play('".$row['voicemail_message_uuid']."');\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
echo "<a id='recording_button_".$row['voicemail_message_uuid']."' onclick=\"recording_play('".$row['voicemail_message_uuid']."');\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</a>";
echo "<a href=\"voicemail_messages.php?action=download&t=bin&id=".$row['voicemail_id']."&voicemail_uuid=".$row['voicemail_uuid']."&uuid=".$row['voicemail_message_uuid']."\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style=\"".$style." text-align: right;\">".$row['message_length_label']."&nbsp;</td>\n";

View File

@@ -1,12 +1,12 @@
<?php
//define the link labels
$v_link_label_edit = "<img src='".PROJECT_PATH."/themes/default/images/icon_edit.png' class='list_control_icon'>";
$v_link_label_add = "<img src='".PROJECT_PATH."/themes/default/images/icon_add.png' class='list_control_icon'>";
$v_link_label_delete = "<img src='".PROJECT_PATH."/themes/default/images/icon_delete.png' class='list_control_icon'>";
$v_link_label_view = "<img src='".PROJECT_PATH."/themes/default/images/icon_view.png' class='list_control_icon'>";
$v_link_label_play = "<img src='".PROJECT_PATH."/themes/default/images/icon_play.png' class='list_control_icon'>";
$v_link_label_pause = "<img src='".PROJECT_PATH."/themes/default/images/icon_pause.png' class='list_control_icon'>";
$v_link_label_download = "<img src='".PROJECT_PATH."/themes/default/images/icon_download.png' class='list_control_icon'>";
$v_link_label_edit = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-pencil'></span></button>";
$v_link_label_add = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-plus'></span></button>";
$v_link_label_delete = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-remove'></span></button>";
$v_link_label_view = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-eye-open'></span></button>";
$v_link_label_play = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-play'></span></button>";
$v_link_label_pause = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-pause'></span></button>";
$v_link_label_download = "<button type='button' class='btn btn-default control_icon'><span class='glyphicon glyphicon-cloud-download'></span></button>";
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -201,7 +201,7 @@
color: <?php echo ($_SESSION['theme']['footer_color']['text'] != '') ? $_SESSION['theme']['footer_color']['text'] : 'rgba(255,255,255,0.3)'; ?>;
}
/* BOOTSTRAP MENU: BEGIN ******************************************************************/
/* MENU: BEGIN ******************************************************************/
/* main menu container */
.navbar {
@@ -372,6 +372,77 @@
cursor: pointer;
}
/* BUTTONS ********************************************************************/
/* default buttons */
button.btn-default {
font-family: Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
padding: 4px 8px;
color: #fff;
font-weight: bold;
font-size: 8pt;
border: 1px solid #26242a;
background: #3e3e3e;
background-image: -moz-linear-gradient(top, #000 25%, #3e3e3e 64%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25, #000), color-stop(0.64, #3e3e3e));
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
text-align: center;
text-transform: uppercase;
text-shadow: 0px 0px 1px rgba(0,0,0,0.9);
opacity: 0.9;
-moz-opacity: 0.9;
}
button.btn-default:hover, .btn-default:active, .btn-default:focus {
cursor: pointer;
color: #fff;
border: 1px solid #26242a;
box-shadow: 0 0 5px #cddaf0;
-webkit-box-shadow: 0 0 5px #cddaf0;
-moz-box-shadow: 0 0 5px #cddaf0;
opacity: 1.0;
-moz-opacity: 1.0;
}
/* control icons */
button.control_icon {
font-family: Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
padding: 2px;
color: #fff;
font-weight: normal;
font-size: 10.5pt;
width: 24px;
height: 24px;
margin: 1px;
border: 1px solid #26242a;
background: #3e3e3e;
background-image: -moz-linear-gradient(top, #000 25%, #3e3e3e 64%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25, #000), color-stop(0.64, #3e3e3e));
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
text-align: center;
text-shadow: 0px 0px 1px rgba(0,0,0,1.0);
opacity: 0.3;
-moz-opacity: 0.3;
}
button.control_icon:hover, button.control_icon:active, button.control_icon:focus {
cursor: pointer;
color: #fff;
border: 1px solid #26242a;
box-shadow: 0 0 5px #cddaf0;
-webkit-box-shadow: 0 0 5px #cddaf0;
-moz-box-shadow: 0 0 5px #cddaf0;
opacity: 1.0;
-moz-opacity: 1.0;
}
/* DOMAIN SELECTOR ***********************************************************/
#domains_container {
@@ -546,9 +617,9 @@
td.list_control_icons {
/* multiple icons exist (horizontally) */
width: 52px;
padding: none;
padding-left: 2px;
width: 50px;
text-align: right;
vertical-align: top;
white-space: nowrap;
@@ -556,9 +627,9 @@
td.list_control_icon {
/* a single icon exists */
width: 26px;
padding: none;
padding-left: 3px;
width: 25px;
padding-left: 2px;
text-align: right;
vertical-align: top;
white-space: nowrap;