diff options
author | michael pereira | 2011-04-06 00:42:25 +0200 |
---|---|---|
committer | michael pereira | 2011-04-06 00:42:25 +0200 |
commit | 87a4025046e739df02bf07f931a3e87dc7ca8a41 (patch) | |
tree | 3edb663b624be93ed85240ab23fb2def85b2d966 | |
parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
download | pbs2-87a4025046e739df02bf07f931a3e87dc7ca8a41.tar.gz pbs2-87a4025046e739df02bf07f931a3e87dc7ca8a41.tar.xz pbs2-87a4025046e739df02bf07f931a3e87dc7ca8a41.zip |
bootmenu fix
5 files changed, 22 insertions, 15 deletions
diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php index 5f1a3a2..a8c7de7 100644 --- a/application/modules/user/controllers/BootisoController.php +++ b/application/modules/user/controllers/BootisoController.php @@ -54,7 +54,6 @@ class user_BootisoController extends Zend_Controller_Action $groupMapper = new Application_Model_GroupMapper(); - $personMapper = new Application_Model_PersonMapper(); $groupID = $this->membership->getGroupID(); diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index 738b7d5..560b9a5 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -80,7 +80,7 @@ class user_BootmenuController extends Zend_Controller_Action }else{ $bootmenu = $this->bootmenuMapper->findBy(array('membershipID' => $this->membership->getID())); - $bootmenu[0]->setCreated(date(Zend_Registry::get('dateformat'),$bm->getCreated())); + $bootmenu[0]->setCreated(date(Zend_Registry::get('dateformat'),$bootmenu[0]->getCreated())); $bootmenuID = $bootmenu[0]->getID(); $bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID)); foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){ @@ -137,7 +137,6 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenu = new Application_Model_BootMenu($_POST); $bootmenu->setCreated(time()); - $bootmenu->setGroupID($this->membership->getGroupID()); try{ 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){ diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index 2bb588e..bbc0c8f 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -54,7 +54,6 @@ class user_ConfigController extends Zend_Controller_Action $this->_redirect('/user/index'); $this->configMapper = new Application_Model_ConfigMapper(); - $groupMapper = new Application_Model_GroupMapper(); if(Pbs_Acl::checkRight('csai')){ $this->view->configlist = $this->configMapper->findBy(array('groupID' => $this->membership->getGroupID())); diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php index 5e09721..b630267 100644 --- a/application/modules/user/controllers/PrebootController.php +++ b/application/modules/user/controllers/PrebootController.php @@ -52,10 +52,7 @@ class User_PrebootController extends Zend_Controller_Action $pbsNotifier = new Pbs_Notifier(); $this->view->notification = $pbsNotifier->notify('update',$result); } - - $groupMapper = new Application_Model_GroupMapper(); - $personMapper = new Application_Model_PersonMapper(); - + $groupID = $this->membership->getGroupID(); //ACL Darf er PrebootMenu sehen? |