mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Groups - List: Minor adjutsments, Edit: Button updates.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018 - 2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2018-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -65,6 +65,30 @@
|
||||
//process the user data and save it to the database
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//process the http post data by submitted action
|
||||
if ($_POST['action'] != '' && is_uuid($group_uuid)) {
|
||||
$array[0]['checked'] = 'true';
|
||||
$array[0]['uuid'] = $group_uuid;
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'copy':
|
||||
if (permission_exists('group_add')) {
|
||||
$obj = new groups;
|
||||
$obj->copy($array);
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (permission_exists('group_delete')) {
|
||||
$obj = new groups;
|
||||
$obj->delete($array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: groups.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
@@ -156,28 +180,36 @@
|
||||
require_once "resources/header.php";
|
||||
|
||||
//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-group']."</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'groups.php']);
|
||||
$button_margin = 'margin-left: 15px;';
|
||||
if ($action == 'update' && permission_exists('group_add')) {
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'name'=>'action','value'=>'copy','style'=>$button_margin,'onclick'=>"if (confirm('".$text['confirm-copy']."')) { document.getElementById('frm').submit(); } else { this.blur(); return false; }"]);
|
||||
unset($button_margin);
|
||||
}
|
||||
if ($action == 'update' && permission_exists('group_delete')) {
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'action','value'=>'delete','style'=>$button_margin,'onclick'=>"if (confirm('".$text['confirm-delete']."')) { document.getElementById('frm').submit(); } else { this.blur(); return false; }"]);
|
||||
unset($button_margin);
|
||||
}
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'style'=>'margin-left: 15px;']);
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo $text['description-groups']."\n";
|
||||
echo "<br /><br />\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-group']."</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='groups.php'\" value='".$text['button-back']."'>";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"window.location='group_copy.php'\" value='".$text['button-copy']."'>";
|
||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='2'>\n";
|
||||
echo " ".$text['description-groups']."<br /><br />\n";
|
||||
echo "</td>\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-group_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='group_name' maxlength='255' value='".escape($group_name)."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-group_name']."\n";
|
||||
@@ -217,59 +249,9 @@
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <select class='formfld' name='group_level'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($group_level == "10") {
|
||||
echo " <option value='10' selected='selected'>10</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='10'>10</option>\n";
|
||||
}
|
||||
if ($group_level == "20") {
|
||||
echo " <option value='20' selected='selected'>20</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='20'>20</option>\n";
|
||||
}
|
||||
if ($group_level == "30") {
|
||||
echo " <option value='30' selected='selected'>".$text['label-30']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='30'>30</option>\n";
|
||||
}
|
||||
if ($group_level == "40") {
|
||||
echo " <option value='40' selected='selected'>40</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='40'>40</option>\n";
|
||||
}
|
||||
if ($group_level == "50") {
|
||||
echo " <option value='50' selected='selected'>50</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='50'>50</option>\n";
|
||||
}
|
||||
if ($group_level == "60") {
|
||||
echo " <option value='60' selected='selected'>60</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='60'>60</option>\n";
|
||||
}
|
||||
if ($group_level == "70") {
|
||||
echo " <option value='70' selected='selected'>70</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='70'>70</option>\n";
|
||||
}
|
||||
if ($group_level == "80") {
|
||||
echo " <option value='80' selected='selected'>80</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='80'>80</option>\n";
|
||||
}
|
||||
if ($group_level == "90") {
|
||||
echo " <option value='90' selected='selected'>90</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='90'>90</option>\n";
|
||||
for ($l = 10; $l <=90; $l += 10) {
|
||||
$selected = $group_level == $l ? "selected='selected'" : null;
|
||||
echo " <option value='".$l."' ".$selected.">".$l."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
@@ -302,19 +284,15 @@
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='hidden' name='group_uuid' value='".escape($group_uuid)."'>\n";
|
||||
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo " <br />\n";
|
||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "<br /><br />";
|
||||
|
||||
echo "<input type='hidden' name='group_uuid' value='".escape($group_uuid)."'>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018 - 2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2018-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -138,7 +138,7 @@
|
||||
echo " <div class='heading'><b>".$text['title-groups']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-users'],'icon'=>$_SESSION['theme']['button_icon_users'],'onclick'=>"window.location='../users/users.php'"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>$_SESSION['theme']['button_icon_sync'],'style'=>'margin-right: 15px;','onclick'=>"window.location='permissions_default.php'"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>$_SESSION['theme']['button_icon_sync'],'style'=>'margin-right: 15px;','link'=>'permissions_default.php']);
|
||||
if (permission_exists('group_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'group_edit.php']);
|
||||
}
|
||||
@@ -189,12 +189,10 @@
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
|
||||
}
|
||||
echo th_order_by('group_name', $text['label-group_name'], $order_by, $order);
|
||||
//echo "<th style=''>".$text['label-group_permissions']."</th>\n";
|
||||
//echo "<th style=''>".$text['label-group_members']."</th>\n";
|
||||
echo "<th style=''>".$text['label-tools']."</th>\n";
|
||||
echo th_order_by('group_level', $text['label-group_level'], $order_by, $order);
|
||||
echo " <th>".$text['label-tools']."</th>\n";
|
||||
echo th_order_by('group_level', $text['label-group_level'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('group_protected', $text['label-group_protected'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='hide-sm-dn'>".$text['label-group_description']."</th>\n";
|
||||
echo " <th class='pct-30 hide-sm-dn'>".$text['label-group_description']."</th>\n";
|
||||
if (permission_exists('group_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
@@ -224,14 +222,12 @@
|
||||
echo " ".escape($row['group_name']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top'>\n";
|
||||
echo " <td class='no-link no-wrap'>\n";
|
||||
echo " <a href=\"/core/groups/group_permissions.php?group_uuid=".urlencode($row['group_uuid'])."\">".$text['label-group_permissions']."</a>\n";
|
||||
//echo " </td>\n";
|
||||
//echo " <td valign='top'>\n";
|
||||
echo " \n";
|
||||
echo " <a href=\"/core/groups/groupmembers.php?group_uuid=".urlencode($row['group_uuid'])."\">".$text['label-group_members']." (".$row['group_members'].")</a>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape($row['group_level'])."</td>\n";
|
||||
echo " <td class='center'>".escape($row['group_level'])."</td>\n";
|
||||
if (permission_exists('group_edit')) {
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['group_protected']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
|
||||
Reference in New Issue
Block a user