mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Conference Centers - Rooms: List view updates, token integration, added bulk actions within class.
This commit is contained in:
@@ -61,6 +61,27 @@ $text['title_description-conference_centers']['ru-ru'] = "Конференс-ц
|
||||
$text['title_description-conference_centers']['sv-se'] = "Konferenscenter är en grupp med konferensrum. De kan sorteras på kostnadscenter, geografisk placering eller andra kriterier.";
|
||||
$text['title_description-conference_centers']['uk-ua'] = "Конференц-центри є група конференц-залів. Вони можуть бути організовані МВЗ, географічно або інших критеріїв.";
|
||||
|
||||
$text['title_description-conference_rooms']['en-us'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['ar-eg'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['de-at'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['de-ch'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['de-de'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['es-cl'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['es-mx'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['fr-ca'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['fr-fr'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['he-il'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['it-it'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['nl-nl'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['pl-pl'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['pt-br'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['pt-pt'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['ro-ro'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['ru-ru'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['sv-se'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
$text['title_description-conference_rooms']['uk-ua'] = "Conference Rooms are individual meeting places within a Conference Center.";
|
||||
|
||||
|
||||
$text['label-conference_center_name']['en-us'] = "Name";
|
||||
$text['label-conference_center_name']['ar-eg'] = "";
|
||||
$text['label-conference_center_name']['de-at'] = "Name"; //copied from de-de
|
||||
|
||||
@@ -43,6 +43,36 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the http post data
|
||||
if (is_array($_POST['conference_rooms'])) {
|
||||
$action = $_POST['action'];
|
||||
$toggle_field = $_POST['toggle_field'];
|
||||
$search = $_POST['search'];
|
||||
$conference_rooms = $_POST['conference_rooms'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($conference_rooms) && @sizeof($conference_rooms) != 0) {
|
||||
switch ($action) {
|
||||
case 'toggle':
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
$obj = new conference_centers;
|
||||
$obj->toggle_field = $toggle_field;
|
||||
$obj->toggle_conference_rooms($conference_rooms);
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (permission_exists('conference_room_delete')) {
|
||||
$obj = new conference_centers;
|
||||
$obj->delete_conference_rooms($conference_rooms);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: conference_rooms.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the meeting_uuid using the pin number
|
||||
$search = preg_replace('{\D}', '', $_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
@@ -59,6 +89,7 @@
|
||||
$meeting_uuid = $database->select($sql, $parameters, 'column');
|
||||
}
|
||||
|
||||
/*
|
||||
//if the $_GET array exists then process it
|
||||
if (count($_GET) > 0 && strlen($_GET["search"]) == 0) {
|
||||
//get http GET variables and set them as php variables
|
||||
@@ -114,6 +145,7 @@
|
||||
$message = $database->message;
|
||||
unset($array);
|
||||
}
|
||||
*/
|
||||
|
||||
//get conference array
|
||||
$switch_cmd = "conference xml_list";
|
||||
@@ -152,99 +184,137 @@
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//get the conference room count
|
||||
$conference_center = new conference_centers;
|
||||
$conference_center->db = $db;
|
||||
$conference_center->domain_uuid = $_SESSION['domain_uuid'];
|
||||
if (strlen($meeting_uuid) > 0) {
|
||||
$conference_center->meeting_uuid = $meeting_uuid;
|
||||
}
|
||||
if (strlen($search) > 0) {
|
||||
$conference_center->search = $search;
|
||||
}
|
||||
$num_rows = $conference_center->room_count();
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = $search ? "&search=".$search : null;
|
||||
if (isset($_GET['page'])) {
|
||||
$page = is_numeric($_GET['page']) ? $_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 conference rooms
|
||||
$conference_center->rows_per_page = $rows_per_page;
|
||||
$conference_center->offset = $offset;
|
||||
$conference_center->order_by = $order_by;
|
||||
$conference_center->order = $order;
|
||||
if (strlen($meeting_uuid) > 0) {
|
||||
$conference_center->meeting_uuid = $meeting_uuid;
|
||||
}
|
||||
if (strlen($search) > 0) {
|
||||
$conference_center->search = $search;
|
||||
}
|
||||
$result = $conference_center->rooms();
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//include header
|
||||
$document['title'] = $text['title-conference_rooms'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//javascript for toggle select box
|
||||
echo "<script language='javascript' type='text/javascript'>\n";
|
||||
echo " function toggle_select() {\n";
|
||||
echo " $('#conference_room_feature').fadeToggle(400, function() {\n";
|
||||
echo " document.getElementById('conference_room_feature').selectedIndex = 0;\n";
|
||||
echo " document.getElementById('conference_room_feature').focus();\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
|
||||
//show the content
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td width='50%' align='left' valign='top' nowrap='nowrap'><b>".$text['title-conference_rooms']."</b></td>\n";
|
||||
echo " <td width='50%' align='right' valign='top'>\n";
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' value='".escape($search)."'>";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
|
||||
echo " </td>\n";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-conference_rooms']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'style'=>'margin-right: 15px;','link'=>'conference_centers.php']);
|
||||
if (permission_exists('conference_room_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'conference_room_edit.php']);
|
||||
}
|
||||
if (permission_exists('conference_room_edit') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"toggle_select(); this.blur();"]);
|
||||
echo "<select class='formfld' style='display: none; width: auto;' id='conference_room_feature' onchange=\"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); document.getElementById('toggle_field').value = this.options[this.selectedIndex].value; list_form_submit('form_list'); } else { this.blur(); this.style.display = 'none'; return false; }\">";
|
||||
echo " <option value='' selected='selected'>".$text['label-select']."</option>";
|
||||
echo " <option value='record'>".$text['label-record']."</option>";
|
||||
echo " <option value='wait_mod'>".$text['label-wait_moderator']."</option>";
|
||||
echo " <option value='announce'>".$text['label-announce']."</option>";
|
||||
echo " <option value='mute'>".$text['label-mute']."</option>";
|
||||
echo " <option value='sounds'>".$text['label-sounds']."</option>";
|
||||
echo " <option value='enabled'>".$text['label-enabled']."</option>";
|
||||
echo " </select>";
|
||||
}
|
||||
if (permission_exists('conference_room_delete') && $result) {
|
||||
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 "<form id='form_search' class='inline' method='get'>\n";
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
}
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br /><br>\n";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
//get the conference room count
|
||||
$conference_center = new conference_centers;
|
||||
$conference_center->db = $db;
|
||||
$conference_center->domain_uuid = $_SESSION['domain_uuid'];
|
||||
if (strlen($meeting_uuid) > 0) {
|
||||
$conference_center->meeting_uuid = $meeting_uuid;
|
||||
}
|
||||
if (strlen($search) > 0) {
|
||||
$conference_center->search = $search;
|
||||
}
|
||||
$row_count = $conference_center->room_count();
|
||||
echo $text['title_description-conference_rooms']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = '';
|
||||
if (isset($_GET['page'])) {
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($row_count, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
}
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' id='toggle_field' name='toggle_field' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
//get the conference rooms
|
||||
$conference_center->rows_per_page = $rows_per_page;
|
||||
$conference_center->offset = $offset;
|
||||
$conference_center->order_by = $order_by;
|
||||
$conference_center->order = $order;
|
||||
if (strlen($meeting_uuid) > 0) {
|
||||
$conference_center->meeting_uuid = $meeting_uuid;
|
||||
}
|
||||
if (strlen($search) > 0) {
|
||||
$conference_center->search = $search;
|
||||
}
|
||||
$result = $conference_center->rooms();
|
||||
|
||||
//prepare to alternate the row styles
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//table header
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
//echo th_order_by('conference_center_uuid', 'Conference UUID', $order_by, $order);
|
||||
//echo th_order_by('meeting_uuid', 'Meeting UUID', $order_by, $order);
|
||||
echo "<th nowrap='nowrap'>".$text['label-name']."</th>\n";
|
||||
echo "<th nowrap='nowrap'>".$text['label-moderator-pin']."</th>\n";
|
||||
echo "<th nowrap='nowrap'>".$text['label-participant-pin']."</th>\n";
|
||||
//echo th_order_by('profile', $text['label-profile'], $order_by, $order);
|
||||
echo th_order_by('record', $text['label-record'], $order_by, $order);
|
||||
//echo th_order_by('max_members', 'Max', $order_by, $order);
|
||||
echo th_order_by('wait_mod', $text['label-wait_moderator'], $order_by, $order);
|
||||
echo th_order_by('announce', $text['label-announce'], $order_by, $order);
|
||||
//echo th_order_by('enter_sound', 'Enter Sound', $order_by, $order);
|
||||
echo th_order_by('mute', $text['label-mute'], $order_by, $order);
|
||||
echo th_order_by('sounds', $text['label-sounds'], $order_by, $order);
|
||||
echo "<th>".$text['label-members']."</th>\n";
|
||||
echo "<th>".$text['label-tools']."</th>\n";
|
||||
if (permission_exists('conference_room_enabled')) {
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order);
|
||||
}
|
||||
echo th_order_by('description', $text['label-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42' nowrap='nowrap'>\n";
|
||||
if (permission_exists('conference_room_add')) {
|
||||
echo " <a href='conference_room_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('conference_room_add') || permission_exists('conference_room_edit') || permission_exists('conference_room_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
//echo th_order_by('conference_center_uuid', 'Conference UUID', $order_by, $order);
|
||||
//echo th_order_by('meeting_uuid', 'Meeting UUID', $order_by, $order);
|
||||
echo "<th>".$text['label-name']."</th>\n";
|
||||
echo "<th>".$text['label-moderator-pin']."</th>\n";
|
||||
echo "<th>".$text['label-participant-pin']."</th>\n";
|
||||
//echo th_order_by('profile', $text['label-profile'], $order_by, $order);
|
||||
echo th_order_by('record', $text['label-record'], $order_by, $order, null, "class='center'");
|
||||
//echo th_order_by('max_members', 'Max', $order_by, $order);
|
||||
echo th_order_by('wait_mod', $text['label-wait_moderator'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('announce', $text['label-announce'], $order_by, $order, null, "class='center'");
|
||||
//echo th_order_by('enter_sound', 'Enter Sound', $order_by, $order);
|
||||
echo th_order_by('mute', $text['label-mute'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('sounds', $text['label-sounds'], $order_by, $order, null, "class='center'");
|
||||
echo "<th class='center'>".$text['label-members']."</th>\n";
|
||||
echo "<th>".$text['label-tools']."</th>\n";
|
||||
if (permission_exists('conference_room_enabled')) {
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
}
|
||||
echo th_order_by('description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
if (permission_exists('conference_room_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
//show the data
|
||||
if (is_array($result) > 0) {
|
||||
foreach($result as $row) {
|
||||
$x = 0;
|
||||
foreach ($result as $row) {
|
||||
$meeting_uuid = $row['meeting_uuid'];
|
||||
$conference_room_name = $row['conference_room_name'];
|
||||
$moderator_pin = $row['moderator_pin'];
|
||||
@@ -256,127 +326,165 @@
|
||||
$participant_pin = substr($participant_pin, 0, 3) ."-". substr($participant_pin, 3, 3) ."-". substr($participant_pin, -3)."\n";
|
||||
}
|
||||
|
||||
$tr_link = (permission_exists('conference_room_edit')) ? "href='conference_room_edit.php?id=".escape($row['conference_room_uuid'])."'" : null;
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>".(($conference_room_name != '') ? "<a ".$tr_link.">".escape($conference_room_name)."</a>" : " ")."</td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>".$moderator_pin."</td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>".$participant_pin."</td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['conference_center_uuid'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['meeting_uuid'])." </td>\n";
|
||||
//echo " <td valign='middle' class='".$row_style[$c]."'>".escape($row['profile'])." </td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['record'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&record=false&meeting_uuid=".escape($meeting_uuid)."\">".$text['label-true']."</a>";
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
$list_row_url = "conference_room_edit.php?id=".urlencode($row['conference_room_uuid']);
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&record=true&meeting_uuid=".escape($meeting_uuid)."\">".$text['label-false']."</a>";
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('conference_room_add') || permission_exists('conference_room_edit') || permission_exists('conference_room_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='conference_rooms[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='conference_rooms[$x][uuid]' value='".escape($row['conference_room_uuid'])."' />\n";
|
||||
echo " <input type='hidden' name='conference_rooms[$x][meeting_uuid]' value='".escape($meeting_uuid)."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
//echo " <td valign='middle' class='".$row_style[$c]."'>".$row['max_members']." </td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['wait_mod'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&wait_mod=false\">".$text['label-true']."</a>";
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&wait_mod=true\">".$text['label-false']."</a>";
|
||||
}
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['announce'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&announce=false\">".$text['label-true']."</a>";
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&announce=true\">".$text['label-false']."</a>";
|
||||
}
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
echo " <td><a href='".$list_row_url."'>".escape($conference_room_name)."</a> </td>\n";
|
||||
echo " <td>".$moderator_pin."</td>\n";
|
||||
echo " <td>".$participant_pin."</td>\n";
|
||||
//echo " <td>".escape($row['conference_center_uuid'])." </td>\n";
|
||||
//echo " <td>".escape($row['meeting_uuid'])." </td>\n";
|
||||
//echo " <td>".escape($row['profile'])." </td>\n";
|
||||
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['mute'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&mute=false\">".$text['label-true']."</a> ";
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['record'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'record'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&mute=true\">".$text['label-false']."</a> ";
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['record'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['record'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".urlencode($row['conference_room_uuid'])."&record=false&meeting_uuid=".urlencode($meeting_uuid)."'>".$text['label-true']."</a>";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".urlencode($row['conference_room_uuid'])."&record=true&meeting_uuid=".urlencode($meeting_uuid)."'>".$text['label-false']."</a>";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
//echo " <td>".$row['max_members']." </td>\n";
|
||||
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['sounds'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&sounds=false\">".$text['label-true']."</a>";
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['wait_mod'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'wait_mod'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&sounds=true\">".$text['label-false']."</a>";
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['wait_mod'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['wait_mod'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&wait_mod=false'>".$text['label-true']."</a>";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&wait_mod=true'>".$text['label-false']."</a>";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['announce'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'announce'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['announce'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['announce'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&announce=false'>".$text['label-true']."</a>";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&announce=true'>".$text['label-false']."</a>";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['mute'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'mute'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['mute'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['mute'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&mute=false'>".$text['label-true']."</a> ";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&mute=true'>".$text['label-false']."</a> ";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['sounds'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'sounds'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['sounds'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['sounds'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&sounds=false'>".$text['label-true']."</a>";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".escape($row['conference_room_uuid'])."&sounds=true'>".$text['label-false']."</a>";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
|
||||
if (strlen($conference[$meeting_uuid]["session_uuid"])) {
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>".escape($conference[$meeting_uuid]["member_count"])." </td>\n";
|
||||
echo " <td class='center'>".escape($conference[$meeting_uuid]["member_count"])." </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>0</td>\n";
|
||||
echo " <td class='center'>0</td>\n";
|
||||
}
|
||||
echo " <td valign='middle' class='".$row_style[$c]."' nowrap='nowrap'>\n";
|
||||
echo " <a href='".PROJECT_PATH."/app/conferences_active/conference_interactive.php?c=".escape($row['meeting_uuid'])."'>".$text['label-view']."</a> \n";
|
||||
echo " <a href='conference_sessions.php?id=".escape($row['meeting_uuid'])."'>".$text['label-sessions']."</a>\n";
|
||||
echo " <td class='no-wrap'>\n";
|
||||
echo " <a href='".PROJECT_PATH."/app/conferences_active/conference_interactive.php?c=".urlencode($row['meeting_uuid'])."'>".$text['label-view']."</a> \n";
|
||||
echo " <a href='conference_sessions.php?id=".urlencode($row['meeting_uuid'])."'>".$text['label-sessions']."</a>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
if (permission_exists('conference_room_enabled')) {
|
||||
echo " <td valign='middle' class='".$row_style[$c]."'>";
|
||||
if ($row['enabled'] == "true") {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&enabled=false\">".$text['label-true']."</a>";
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['enabled'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'enabled'; list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <a href=\"?conference_room_uuid=".escape($row['conference_room_uuid'])."&enabled=true\">".$text['label-false']."</a>";
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.($row['enabled'] == "true" ? 'true' : 'false')];
|
||||
}
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
// echo " <td>";
|
||||
// if ($row['enabled'] == "true") {
|
||||
// echo "<a href='?conference_room_uuid=".urlencode($row['conference_room_uuid'])."&enabled=false'>".$text['label-true']."</a>";
|
||||
// }
|
||||
// else {
|
||||
// echo "<a href='?conference_room_uuid=".urlencode($row['conference_room_uuid'])."&enabled=true'>".$text['label-false']."</a>";
|
||||
// }
|
||||
// echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['description'])."</td>\n";
|
||||
if (permission_exists('conference_room_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td valign='middle' class='row_stylebg'>";
|
||||
echo " ".escape($row['description'])."\n";
|
||||
echo " \n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_room_edit')) {
|
||||
echo "<a href='conference_room_edit.php?id=".escape($row['conference_room_uuid'])."' alt='".$text['label-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('conference_room_delete')) {
|
||||
echo "<a href='conference_room_delete.php?id=".escape($row['conference_room_uuid'])."' alt='".$text['label-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
//show paging
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='13' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_room_add')) {
|
||||
echo "<a href='conference_room_edit.php' alt='add'>$v_link_label_add</a>";
|
||||
$x++;
|
||||
}
|
||||
unset($result);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
//close the tables
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -30,19 +30,33 @@ if (!class_exists('conference_centers')) {
|
||||
class conference_centers {
|
||||
|
||||
/**
|
||||
* define the variables
|
||||
*/
|
||||
* declare public variables
|
||||
*/
|
||||
public $domain_uuid;
|
||||
public $meeting_uuid;
|
||||
public $order_by;
|
||||
public $order;
|
||||
public $rows_per_page;
|
||||
public $offset;
|
||||
private $fields;
|
||||
public $search;
|
||||
public $count;
|
||||
public $created_by;
|
||||
|
||||
public $toggle_field;
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
private $fields;
|
||||
|
||||
private $app_name;
|
||||
private $app_uuid;
|
||||
private $permission_prefix;
|
||||
private $list_page;
|
||||
private $table;
|
||||
private $uuid_prefix;
|
||||
private $toggle_values;
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
@@ -63,10 +77,8 @@ if (!class_exists('conference_centers')) {
|
||||
public function __construct() {
|
||||
|
||||
//assign private variables
|
||||
/*
|
||||
$this->app_name = 'conference_centers';
|
||||
$this->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e';
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -391,6 +403,74 @@ if (!class_exists('conference_centers')) {
|
||||
}
|
||||
*/
|
||||
|
||||
public function delete_conference_rooms($records) {
|
||||
|
||||
//assign private variables
|
||||
$this->permission_prefix = 'conference_room_';
|
||||
$this->list_page = 'conference_rooms.php';
|
||||
$this->table = 'conference_rooms';
|
||||
$this->uuid_prefix = 'conference_room_';
|
||||
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//delete multiple records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//build the delete array
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
|
||||
//create array
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
if (is_uuid($record['meeting_uuid'])) {
|
||||
$array['meeting_users'][$x]['meeting_uuid'] = $record['meeting_uuid'];
|
||||
$array['meeting_users'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['meetings'][$x]['meeting_uuid'] = $record['meeting_uuid'];
|
||||
$array['meetings'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('meeting_user_delete', 'temp');
|
||||
$p->add('meeting_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
$p->delete('meeting_user_delete', 'temp');
|
||||
$p->delete('meeting_delete', 'temp');
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete']);
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle records
|
||||
*/
|
||||
@@ -492,6 +572,114 @@ if (!class_exists('conference_centers')) {
|
||||
}
|
||||
*/
|
||||
|
||||
public function toggle_conference_rooms($records) {
|
||||
|
||||
//assign private variables
|
||||
$this->permission_prefix = 'conference_room_';
|
||||
$this->list_page = 'conference_rooms.php';
|
||||
$this->table = 'conference_rooms';
|
||||
$this->uuid_prefix = 'conference_room_';
|
||||
$this->toggle_values = ['true','false'];
|
||||
|
||||
if (permission_exists($this->permission_prefix.'edit')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//toggle the checked records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//validate submitted toggle field
|
||||
if (!in_array($this->toggle_field, ['record','wait_mod','announce','mute','sounds','enabled'])) {
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//get current toggle state
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$uuids[$x] = "'".$record['uuid']."'";
|
||||
if (($this->toggle_field == 'record' || $this->toggle_field == 'enabled') && is_uuid($record['meeting_uuid'])) {
|
||||
$meeting_uuid[$record['uuid']] = $record['meeting_uuid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_array($uuids) && @sizeof($uuids) != 0) {
|
||||
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
|
||||
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $row) {
|
||||
$states[$row['uuid']] = $row['toggle'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
}
|
||||
|
||||
//build update array
|
||||
$x = 0;
|
||||
foreach ($states as $uuid => $state) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
|
||||
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||
if ($this->toggle_field == 'enabled' && is_uuid($meeting_uuid[$uuid])) {
|
||||
$array['meetings'][$x]['meeting_uuid'] = $meeting_uuid[$uuid];
|
||||
$array['meetings'][$x]['enabled'] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||
}
|
||||
/*
|
||||
//if toggling to true, start recording
|
||||
if ($this->toggle_field == 'record' && is_uuid($meeting_uuid[$uuid]) && $state == $this->toggle_values[1]) {
|
||||
//prepare the values and commands
|
||||
$default_language = 'en';
|
||||
$default_dialect = 'us';
|
||||
$default_voice = 'callie';
|
||||
// $recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
||||
// $switch_cmd_record = "conference ".$meeting_uuid[$uuid]."@".$_SESSION['domain_name']." record ".$recording_dir.'/'.$meeting_uuid[$uuid].'.wav';
|
||||
$switch_cmd_notice = "conference ".$meeting_uuid[$uuid]."@".$_SESSION['domain_name']." play ".$_SESSION['switch']['sounds']['dir']."/".$default_language."/".$default_dialect."/".$default_voice."/ivr/ivr-recording_started.wav";
|
||||
//execute api commands
|
||||
// if (!file_exists($recording_dir.'/'.$meeting_uuid[$uuid].'.wav')) {
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if ($fp) {
|
||||
// $switch_result = event_socket_request($fp, 'api '.$switch_cmd_record);
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd_notice);
|
||||
}
|
||||
// }
|
||||
}
|
||||
*/
|
||||
$x++;
|
||||
}
|
||||
|
||||
//save the changes
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//save the array
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
message::add($text['message-toggle']);
|
||||
|
||||
}
|
||||
unset($records, $states, $state);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy records
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user