fusionpbx/app/conferences/conference_edit.php

603 lines
23 KiB
PHP
Raw Normal View History

2013-01-05 01:17:37 +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>
Portions created by the Initial Developer are Copyright (C) 2008-2024
2013-01-05 01:17:37 +01:00
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
2016-10-06 02:42:46 +02:00
2022-10-11 00:35:14 +02:00
//includes files
Use magic constant dir (#6711) * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ to load only functions.php * replace spaces with tab character * update dirname command to use levels instead of nesting * use magic constant __DIR__ * update dirname command to use levels instead of nesting * Update access_control_edit.php * Update access_control_import.php * Update access_controls.php * Update dnd.php * Update access_controls_reload.php * Update call_center_agents.php * Update call_center_agents.php * Update fax_queue.php * Update login.php * Update pdo.php * Update pdo_vm.php * Update switch.php * Update index.php * Update css.php * Update v_mailto.php * Update fax_to_email.php --------- Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-06-15 19:28:23 +02:00
require_once dirname(__DIR__, 2) . "/resources/require.php";
2016-10-06 02:42:46 +02:00
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('conference_add') || permission_exists('conference_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
2013-01-05 01:17:37 +01:00
//add multi-lingual support
$language = new text;
$text = $language->get();
2013-01-05 01:17:37 +01:00
//set the defaults
$conference_name = '';
$conference_extension = '';
$conference_pin_number = '';
$conference_flags = '';
$conference_account_code = '';
$conference_description = '';
2013-01-05 01:17:37 +01:00
//action add or update
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
2013-01-05 01:17:37 +01:00
$action = "update";
2019-07-07 02:04:44 +02:00
$conference_uuid = $_REQUEST["id"];
2013-01-05 01:17:37 +01:00
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (!empty($_POST)) {
2023-06-02 22:13:47 +02:00
$dialplan_uuid = $_POST["dialplan_uuid"] ?? null;
2019-07-07 02:04:44 +02:00
$conference_name = $_POST["conference_name"];
$conference_extension = $_POST["conference_extension"];
$conference_pin_number = $_POST["conference_pin_number"];
$conference_profile = $_POST["conference_profile"];
$conference_flags = $_POST["conference_flags"];
2023-06-02 22:13:47 +02:00
$conference_email_address = $_POST["conference_email_address"] ?? null;
$conference_account_code = $_POST["conference_account_code"];
2019-07-07 02:04:44 +02:00
$conference_order = $_POST["conference_order"];
$conference_description = $_POST["conference_description"];
2023-06-02 22:13:47 +02:00
$conference_enabled = $_POST["conference_enabled"] ?? 'false';
2013-01-05 01:17:37 +01:00
//set the context for users that do not have the permission
if (permission_exists('conference_context')) {
$conference_context = $_POST["conference_context"];
}
else if ($action == 'add') {
$conference_context = $_SESSION['domain_name'];
}
2013-01-05 01:17:37 +01:00
//sanitize the conference name
$conference_name = preg_replace("/[^A-Za-z0-9\- ]/", "", $conference_name);
2019-08-30 06:15:01 +02:00
//$conference_name = str_replace(" ", "-", $conference_name);
2013-01-05 01:17:37 +01:00
}
//delete the user from the v_conference_users
if (!empty($_GET["a"]) && $_GET["a"] == "delete" && permission_exists("conference_delete")) {
2019-07-07 02:04:44 +02:00
$user_uuid = $_REQUEST["user_uuid"];
$conference_uuid = $_REQUEST["id"];
2024-11-29 22:06:08 +01:00
$p = permissions::new();
2019-07-07 02:04:44 +02:00
$p->add('conference_user_delete', 'temp');
$array['conference_users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['conference_users'][0]['conference_uuid'] = $conference_uuid;
$array['conference_users'][0]['user_uuid'] = $user_uuid;
$database = new database;
$database->app_name = 'conferences';
$database->app_uuid = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$database->delete($array);
$response = $database->message;
unset($array);
$p->delete('conference_user_delete', 'temp');
2014-02-21 04:02:55 +01:00
2018-08-31 05:09:01 +02:00
message::add($text['confirm-delete']);
2014-02-21 04:02:55 +01:00
header("Location: conference_edit.php?id=".$conference_uuid);
2019-07-07 02:04:44 +02:00
exit;
2013-01-05 01:17:37 +01:00
}
//add the user to the v_conference_users
2023-06-02 22:13:47 +02:00
if (!empty($_REQUEST["user_uuid"]) && is_uuid($_REQUEST["user_uuid"]) && is_uuid($_REQUEST["id"]) && (empty($_GET["a"]) || $_GET["a"] != "delete")) {
2013-01-05 01:17:37 +01:00
//set the variables
2019-07-07 02:04:44 +02:00
$user_uuid = $_REQUEST["user_uuid"];
$conference_uuid = $_REQUEST["id"];
2019-08-30 06:15:01 +02:00
2013-01-05 01:17:37 +01:00
//assign the user to the extension
2019-07-07 02:04:44 +02:00
$array['conference_users'][0]['conference_user_uuid'] = uuid();
$array['conference_users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['conference_users'][0]['conference_uuid'] = $conference_uuid;
$array['conference_users'][0]['user_uuid'] = $user_uuid;
2024-11-29 22:06:08 +01:00
$p = permissions::new();
2019-07-07 02:04:44 +02:00
$p->add('conference_user_add', 'temp');
$database = new database;
$database->app_name = 'conferences';
$database->app_uuid = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$database->save($array);
$response = $database->message;
unset($array);
$p->delete('conference_user_add', 'temp');
2017-06-08 18:54:48 +02:00
//send a message
2018-08-31 05:09:01 +02:00
message::add($text['confirm-add']);
2019-08-30 06:02:31 +02:00
header("Location: conference_edit.php?id=".urlencode($conference_uuid));
2019-07-07 02:04:44 +02:00
exit;
2013-01-05 01:17:37 +01:00
}
2016-10-14 16:32:15 +02:00
//process http post variables
if (!empty($_POST) && empty($_POST["persistformvar"])) {
2013-01-05 01:17:37 +01:00
2019-08-30 06:02:31 +02:00
//get the conference id
2019-08-30 06:15:01 +02:00
if ($action == "add") {
$conference_uuid = uuid();
$dialplan_uuid = uuid();
}
2019-08-30 06:02:31 +02:00
if ($action == "update") {
$conference_uuid = $_POST["conference_uuid"];
}
2013-01-05 01:17:37 +01:00
2019-09-18 06:19:04 +02:00
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: conferences.php');
exit;
}
2016-10-14 16:32:15 +02:00
//check for all required data
$msg = '';
//if (empty($dialplan_uuid)) { $msg .= "Please provide: Dialplan UUID<br>\n"; }
if (empty($conference_name)) { $msg .= "".$text['confirm-name']."<br>\n"; }
if (empty($conference_extension)) { $msg .= "".$text['confirm-extension']."<br>\n"; }
//if (empty($conference_pin_number)) { $msg .= "Please provide: Pin Number<br>\n"; }
if (empty($conference_profile)) { $msg .= "".$text['confirm-profile']."<br>\n"; }
//if (empty($conference_flags)) { $msg .= "Please provide: Flags<br>\n"; }
//if (empty($conference_order)) { $msg .= "Please provide: Order<br>\n"; }
//if (empty($conference_description)) { $msg .= "Please provide: Description<br>\n"; }
if (empty($conference_enabled)) { $msg .= "".$text['confirm-enabled']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) {
2020-01-06 19:25:38 +01:00
$document['title'] = $text['title-conference'];
2016-10-14 16:32:15 +02:00
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;
2016-10-14 16:32:15 +02:00
}
2013-01-05 01:17:37 +01:00
2016-10-14 16:32:15 +02:00
//add or update the database
2023-06-02 22:13:47 +02:00
if (empty($_POST["persistformvar"])) {
2019-08-30 06:02:31 +02:00
//update the conference extension
2019-08-30 06:15:01 +02:00
$array['conferences'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
2019-08-30 06:02:31 +02:00
$array['conferences'][0]['conference_uuid'] = $conference_uuid;
$array['conferences'][0]['dialplan_uuid'] = $dialplan_uuid;
$array['conferences'][0]['conference_name'] = $conference_name;
$array['conferences'][0]['conference_extension'] = $conference_extension;
$array['conferences'][0]['conference_pin_number'] = $conference_pin_number;
2021-12-02 05:43:16 +01:00
$array['conferences'][0]['conference_profile'] = $conference_profile;
$array['conferences'][0]['conference_flags'] = $conference_flags;
2021-11-29 07:19:37 +01:00
if (permission_exists('conference_email_address')) {
2021-11-29 06:36:24 +01:00
$array['conferences'][0]['conference_email_address'] = $conference_email_address;
}
if (permission_exists('conference_account_code')) {
$array['conferences'][0]['conference_account_code'] = $conference_account_code;
}
2019-08-30 06:02:31 +02:00
$array['conferences'][0]['conference_order'] = $conference_order;
$array['conferences'][0]['conference_description'] = $conference_description;
$array['conferences'][0]['conference_context'] = $conference_context;
2019-08-30 06:02:31 +02:00
$array['conferences'][0]['conference_enabled'] = $conference_enabled;
2020-02-15 00:55:39 +01:00
//conference pin number
$pin_number = (!empty($conference_pin_number)) ? '+'.$conference_pin_number : '';
2020-02-15 00:55:39 +01:00
2019-08-30 06:02:31 +02:00
//build the xml
$dialplan_xml = "<extension name=\"".xml::sanitize($conference_name)."\" continue=\"\" uuid=\"".xml::sanitize($dialplan_uuid)."\">\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".xml::sanitize($conference_extension)."$\">\n";
2019-08-30 06:02:31 +02:00
$dialplan_xml .= " <action application=\"answer\" data=\"\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"conference_uuid=".xml::sanitize($conference_uuid)."\" inline=\"true\"/>\n";
//$dialplan_xml .= " <action application=\"set\" data=\"conference_name=".xml::sanitize($conference_name)."\" inline=\"true\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"conference_extension=".xml::sanitize($conference_extension)."\" inline=\"true\"/>\n";
$dialplan_xml .= " <action application=\"conference\" data=\"".xml::sanitize($conference_extension)."@".$_SESSION['domain_name']."@".xml::sanitize($conference_profile.$pin_number)."+flags{'".xml::sanitize($conference_flags)."'}\"/>\n";
2019-08-30 06:02:31 +02:00
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= "</extension>\n";
//update the conference dialplan
$array['dialplans'][0]['dialplan_uuid'] = $dialplan_uuid;
$array['dialplans'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][0]['dialplan_name'] = $conference_name;
$array['dialplans'][0]['dialplan_number'] = $conference_extension;
if (isset($conference_context)) {
$array['dialplans'][0]["dialplan_context"] = $conference_context;
}
2019-08-30 06:15:01 +02:00
$array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
2019-08-30 06:02:31 +02:00
$array['dialplans'][0]['dialplan_xml'] = $dialplan_xml;
2023-05-08 22:36:35 +02:00
$array['dialplans'][0]['dialplan_continue'] = 'false';
2019-08-30 06:15:01 +02:00
$array['dialplans'][0]['dialplan_order'] = '333';
2019-11-03 01:47:55 +01:00
$array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
2019-08-30 06:02:31 +02:00
$array['dialplans'][0]['dialplan_description'] = $conference_description;
2024-11-29 22:06:08 +01:00
$p = permissions::new();
2019-11-03 01:47:55 +01:00
$p->add('dialplan_add', 'temp');
2019-08-30 06:02:31 +02:00
$p->add('dialplan_edit', 'temp');
$database = new database;
$database->app_name = 'conferences';
$database->app_uuid = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$database->save($array);
$response = $database->message;
unset($array);
2019-11-03 01:47:55 +01:00
$p->delete('dialplan_add', 'temp');
2019-08-30 06:02:31 +02:00
$p->delete('dialplan_edit', 'temp');
//delete the dialplan details
$sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = :dialplan_uuid ";
//$sql .= "and domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['dialplan_uuid'] = $dialplan_uuid;
$database = new database;
$database->execute($sql, $parameters ?? null);
2019-08-30 06:02:31 +02:00
unset($sql, $parameters);
//add the message
message::add($text['confirm-update']);
2016-10-14 16:32:15 +02:00
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["domain_name"]);
2016-10-14 16:32:15 +02:00
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
2016-10-14 16:32:15 +02:00
//redirect the browser
header("Location: conferences.php");
2019-08-30 06:02:31 +02:00
exit;
2016-10-14 16:32:15 +02:00
}
}
2013-01-05 01:17:37 +01:00
//pre-populate the form
2023-06-02 22:13:47 +02:00
if (!empty($_GET) && empty($_POST["persistformvar"])) {
2013-01-05 01:17:37 +01:00
$conference_uuid = $_GET["id"];
$sql = "select * from v_conferences ";
2019-07-07 02:04:44 +02:00
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and conference_uuid = :conference_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['conference_uuid'] = $conference_uuid;
$database = new database;
$row = $database->select($sql, $parameters ?? null, 'row');
if (!empty($row)) {
2013-01-05 01:17:37 +01:00
$dialplan_uuid = $row["dialplan_uuid"];
$conference_name = $row["conference_name"];
$conference_extension = $row["conference_extension"];
$conference_pin_number = $row["conference_pin_number"];
$conference_profile = $row["conference_profile"];
$conference_flags = $row["conference_flags"];
2021-12-02 05:43:16 +01:00
$conference_email_address = $row["conference_email_address"];
$conference_account_code = $row["conference_account_code"];
2013-01-05 01:17:37 +01:00
$conference_order = $row["conference_order"];
$conference_description = $row["conference_description"];
$conference_context = $row["conference_context"];
2013-01-05 01:17:37 +01:00
$conference_enabled = $row["conference_enabled"];
$conference_name = str_replace("-", " ", $conference_name);
}
2019-07-07 02:04:44 +02:00
unset($sql, $parameters, $row);
2013-01-05 01:17:37 +01:00
}
Set default for enabled (#6556) * Set default for enabled * Update conference_profile_edit.php * Update call_block_edit.php * Update conference_control_edit.php * Update conference_control_detail_edit.php * Update conference_profile_edit.php * Update conference_profile_param_edit.php * Update conference_edit.php * Update destination_edit.php * Update device_edit.php * Update device_profile_edit.php * Update device_vendor_edit.php * Update email_template_edit.php * Update extension_edit.php * Update module_edit.php * Update phrase_edit.php * Update ring_group_edit.php * Update sip_profile_edit.php * Update stream_edit.php * Update time_condition_edit.php * Update var_edit.php * Update voicemail_edit.php * Update call_block_edit.php * Update default_setting_edit.php * Update domain_setting_edit.php * Update domain_edit.php * Update user_edit.php * Update bridge_edit.php * Update sip_profile_edit.php * Update sofia_global_setting_edit.php * Update call_flow_edit.php * Update email_template_edit.php * Update call_flow_edit.php * Update bridge_edit.php * Update email_template_edit.php * Update sip_profile_edit.php * Update sofia_global_setting_edit.php * Update bridge_edit.php * Update call_flow_edit.php * Update conference_control_edit.php * Update sip_profile_edit.php * Update stream_edit.php * Update default_setting_edit.php * Update email_template_edit.php * Update extension_setting_edit.php * Update default_setting_edit.php * Update dashboard_edit.php * Update dashboard_edit.php * Update default_setting_edit.php
2023-02-17 22:21:41 +01:00
//set the defaults
if (empty($conference_context)) { $conference_context = $_SESSION['domain_name']; }
if (empty($conference_enabled)) { $conference_enabled = 'true'; }
Set default for enabled (#6556) * Set default for enabled * Update conference_profile_edit.php * Update call_block_edit.php * Update conference_control_edit.php * Update conference_control_detail_edit.php * Update conference_profile_edit.php * Update conference_profile_param_edit.php * Update conference_edit.php * Update destination_edit.php * Update device_edit.php * Update device_profile_edit.php * Update device_vendor_edit.php * Update email_template_edit.php * Update extension_edit.php * Update module_edit.php * Update phrase_edit.php * Update ring_group_edit.php * Update sip_profile_edit.php * Update stream_edit.php * Update time_condition_edit.php * Update var_edit.php * Update voicemail_edit.php * Update call_block_edit.php * Update default_setting_edit.php * Update domain_setting_edit.php * Update domain_edit.php * Update user_edit.php * Update bridge_edit.php * Update sip_profile_edit.php * Update sofia_global_setting_edit.php * Update call_flow_edit.php * Update email_template_edit.php * Update call_flow_edit.php * Update bridge_edit.php * Update email_template_edit.php * Update sip_profile_edit.php * Update sofia_global_setting_edit.php * Update bridge_edit.php * Update call_flow_edit.php * Update conference_control_edit.php * Update sip_profile_edit.php * Update stream_edit.php * Update default_setting_edit.php * Update email_template_edit.php * Update extension_setting_edit.php * Update default_setting_edit.php * Update dashboard_edit.php * Update dashboard_edit.php * Update default_setting_edit.php
2023-02-17 22:21:41 +01:00
2017-10-21 18:37:38 +02:00
//get the conference profiles
$sql = "select * ";
$sql .= "from v_conference_profiles ";
$sql .= "where profile_enabled = 'true' ";
2017-10-21 18:45:12 +02:00
$sql .= "and profile_name <> 'sla' ";
2019-07-07 02:04:44 +02:00
$database = new database;
$conference_profiles = $database->select($sql, null, 'all');
unset($sql);
2017-10-21 18:37:38 +02:00
2019-01-14 04:53:12 +01:00
//get conference users
2019-07-07 02:04:44 +02:00
$sql = "select * from v_conference_users as e, v_users as u ";
2019-01-14 04:53:12 +01:00
$sql .= "where e.user_uuid = u.user_uuid ";
$sql .= "and u.user_enabled = 'true' ";
2019-07-07 02:04:44 +02:00
$sql .= "and e.domain_uuid = :domain_uuid ";
$sql .= "and e.conference_uuid = :conference_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
2023-06-02 22:13:47 +02:00
$parameters['conference_uuid'] = $conference_uuid ?? null;
2019-07-07 02:04:44 +02:00
$database = new database;
$conference_users = $database->select($sql, $parameters ?? null, 'all');
2019-07-07 02:04:44 +02:00
unset($sql, $parameters);
2019-01-14 04:53:12 +01:00
//get the users
2019-07-07 02:04:44 +02:00
$sql = "select * from v_users ";
$sql .= "where domain_uuid = :domain_uuid ";
2019-01-14 04:53:12 +01:00
$sql .= "and user_enabled = 'true' ";
2019-07-07 02:04:44 +02:00
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$users = $database->select($sql, $parameters ?? null, 'all');
2019-07-07 02:04:44 +02:00
unset($sql, $parameters);
2019-01-14 04:53:12 +01:00
2017-10-21 18:37:38 +02:00
//set the default
if (empty($conference_profile)) { $conference_profile = "default"; }
2017-10-21 18:37:38 +02:00
2019-09-18 06:19:04 +02:00
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
2013-01-05 01:17:37 +01:00
//show the header
2020-01-06 19:25:38 +01:00
$document['title'] = $text['title-conference'];
require_once "resources/header.php";
2013-01-05 01:17:37 +01:00
//show the content
echo "<form method='post' name='frm' id='frm'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'>";
2020-08-03 16:32:18 +02:00
echo " <b>".$text['title-conference']."</b>";
echo " </div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'conferences.php']);
if ($action == 'update') {
if (permission_exists('conference_cdr_view')) {
echo button::create(['type'=>'button','label'=>$text['button-cdr'],'icon'=>'list','link'=>PROJECT_PATH.'/app/conference_cdr/conference_cdr.php?id='.urlencode($conference_uuid)]);
}
if (permission_exists('conference_interactive_view')) {
echo button::create(['type'=>'button','label'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'style'=>'','link'=>'../conferences_active/conference_interactive.php?c='.urlencode($conference_extension)]);
}
else if (permission_exists('conference_active_view')) {
echo button::create(['type'=>'button','label'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'style'=>'','link'=>'../conferences_active/conferences_active.php']);
}
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['description']."\n";
echo "<br /><br />\n";
echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
2013-01-05 01:17:37 +01:00
echo "<tr>\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-name']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_name' maxlength='255' value=\"".escape($conference_name)."\">\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-extension']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
2024-05-31 02:45:45 +02:00
echo " <input class='formfld' type='text' name='conference_extension' maxlength='255' value=\"".escape($conference_extension)."\" required='required' placeholder=\"".($_SESSION['conference']['extension_range']['text'] ?? '')."\">\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-extension']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-pin']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='conference_pin_number' maxlength='255' value=\"".escape($conference_pin_number)."\">\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-pin']."\n";
echo "</td>\n";
echo "</tr>\n";
2019-01-14 04:53:12 +01:00
if (permission_exists('conference_user_add') || permission_exists('conference_user_edit')) {
2013-01-05 01:17:37 +01:00
if ($action == "update") {
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-user_list']."</td>";
2013-01-05 01:17:37 +01:00
echo " <td class='vtable'>";
if (!empty($conference_users)) {
echo " <table width='50%'>\n";
2019-11-03 01:47:55 +01:00
foreach ($conference_users as $field) {
echo " <tr>\n";
echo " <td class='vtable'>".escape($field['username'])."</td>\n";
echo " <td>\n";
echo " <a href='conference_edit.php?id=".urlencode($conference_uuid)."&domain_uuid=".$_SESSION['domain_uuid']."&user_uuid=".urlencode($field['user_uuid'])."&a=delete' alt='delete' onclick=\"return confirm('".$text['confirm-delete-2']."')\">$v_link_label_delete</a>\n";
2019-11-03 01:47:55 +01:00
echo " </td>\n";
echo " </tr>\n";
}
echo " </table>\n";
echo " <br />\n";
2013-01-05 01:17:37 +01:00
}
2019-11-03 01:47:55 +01:00
echo " <select name=\"user_uuid\" class='formfld'>\n";
2013-01-05 01:17:37 +01:00
echo " <option value=\"\"></option>\n";
2019-11-03 01:47:55 +01:00
foreach ($users as $field) {
2018-06-13 08:23:41 +02:00
echo " <option value='".escape($field['user_uuid'])."'>".escape($field['username'])."</option>\n";
2013-01-05 01:17:37 +01:00
}
echo " </select>";
echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]);
2019-01-14 04:53:12 +01:00
2013-01-05 01:17:37 +01:00
echo " <br>\n";
echo " ".$text['description-user-add']."\n";
echo " <br />\n";
echo " </td>";
echo " </tr>";
}
}
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['table-profile']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='conference_profile'>\n";
2017-10-21 18:37:38 +02:00
foreach ($conference_profiles as $row) {
if ($conference_profile === $row['profile_name']) {
echo " <option value='".escape($row['profile_name'])."' selected='selected'>".escape($row['profile_name'])."</option>\n";
2017-10-21 18:37:38 +02:00
}
else {
echo " <option value='".escape($row['profile_name'])."'>".escape($row['profile_name'])."</option>\n";
2017-10-21 18:37:38 +02:00
}
}
echo " </select>\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-profile']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-flags']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_flags' maxlength='255' value=\"".escape($conference_flags)."\">\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-flags']."\n";
echo "</td>\n";
echo "</tr>\n";
2021-12-02 05:43:16 +01:00
if (permission_exists('conference_email_address')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-email_address']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_email_address' maxlength='255' value=\"".escape($conference_email_address)."\">\n";
echo "<br />\n";
echo "".$text['description-email_address']."\n";
echo "</td>\n";
echo "</tr>\n";
}
if (permission_exists('conference_account_code')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-account_code']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_account_code' maxlength='255' value=\"".escape($conference_account_code)."\">\n";
echo "<br />\n";
echo "".$text['description-account_code']."\n";
echo "</td>\n";
echo "</tr>\n";
}
2021-12-02 05:43:16 +01:00
2013-01-05 01:17:37 +01:00
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-order']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='conference_order' class='formfld'>\n";
2023-06-02 22:13:47 +02:00
if (!empty($dialplan_order) && strlen(htmlspecialchars($dialplan_order) ?? '') != 0) {
echo " <option selected='selected' value='".htmlspecialchars($dialplan_order)."'>".htmlspecialchars($dialplan_order)."</option>\n";
2013-01-05 01:17:37 +01:00
}
$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"; }
2013-01-05 01:17:37 +01:00
$i++;
}
echo " </select>\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-order']."\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('conference_context')) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-context']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_context' maxlength='255' value=\"".escape($conference_context)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-enter-context']."\n";
echo "</td>\n";
echo "</tr>\n";
}
2013-01-05 01:17:37 +01:00
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['table-enabled']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
echo " <label class='switch'>\n";
echo " <input type='checkbox' id='conference_enabled' name='conference_enabled' value='true' ".($conference_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
}
else {
echo " <select class='formfld' id='conference_enabled' name='conference_enabled'>\n";
echo " <option value='true' ".($conference_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($conference_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n";
}
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-conference-enable']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-description']."\n";
2013-01-05 01:17:37 +01:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_description' maxlength='255' value=\"".escape($conference_description)."\">\n";
2013-01-05 01:17:37 +01:00
echo "<br />\n";
echo "".$text['description-info']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>\n";
2015-02-15 12:57:14 +01:00
echo "<br><br>";
if ($action == "update") {
echo "<input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid ?? '')."'>\n";
echo "<input type='hidden' name='conference_uuid' value='".escape($conference_uuid)."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
2013-01-05 01:17:37 +01:00
echo "</form>";
//include the footer
require_once "resources/footer.php";
2016-10-14 16:32:15 +02:00
2020-02-15 00:55:39 +01:00
?>