Conference Controls - Details: List view, token, and button updates.
This commit is contained in:
parent
a14418969b
commit
5d3e057371
|
|
@ -135,21 +135,24 @@
|
||||||
require_once "resources/header.php";
|
require_once "resources/header.php";
|
||||||
|
|
||||||
//show the content
|
//show the content
|
||||||
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
echo "<form name='frm' id='frm' method='post'>\n";
|
||||||
|
|
||||||
|
echo "<div class='action_bar' id='action_bar'>\n";
|
||||||
|
echo " <div class='heading'><b>".$text['title-conference_control_detail']."</b></div>\n";
|
||||||
|
echo " <div class='actions'>\n";
|
||||||
|
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'conference_control_edit.php?id='.urlencode($conference_control_uuid)]);
|
||||||
|
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>'hide-xs','name'=>'action','value'=>'save']);
|
||||||
|
echo " </div>\n";
|
||||||
|
echo " <div style='clear: both;'></div>\n";
|
||||||
|
echo "</div>\n";
|
||||||
|
|
||||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['title-conference_control_detail']."</b><br><br></td>\n";
|
|
||||||
echo "<td width='70%' align='right' valign='top'>\n";
|
|
||||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_control_edit.php?id=".escape($conference_control_uuid)."'\" value='".$text['button-back']."'>";
|
|
||||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||||
echo " ".$text['label-control_digits']."\n";
|
echo " ".$text['label-control_digits']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||||
echo " <input class='formfld' type='text' name='control_digits' maxlength='255' value='".escape($control_digits)."'>\n";
|
echo " <input class='formfld' type='text' name='control_digits' maxlength='255' value='".escape($control_digits)."'>\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-control_digits']."\n";
|
echo $text['description-control_digits']."\n";
|
||||||
|
|
@ -172,7 +175,7 @@
|
||||||
echo " ".$text['label-control_data']."\n";
|
echo " ".$text['label-control_data']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td class='vtable' align='left'>\n";
|
||||||
echo " <input class='formfld' type='text' name='control_data' maxlength='255' value=\"".escape($control_data)."\">\n";
|
echo " <input class='formfld' type='text' name='control_data' maxlength='255' style='min-width: 50%;' value=\"".escape($control_data)."\">\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-control_data']."\n";
|
echo $text['description-control_data']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
|
|
@ -184,37 +187,24 @@
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td class='vtable' align='left'>\n";
|
||||||
echo " <select class='formfld' name='control_enabled'>\n";
|
echo " <select class='formfld' name='control_enabled'>\n";
|
||||||
echo " <option value=''></option>\n";
|
|
||||||
if ($control_enabled == "true") {
|
|
||||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||||
}
|
echo " <option value='false' ".($control_enabled == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
|
||||||
if ($control_enabled == "false") {
|
|
||||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
|
||||||
}
|
|
||||||
echo " </select>\n";
|
echo " </select>\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-control_enabled']."\n";
|
echo $text['description-control_enabled']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
echo " <tr>\n";
|
|
||||||
echo " <td colspan='2' align='right'>\n";
|
echo "</table>";
|
||||||
|
echo "<br /><br />";
|
||||||
|
|
||||||
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid)."'>\n";
|
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid)."'>\n";
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
echo "<input type='hidden' name='conference_control_detail_uuid' value='".escape($conference_control_detail_uuid)."'>\n";
|
echo "<input type='hidden' name='conference_control_detail_uuid' value='".escape($conference_control_detail_uuid)."'>\n";
|
||||||
}
|
}
|
||||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
||||||
echo " </td>\n";
|
|
||||||
echo " </tr>";
|
|
||||||
echo "</table>";
|
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
echo "<br /><br />";
|
|
||||||
|
|
||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,10 @@
|
||||||
//includes
|
//includes
|
||||||
require_once "root.php";
|
require_once "root.php";
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
|
require_once "resources/check_auth.php";
|
||||||
|
require_once "resources/paging.php";
|
||||||
|
|
||||||
//check permissions
|
//check permissions
|
||||||
require_once "resources/check_auth.php";
|
|
||||||
if (permission_exists('conference_control_detail_view')) {
|
if (permission_exists('conference_control_detail_view')) {
|
||||||
//access granted
|
//access granted
|
||||||
}
|
}
|
||||||
|
|
@ -42,6 +43,36 @@
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
|
//get the http post data
|
||||||
|
if (is_array($_POST['conference_control_details'])) {
|
||||||
|
$action = $_POST['action'];
|
||||||
|
$conference_control_uuid = $_POST['conference_control_uuid'];
|
||||||
|
$conference_control_details = $_POST['conference_control_details'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//process the http post data by action
|
||||||
|
if ($action != '' && is_array($conference_control_details) && @sizeof($conference_control_details) != 0) {
|
||||||
|
switch ($action) {
|
||||||
|
case 'toggle':
|
||||||
|
if (permission_exists('conference_control_detail_edit')) {
|
||||||
|
$obj = new conference_controls;
|
||||||
|
$obj->conference_control_uuid = $conference_control_uuid;
|
||||||
|
$obj->toggle_details($conference_control_details);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
if (permission_exists('conference_control_detail_delete')) {
|
||||||
|
$obj = new conference_controls;
|
||||||
|
$obj->conference_control_uuid = $conference_control_uuid;
|
||||||
|
$obj->delete_details($conference_control_details);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Location: conference_control_edit.php?id='.urlencode($conference_control_uuid));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//get variables used to control the order
|
//get variables used to control the order
|
||||||
$order_by = $_GET["order_by"];
|
$order_by = $_GET["order_by"];
|
||||||
$order = $_GET["order"];
|
$order = $_GET["order"];
|
||||||
|
|
@ -57,119 +88,139 @@
|
||||||
$sql_search .= ")";
|
$sql_search .= ")";
|
||||||
$parameters['search'] = '%'.$search.'%';
|
$parameters['search'] = '%'.$search.'%';
|
||||||
}
|
}
|
||||||
//additional includes
|
|
||||||
require_once "resources/header.php";
|
|
||||||
require_once "resources/paging.php";
|
|
||||||
|
|
||||||
//prepare to page the results
|
//prepare to page the results
|
||||||
$sql = "select count(*) ";
|
$sql = "select count(conference_control_detail_uuid) ";
|
||||||
$sql .= "from v_conference_control_details ";
|
$sql .= "from v_conference_control_details ";
|
||||||
$sql .= "where conference_control_uuid = :conference_control_uuid ";
|
$sql .= "where conference_control_uuid = :conference_control_uuid ";
|
||||||
//$sql .= "and domain_uuid = :domain_uuid ";
|
|
||||||
$sql .= $sql_search;
|
$sql .= $sql_search;
|
||||||
$parameters['conference_control_uuid'] = $conference_control_uuid;
|
$parameters['conference_control_uuid'] = $conference_control_uuid;
|
||||||
//$parameters['domain_uuid'] = $domain_uuid;
|
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$num_rows = $database->select($sql, $parameters, 'column');
|
$num_rows = $database->select($sql, $parameters, 'column');
|
||||||
|
|
||||||
//prepare to page the results
|
//prepare to page the results
|
||||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||||
$param = "";
|
$param = "&id=".$conference_control_uuid;
|
||||||
if (isset($_GET['page'])) {
|
if (isset($_GET['page'])) {
|
||||||
$page = $_GET['page'];
|
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
||||||
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, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
|
||||||
$offset = $rows_per_page * $page;
|
$offset = $rows_per_page * $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the list
|
//get the list
|
||||||
$sql = "select * from v_conference_control_details ";
|
$sql = str_replace('count(conference_control_detail_uuid)', '*', $sql);
|
||||||
$sql .= "where conference_control_uuid = :conference_control_uuid ";
|
|
||||||
//$sql .= "and domain_uuid = :domain_uuid ";
|
|
||||||
$sql .= $sql_search;
|
$sql .= $sql_search;
|
||||||
$sql .= order_by($order_by, $order);
|
$sql .= order_by($order_by, $order, 'control_digits', 'asc');
|
||||||
$sql .= limit_offset($rows_per_page, $offset);
|
$sql .= limit_offset($rows_per_page, $offset);
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$result = $database->select($sql, $parameters, 'all');
|
$result = $database->select($sql, $parameters, 'all');
|
||||||
|
unset($sql, $parameters);
|
||||||
|
|
||||||
//alternate the row style
|
//create token
|
||||||
$c = 0;
|
$object = new token;
|
||||||
$row_style["0"] = "row_style0";
|
$token = $object->create('/app/conference_controls/conference_control_details.php');
|
||||||
$row_style["1"] = "row_style1";
|
|
||||||
|
|
||||||
//show the content
|
//show the content
|
||||||
echo "<table width='100%' border='0'>\n";
|
echo "<div class='action_bar' id='action_bar_sub'>\n";
|
||||||
echo " <tr>\n";
|
echo " <div class='heading'><b id='heading_sub'>".$text['title-conference_control_details']."</b></div>\n";
|
||||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference_control_details']."</b></td>\n";
|
echo " <div class='actions'>\n";
|
||||||
//echo " <form method='get' action=''>\n";
|
echo button::create(['type'=>'button','id'=>'action_bar_sub_button_back','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'collapse'=>'hide-xs','style'=>'margin-right: 15px; display: none;','link'=>'conference_controls.php']);
|
||||||
//echo " <td width='50%' style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
|
||||||
//echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".escape($search)."'>\n";
|
|
||||||
//echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
|
|
||||||
//echo " </td>\n";
|
|
||||||
//echo " </form>\n";
|
|
||||||
echo " </tr>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
|
|
||||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo th_order_by('control_digits', $text['label-control_digits'], $order_by, $order);
|
|
||||||
echo th_order_by('control_action', $text['label-control_action'], $order_by, $order);
|
|
||||||
echo th_order_by('control_data', $text['label-control_data'], $order_by, $order);
|
|
||||||
echo th_order_by('control_enabled', $text['label-control_enabled'], $order_by, $order);
|
|
||||||
echo "<td class='list_control_icons'>";
|
|
||||||
if (permission_exists('conference_control_detail_add')) {
|
if (permission_exists('conference_control_detail_add')) {
|
||||||
echo "<a href='conference_control_detail_edit.php?conference_control_uuid=".escape($_GET['id'])."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'collapse'=>'hide-xs','link'=>'conference_control_detail_edit.php?conference_control_uuid='.urlencode($_GET['id'])]);
|
||||||
}
|
}
|
||||||
else {
|
if (permission_exists('conference_control_detail_edit') && $result) {
|
||||||
echo " \n";
|
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'collapse'=>'hide-xs','onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||||
}
|
}
|
||||||
echo "</td>\n";
|
if (permission_exists('conference_control_detail_delete') && $result) {
|
||||||
echo "<tr>\n";
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'collapse'=>'hide-xs','onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||||
|
}
|
||||||
|
echo "</div>\n";
|
||||||
|
echo " <div style='clear: both;'></div>\n";
|
||||||
|
echo "</div>\n";
|
||||||
|
|
||||||
if (is_array($result) && sizeof($result) != 0) {
|
echo "<form id='form_list' method='post' action='conference_control_details.php'>\n";
|
||||||
|
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||||
|
echo "<input type='hidden' name='conference_control_uuid' value=\"".escape($conference_control_uuid)."\">\n";
|
||||||
|
|
||||||
|
echo "<table class='list'>\n";
|
||||||
|
echo "<tr class='list-header'>\n";
|
||||||
|
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('control_digits', $text['label-control_digits'], $order_by, $order, null, "class='pct-5 center'", $param);
|
||||||
|
echo th_order_by('control_action', $text['label-control_action'], $order_by, $order, null, null, $param);
|
||||||
|
echo th_order_by('control_data', $text['label-control_data'], $order_by, $order, null, "class='pct-50 hide-xs'", $param);
|
||||||
|
echo th_order_by('control_enabled', $text['label-control_enabled'], $order_by, $order, null, "class='center'", $param);
|
||||||
|
if (permission_exists('conference_control_detail_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||||
|
echo " <td class='action-button'> </td>\n";
|
||||||
|
}
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
if (is_array($result) && @sizeof($result) != 0) {
|
||||||
|
$x = 0;
|
||||||
foreach($result as $row) {
|
foreach($result as $row) {
|
||||||
if (permission_exists('conference_control_detail_edit')) {
|
if (permission_exists('conference_control_detail_edit')) {
|
||||||
$tr_link = "href='conference_control_detail_edit.php?conference_control_uuid=".escape($row['conference_control_uuid'])."&id=".escape($row['conference_control_detail_uuid'])."'";
|
$list_row_url = 'conference_control_detail_edit.php?conference_control_uuid='.urlencode($row['conference_control_uuid']).'&id='.urlencode($row['conference_control_detail_uuid']);
|
||||||
}
|
|
||||||
echo "<tr ".$tr_link.">\n";
|
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['control_digits'])." </td>\n";
|
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['control_action'])." </td>\n";
|
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['control_data'])." </td>\n";
|
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['control_enabled'])." </td>\n";
|
|
||||||
echo " <td class='list_control_icons'>";
|
|
||||||
if (permission_exists('conference_control_detail_edit')) {
|
|
||||||
echo "<a href='conference_control_detail_edit.php?conference_control_uuid=".escape($row['conference_control_uuid'])."&id=".escape($row['conference_control_detail_uuid'])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
|
||||||
}
|
|
||||||
if (permission_exists('conference_control_detail_delete')) {
|
|
||||||
echo "<a href='conference_control_detail_delete.php?conference_control_uuid=".escape($row['conference_control_uuid'])."&id=".escape($row['conference_control_detail_uuid'])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
|
||||||
}
|
}
|
||||||
|
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||||
|
if (permission_exists('conference_control_detail_edit') || permission_exists('conference_control_detail_delete')) {
|
||||||
|
echo " <td class='checkbox'>\n";
|
||||||
|
echo " <input type='checkbox' name='conference_control_details[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||||
|
echo " <input type='hidden' name='conference_control_details[$x][uuid]' value='".escape($row['conference_control_detail_uuid'])."' />\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo "</tr>\n";
|
}
|
||||||
if ($c==0) { $c=1; } else { $c=0; }
|
echo " <td class='center'>".escape($row['control_digits'])." </td>\n";
|
||||||
} //end foreach
|
echo " <td>\n";
|
||||||
unset($result);
|
if (permission_exists('conference_control_detail_edit')) {
|
||||||
} //end if results
|
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['control_action'])."</a>\n";
|
||||||
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td colspan='5' align='left'>\n";
|
|
||||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
|
||||||
echo " <tr>\n";
|
|
||||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
|
||||||
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
|
||||||
echo " <td class='list_control_icons'>";
|
|
||||||
if (permission_exists('conference_control_detail_add')) {
|
|
||||||
echo "<a href='conference_control_detail_edit.php?conference_control_uuid=".escape($_GET['id'])."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " ";
|
echo " ".escape($row['control_action']);
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " </tr>\n";
|
echo " <td class='overflow hide-xs'>".escape($row['control_data'])." </td>\n";
|
||||||
echo " </table>\n";
|
if (permission_exists('conference_control_detail_edit')) {
|
||||||
|
echo " <td class='no-link center'>\n";
|
||||||
|
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['control_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo " <td class='center'>\n";
|
||||||
|
echo $text['label-'.$row['control_enabled']];
|
||||||
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
|
if (permission_exists('conference_control_detail_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 "</tr>\n";
|
echo "</tr>\n";
|
||||||
echo "</table>";
|
$x++;
|
||||||
echo "<br /><br />";
|
}
|
||||||
|
unset($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
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";
|
||||||
|
|
||||||
|
//make sub action bar sticky
|
||||||
|
echo "<script>\n";
|
||||||
|
echo " window.addEventListener('scroll', function(){\n";
|
||||||
|
echo " action_bar_scroll('action_bar_sub', 255, heading_modify, heading_restore);\n";
|
||||||
|
echo " }, false);\n";
|
||||||
|
|
||||||
|
echo " function heading_modify() {\n";
|
||||||
|
echo " document.getElementById('heading_sub').innerHTML = \"".$text['title-conference_controls']."\";\n";
|
||||||
|
echo " document.getElementById('action_bar_sub_button_back').style.display = 'inline-block';\n";
|
||||||
|
echo " }\n";
|
||||||
|
|
||||||
|
echo " function heading_restore() {\n";
|
||||||
|
echo " document.getElementById('heading_sub').innerHTML = \"".$text['title-conference_control_details']."\";\n";
|
||||||
|
echo " document.getElementById('action_bar_sub_button_back').style.display = 'none';\n";
|
||||||
|
echo " }\n";
|
||||||
|
echo "</script>\n";
|
||||||
|
|
||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
|
||||||
|
|
@ -129,21 +129,24 @@
|
||||||
require_once "resources/header.php";
|
require_once "resources/header.php";
|
||||||
|
|
||||||
//show the content
|
//show the content
|
||||||
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
echo "<form name='frm' id='frm' method='post'>\n";
|
||||||
|
|
||||||
|
echo "<div class='action_bar' id='action_bar'>\n";
|
||||||
|
echo " <div class='heading'><b>".$text['title-conference_control']."</b></div>\n";
|
||||||
|
echo " <div class='actions'>\n";
|
||||||
|
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'conference_controls.php']);
|
||||||
|
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>'hide-xs']);
|
||||||
|
echo " </div>\n";
|
||||||
|
echo " <div style='clear: both;'></div>\n";
|
||||||
|
echo "</div>\n";
|
||||||
|
|
||||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['title-conference_control']."</b><br><br></td>\n";
|
|
||||||
echo "<td width='70%' align='right' valign='top'>\n";
|
|
||||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_controls.php'\" value='".$text['button-back']."'>";
|
|
||||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||||
echo " ".$text['label-control_name']."\n";
|
echo " ".$text['label-control_name']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||||
echo " <input class='formfld' type='text' name='control_name' maxlength='255' value=\"".escape($control_name)."\">\n";
|
echo " <input class='formfld' type='text' name='control_name' maxlength='255' value=\"".escape($control_name)."\">\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-control_name']."\n";
|
echo $text['description-control_name']."\n";
|
||||||
|
|
@ -185,18 +188,16 @@
|
||||||
echo $text['description-control_description']."\n";
|
echo $text['description-control_description']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
echo " <tr>\n";
|
|
||||||
echo " <td colspan='2' align='right'>\n";
|
echo "</table>";
|
||||||
|
echo "<br /><br />";
|
||||||
|
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid)."'>\n";
|
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid)."'>\n";
|
||||||
}
|
}
|
||||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
||||||
echo " </td>\n";
|
|
||||||
echo " </tr>";
|
|
||||||
echo "</table>";
|
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
echo "<br /><br />";
|
|
||||||
|
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
require "conference_control_details.php";
|
require "conference_control_details.php";
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ if (!class_exists('conference_controls')) {
|
||||||
class conference_controls {
|
class conference_controls {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* declare the variables
|
* declare private variables
|
||||||
*/
|
*/
|
||||||
private $app_name;
|
private $app_name;
|
||||||
private $app_uuid;
|
private $app_uuid;
|
||||||
|
|
@ -46,20 +46,20 @@ if (!class_exists('conference_controls')) {
|
||||||
private $description_field;
|
private $description_field;
|
||||||
private $location;
|
private $location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* declare public variables
|
||||||
|
*/
|
||||||
|
public $conference_control_uuid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when the object is created
|
* called when the object is created
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
||||||
//assign the variables
|
//assign the variables
|
||||||
$this->app_name = 'conference_controls';
|
$this->app_name = 'conference_controls';
|
||||||
$this->app_uuid = '';
|
$this->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048';
|
||||||
$this->name = 'conference_control';
|
|
||||||
$this->table = 'conference_controls';
|
|
||||||
$this->toggle_field = 'control_enabled';
|
|
||||||
$this->description_field = 'control_description';
|
|
||||||
//$this->toggle_field = 'conference_control_enabled';
|
|
||||||
$this->toggle_values = ['true','false'];
|
|
||||||
$this->location = 'conference_controls.php';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -76,6 +76,12 @@ if (!class_exists('conference_controls')) {
|
||||||
* delete rows from the database
|
* delete rows from the database
|
||||||
*/
|
*/
|
||||||
public function delete($records) {
|
public function delete($records) {
|
||||||
|
|
||||||
|
//assign the variables
|
||||||
|
$this->name = 'conference_control';
|
||||||
|
$this->table = 'conference_controls';
|
||||||
|
$this->location = 'conference_controls.php';
|
||||||
|
|
||||||
if (permission_exists($this->name.'_delete')) {
|
if (permission_exists($this->name.'_delete')) {
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
|
|
@ -90,6 +96,67 @@ if (!class_exists('conference_controls')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//delete multiple records
|
||||||
|
if (is_array($records) && @sizeof($records) != 0) {
|
||||||
|
//build the delete array
|
||||||
|
$x = 0;
|
||||||
|
foreach ($records as $record) {
|
||||||
|
//add to the array
|
||||||
|
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||||
|
$array[$this->table][$x][$this->name.'_uuid'] = $record['uuid'];
|
||||||
|
$array['conference_control_details'][$x][$this->name.'_uuid'] = $record['uuid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//increment the id
|
||||||
|
$x++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete the checked rows
|
||||||
|
if (is_array($array) && @sizeof($array) != 0) {
|
||||||
|
|
||||||
|
//grant temporary permissions
|
||||||
|
$p = new permissions;
|
||||||
|
$p->add('conference_control_detail_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('conference_control_detail_delete', 'temp');
|
||||||
|
|
||||||
|
//set message
|
||||||
|
message::add($text['message-delete']);
|
||||||
|
}
|
||||||
|
unset($records);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete_details($records) {
|
||||||
|
|
||||||
|
//assign the variables
|
||||||
|
$this->name = 'conference_control_detail';
|
||||||
|
$this->table = 'conference_control_details';
|
||||||
|
$this->location = 'conference_control_edit.php?id='.$this->conference_control_uuid;
|
||||||
|
|
||||||
|
if (permission_exists($this->name.'_delete')) {
|
||||||
|
|
||||||
|
//add multi-lingual support
|
||||||
|
$language = new text;
|
||||||
|
$text = $language->get();
|
||||||
|
|
||||||
|
//validate the token
|
||||||
|
$token = new token;
|
||||||
|
if (!$token->validate('/app/conference_controls/conference_control_details.php')) {
|
||||||
|
message::add($text['message-invalid_token'],'negative');
|
||||||
|
header('Location: '.$this->location);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//delete multiple records
|
//delete multiple records
|
||||||
if (is_array($records) && @sizeof($records) != 0) {
|
if (is_array($records) && @sizeof($records) != 0) {
|
||||||
//build the delete array
|
//build the delete array
|
||||||
|
|
@ -125,6 +192,15 @@ if (!class_exists('conference_controls')) {
|
||||||
* toggle a field between two values
|
* toggle a field between two values
|
||||||
*/
|
*/
|
||||||
public function toggle($records) {
|
public function toggle($records) {
|
||||||
|
|
||||||
|
//assign the variables
|
||||||
|
$this->name = 'conference_control';
|
||||||
|
$this->table = 'conference_controls';
|
||||||
|
$this->toggle_field = 'control_enabled';
|
||||||
|
$this->toggle_values = ['true','false'];
|
||||||
|
$this->description_field = 'control_description';
|
||||||
|
$this->location = 'conference_controls.php';
|
||||||
|
|
||||||
if (permission_exists($this->name.'_edit')) {
|
if (permission_exists($this->name.'_edit')) {
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
|
|
@ -188,6 +264,81 @@ if (!class_exists('conference_controls')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* toggle a field between two values
|
||||||
|
*/
|
||||||
|
public function toggle_details($records) {
|
||||||
|
|
||||||
|
//assign the variables
|
||||||
|
$this->name = 'conference_control_detail';
|
||||||
|
$this->table = 'conference_control_details';
|
||||||
|
$this->toggle_field = 'control_enabled';
|
||||||
|
$this->toggle_values = ['true','false'];
|
||||||
|
$this->location = 'conference_control_edit.php?id='.$this->conference_control_uuid;
|
||||||
|
|
||||||
|
if (permission_exists($this->name.'_edit')) {
|
||||||
|
|
||||||
|
//add multi-lingual support
|
||||||
|
$language = new text;
|
||||||
|
$text = $language->get();
|
||||||
|
|
||||||
|
//validate the token
|
||||||
|
$token = new token;
|
||||||
|
if (!$token->validate('/app/conference_controls/conference_control_details.php')) {
|
||||||
|
message::add($text['message-invalid_token'],'negative');
|
||||||
|
header('Location: '.$this->location);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//toggle the checked records
|
||||||
|
if (is_array($records) && @sizeof($records) != 0) {
|
||||||
|
//get current toggle state
|
||||||
|
foreach ($records as $record) {
|
||||||
|
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||||
|
$uuids[] = "'".$record['uuid']."'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (is_array($uuids) && @sizeof($uuids) != 0) {
|
||||||
|
$sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
|
||||||
|
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
|
||||||
|
$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) {
|
||||||
|
//create the array
|
||||||
|
$array[$this->table][$x][$this->name.'_uuid'] = $uuid;
|
||||||
|
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||||
|
|
||||||
|
//increment the id
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copy rows from the database
|
* copy rows from the database
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue