2012-12-29 10:17:12 +01:00
|
|
|
<?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>
|
2016-09-20 17:51:48 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
2012-12-29 10:17:12 +01:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
|
|
|
|
require_once "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2012-12-29 10:17:12 +01:00
|
|
|
if (permission_exists('voicemail_add') || permission_exists('voicemail_edit')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add multi-lingual support
|
2015-01-18 11:04:43 +01:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2012-12-29 10:17:12 +01:00
|
|
|
|
|
|
|
|
//action add or update
|
|
|
|
|
if (isset($_REQUEST["id"])) {
|
|
|
|
|
$action = "update";
|
|
|
|
|
$voicemail_uuid = check_str($_REQUEST["id"]);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-02 00:22:07 +01:00
|
|
|
//get http variables and set them to php variables
|
|
|
|
|
$referer_path = check_str($_REQUEST["referer_path"]);
|
|
|
|
|
$referer_query = check_str($_REQUEST["referer_query"]);
|
2012-12-29 10:17:12 +01:00
|
|
|
if (count($_POST)>0) {
|
2013-06-03 16:26:50 +02:00
|
|
|
//set the variables from the HTTP values
|
|
|
|
|
$voicemail_id = check_str($_POST["voicemail_id"]);
|
|
|
|
|
$voicemail_password = check_str($_POST["voicemail_password"]);
|
|
|
|
|
$greeting_id = check_str($_POST["greeting_id"]);
|
2015-02-15 05:54:32 +01:00
|
|
|
$voicemail_options = $_POST["voicemail_options"];
|
2016-09-20 17:51:48 +02:00
|
|
|
$voicemail_alternate_greet_id = check_str($_POST["voicemail_alternate_greet_id"]);
|
2013-06-03 16:26:50 +02:00
|
|
|
$voicemail_mail_to = check_str($_POST["voicemail_mail_to"]);
|
2016-12-01 00:26:39 +01:00
|
|
|
$voicemail_sms_to = check_str($_POST["voicemail_sms_to"]);
|
2017-02-13 21:12:43 +01:00
|
|
|
$voicemail_transcription_enabled = check_str($_POST["voicemail_transcription_enabled"]);
|
2015-02-24 09:09:01 +01:00
|
|
|
$voicemail_file = check_str($_POST["voicemail_file"]);
|
2013-06-03 16:26:50 +02:00
|
|
|
$voicemail_local_after_email = check_str($_POST["voicemail_local_after_email"]);
|
|
|
|
|
$voicemail_enabled = check_str($_POST["voicemail_enabled"]);
|
|
|
|
|
$voicemail_description = check_str($_POST["voicemail_description"]);
|
|
|
|
|
//remove the space
|
|
|
|
|
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
|
2015-02-15 05:54:32 +01:00
|
|
|
|
|
|
|
|
echo "<pre>"; print_r($voicemail_options); echo "</pre>";
|
2012-12-29 10:17:12 +01:00
|
|
|
}
|
|
|
|
|
|
2014-03-07 00:06:45 +01:00
|
|
|
//unassign the voicemail id copy from the voicemail id
|
|
|
|
|
if ($_GET["a"] == "delete" && strlen($voicemail_uuid) > 0 && strlen($_REQUEST["voicemail_destination_uuid"]) > 0) {
|
|
|
|
|
//set the variables
|
|
|
|
|
$voicemail_destination_uuid = check_str($_REQUEST["voicemail_destination_uuid"]);
|
|
|
|
|
//delete the voicemail from the destionations
|
|
|
|
|
$sqld = "
|
|
|
|
|
delete from
|
|
|
|
|
v_voicemail_destinations as d
|
|
|
|
|
where
|
|
|
|
|
d.voicemail_destination_uuid = '".$voicemail_destination_uuid."' and
|
|
|
|
|
d.voicemail_uuid = '".$voicemail_uuid."'";
|
|
|
|
|
$db->exec(check_sql($sqld));
|
|
|
|
|
//redirect the browser
|
|
|
|
|
$_SESSION["message"] = $text['message-delete'];
|
|
|
|
|
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//assign the voicemail id copy to the voicemail id
|
|
|
|
|
if (strlen($voicemail_uuid) > 0 && strlen($_REQUEST["voicemail_uuid_copy"]) > 0) {
|
|
|
|
|
//set the variables
|
|
|
|
|
$voicemail_uuid_copy = check_str($_REQUEST["voicemail_uuid_copy"]);
|
|
|
|
|
//assign the user to the extension
|
|
|
|
|
$sqli = "
|
2015-01-18 11:04:43 +01:00
|
|
|
insert into
|
2014-12-04 08:51:05 +01:00
|
|
|
v_voicemail_destinations
|
2014-03-07 00:06:45 +01:00
|
|
|
(
|
2014-12-04 08:51:05 +01:00
|
|
|
domain_uuid,
|
2014-03-07 00:06:45 +01:00
|
|
|
voicemail_destination_uuid,
|
|
|
|
|
voicemail_uuid,
|
|
|
|
|
voicemail_uuid_copy
|
|
|
|
|
)
|
|
|
|
|
values
|
|
|
|
|
(
|
2014-12-04 08:51:05 +01:00
|
|
|
'".$domain_uuid."',
|
2014-03-07 00:06:45 +01:00
|
|
|
'".uuid()."',
|
|
|
|
|
'".$voicemail_uuid."',
|
|
|
|
|
'".$voicemail_uuid_copy."'
|
|
|
|
|
)";
|
|
|
|
|
$db->exec(check_sql($sqli));
|
|
|
|
|
//redirect the browser
|
2014-12-04 09:00:20 +01:00
|
|
|
$_SESSION["message"] = $text['message-add'];
|
2014-03-07 00:06:45 +01:00
|
|
|
}
|
|
|
|
|
|
2013-06-03 16:26:50 +02:00
|
|
|
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
2012-12-29 10:17:12 +01:00
|
|
|
|
|
|
|
|
$msg = '';
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
$voicemail_uuid = check_str($_POST["voicemail_uuid"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//check for all required data
|
|
|
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2013-07-06 08:21:12 +02:00
|
|
|
require_once "resources/persist_form_var.php";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-12-29 10:17:12 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add or update the database
|
|
|
|
|
if ($_POST["persistformvar"] != "true") {
|
|
|
|
|
if ($action == "add" && permission_exists('voicemail_add')) {
|
|
|
|
|
$sql = "insert into v_voicemails ";
|
|
|
|
|
$sql .= "(";
|
|
|
|
|
$sql .= "domain_uuid, ";
|
|
|
|
|
$sql .= "voicemail_uuid, ";
|
|
|
|
|
$sql .= "voicemail_id, ";
|
|
|
|
|
$sql .= "voicemail_password, ";
|
2016-02-25 22:39:28 +01:00
|
|
|
$sql .= "greeting_id, ";
|
2016-09-20 17:51:48 +02:00
|
|
|
$sql .= "voicemail_alternate_greet_id, ";
|
2012-12-29 10:17:12 +01:00
|
|
|
$sql .= "voicemail_mail_to, ";
|
2016-12-01 00:26:39 +01:00
|
|
|
$sql .= "voicemail_sms_to, ";
|
2017-02-13 21:12:43 +01:00
|
|
|
$sql .= "voicemail_transcription_enabled, ";
|
2015-02-24 09:09:01 +01:00
|
|
|
$sql .= "voicemail_file, ";
|
2012-12-29 10:17:12 +01:00
|
|
|
$sql .= "voicemail_local_after_email, ";
|
|
|
|
|
$sql .= "voicemail_enabled, ";
|
|
|
|
|
$sql .= "voicemail_description ";
|
|
|
|
|
$sql .= ")";
|
|
|
|
|
$sql .= "values ";
|
|
|
|
|
$sql .= "(";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "'".$domain_uuid."', ";
|
2012-12-29 10:17:12 +01:00
|
|
|
$sql .= "'".uuid()."', ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "'".$voicemail_id."', ";
|
|
|
|
|
$sql .= "'".$voicemail_password."', ";
|
2016-02-25 22:39:28 +01:00
|
|
|
$sql .= (($greeting_id != '') ? "'".$greeting_id."'" : 'null').", ";
|
2016-09-20 17:51:48 +02:00
|
|
|
$sql .= (($voicemail_alternate_greet_id != '') ? "'".$voicemail_alternate_greet_id."'" : 'null').", ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "'".$voicemail_mail_to."', ";
|
2016-12-01 00:26:39 +01:00
|
|
|
$sql .= "'".$voicemail_sms_to."', ";
|
2017-02-13 21:12:43 +01:00
|
|
|
$sql .= "'".$voicemail_transcription_enabled."', ";
|
2015-02-24 09:09:01 +01:00
|
|
|
$sql .= "'".$voicemail_file."', ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "'".$voicemail_local_after_email."', ";
|
|
|
|
|
$sql .= "'".$voicemail_enabled."', ";
|
|
|
|
|
$sql .= "'".$voicemail_description."' ";
|
2012-12-29 10:17:12 +01:00
|
|
|
$sql .= ")";
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
2014-02-23 09:47:58 +01:00
|
|
|
$_SESSION["message"] = $text['message-add'];
|
2012-12-29 10:17:12 +01:00
|
|
|
} //if ($action == "add")
|
|
|
|
|
|
|
|
|
|
if ($action == "update" && permission_exists('voicemail_edit')) {
|
|
|
|
|
$sql = "update v_voicemails set ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "voicemail_id = '".$voicemail_id."', ";
|
|
|
|
|
$sql .= "voicemail_password = '".$voicemail_password."', ";
|
2016-02-25 22:39:28 +01:00
|
|
|
$sql .= "greeting_id = ".(($greeting_id != '') ? "'".$greeting_id."'" : 'null').", ";
|
2016-09-20 17:51:48 +02:00
|
|
|
$sql .= "voicemail_alternate_greet_id = ".(($voicemail_alternate_greet_id != '') ? "'".$voicemail_alternate_greet_id."'" : 'null').", ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "voicemail_mail_to = '".$voicemail_mail_to."', ";
|
2016-12-01 00:26:39 +01:00
|
|
|
$sql .= "voicemail_sms_to = '".$voicemail_sms_to."', ";
|
2017-02-13 21:12:43 +01:00
|
|
|
$sql .= "voicemail_transcription_enabled = '".$voicemail_transcription_enabled."', ";
|
2015-02-24 09:09:01 +01:00
|
|
|
$sql .= "voicemail_file = '".$voicemail_file."', ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "voicemail_local_after_email = '".$voicemail_local_after_email."', ";
|
|
|
|
|
$sql .= "voicemail_enabled = '".$voicemail_enabled."', ";
|
|
|
|
|
$sql .= "voicemail_description = '".$voicemail_description."' ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
|
|
|
|
$sql .= "and voicemail_uuid = '".$voicemail_uuid."'";
|
2012-12-29 10:17:12 +01:00
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
2014-02-23 09:47:58 +01:00
|
|
|
$_SESSION["message"] = $text['message-update'];
|
2012-12-29 10:17:12 +01:00
|
|
|
} //if ($action == "update")
|
2015-02-15 05:54:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// add voicemail options
|
|
|
|
|
if (sizeof($voicemail_options) > 0) {
|
|
|
|
|
foreach ($voicemail_options as $index => $voicemail_option) {
|
|
|
|
|
if ($voicemail_option['voicemail_option_digits'] == '' || $voicemail_option['voicemail_option_param'] == '') { unset($voicemail_options[$index]); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (sizeof($voicemail_options) > 0) {
|
|
|
|
|
$sql = "insert into v_voicemail_options ";
|
|
|
|
|
$sql .= "( ";
|
|
|
|
|
$sql .= "voicemail_option_uuid, ";
|
|
|
|
|
$sql .= "voicemail_uuid, ";
|
|
|
|
|
$sql .= "domain_uuid, ";
|
|
|
|
|
$sql .= "voicemail_option_digits, ";
|
|
|
|
|
$sql .= "voicemail_option_action, ";
|
|
|
|
|
$sql .= "voicemail_option_param, ";
|
|
|
|
|
$sql .= "voicemail_option_order, ";
|
|
|
|
|
$sql .= "voicemail_option_description ";
|
|
|
|
|
$sql .= ") ";
|
|
|
|
|
$sql .= "values ";
|
|
|
|
|
foreach ($voicemail_options as $index => $voicemail_option) {
|
|
|
|
|
$voicemail_option_uuid = uuid();
|
|
|
|
|
//seperate the action and the param
|
|
|
|
|
$option_array = explode(":", $voicemail_option["voicemail_option_param"]);
|
|
|
|
|
$voicemail_option['voicemail_option_action'] = array_shift($option_array);
|
|
|
|
|
$voicemail_option['voicemail_option_param'] = join(':', $option_array);
|
|
|
|
|
//continue building insert query
|
|
|
|
|
$sql_record[$index] = "( ";
|
|
|
|
|
$sql_record[$index] .= "'".$voicemail_option_uuid."', ";
|
|
|
|
|
$sql_record[$index] .= "'".$voicemail_uuid."', ";
|
|
|
|
|
$sql_record[$index] .= "'".$domain_uuid."', ";
|
|
|
|
|
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_digits'])."', ";
|
|
|
|
|
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_action'])."', ";
|
|
|
|
|
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_param'])."', ";
|
|
|
|
|
$sql_record[$index] .= $voicemail_option['voicemail_option_order'].", ";
|
|
|
|
|
$sql_record[$index] .= "'".trim($voicemail_option['voicemail_option_description'])."' ";
|
|
|
|
|
$sql_record[$index] .= ") ";
|
|
|
|
|
}
|
|
|
|
|
$sql .= implode(",", $sql_record);
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//redirect user
|
|
|
|
|
if ($action == 'add') {
|
|
|
|
|
header("Location: voicemails.php");
|
|
|
|
|
}
|
|
|
|
|
else if ($action == "update") {
|
|
|
|
|
header("Location: voicemail_edit.php?id=".$voicemail_uuid);
|
|
|
|
|
}
|
|
|
|
|
exit;
|
|
|
|
|
|
2014-02-23 09:47:58 +01:00
|
|
|
} //if ($_POST["persistformvar"] != "true")
|
2012-12-29 10:17:12 +01:00
|
|
|
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
|
|
|
|
|
2015-08-07 21:24:58 +02:00
|
|
|
//initialize the destinations object
|
|
|
|
|
$destination = new destinations;
|
|
|
|
|
|
2012-12-29 10:17:12 +01:00
|
|
|
//pre-populate the form
|
|
|
|
|
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
|
|
|
|
$voicemail_uuid = check_str($_GET["id"]);
|
|
|
|
|
$sql = "select * from v_voicemails ";
|
2015-02-15 05:54:32 +01:00
|
|
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
|
|
|
|
$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
|
2012-12-29 10:17:12 +01:00
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
foreach ($result as &$row) {
|
|
|
|
|
$voicemail_id = $row["voicemail_id"];
|
|
|
|
|
$voicemail_password = $row["voicemail_password"];
|
|
|
|
|
$greeting_id = $row["greeting_id"];
|
2016-09-20 17:51:48 +02:00
|
|
|
$voicemail_alternate_greet_id = $row["voicemail_alternate_greet_id"];
|
2012-12-29 10:17:12 +01:00
|
|
|
$voicemail_mail_to = $row["voicemail_mail_to"];
|
2016-12-01 00:26:39 +01:00
|
|
|
$voicemail_sms_to = $row["voicemail_sms_to"];
|
2017-02-13 21:12:43 +01:00
|
|
|
$voicemail_transcription_enabled = $row["voicemail_transcription_enabled"];
|
2015-02-24 09:09:01 +01:00
|
|
|
$voicemail_file = $row["voicemail_file"];
|
2012-12-29 10:17:12 +01:00
|
|
|
$voicemail_local_after_email = $row["voicemail_local_after_email"];
|
|
|
|
|
$voicemail_enabled = $row["voicemail_enabled"];
|
|
|
|
|
$voicemail_description = $row["voicemail_description"];
|
|
|
|
|
break; //limit to 1 row
|
|
|
|
|
}
|
|
|
|
|
unset ($prep_statement);
|
|
|
|
|
}
|
2015-03-20 02:09:18 +01:00
|
|
|
else {
|
|
|
|
|
$voicemail_file = $_SESSION['voicemail']['voicemail_file']['text'];
|
|
|
|
|
$voicemail_local_after_email = $_SESSION['voicemail']['keep_local']['boolean'];
|
|
|
|
|
}
|
2012-12-29 10:17:12 +01:00
|
|
|
|
2013-06-03 16:26:50 +02:00
|
|
|
//remove the spaces
|
|
|
|
|
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
|
|
|
|
|
|
2013-01-03 00:42:33 +01:00
|
|
|
//set defaults
|
|
|
|
|
if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; }
|
|
|
|
|
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; }
|
|
|
|
|
|
2016-02-25 20:06:45 +01:00
|
|
|
//get the greetings list
|
|
|
|
|
$sql = "select * from v_voicemail_greetings ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
|
|
|
|
$sql .= "and voicemail_id = '".$voicemail_id."' ";
|
|
|
|
|
$sql .= "order by greeting_name asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$greetings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
$greeting_count = count($greetings);
|
|
|
|
|
unset ($prep_statement, $sql);
|
|
|
|
|
|
2012-12-29 10:17:12 +01:00
|
|
|
//show the header
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2015-02-15 05:54:32 +01:00
|
|
|
$document['title'] = $text['title-voicemail'];
|
2012-12-29 10:17:12 +01:00
|
|
|
|
|
|
|
|
//show the content
|
2016-02-25 22:39:28 +01:00
|
|
|
echo "<form method='post' name='frm' id='frm' action=''>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<tr>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'>";
|
|
|
|
|
echo " <b>".$text['title-voicemail']."</b>";
|
|
|
|
|
echo " <br><br>";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td width='70%' align='right' valign='top'>\n";
|
2013-11-23 05:19:37 +01:00
|
|
|
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"javascript:history.back();\" value='".$text['button-back']."'>\n";
|
2016-02-25 22:39:28 +01:00
|
|
|
echo " <input type='button' class='btn' value='".$text['button-save']."' onclick='submit_form();'>\n";
|
2013-11-23 05:19:37 +01:00
|
|
|
echo "</td>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2014-06-22 06:34:19 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_id']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2013-01-19 20:06:45 +01:00
|
|
|
echo " <input class='formfld' type='text' name='voicemail_id' maxlength='255' value='$voicemail_id'>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_id']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2014-06-22 06:34:19 +02:00
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_password']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2016-08-28 22:27:15 +02:00
|
|
|
echo " <input class='formfld' type='text' name='voicemail_password' id='password' autocomplete='off' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" autocomplete='off' maxlength='50' value=\"$voicemail_password\">\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<br />\n";
|
2014-03-07 02:52:44 +01:00
|
|
|
echo $text['description-voicemail_password']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2016-02-25 20:06:45 +01:00
|
|
|
echo " ".$text['label-greeting']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2016-02-25 20:06:45 +01:00
|
|
|
echo " <select class='formfld' name='greeting_id'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
if ($greeting_count > 0) {
|
|
|
|
|
foreach ($greetings as $greeting) {
|
2016-02-25 22:39:28 +01:00
|
|
|
$selected = ($greeting['greeting_id'] == $greeting_id) ? 'selected' : null;
|
|
|
|
|
echo "<option value='".$greeting['greeting_id']."' ".$selected.">".$greeting['greeting_name']."</option>\n";
|
2016-02-25 20:06:45 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<br />\n";
|
2016-02-25 20:06:45 +01:00
|
|
|
echo $text['description-greeting']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2016-09-20 17:51:48 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-voicemail_alternate_greet_id']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='voicemail_alternate_greet_id' maxlength='255' value='$voicemail_alternate_greet_id'>\n";
|
|
|
|
|
echo " <br />\n";
|
|
|
|
|
echo " ".$text['description-voicemail_alternate_greet_id']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell' valign='top'>".$text['label-options']."</td>";
|
|
|
|
|
echo " <td class='vtable' align='left'>";
|
|
|
|
|
echo " <table width='59%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-option']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-destination']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-order']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-description']."</td>\n";
|
|
|
|
|
echo " <td></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if (strlen($voicemail_uuid) > 0) {
|
|
|
|
|
$sql = "select * from v_voicemail_options ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
|
|
|
|
|
$sql .= "order by voicemail_option_digits, voicemail_option_order asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
$result_count = count($result);
|
|
|
|
|
foreach($result as $field) {
|
|
|
|
|
$voicemail_option_param = $field['voicemail_option_param'];
|
|
|
|
|
if (strlen(trim($voicemail_option_param)) == 0) {
|
|
|
|
|
$voicemail_option_param = $field['voicemail_option_action'];
|
|
|
|
|
}
|
|
|
|
|
$voicemail_option_param = str_replace("menu-", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace("XML", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace("transfer", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace("bridge", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace($_SESSION['domain_name'], "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace("\${domain_name}", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = str_replace("\${domain}", "", $voicemail_option_param);
|
|
|
|
|
$voicemail_option_param = ucfirst(trim($voicemail_option_param));
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vtable'>\n";
|
|
|
|
|
echo " ".$field['voicemail_option_digits'];
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='vtable'>\n";
|
|
|
|
|
echo " ".$voicemail_option_param." \n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='vtable'>\n";
|
|
|
|
|
echo " ".$field['voicemail_option_order']." \n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='vtable'>\n";
|
|
|
|
|
echo " ".$field['voicemail_option_description']." \n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='list_control_icons'>";
|
|
|
|
|
echo "<a href='voicemail_option_edit.php?id=".$field['voicemail_option_uuid']."&voicemail_uuid=".$field['voicemail_uuid']."' alt='".$text['button-edit']."'>".$v_link_label_edit."</a>";
|
|
|
|
|
echo "<a href='voicemail_option_delete.php?id=".$field['voicemail_option_uuid']."&voicemail_uuid=".$field['voicemail_uuid']."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $result);
|
|
|
|
|
|
|
|
|
|
for ($c = 0; $c < 1; $c++) {
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' style='width:70px' type='text' name='voicemail_options[".$c."][voicemail_option_digits]' maxlength='255' value='".$voicemail_option_digits."'>\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left' nowrap='nowrap'>\n";
|
2015-08-07 21:24:58 +02:00
|
|
|
echo $destination->select('ivr', 'voicemail_options['.$c.'][voicemail_option_param]', '');
|
2015-02-15 05:54:32 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select name='voicemail_options[".$c."][voicemail_option_order]' class='formfld' style='width:55px'>\n";
|
|
|
|
|
//echo " <option></option>\n";
|
|
|
|
|
if (strlen(htmlspecialchars($voicemail_option_order))> 0) {
|
|
|
|
|
echo " <option selected='yes' value='".htmlspecialchars($voicemail_option_order)."'>".htmlspecialchars($voicemail_option_order)."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
$i=0;
|
|
|
|
|
while($i<=999) {
|
|
|
|
|
if (strlen($i) == 1) {
|
|
|
|
|
echo " <option value='00$i'>00$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 2) {
|
|
|
|
|
echo " <option value='0$i'>0$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($i) == 3) {
|
|
|
|
|
echo " <option value='$i'>$i</option>\n";
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' style='width:100px' type='text' name='voicemail_options[".$c."][voicemail_option_description]' maxlength='255' value=\"".$voicemail_option_description."\">\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
|
|
|
|
|
echo " <td>\n";
|
2016-02-25 22:39:28 +01:00
|
|
|
echo " <input type='button' class='btn' value=\"".$text['button-add']."\" onclick='submit_form();'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
|
|
|
|
|
echo " ".$text['description-options']."\n";
|
|
|
|
|
echo " <br />\n";
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_mail_to']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='voicemail_mail_to' maxlength='255' value=\"$voicemail_mail_to\">\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_mail_to']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2016-12-01 00:26:39 +01:00
|
|
|
if(permission_exists('voicemail_sms_edit')) {
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-voicemail_sms_to']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='voicemail_sms_to' maxlength='255' value=\"$voicemail_sms_to\">\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_sms_to']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
2017-02-13 21:12:43 +01:00
|
|
|
if(permission_exists('voicemail_transcription_edit') && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") {
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " ".$text['label-voicemail_transcription_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='voicemail_transcription_enabled' id='voicemail_transcription_enabled'>\n";
|
|
|
|
|
echo " <option value='true' ".(($voicemail_transcription_enabled == "true") ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
|
|
|
|
|
echo " <option value='false' ".(($voicemail_transcription_enabled == "false") ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_transcription_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
2012-12-29 10:17:12 +01:00
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-24 09:09:01 +01:00
|
|
|
echo " ".$text['label-voicemail_file']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2015-03-15 10:15:04 +01:00
|
|
|
echo " <select class='formfld' name='voicemail_file' id='voicemail_file' onchange=\"if (this.selectedIndex != 2) { document.getElementById('voicemail_local_after_email').selectedIndex = 0; }\">\n";
|
2015-03-20 02:09:18 +01:00
|
|
|
echo " <option value='' ".(($voicemail_file == "listen") ? "selected='selected'" : null).">".$text['option-voicemail_file_listen']."</option>\n";
|
2015-02-24 09:09:01 +01:00
|
|
|
echo " <option value='link' ".(($voicemail_file == "link") ? "selected='selected'" : null).">".$text['option-voicemail_file_link']."</option>\n";
|
|
|
|
|
echo " <option value='attach' ".(($voicemail_file == "attach") ? "selected='selected'" : null).">".$text['option-voicemail_file_attach']."</option>\n";
|
|
|
|
|
echo " </select>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<br />\n";
|
2015-02-24 09:09:01 +01:00
|
|
|
echo $text['description-voicemail_file']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_local_after_email']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
2015-03-15 10:15:04 +01:00
|
|
|
echo " <select class='formfld' name='voicemail_local_after_email' id='voicemail_local_after_email' onchange=\"if (this.selectedIndex == 1) { document.getElementById('voicemail_file').selectedIndex = 2; }\">\n";
|
2015-03-20 02:09:18 +01:00
|
|
|
echo " <option value='true' ".(($voicemail_local_after_email == "true") ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
|
|
|
|
|
echo " <option value='false' ".(($voicemail_local_after_email == "false") ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_local_after_email']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2014-03-07 00:06:45 +01:00
|
|
|
if ($action == "update") {
|
|
|
|
|
echo " <tr>";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " <td class='vncell' valign='top'>".$text['label-forward_destinations']."</td>";
|
2014-03-07 00:06:45 +01:00
|
|
|
echo " <td class='vtable'>";
|
|
|
|
|
|
2014-03-07 09:35:55 +01:00
|
|
|
$sql = "
|
2014-03-07 00:06:45 +01:00
|
|
|
select
|
|
|
|
|
v.voicemail_id,
|
|
|
|
|
d.voicemail_destination_uuid,
|
|
|
|
|
d.voicemail_uuid_copy
|
|
|
|
|
from
|
|
|
|
|
v_voicemails as v,
|
|
|
|
|
v_voicemail_destinations as d
|
|
|
|
|
where
|
|
|
|
|
d.voicemail_uuid_copy = v.voicemail_uuid and
|
|
|
|
|
v.domain_uuid = '".$_SESSION['domain_uuid']."' and
|
|
|
|
|
v.voicemail_enabled = 'true' and
|
|
|
|
|
d.voicemail_uuid = '".$voicemail_uuid."'
|
|
|
|
|
order by
|
|
|
|
|
v.voicemail_id asc";
|
2014-03-07 09:35:55 +01:00
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
2014-03-07 00:06:45 +01:00
|
|
|
$prep_statement->execute();
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
$result_count = count($result);
|
2015-02-15 05:54:32 +01:00
|
|
|
if ($result_count > 0) {
|
|
|
|
|
echo " <table width='52%'>\n";
|
|
|
|
|
foreach($result as $field) {
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vtable'>".$field['voicemail_id']."</td>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <a href='voicemail_edit.php?id=".$voicemail_uuid."&voicemail_destination_uuid=".$field['voicemail_destination_uuid']."&a=delete' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
$voicemail_uuid_copied[] = $field['voicemail_uuid_copy'];
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " <br />\n";
|
2014-03-07 00:06:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sizeof($voicemail_uuid_copied) > 0) {
|
|
|
|
|
// modify sql to remove already copied voicemail uuids from the list
|
2014-03-07 09:35:55 +01:00
|
|
|
$sql_mod = " and v.voicemail_uuid not in ('".implode("','", $voicemail_uuid_copied)."') ";
|
2014-03-07 00:06:45 +01:00
|
|
|
}
|
2015-02-15 05:54:32 +01:00
|
|
|
|
2014-03-07 09:35:55 +01:00
|
|
|
$sql = "
|
2014-03-07 00:06:45 +01:00
|
|
|
select
|
|
|
|
|
v.voicemail_id,
|
|
|
|
|
v.voicemail_uuid
|
|
|
|
|
from
|
|
|
|
|
v_voicemails as v
|
|
|
|
|
where
|
|
|
|
|
v.domain_uuid = '".$_SESSION['domain_uuid']."' and
|
|
|
|
|
v.voicemail_enabled = 'true' and
|
|
|
|
|
v.voicemail_uuid <> '".$voicemail_uuid."'
|
2014-03-07 09:35:55 +01:00
|
|
|
".$sql_mod."
|
2014-03-07 00:06:45 +01:00
|
|
|
order by
|
|
|
|
|
v.voicemail_id asc";
|
2014-03-07 09:35:55 +01:00
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
2014-03-07 00:06:45 +01:00
|
|
|
$prep_statement->execute();
|
|
|
|
|
echo " <select name=\"voicemail_uuid_copy\" class='formfld' style='width: auto;'>\n";
|
|
|
|
|
echo " <option value=\"\"></option>\n";
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
foreach($result as $field) {
|
|
|
|
|
echo " <option value='".$field['voicemail_uuid']."'>".$field['voicemail_id']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>";
|
2016-02-25 22:39:28 +01:00
|
|
|
echo " <input type='button' class='btn' value=\"".$text['button-add']."\" onclick='submit_form();'>\n";
|
2014-03-07 00:06:45 +01:00
|
|
|
unset($sql, $result);
|
|
|
|
|
echo " <br>\n";
|
2014-03-07 09:35:55 +01:00
|
|
|
echo " ".$text['description-forward_destinations']."\n";
|
2014-03-07 00:06:45 +01:00
|
|
|
echo " <br />\n";
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_enabled']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='voicemail_enabled'>\n";
|
2014-02-23 09:47:58 +01:00
|
|
|
if ($voicemail_enabled == "true") {
|
2012-12-29 10:17:12 +01:00
|
|
|
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
|
|
|
|
}
|
2014-02-23 09:47:58 +01:00
|
|
|
if ($voicemail_enabled == "false") {
|
2012-12-29 10:17:12 +01:00
|
|
|
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='false'>".$text['label-false']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_enabled']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " ".$text['label-voicemail_description']."\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='voicemail_description' maxlength='255' value=\"$voicemail_description\">\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-voicemail_description']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2' align='right'>\n";
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
echo " <input type='hidden' name='voicemail_uuid' value='$voicemail_uuid'>\n";
|
|
|
|
|
}
|
2013-01-02 00:22:07 +01:00
|
|
|
$http_referer = parse_url($_SERVER["HTTP_REFERER"]);
|
|
|
|
|
echo " <input type='hidden' name='referer_path' value='".$http_referer['path']."'>\n";
|
|
|
|
|
echo " <input type='hidden' name='referer_query' value='".$http_referer['query']."'>\n";
|
2015-02-15 05:54:32 +01:00
|
|
|
echo " <br>";
|
2016-02-25 22:39:28 +01:00
|
|
|
echo " <input type='button' class='btn' value='".$text['button-save']."' onclick='submit_form();'>\n";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
2015-02-15 12:57:14 +01:00
|
|
|
echo "<br><br>";
|
2012-12-29 10:17:12 +01:00
|
|
|
echo "</form>";
|
|
|
|
|
|
2016-02-25 22:39:28 +01:00
|
|
|
echo "<script>\n";
|
|
|
|
|
//capture enter key to submit form
|
|
|
|
|
echo " $(window).keypress(function(event){\n";
|
|
|
|
|
echo " if (event.which == 13) { submit_form(); }\n";
|
|
|
|
|
echo " });\n";
|
|
|
|
|
// convert password fields to
|
|
|
|
|
echo " function submit_form() {\n";
|
|
|
|
|
echo " $('input:password').css('visibility','hidden');\n";
|
|
|
|
|
echo " $('input:password').attr({type:'text'});\n";
|
|
|
|
|
echo " $('form#frm').submit();\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo "</script>\n";
|
|
|
|
|
|
2012-12-29 10:17:12 +01:00
|
|
|
//include the footer
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2016-08-28 22:27:15 +02:00
|
|
|
?>
|