From 87a4025046e739df02bf07f931a3e87dc7ca8a41 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Wed, 6 Apr 2011 00:42:25 +0200 Subject: bootmenu fix --- .../modules/user/controllers/BootosController.php | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'application/modules/user/controllers/BootosController.php') diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php index 04324ef..59efff0 100644 --- a/application/modules/user/controllers/BootosController.php +++ b/application/modules/user/controllers/BootosController.php @@ -52,20 +52,29 @@ class user_BootosController extends Zend_Controller_Action $this->view->notification = $pbsNotifier->notify('update',$result); } - $groupMapper = new Application_Model_GroupMapper(); - $personMapper = new Application_Model_PersonMapper(); - $groupID = $this->membership->getGroupID(); //ACL Darf er BootOs sehen? if(!Pbs_Acl::checkRight('boai') && !Pbs_Acl::checkRight('boui')) $this->_redirect('/user/index'); - - $configMapper = new Application_Model_ConfigMapper(); + + $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); - $this->view->bootoslist = $this->bootosMapper->findBy(array("groupID" => $groupID)); - $this->view->update = array(); + $parents = array(); + $this->view->bootoslist = array(); + $parents = $groupgroupsMapper->getParentGroups($groupID); + + foreach($parents as $k => $parent){ + foreach($parent as $p){ + $bootos = $this->bootosMapper->findBy(array("groupID" => $p)); + foreach ($bootos as $b) + if($b->getPublic() - $k >= 0 ) + $this->view->bootoslist[] = $b; + } + } + $this->view->bootoslist = array_reverse($this->view->bootoslist); + // Search $search = $this->_request->getParam('search'); $mySearch = new Pbs_Search(); @@ -88,7 +97,11 @@ class user_BootosController extends Zend_Controller_Action $this->view->pagination = $pagination->pagination($pageurl); $this->view->page = $pagination->getRequestPage(); + $this->view->update = array(); $update = $this->_request->getParam('checkupdate'); + $groupMapper = new Application_Model_GroupMapper(); + $configMapper = new Application_Model_ConfigMapper(); + if(count($this->view->bootoslist)>0){ foreach ($this->view->bootoslist as $bootos){ -- cgit v1.2.3-55-g7522