diff --git a/app/conferences/app_config.php b/app/conferences/app_config.php
index f338c07c6c..ba49243b2c 100644
--- a/app/conferences/app_config.php
+++ b/app/conferences/app_config.php
@@ -63,10 +63,6 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
- $apps[$x]['permissions'][$y]['name'] = "conference_delete";
- $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
- $apps[$x]['permissions'][$y]['groups'][] = "admin";
- $y++;
$apps[$x]['permissions'][$y]['name'] = "conference_user_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";;
diff --git a/app/conferences/conference_edit.php b/app/conferences/conference_edit.php
index e3257bc41f..e02cfddd67 100644
--- a/app/conferences/conference_edit.php
+++ b/app/conferences/conference_edit.php
@@ -202,10 +202,11 @@
$array['dialplans'][0]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][0]['dialplan_order'] = '333';
$array['dialplans'][0]['dialplan_context'] = $_SESSION['context'];
- $array['dialplans'][0]['dialplan_enabled'] = 'true';
+ $array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
$array['dialplans'][0]['dialplan_description'] = $conference_description;
$p = new permissions;
+ $p->add('dialplan_add', 'temp');
$p->add('dialplan_edit', 'temp');
$database = new database;
@@ -215,6 +216,7 @@
$response = $database->message;
unset($array);
+ $p->delete('dialplan_add', 'temp');
$p->delete('dialplan_edit', 'temp');
//delete the dialplan details
@@ -302,9 +304,6 @@
//set the default
if ($conference_profile == "") { $conference_profile = "default"; }
-//set defaults
- if (strlen($conference_enabled) == 0) { $conference_enabled = "true"; }
-
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
@@ -378,20 +377,23 @@
echo "
".$text['label-user_list']." | ";
echo " ";
- echo " \n";
- foreach($conference_users as $field) {
- echo " \n";
- echo " | ".escape($field['username'])." | \n";
- echo " \n";
- echo " $v_link_label_delete\n";
- echo " | \n";
- echo " \n";
+ if (is_array($conference_users) && @sizeof($conference_users) != 0) {
+ echo " \n";
+ foreach ($conference_users as $field) {
+ echo " \n";
+ echo " | ".escape($field['username'])." | \n";
+ echo " \n";
+ echo " $v_link_label_delete\n";
+ echo " | \n";
+ echo " \n";
+ }
+ echo " \n";
+ echo " \n";
}
- echo " \n";
- echo " \n";
+
echo " ";
@@ -464,18 +466,9 @@
echo " | \n";
echo "\n";
echo " \n";
echo " \n";
echo "".$text['description-conference-enable']."\n";
diff --git a/app/conferences/conferences.php b/app/conferences/conferences.php
index 9685fff41b..ae3dae0370 100644
--- a/app/conferences/conferences.php
+++ b/app/conferences/conferences.php
@@ -17,167 +17,236 @@
The Initial Developer of the Original Code is
Mark J Crane
- Portions created by the Initial Developer are Copyright (C) 2008-2012
+ Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane
*/
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('conference_view')) {
- //access granted
-}
-else {
- echo "access denied";
- exit;
-}
+
+//includes
+ require_once "root.php";
+ require_once "resources/require.php";
+ require_once "resources/check_auth.php";
+ require_once "resources/paging.php";
+
+//check permissions
+ if (permission_exists('conference_view')) {
+ //access granted
+ }
+ else {
+ echo "access denied";
+ exit;
+ }
//add multi-lingual support
$language = new text;
$text = $language->get();
-//includes
- require_once "resources/header.php";
- require_once "resources/paging.php";
+//get posted data
+ if (is_array($_POST['conferences'])) {
+ $action = $_POST['action'];
+ $search = $_POST['search'];
+ $conferences = $_POST['conferences'];
+ }
+
+//copy the conferences
+ if (permission_exists('conference_add')) {
+ if ($action == 'copy' && is_array($conferences) && @sizeof($conferences) != 0) {
+ //copy
+ $obj = new conferences;
+ $obj->copy($conferences);
+ //redirect
+ header('Location: conferences.php'.($search != '' ? '?search='.urlencode($search) : null));
+ exit;
+ }
+ }
+
+//toggle the conferences
+ if (permission_exists('conference_edit')) {
+ if ($action == 'toggle' && is_array($conferences) && @sizeof($conferences) != 0) {
+ //toggle
+ $obj = new conferences;
+ $obj->toggle($conferences);
+ //redirect
+ header('Location: conferences.php'.($search != '' ? '?search='.urlencode($search) : null));
+ exit;
+ }
+ }
+
+//delete the conferences
+ if (permission_exists('conference_delete')) {
+ if ($action == 'delete' && is_array($conferences) && @sizeof($conferences) != 0) {
+ //delete
+ $obj = new conferences;
+ $obj->delete($conferences);
+ //redirect
+ header('Location: conferences.php'.($search != '' ? '?search='.urlencode($search) : null));
+ exit;
+ }
+ }
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
-//show the content
- echo "\n";
- echo " \n";
- echo $text['description'];
+
+//prepare to page the results
+ if (if_group("superadmin") || if_group("admin")) {
+ //show all extensions
+ $sql = "select count(*) from v_conferences ";
+ $sql .= "where domain_uuid = :domain_uuid ";
+ }
+ else {
+ //show only assigned extensions
+ $sql = "select count(*) from v_conferences as c, v_conference_users as u ";
+ $sql .= "where c.conference_uuid = u.conference_uuid ";
+ $sql .= "and c.domain_uuid = :domain_uuid ";
+ $sql .= "and u.user_uuid = :user_uuid ";
+ $parameters['user_uuid'] = $_SESSION['user_uuid'];
+ }
+ $sql .= $sql_search;
+ $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
+ $database = new database;
+ $num_rows = $database->select($sql, $parameters, 'column');
+
+//prepare to page the results
+ $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
+ $param = "&search=".$search;
+ $page = $_GET['page'];
+ if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
+ list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
+ list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
+ $offset = $rows_per_page * $page;
+
+//get the list
+ $sql = str_replace('count(*)', '*', $sql);
+ $sql .= order_by($order_by, $order);
+ $sql .= limit_offset($rows_per_page, $offset);
+ $database = new database;
+ $conferences = $database->select($sql, $parameters, 'all');
+ unset($sql, $parameters);
+
+//create token
+ $object = new token;
+ $token = $object->create($_SERVER['PHP_SELF']);
+
+//include the header
+ require_once "resources/header.php";
+
+//show the content
+ echo "\n";
+ echo " ".$text['title-conferences']." (".$num_rows.") \n";
+ echo " \n";
+ if (permission_exists('conference_add')) {
+ echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'conference_edit.php']);
+ }
+ if (permission_exists('conference_add') && $conferences) {
+ echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'onclick'=>"if (confirm('".$text['confirm-copy']."')) { list_action_set('copy'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
+ }
+ if (permission_exists('conference_edit') && $conferences) {
+ echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
+ }
+ if (permission_exists('conference_delete') && $conferences) {
+ echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
+ }
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo " \n";
+
+ echo $text['description']."\n";
echo "
\n";
- //prepare to page the results
- if (if_group("superadmin") || if_group("admin")) {
- //show all extensions
- $sql = "select count(*) from v_conferences ";
- $sql .= "where domain_uuid = :domain_uuid ";
- $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
- }
- else {
- //show only assigned extensions
- $sql = "select count(*) from v_conferences as c, v_conference_users as u ";
- $sql .= "where c.conference_uuid = u.conference_uuid ";
- $sql .= "and c.domain_uuid = :domain_uuid ";
- $sql .= "and u.user_uuid = :user_uuid ";
- $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
- $parameters['user_uuid'] = $_SESSION['user_uuid'];
- }
- $database = new database;
- $num_rows = $database->select($sql, $parameters, 'column');
- unset($sql);
+ echo "\n";
//include the footer
require_once "resources/footer.php";
-?>
+
+?>
\ No newline at end of file
|