diff --git a/core/groups/group_edit.php b/core/groups/group_edit.php index ac0744ef71..db81a4561b 100644 --- a/core/groups/group_edit.php +++ b/core/groups/group_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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 "
\n"; + echo "\n"; + + echo "
\n"; + echo "
".$text['title-group']."
\n"; + echo "
\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 "
\n"; + echo "
\n"; + echo "
\n"; + + echo $text['description-groups']."\n"; + echo "

\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " "; echo "
".$text['title-group']."

\n"; - echo " "; - echo " "; - echo " "; - echo "
\n"; - echo " ".$text['description-groups']."

\n"; - echo "
\n"; + echo "\n"; echo " ".$text['label-group_name']."\n"; echo "\n"; + echo "\n"; echo " \n"; echo "
\n"; echo $text['description-group_name']."\n"; @@ -217,59 +249,9 @@ echo "
\n"; echo " \n"; echo "
\n"; @@ -302,19 +284,15 @@ echo "
\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " \n"; - echo "
"; - echo "
"; echo "

"; + echo "\n"; + echo "\n"; + + echo ""; + //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/groups/groups.php b/core/groups/groups.php index 8a420216c3..19f35ae25e 100644 --- a/core/groups/groups.php +++ b/core/groups/groups.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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 "
".$text['title-groups']." (".$num_rows.")
\n"; echo "
\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 "".$text['label-group_permissions']."\n"; - //echo "".$text['label-group_members']."\n"; - echo "".$text['label-tools']."\n"; - echo th_order_by('group_level', $text['label-group_level'], $order_by, $order); + echo " ".$text['label-tools']."\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 " ".$text['label-group_description']."\n"; + echo " ".$text['label-group_description']."\n"; if (permission_exists('group_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { echo "  \n"; } @@ -224,14 +222,12 @@ echo " ".escape($row['group_name']); } echo " \n"; - echo " \n"; + echo " \n"; echo " ".$text['label-group_permissions']."\n"; - //echo " \n"; - //echo " \n"; echo "   \n"; echo " ".$text['label-group_members']." (".$row['group_members'].")\n"; echo " \n"; - echo " ".escape($row['group_level'])."\n"; + echo " ".escape($row['group_level'])."\n"; if (permission_exists('group_edit')) { echo " \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')"]);