diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php index cf58435c80..4b25157061 100644 --- a/app/voicemails/resources/classes/voicemail.php +++ b/app/voicemails/resources/classes/voicemail.php @@ -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); diff --git a/app/voicemails/voicemail_message_toggle.php b/app/voicemails/voicemail_message_toggle.php new file mode 100644 index 0000000000..8dd367eb5f --- /dev/null +++ b/app/voicemails/voicemail_message_toggle.php @@ -0,0 +1,78 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ +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"); + } + +?> \ No newline at end of file diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index d07d86d41c..242ee086ad 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -98,7 +98,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"] //loop through the voicemail messages if (count($voicemails) > 0) { - echo "
\n"; + echo "\n"; echo "
"; echo "\n"; @@ -113,11 +113,12 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"] echo " ".$text['label-mailbox'].": ".$field['voicemail_id']."
 \n"; echo " \n"; echo " \n"; @@ -139,7 +140,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"] } if (permission_exists('voicemail_message_delete')) { echo ""; } echo "\n"; @@ -174,7 +175,7 @@ if (!(check_str($_REQUEST["action"]) == "download" && check_str($_REQUEST["src"] case "ogg" : $recording_type = "audio/ogg"; break; } echo ""; - echo "".$v_link_label_play.""; + echo "".$v_link_label_play.""; echo "".$v_link_label_download.""; echo " \n"; echo " \n"; diff --git a/themes/default/config.php b/themes/default/config.php index d849837143..c3fea3b94b 100644 --- a/themes/default/config.php +++ b/themes/default/config.php @@ -1,12 +1,12 @@ "; - $v_link_label_add = ""; - $v_link_label_delete = ""; - $v_link_label_view = ""; - $v_link_label_play = ""; - $v_link_label_pause = ""; - $v_link_label_download = ""; + $v_link_label_edit = ""; + $v_link_label_add = ""; + $v_link_label_delete = ""; + $v_link_label_view = ""; + $v_link_label_play = ""; + $v_link_label_pause = ""; + $v_link_label_download = ""; ?> diff --git a/themes/default/images/icon_add.png b/themes/default/images/icon_add.png deleted file mode 100644 index 5715569041..0000000000 Binary files a/themes/default/images/icon_add.png and /dev/null differ diff --git a/themes/default/images/icon_delete.png b/themes/default/images/icon_delete.png deleted file mode 100644 index a77161f734..0000000000 Binary files a/themes/default/images/icon_delete.png and /dev/null differ diff --git a/themes/default/images/icon_download.png b/themes/default/images/icon_download.png deleted file mode 100644 index 931554ec64..0000000000 Binary files a/themes/default/images/icon_download.png and /dev/null differ diff --git a/themes/default/images/icon_edit.png b/themes/default/images/icon_edit.png deleted file mode 100644 index 93e573bbe7..0000000000 Binary files a/themes/default/images/icon_edit.png and /dev/null differ diff --git a/themes/default/images/icon_pause.png b/themes/default/images/icon_pause.png deleted file mode 100644 index c3aea46eb5..0000000000 Binary files a/themes/default/images/icon_pause.png and /dev/null differ diff --git a/themes/default/images/icon_play.png b/themes/default/images/icon_play.png deleted file mode 100644 index 915d58986d..0000000000 Binary files a/themes/default/images/icon_play.png and /dev/null differ diff --git a/themes/default/images/icon_view.png b/themes/default/images/icon_view.png deleted file mode 100644 index 0d8df9f1f1..0000000000 Binary files a/themes/default/images/icon_view.png and /dev/null differ diff --git a/themes/default/template.php b/themes/default/template.php index 9492cff795..1a616ddce6 100644 --- a/themes/default/template.php +++ b/themes/default/template.php @@ -201,7 +201,7 @@ color: ; } -/* 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;
\n"; + echo " \n"; if (permission_exists('voicemail_greeting_view')) { - echo " \n"; + echo " \n"; } if (permission_exists('voicemail_edit')) { - echo " \n"; + echo " \n"; } echo "

"; echo "
"; - echo "".$v_link_label_delete.""; + echo "".$v_link_label_delete.""; echo "
".$row['message_length_label']."