diff options
| author | Simon | 2011-04-26 18:17:38 +0200 |
|---|---|---|
| committer | Simon | 2011-04-26 18:17:38 +0200 |
| commit | 631d3fc7695ae96dc6cd527075e043743d666caf (patch) | |
| tree | 8fbf71dcecf6a49b187465b084937ea17af09b38 /application/modules | |
| parent | Notices in Filter entfernt (diff) | |
| parent | config fix (diff) | |
| download | pbs2-631d3fc7695ae96dc6cd527075e043743d666caf.tar.gz pbs2-631d3fc7695ae96dc6cd527075e043743d666caf.tar.xz pbs2-631d3fc7695ae96dc6cd527075e043743d666caf.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/user/controllers/ConfigController.php | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index 6c6466c..bf79151 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -99,6 +99,8 @@ class user_ConfigController extends Zend_Controller_Action $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); $parents = array(); + $groupconfs = array(); + $ownerconfs = array(); $parents = $groupgroupsMapper->getParentGroups($groupID); foreach($parents as $k => $parent){ @@ -107,20 +109,31 @@ class user_ConfigController extends Zend_Controller_Action foreach ($bootos as $b) if($b->getPublic() - $k >= 0 ){ $this->view->bootoslist[] = $b; - if(Pbs_Acl::checkRight('cc')) - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID())); - else - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + if(Pbs_Acl::checkRight('cc')){ + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); + }else{ + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); + + } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); } } elseif($k == 0 && $b->getPublic() == -1 && Pbs_Acl::checkRight('boc')){ $this->view->bootoslist[] = $b; - if(Pbs_Acl::checkRight('cc')) - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID())); - else - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + if(Pbs_Acl::checkRight('cc')){ + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); + }else{ + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); + } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); } |
