2012-06-04 16:58:40 +02: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>
|
2014-02-20 08:20:55 +01:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2010-2014
|
2012-06-04 16:58:40 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2012-11-24 08:43:34 +01:00
|
|
|
James Rose <james.o.rose@gmail.com>
|
2012-06-04 16:58:40 +02:00
|
|
|
*/
|
|
|
|
|
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";
|
2013-04-24 04:57:16 +02:00
|
|
|
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-24 08:43:34 +01:00
|
|
|
//add multi-lingual support
|
|
|
|
|
require_once "app_languages.php";
|
|
|
|
|
foreach($text as $key => $value) {
|
|
|
|
|
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-16 06:50:30 +02:00
|
|
|
//delete the user from v_ring_group_users
|
|
|
|
|
if ($_GET["a"] == "delete" && strlen($_REQUEST["user_uuid"]) > 0 && permission_exists("ring_group_edit")) {
|
2013-07-24 21:37:59 +02:00
|
|
|
//set the variables
|
2013-08-16 06:50:30 +02:00
|
|
|
$user_uuid = check_str($_REQUEST["user_uuid"]);
|
|
|
|
|
$ring_group_uuid = check_str($_REQUEST["id"]);
|
|
|
|
|
//delete the group from the users
|
|
|
|
|
$sql = "delete from v_ring_group_users ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
|
|
|
|
$sql .= "and ring_group_uuid = '".$ring_group_uuid."' ";
|
|
|
|
|
$sql .= "and user_uuid = '".$user_uuid."' ";
|
2013-07-24 21:37:59 +02:00
|
|
|
$db->exec(check_sql($sql));
|
2014-02-20 08:20:55 +01:00
|
|
|
//save the message to a session variable
|
2014-02-23 08:48:21 +01:00
|
|
|
$_SESSION['message'] = $text['message-delete'];
|
2012-06-04 16:58:40 +02:00
|
|
|
//redirect the browser
|
2014-02-20 08:20:55 +01:00
|
|
|
header("Location: ring_group_edit.php?id=$ring_group_uuid");
|
|
|
|
|
exit;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//action add or update
|
|
|
|
|
if (isset($_REQUEST["id"])) {
|
|
|
|
|
$action = "update";
|
|
|
|
|
$ring_group_uuid = check_str($_REQUEST["id"]);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$action = "add";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get http post variables and set them to php variables
|
2013-05-28 19:53:21 +02:00
|
|
|
if (count($_POST) > 0) {
|
2012-09-15 18:35:08 +02:00
|
|
|
//set variables from http values
|
|
|
|
|
$ring_group_name = check_str($_POST["ring_group_name"]);
|
|
|
|
|
$ring_group_extension = check_str($_POST["ring_group_extension"]);
|
|
|
|
|
$ring_group_context = check_str($_POST["ring_group_context"]);
|
|
|
|
|
$ring_group_strategy = check_str($_POST["ring_group_strategy"]);
|
|
|
|
|
$ring_group_timeout_action = check_str($_POST["ring_group_timeout_action"]);
|
|
|
|
|
$ring_group_cid_name_prefix = check_str($_POST["ring_group_cid_name_prefix"]);
|
2012-10-22 22:09:37 +02:00
|
|
|
$ring_group_ringback = check_str($_POST["ring_group_ringback"]);
|
2014-08-13 10:41:44 +02:00
|
|
|
$ring_group_skip_active = check_str($_POST["ring_group_skip_active"]);
|
2012-09-15 18:35:08 +02:00
|
|
|
$ring_group_enabled = check_str($_POST["ring_group_enabled"]);
|
|
|
|
|
$ring_group_description = check_str($_POST["ring_group_description"]);
|
|
|
|
|
$dialplan_uuid = check_str($_POST["dialplan_uuid"]);
|
|
|
|
|
//$ring_group_timeout_action = "transfer:1001 XML default";
|
|
|
|
|
$ring_group_timeout_array = explode(":", $ring_group_timeout_action);
|
|
|
|
|
$ring_group_timeout_app = array_shift($ring_group_timeout_array);
|
|
|
|
|
$ring_group_timeout_data = join(':', $ring_group_timeout_array);
|
2013-07-24 21:37:59 +02:00
|
|
|
$destination_number = check_str($_POST["destination_number"]);
|
|
|
|
|
$destination_delay = check_str($_POST["destination_delay"]);
|
|
|
|
|
$destination_timeout = check_str($_POST["destination_timeout"]);
|
|
|
|
|
$destination_prompt = check_str($_POST["destination_prompt"]);
|
2012-09-15 18:35:08 +02:00
|
|
|
|
|
|
|
|
//set the context for users that are not in the superadmin group
|
|
|
|
|
if (!if_group("superadmin")) {
|
|
|
|
|
if (count($_SESSION["domains"]) > 1) {
|
|
|
|
|
$ring_group_context = $_SESSION['domain_name'];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$ring_group_context = "default";
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2013-09-19 14:06:29 +02:00
|
|
|
//assign the user
|
2013-08-16 06:50:30 +02:00
|
|
|
if (strlen($_REQUEST["user_uuid"]) > 0 && strlen($_REQUEST["id"]) > 0 && $_GET["a"] != "delete") {
|
|
|
|
|
//set the variables
|
|
|
|
|
$user_uuid = check_str($_REQUEST["user_uuid"]);
|
|
|
|
|
$extension_uuid = check_str($_REQUEST["id"]);
|
2013-09-19 14:06:29 +02:00
|
|
|
//assign the user to the ring group
|
2013-08-16 06:50:30 +02:00
|
|
|
$sql_insert = "insert into v_ring_group_users ";
|
|
|
|
|
$sql_insert .= "(";
|
|
|
|
|
$sql_insert .= "ring_group_user_uuid, ";
|
|
|
|
|
$sql_insert .= "domain_uuid, ";
|
|
|
|
|
$sql_insert .= "ring_group_uuid, ";
|
|
|
|
|
$sql_insert .= "user_uuid ";
|
|
|
|
|
$sql_insert .= ")";
|
|
|
|
|
$sql_insert .= "values ";
|
|
|
|
|
$sql_insert .= "(";
|
|
|
|
|
$sql_insert .= "'".uuid()."', ";
|
|
|
|
|
$sql_insert .= "'$domain_uuid', ";
|
|
|
|
|
$sql_insert .= "'".$ring_group_uuid."', ";
|
|
|
|
|
$sql_insert .= "'".$user_uuid."' ";
|
|
|
|
|
$sql_insert .= ")";
|
|
|
|
|
$db->exec($sql_insert);
|
2014-02-20 08:20:55 +01:00
|
|
|
//save the message to a session variable
|
|
|
|
|
$_SESSION['message'] = $text['message-add'];
|
2013-08-16 06:50:30 +02:00
|
|
|
//redirect the browser
|
2014-02-20 08:20:55 +01:00
|
|
|
header("Location: ring_group_edit.php?id=$ring_group_uuid");
|
|
|
|
|
exit;
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//process the HTTP POST
|
|
|
|
|
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
2014-02-20 08:20:55 +01:00
|
|
|
//get the ring group uuid
|
|
|
|
|
if (strlen($ring_group_uuid) == 0) {
|
|
|
|
|
$ring_group_uuid = check_str($_REQUEST["ring_group_uuid"]);
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2013-08-16 06:50:30 +02:00
|
|
|
//check for all required data
|
2014-02-20 08:20:55 +01:00
|
|
|
$msg = '';
|
2013-08-16 06:50:30 +02:00
|
|
|
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
|
|
|
|
|
if (strlen($ring_group_extension) == 0) { $msg .= $text['message-extension']."<br>\n"; }
|
|
|
|
|
if (strlen($ring_group_strategy) == 0) { $msg .= $text['message-strategy']."<br>\n"; }
|
2014-02-20 08:20:55 +01:00
|
|
|
//if (strlen($ring_group_timeout_app) == 0) { $msg .= $text['message-timeout-action']."<br>\n"; }
|
2013-08-16 06:50:30 +02:00
|
|
|
//if (strlen($ring_group_cid_name_prefix) == 0) { $msg .= "Please provide: Caller ID Prefix<br>\n"; }
|
|
|
|
|
//if (strlen($ring_group_ringback) == 0) { $msg .= "Please provide: Ringback<br>\n"; }
|
|
|
|
|
if (strlen($ring_group_enabled) == 0) { $msg .= $text['message-enabled']."<br>\n"; }
|
|
|
|
|
//if (strlen($ring_group_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
|
|
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
require_once "resources/persist_form_var.php";
|
|
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table><tr><td>\n";
|
|
|
|
|
echo $msg."<br />";
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
|
persistformvar($_POST);
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
require_once "resources/footer.php";
|
|
|
|
|
return;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2013-08-16 06:50:30 +02:00
|
|
|
//add or update the database
|
|
|
|
|
if ($_POST["persistformvar"] != "true") {
|
2014-02-20 08:20:55 +01:00
|
|
|
//set the app and data
|
|
|
|
|
$ring_group_timeout_array = explode(":", $ring_group_timeout_action);
|
|
|
|
|
$ring_group_timeout_app = array_shift($ring_group_timeout_array);
|
|
|
|
|
$ring_group_timeout_data = join(':', $ring_group_timeout_array);
|
|
|
|
|
$_POST["ring_group_timeout_app"] = $ring_group_timeout_app;
|
|
|
|
|
$_POST["ring_group_timeout_data"] = $ring_group_timeout_data;
|
|
|
|
|
|
|
|
|
|
//remove the action
|
|
|
|
|
unset($_POST["ring_group_timeout_action"]);
|
|
|
|
|
|
|
|
|
|
//remove the user_uuid
|
|
|
|
|
unset($_POST["user_uuid"]);
|
|
|
|
|
|
|
|
|
|
//add the domain_uuid
|
|
|
|
|
if (strlen($_POST["domain_uuid"]) == 0) {
|
|
|
|
|
$_POST["domain_uuid"] = $_SESSION['domain_uuid'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add the dialplan_uuid
|
|
|
|
|
if (strlen($_POST["dialplan_uuid"]) == 0) {
|
2013-08-16 06:50:30 +02:00
|
|
|
$dialplan_uuid = uuid();
|
2014-02-20 08:20:55 +01:00
|
|
|
$_POST["dialplan_uuid"] = $dialplan_uuid;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2013-08-15 21:16:03 +02:00
|
|
|
|
2014-02-20 08:20:55 +01:00
|
|
|
//update the ring group destinations array
|
|
|
|
|
$x = 0;
|
|
|
|
|
foreach ($_POST["ring_group_destinations"] as $row) {
|
|
|
|
|
//add the domain_uuid
|
|
|
|
|
if (strlen($_POST["ring_group_destinations"][$x]["domain_uuid"]) == 0) {
|
|
|
|
|
$_POST["ring_group_destinations"][$x]["domain_uuid"] = $_SESSION['domain_uuid'];
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
//unset the empty row
|
|
|
|
|
if (strlen($_POST["ring_group_destinations"][$x]["destination_number"]) == 0) {
|
|
|
|
|
unset($_POST["ring_group_destinations"][$x]);
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
//unset ring_group_destination_uuid if the field has no value
|
|
|
|
|
if (strlen($row["ring_group_destination_uuid"]) == 0) {
|
|
|
|
|
unset($_POST["ring_group_destinations"][$x]["ring_group_destination_uuid"]);
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
//increment the row
|
|
|
|
|
$x++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//save to the data
|
|
|
|
|
$orm = new orm;
|
|
|
|
|
$orm->name('ring_groups');
|
|
|
|
|
if (strlen($ring_group_uuid) > 0) {
|
|
|
|
|
$orm->uuid($ring_group_uuid);
|
|
|
|
|
}
|
|
|
|
|
$orm->save($_POST);
|
|
|
|
|
$message = $orm->message;
|
|
|
|
|
if (strlen($ring_group_uuid) == 0) {
|
|
|
|
|
$ring_group_uuid = $message['uuid'];
|
|
|
|
|
$_GET["id"] = $ring_group_uuid;
|
|
|
|
|
}
|
2014-02-23 08:48:21 +01:00
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
|
|
|
|
|
//delete the dialplan details
|
|
|
|
|
$sql = "delete from v_dialplan_details ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
|
|
|
|
//delete from the dialplan
|
|
|
|
|
$sql = "delete from v_dialplans ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
|
|
|
|
|
$db->exec(check_sql($sql));
|
|
|
|
|
unset($sql);
|
|
|
|
|
|
|
|
|
|
//add the dialplan
|
|
|
|
|
$database = new database;
|
|
|
|
|
$database->db = $db;
|
|
|
|
|
$database->table = "v_dialplans";
|
|
|
|
|
$database->fields['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$database->fields['dialplan_uuid'] = $dialplan_uuid;
|
|
|
|
|
$database->fields['dialplan_name'] = $ring_group_name;
|
|
|
|
|
$database->fields['dialplan_order'] = '333';
|
|
|
|
|
$database->fields['dialplan_context'] = $ring_group_context;
|
|
|
|
|
$database->fields['dialplan_enabled'] = 'true';
|
|
|
|
|
$database->fields['dialplan_description'] = $ring_group_description;
|
|
|
|
|
$database->fields['app_uuid'] = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2';
|
|
|
|
|
$database->add();
|
|
|
|
|
|
|
|
|
|
//add the dialplan details
|
|
|
|
|
$database->table = "v_dialplan_details";
|
|
|
|
|
$database->fields['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$database->fields['dialplan_uuid'] = $dialplan_uuid;
|
|
|
|
|
$database->fields['dialplan_detail_uuid'] = uuid();
|
|
|
|
|
$database->fields['dialplan_detail_tag'] = 'condition'; //condition, action, antiaction
|
|
|
|
|
$database->fields['dialplan_detail_type'] = 'destination_number';
|
|
|
|
|
$database->fields['dialplan_detail_data'] = '^'.$ring_group_extension.'$';
|
|
|
|
|
$database->fields['dialplan_detail_order'] = '000';
|
|
|
|
|
$database->add();
|
|
|
|
|
|
|
|
|
|
//add the dialplan details
|
|
|
|
|
$database->table = "v_dialplan_details";
|
|
|
|
|
$database->fields['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$database->fields['dialplan_uuid'] = $dialplan_uuid;
|
|
|
|
|
$database->fields['dialplan_detail_uuid'] = uuid();
|
|
|
|
|
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
|
|
|
|
$database->fields['dialplan_detail_type'] = 'set';
|
|
|
|
|
$database->fields['dialplan_detail_data'] = 'ring_group_uuid='.$ring_group_uuid;
|
|
|
|
|
$database->fields['dialplan_detail_order'] = '025';
|
|
|
|
|
$database->add();
|
|
|
|
|
|
|
|
|
|
//add the dialplan details
|
|
|
|
|
$database->table = "v_dialplan_details";
|
|
|
|
|
$database->fields['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$database->fields['dialplan_uuid'] = $dialplan_uuid;
|
|
|
|
|
$database->fields['dialplan_detail_uuid'] = uuid();
|
|
|
|
|
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
|
|
|
|
$database->fields['dialplan_detail_type'] = 'lua';
|
|
|
|
|
$database->fields['dialplan_detail_data'] = 'app.lua ring_groups';
|
|
|
|
|
$database->fields['dialplan_detail_order'] = '030';
|
|
|
|
|
$database->add();
|
|
|
|
|
|
|
|
|
|
//save the xml
|
|
|
|
|
save_dialplan_xml();
|
|
|
|
|
|
|
|
|
|
//apply settings reminder
|
|
|
|
|
$_SESSION["reload_xml"] = true;
|
|
|
|
|
|
|
|
|
|
//delete the dialplan context from memcache
|
|
|
|
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
|
|
|
if ($fp) {
|
|
|
|
|
$switch_cmd = "memcache delete dialplan:".$ring_group_context;
|
|
|
|
|
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set the message
|
|
|
|
|
if ($action == "add") {
|
|
|
|
|
//save the message to a session variable
|
|
|
|
|
$_SESSION['message'] = $text['message-add'];
|
|
|
|
|
//redirect the browser
|
|
|
|
|
header("Location: ring_group_edit.php?id=$ring_group_uuid");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
if ($action == "update") {
|
|
|
|
|
//save the message to a session variable
|
|
|
|
|
$_SESSION['message'] = $text['message-update'];
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-16 06:50:30 +02:00
|
|
|
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//pre-populate the form
|
2014-02-20 08:20:55 +01:00
|
|
|
if (strlen($ring_group_uuid) == 0) { $ring_group_uuid = check_str($_GET["id"]); }
|
|
|
|
|
if (strlen($ring_group_uuid) > 0) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql = "select * from v_ring_groups ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and ring_group_uuid = '$ring_group_uuid' ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$result = $prep_statement->fetchAll();
|
|
|
|
|
foreach ($result as &$row) {
|
|
|
|
|
$ring_group_name = $row["ring_group_name"];
|
|
|
|
|
$ring_group_extension = $row["ring_group_extension"];
|
|
|
|
|
$ring_group_context = $row["ring_group_context"];
|
|
|
|
|
$ring_group_strategy = $row["ring_group_strategy"];
|
|
|
|
|
$ring_group_timeout_app = $row["ring_group_timeout_app"];
|
|
|
|
|
$ring_group_timeout_data = $row["ring_group_timeout_data"];
|
2012-07-31 06:56:18 +02:00
|
|
|
$ring_group_cid_name_prefix = $row["ring_group_cid_name_prefix"];
|
2012-10-22 22:09:37 +02:00
|
|
|
$ring_group_ringback = $row["ring_group_ringback"];
|
2014-08-13 10:41:44 +02:00
|
|
|
$ring_group_skip_active = $row["ring_group_skip_active"];
|
2012-06-04 16:58:40 +02:00
|
|
|
$ring_group_enabled = $row["ring_group_enabled"];
|
|
|
|
|
$ring_group_description = $row["ring_group_description"];
|
|
|
|
|
$dialplan_uuid = $row["dialplan_uuid"];
|
|
|
|
|
}
|
|
|
|
|
unset ($prep_statement);
|
|
|
|
|
if (strlen($ring_group_timeout_app) > 0) {
|
|
|
|
|
$ring_group_timeout_action = $ring_group_timeout_app.":".$ring_group_timeout_data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-20 08:20:55 +01:00
|
|
|
//get the ring group destination array
|
|
|
|
|
if ($action == "add") { $x = 0; $limit = 5; }
|
|
|
|
|
if (strlen($ring_group_uuid) > 0) {
|
|
|
|
|
$sql = "SELECT * FROM v_ring_group_destinations ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and ring_group_uuid = '".$ring_group_uuid."' ";
|
|
|
|
|
$sql .= "order by destination_delay, destination_number asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$ring_group_destinations = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
$x = count($ring_group_destinations);
|
|
|
|
|
$limit = $x + 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while($x < $limit) {
|
|
|
|
|
$ring_group_destinations[$x]['destination_number'] = '';
|
|
|
|
|
$ring_group_destinations[$x]['destination_delay'] = '';
|
|
|
|
|
$ring_group_destinations[$x]['destination_timeout'] = '';
|
2014-06-25 02:09:30 +02:00
|
|
|
$ring_group_destinations[$x]['destination_prompt'] = '';
|
2014-02-20 08:20:55 +01:00
|
|
|
$x++;
|
|
|
|
|
}
|
|
|
|
|
unset($limit);
|
|
|
|
|
|
|
|
|
|
//get the ring group users
|
|
|
|
|
if (strlen($ring_group_uuid) > 0) {
|
|
|
|
|
$sql = "SELECT u.username, r.user_uuid, r.ring_group_uuid FROM v_ring_group_users as r, v_users as u ";
|
|
|
|
|
$sql .= "where r.user_uuid = u.user_uuid ";
|
|
|
|
|
$sql .= "and u.user_enabled = 'true' ";
|
|
|
|
|
$sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and r.ring_group_uuid = '".$ring_group_uuid."' ";
|
|
|
|
|
$sql .= "order by u.username asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
|
|
|
|
$ring_group_users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
//$ring_group_users[$x]['username'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//set defaults
|
2014-08-13 10:41:44 +02:00
|
|
|
if (strlen($ring_group_skip_active) == 0) { $ring_group_skip_active = 'false'; }
|
2012-06-04 16:58:40 +02:00
|
|
|
if (strlen($ring_group_enabled) == 0) { $ring_group_enabled = 'true'; }
|
2012-09-15 18:23:23 +02:00
|
|
|
|
|
|
|
|
//set the context for users that are not in the superadmin group
|
|
|
|
|
if (strlen($ring_group_context) == 0) {
|
2012-09-15 18:35:08 +02:00
|
|
|
if (count($_SESSION["domains"]) > 1) {
|
|
|
|
|
$ring_group_context = $_SESSION['domain_name'];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$ring_group_context = "default";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//show the header
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//show the content
|
|
|
|
|
echo "<div align='center'>";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
|
|
|
|
|
echo "<tr class='border'>\n";
|
|
|
|
|
echo " <td align=\"left\">\n";
|
|
|
|
|
echo " <br>";
|
|
|
|
|
|
|
|
|
|
echo "<form method='post' name='frm' action=''>\n";
|
|
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['label-ring-group']."</b></td>\n";
|
2014-01-12 08:12:08 +01:00
|
|
|
echo "<td width='70%' align='right'>\n";
|
|
|
|
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='ring_groups.php'\" value='".$text['button-back']."'>\n";
|
2014-04-27 01:37:41 +02:00
|
|
|
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
2014-01-12 08:12:08 +01:00
|
|
|
echo "</td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td align='left' colspan='2'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description']."<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo " ".$text['label-name'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ring_group_name' maxlength='255' value=\"$ring_group_name\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-name']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo " ".$text['label-extension'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ring_group_extension' maxlength='255' value=\"$ring_group_extension\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-extension']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
if (if_group("superadmin")) {
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " ".$text['label-context'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ring_group_context' maxlength='255' value=\"$ring_group_context\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-enter-context']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo " ".$text['label-strategy'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='ring_group_strategy'>\n";
|
2013-02-22 22:57:18 +01:00
|
|
|
if ($ring_group_strategy == "sequence") {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='sequence' selected='selected'>".$text['option-sequence']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='sequence'>".$text['option-sequence']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2014-04-27 10:21:35 +02:00
|
|
|
if ($ring_group_strategy == "simultaneous" || $ring_group_strategy == '') {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='simultaneous' selected='selected'>".$text['option-simultaneous']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='simultaneous'>".$text['option-simultaneous']."</option>\n";
|
2013-02-12 03:49:49 +01:00
|
|
|
}
|
2013-02-22 22:57:18 +01:00
|
|
|
if ($ring_group_strategy == "enterprise") {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='enterprise' selected='selected'>".$text['option-enterprise']."</option>\n";
|
2013-02-12 03:49:49 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='enterprise'>".$text['option-enterprise']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2014-02-25 05:55:50 +01:00
|
|
|
if ($ring_group_strategy == "rollover") {
|
|
|
|
|
echo " <option value='rollover' selected='selected'>".$text['option-rollover']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='rollover'>".$text['option-rollover']."</option>\n";
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2013-05-19 01:43:11 +02:00
|
|
|
echo $text['description-strategy']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2013-02-12 03:49:49 +01:00
|
|
|
|
2013-07-24 21:37:59 +02:00
|
|
|
echo " <tr>";
|
2014-02-20 08:20:55 +01:00
|
|
|
echo " <td class='vncellreq' valign='top'>".$text['label-destinations'].":</td>";
|
2013-07-24 21:37:59 +02:00
|
|
|
echo " <td class='vtable' align='left'>";
|
2014-02-20 08:20:55 +01:00
|
|
|
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <table border='0' cellpadding='2' cellspacing='0'>\n";
|
2013-08-16 01:30:35 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-destination_number']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-destination_delay']."</td>\n";
|
|
|
|
|
echo " <td class='vtable'>".$text['label-destination_timeout']."</td>\n";
|
2013-08-16 06:50:30 +02:00
|
|
|
if (permission_exists('ring_group_prompt')) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
2013-08-16 01:30:35 +02:00
|
|
|
echo " <td></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
$x = 0;
|
|
|
|
|
foreach($ring_group_destinations as $row) {
|
|
|
|
|
if (strlen($row['destination_delay']) == 0) { $row['destination_delay'] = "0"; }
|
|
|
|
|
if (strlen($row['destination_timeout']) == 0) { $row['destination_timeout'] = "30"; }
|
|
|
|
|
|
|
|
|
|
if (strlen($row['ring_group_destination_uuid']) > 0) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <input name='ring_group_destinations[".$x."][ring_group_destination_uuid]' type='hidden' value=\"".$row['ring_group_destination_uuid']."\">\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <input type=\"text\" name=\"ring_group_destinations[".$x."][destination_number]\" class=\"formfld\" style=\"width: 90%;\"value=\"".$row['destination_number']."\">\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <select name='ring_group_destinations[".$x."][destination_delay]' class='formfld' style='width:55px'>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
$i=0;
|
|
|
|
|
while($i<=300) {
|
|
|
|
|
if ($i == $row['destination_delay']) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <option value='$i' selected='selected'>$i</option>\n";
|
2013-07-24 21:37:59 +02:00
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
else {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <option value='$i'>$i</option>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
|
|
|
|
$i = $i + 5;
|
2013-07-24 21:37:59 +02:00
|
|
|
}
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <select name='ring_group_destinations[".$x."][destination_timeout]' class='formfld' style='width:55px'>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
$i=5;
|
|
|
|
|
while($i<=300) {
|
|
|
|
|
if ($i == $row['destination_timeout']) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <option value='$i' selected='selected'>$i</option>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <option value='$i'>$i</option>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
|
|
|
|
$i = $i + 5;
|
|
|
|
|
}
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
|
|
|
|
|
if (permission_exists('ring_group_prompt')) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <select class='formfld' style='width: 90px;' name='ring_group_destinations[".$x."][destination_prompt]'>\n";
|
|
|
|
|
echo " <option value=''></option>\n";
|
|
|
|
|
echo " <option value='1'".(($row['destination_prompt'])?"selected='selected'":null).">".$text['label-destination_prompt_confirm']."</option>\n";
|
|
|
|
|
//echo " <option value='2'>".$text['label-destination_prompt_announce]."</option>\n";
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " <td> </td>\n";
|
|
|
|
|
echo " <td class='list_control_icons' style='width: 25px;'>";
|
2014-02-20 08:20:55 +01:00
|
|
|
if (strlen($row['ring_group_destination_uuid']) > 0) {
|
2014-06-25 02:09:30 +02:00
|
|
|
echo "<a href='ring_group_destination_delete.php?id=".$row['ring_group_destination_uuid']."&ring_group_uuid=".$row['ring_group_uuid']."&a=delete' alt='delete' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
2014-06-25 02:09:30 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
|
|
|
|
|
$x++;
|
2013-08-16 06:50:30 +02:00
|
|
|
}
|
2013-08-16 01:30:35 +02:00
|
|
|
echo " </table>\n";
|
2013-07-24 21:37:59 +02:00
|
|
|
echo " ".$text['description-destinations']."\n";
|
|
|
|
|
echo " <br />\n";
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2013-07-24 21:37:59 +02:00
|
|
|
echo " ".$text['label-timeout_destination'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
|
|
|
|
|
switch_select_destination("dialplan", "", "ring_group_timeout_action", $ring_group_timeout_action, "", "");
|
|
|
|
|
echo " <br />\n";
|
2013-07-24 21:37:59 +02:00
|
|
|
echo " ".$text['description-timeout_destination']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-07-31 06:56:18 +02:00
|
|
|
echo "<tr>\n";
|
2013-05-28 19:53:21 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-12-18 02:28:13 +01:00
|
|
|
echo " ".$text['label-cid-prefix'].":\n";
|
2012-07-31 06:56:18 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ring_group_cid_name_prefix' maxlength='255' value='$ring_group_cid_name_prefix'>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-12-18 02:28:13 +01:00
|
|
|
echo $text['description-cid-prefix']." \n";
|
2012-07-31 06:56:18 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-10-22 22:09:37 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo " ".$text['label-ringback'].":\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
|
|
|
|
|
$select_options = "";
|
2013-05-19 01:43:11 +02:00
|
|
|
if ($ring_group_ringback == "\${us-ring}" || $ring_group_ringback == "us-ring") {
|
|
|
|
|
$select_options .= " <option value='\${us-ring}' selected='selected'>".$text['option-usring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
$select_options .= " <option value='\${us-ring}'>".$text['option-usring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
2014-01-17 00:30:56 +01:00
|
|
|
if ($ring_group_ringback == "\${pt-ring}" || $ring_group_ringback == "pt-ring") {
|
|
|
|
|
$select_options .= " <option value='\${pt-ring}' selected='selected'>".$text['option-ptring']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$select_options .= " <option value='\${pt-ring}'>".$text['option-ptring']."</option>\n";
|
|
|
|
|
}
|
2012-10-22 22:09:37 +02:00
|
|
|
if ($ring_group_ringback == "\${fr-ring}" || $ring_group_ringback == "fr-ring") {
|
2013-05-19 01:43:11 +02:00
|
|
|
$select_options .= " <option value='\${fr-ring}' selected='selected'>".$text['option-frring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
$select_options .= " <option value='\${fr-ring}'>".$text['option-frring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
2013-05-19 01:43:11 +02:00
|
|
|
if ($ring_group_ringback == "\${uk-ring}" || $ring_group_ringback == "uk-ring") {
|
|
|
|
|
$select_options .= " <option value='\${uk-ring}' selected='selected'>".$text['option-ukring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
$select_options .= " <option value='\${uk-ring}'>".$text['option-ukring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
2013-05-19 01:43:11 +02:00
|
|
|
if ($ring_group_ringback == "\${rs-ring}" || $ring_group_ringback == "rs-ring") {
|
|
|
|
|
$select_options .= " <option value='\${rs-ring}' selected='selected'>".$text['option-rsring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
$select_options .= " <option value='\${rs-ring}'>".$text['option-rsring']."</option>\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
}
|
2014-03-06 18:16:21 +01:00
|
|
|
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) {
|
|
|
|
|
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
|
|
|
|
$moh = new switch_music_on_hold;
|
|
|
|
|
$moh->select_name = "ring_group_ringback";
|
|
|
|
|
$moh->select_value = $ring_group_ringback;
|
|
|
|
|
$moh->select_options = $select_options;
|
|
|
|
|
echo $moh->select();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <select class='formfld' name='ring_group_ringback'>\n";
|
|
|
|
|
//echo " <option value=''></option>\n";
|
|
|
|
|
echo $select_options;
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
}
|
2012-10-22 22:09:37 +02:00
|
|
|
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-ringback']."\n";
|
2012-10-22 22:09:37 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2013-08-16 06:50:30 +02:00
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell' valign='top'>".$text['label-user_list'].":</td>";
|
|
|
|
|
echo " <td class='vtable'>";
|
|
|
|
|
echo " <table width='52%'>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
foreach($ring_group_users as $field) {
|
2013-08-16 06:50:30 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td class='vtable'>".$field['username']."</td>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " <a href='ring_group_edit.php?id=".$ring_group_uuid."&user_uuid=".$field['user_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";
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " <br />\n";
|
|
|
|
|
$sql = "SELECT * FROM v_users ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "and user_enabled = 'true' ";
|
|
|
|
|
$sql .= "order by username asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement->execute();
|
2014-02-26 06:39:02 +01:00
|
|
|
echo " <select name=\"user_uuid\" class='formfld' style='width: auto;'>\n";
|
2013-08-16 06:50:30 +02:00
|
|
|
echo " <option value=\"\"></option>\n";
|
|
|
|
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
foreach($result as $field) {
|
|
|
|
|
echo " <option value='".$field['user_uuid']."'>".$field['username']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>";
|
|
|
|
|
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
|
|
|
|
|
unset($sql, $result);
|
|
|
|
|
echo " <br>\n";
|
|
|
|
|
echo " ".$text['description-user_list']."\n";
|
|
|
|
|
echo " <br />\n";
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
|
2014-08-13 10:41:44 +02:00
|
|
|
echo "<tr>\n";
|
2014-08-13 11:13:22 +02:00
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
2014-08-13 10:41:44 +02:00
|
|
|
echo " ".$text['label-skip_active'].":\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='ring_group_skip_active'>\n";
|
|
|
|
|
if ($ring_group_skip_active == "true") {
|
|
|
|
|
echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='true'>".$text['option-true']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($ring_group_skip_active == "false") {
|
|
|
|
|
echo " <option value='false' selected='selected'>".$text['option-false']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='false'>".$text['option-false']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo $text['description-skip_active']."\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo " ".$text['label-enabled'].":\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <select class='formfld' name='ring_group_enabled'>\n";
|
2013-05-19 01:43:11 +02:00
|
|
|
if ($ring_group_enabled == "true") {
|
|
|
|
|
echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='true'>".$text['option-true']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2013-05-19 01:43:11 +02:00
|
|
|
if ($ring_group_enabled == "false") {
|
|
|
|
|
echo " <option value='false' selected='selected'>".$text['option-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2013-05-19 01:43:11 +02:00
|
|
|
echo " <option value='false'>".$text['option-false']."</option>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-enabled']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
|
echo " Description:\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
|
echo " <input class='formfld' type='text' name='ring_group_description' maxlength='255' value=\"$ring_group_description\">\n";
|
|
|
|
|
echo "<br />\n";
|
2012-11-24 08:43:34 +01:00
|
|
|
echo $text['description-description']."\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2' align='right'>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
if (strlen($dialplan_uuid) > 0) {
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <input type='hidden' name='dialplan_uuid' value='$dialplan_uuid'>\n";
|
2014-02-20 08:20:55 +01:00
|
|
|
}
|
|
|
|
|
if (strlen($ring_group_uuid) > 0) {
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <input type='hidden' name='ring_group_uuid' value='$ring_group_uuid'>\n";
|
|
|
|
|
}
|
2014-02-20 08:20:55 +01:00
|
|
|
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
|
|
//include the footer
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
?>
|