diff --git a/module/group/control.php b/module/group/control.php index b3c214c894..3b52334e32 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -130,8 +130,10 @@ class group extends control { if($_POST) { - $result = $this->group->updateView($groupID); - die(js::alert($result ? $this->lang->group->successSaved : $this->lang->group->errorNotSaved)); + $this->group->updateView($groupID); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } $group = $this->group->getById($groupID); @@ -167,8 +169,9 @@ class group extends control { if($type == 'byGroup') $result = $this->group->updatePrivByGroup($groupID, $menu, $version); if($type == 'byModule') $result = $this->group->updatePrivByModule(); - print(js::alert($result ? $this->lang->group->successSaved : $this->lang->group->errorNotSaved)); - exit; + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); } if($type == 'byGroup') diff --git a/module/group/css/copy.css b/module/group/css/copy.css new file mode 100644 index 0000000000..79fdcfe687 --- /dev/null +++ b/module/group/css/copy.css @@ -0,0 +1 @@ +.checkbox-inline {display: inline-block !important; padding-left: 0px;} diff --git a/module/group/css/managepriv.css b/module/group/css/managepriv.css index 07c33c31a0..1acda3c117 100644 --- a/module/group/css/managepriv.css +++ b/module/group/css/managepriv.css @@ -3,3 +3,4 @@ .group-item {display:block; width:200px; float:left; font-size: 14px} .outer .table.table-form tbody > tr:last-child td {border-top: 1px solid #ddd} @-moz-document url-prefix(){.outer .table.table-form tbody > tr:last-child td, .outer .table.table-form tbody > tr:last-child th {border-bottom: 1px solid #ddd}} +.checkbox-inline {display: inline-block !important; padding-left: 0px;} diff --git a/module/group/js/managepriv.js b/module/group/js/managepriv.js index deca0b5f43..94b96a75ab 100644 --- a/module/group/js/managepriv.js +++ b/module/group/js/managepriv.js @@ -25,3 +25,21 @@ function setNoChecked() }) $('#noChecked').val(noCheckValue); } + +$(function() +{ + $('#privList > tbody > tr > th input[type=checkbox]').change(function() + { + var id = $(this).attr('id'); + var checked = $(this).prop('checked'); + + if(id == 'allChecker') + { + $('input[type=checkbox]').prop('checked', checked); + } + else + { + $(this).parents('tr').find('input[type=checkbox]').prop('checked', checked); + } + }); +}) diff --git a/module/group/view/browse.html.php b/module/group/view/browse.html.php index 4b0529ae40..b44f772f27 100644 --- a/module/group/view/browse.html.php +++ b/module/group/view/browse.html.php @@ -44,10 +44,10 @@ group->managepriv = $lang->group->managePrivByGroup;?> - id", $group, 'list', 'plus');?> - id", $group, 'list', 'plus');?> + id", $group, 'list', 'pencil');?> + id", $group, 'list', 'pencil');?> group->managemember = $lang->group->manageMember;?> - id", $group, 'list', 'plus', '', 'iframe', 'yes');?> + id", $group, 'list', 'pencil', '', 'iframe', 'yes');?> id", $group, 'list', '', '', 'iframe', 'yes', "data-width='550'");?> id", $group, 'list', '', '', 'iframe', 'yes', "data-width='550'");?> group->option;?> - group->copyOptions);?> + group->copyOptions, '', '', 'inline');?> - + + + + diff --git a/module/group/view/manageview.html.php b/module/group/view/manageview.html.php index 4c7a31b15e..78e822ebcc 100644 --- a/module/group/view/manageview.html.php +++ b/module/group/view/manageview.html.php @@ -11,61 +11,65 @@ */ ?> -
-
- icons['group']);?> id;?> - name;?> - group->manageView;?> +
+
+

+ id;?> + name;?> + arrow . $lang->group->manageView;?> +

+
+ + + + + + + + + + + + + + + + + + + + +
+ group->viewList;?> + + menu as $menu):?> + + + + +
+
+ acl['views'][$module]) or empty($group->acl['views'])) echo "checked";?> /> + +
+
+ +
+
+ acl['views'])) echo "checked";?> /> + +
+
+
+ + + +
+
-
- - - - - - - - - - - - - - - - - - - - -
- group->viewList;?> - - menu as $menu):?> - - - - -
- -
- -
- -
-
- save); - echo html::linkButton($lang->goback, $this->createLink('group', 'browse')); - echo html::hidden('foo'); // Just a hidden var, to make sure $_POST is not empty. - ?> -
-
diff --git a/module/group/view/privbygroup.html.php b/module/group/view/privbygroup.html.php index 2bdf3ff20f..0d36b15c26 100644 --- a/module/group/view/privbygroup.html.php +++ b/module/group/view/privbygroup.html.php @@ -10,114 +10,125 @@ * @link http://www.zentao.net */ ?> -
- role == 'limited'):?> -
-
name;?>
+role == 'limited'):?> + + + +
+
+ + + + + + + + resource as $moduleName => $moduleActions):?> + + group->checkMenuModule($menu, $moduleName)) continue;?> + $actionLabel) + { + if(strpos($changelogs, ",$moduleName-$actionLabel,") !== false) + { + $hasMethod = true; + break; + } + } + if(!$hasMethod) continue; + } + ?> + '> + + + + + + + + +
group->module;?>group->method;?>
+
+ + +
+
+ + + $actionLabel):?> + +
+ $lang->$moduleName->$actionLabel), isset($groupPrivs[$moduleName][$action]) ? $action : '', '', 'inline');?> +
+ +
+
+ + +
+
+ + + +
+
+
+ + + diff --git a/module/group/view/privbymodule.html.php b/module/group/view/privbymodule.html.php index 678d844c6d..a0d0dd5815 100644 --- a/module/group/view/privbymodule.html.php +++ b/module/group/view/privbymodule.html.php @@ -41,11 +41,9 @@ - save); - echo html::linkButton($lang->goback, $this->createLink('group', 'browse')); - echo html::hidden('foo'); // Just make $_POST not empty.. - ?> + + +