diff options
Diffstat (limited to 'application')
3 files changed, 65 insertions, 28 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index 9a5380a..a2434d2 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -154,9 +154,8 @@ class User_GroupController extends Zend_Controller_Action public function editAction() { // ACL edit a group - // TODO: THERE IS NO RIGHT TO EDIT A GROUP - #if(!Pbs_Acl::checkRight('')) - # $this->_redirect('/user'); + if(!Pbs_Acl::checkRight('geo') && !Pbs_Acl::checkRight('geo')) + $this->_redirect('/user'); $groupID = $this->_request->getParam('groupID'); if(!isset($groupID)) { @@ -168,6 +167,8 @@ class User_GroupController extends Zend_Controller_Action $this->_helper->redirector('add', 'group'); return; } + if((!Pbs_Acl::checkRight('geo') && $groupID == $this->membership->getGroupID()) || ( !Pbs_Acl::checkRight('ge') && $groupID != $this->membership->getGroupID() )) + $this->_redirect('/user/group/index/page/'.$this->page.'/deleteresult/forbidden'); if (!isset($_POST["save"])){ $group = $this->groupMapper->find($groupID); $_POST['title'] = $group->getTitle(); @@ -175,9 +176,9 @@ class User_GroupController extends Zend_Controller_Action $editForm = new user_Form_GroupEdit(array('groupID' => $groupID)); } else { $editForm = new user_Form_GroupEdit(array('groupID' => $groupID), $_POST); - if ($editForm->isValid($_POST)) { + if ($editForm->isValid($_POST)) { $group = new Application_Model_Group($_POST); - $group->setID($groupID); + $group->setID($groupID); try { $this->groupMapper->save($group); } catch(Zend_Exception $e) diff --git a/application/modules/user/views/scripts/group/index.phtml b/application/modules/user/views/scripts/group/index.phtml index e3b5082..def21f6 100644 --- a/application/modules/user/views/scripts/group/index.phtml +++ b/application/modules/user/views/scripts/group/index.phtml @@ -1,9 +1,12 @@ <h1>Groups Overview</h1> +<?php if($this->notification != ''){echo $this->notification;} ?> <?php echo $this->searchform; ?> +<?php if(Pbs_Acl::checkRight('gc')):?> <?php echo $this->formButton('addgroup', 'Add Group', array( 'onclick' => 'self.location="/user/group/add"', 'class' => 'addbutton')) ?> +<?php endif;?> <div class='searchvars'> <div class='head'>Available searchfilter:</div> @@ -33,30 +36,54 @@ $class= 'highlight checked'; ?> <div class='content'> <div class='actions'> - <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( + <?php if($group->getID() == $this->userIDsNamespace['groupID'] ): ?> + <?php if(Pbs_Acl::checkRight('gsdo') ): ?> + <a href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'show' + ), + 'default', + true);?>"> + <img src='/media/img/show.png' alt='Show Group' /></a> + <?php endif; ?> + <?php if(Pbs_Acl::checkRight('geo')): ?> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'group', - 'action' => 'show' + 'action' => 'edit' ), 'default', - true); else echo $this->url( + true);?>"><img src='/media/img/edit.png' alt='Edit Group' /></a> + <?php endif; ?> + <?php if(Pbs_Acl::checkRight('gd')): ?> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'group', - 'action' => 'show', - 'groupID' => $group->getID() + 'action' => 'delete' ), 'default', - true); ?>"> <img src='/media/img/show.png' alt='Show Group' /> </a> - <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( + true);?>"><img src='/media/img/delete.png' alt='Delete Group' /></a> + <?php endif; ?> + + <?php endif; ?> + <?php if($group->getID() != $this->userIDsNamespace['groupID']) : ?> + <?php if(Pbs_Acl::checkRight('gsdog') ): ?> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'group', - 'action' => 'edit' + 'action' => 'show', + 'groupID' => $group->getID() ), 'default', - true); else echo $this->url( + true); ?>"><img src='/media/img/show.png' alt='Show Group' /></a> + <?php endif; ?> + <?php if(Pbs_Acl::checkRight('ge')): ?> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'group', @@ -64,15 +91,10 @@ $class= 'highlight checked'; 'groupID' => $group->getID() ), 'default', - true); ?>"> <img src='/media/img/edit.png' alt='Edit Group' /> </a> - <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( - array( - 'module' => 'user', - 'controller' => 'group', - 'action' => 'delete' - ), - 'default', - true); else echo $this->url( + true);?>"><img src='/media/img/edit.png' alt='Edit Group' /></a> + <?php endif; ?> + <?php if(Pbs_Acl::checkRight('gd')): ?> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'group', @@ -80,7 +102,9 @@ $class= 'highlight checked'; 'groupID' => $group->getID() ), 'default', - true); ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> + true);?>"><img src='/media/img/delete.png' alt='Delete Group' /></a> + <?php endif; ?> + <?php endif; ?> </div> <div class='title'><?php echo $group->getTitle(); ?></div> <?php if($group->getDescription()) { @@ -99,10 +123,10 @@ $class= 'highlight checked'; <?php endforeach ?> </div> <?php echo $this->pagination; ?> - +<?php if(Pbs_Acl::checkRight('glk')): ?> <?php echo $this->formButton('linkgroups', 'Link Groups', array( 'onclick' => 'self.location="/user/group/link"', - 'class' => 'addbutton')) -?> + 'class' => 'addbutton'));?> +<?php endif ?> <br /> <br /> diff --git a/application/modules/user/views/scripts/role/linkright.phtml b/application/modules/user/views/scripts/role/linkright.phtml index 38c0d45..f7c1133 100644 --- a/application/modules/user/views/scripts/role/linkright.phtml +++ b/application/modules/user/views/scripts/role/linkright.phtml @@ -1,5 +1,17 @@ <h1>Add Right</h1> +<div>Click to expand the boxes</div> <?php $this->linkForm->setAction($this->url()); echo $this->linkForm; -?>
\ No newline at end of file +?> +<script> +$(document).ready(function(){ + $('fieldset').children('dl:gt(0)').hide(); + $('fieldset fieldset>legend').css('cursor','pointer'); + $('fieldset fieldset').click( + function(){ + $(this).children('dl').slideToggle(); + }); + +}); +</script> |
