summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-10-05 18:01:26 +0200
committerBjörn Geiger2011-10-05 18:01:26 +0200
commit956724f02ae833a6d8fb02d663a4f1a881a7182e (patch)
treec7e27220389213e282d56ffc540bd12fccd72720 /application
parentchangefilter API hinzugefügt (diff)
downloadpbs2-956724f02ae833a6d8fb02d663a4f1a881a7182e.tar.gz
pbs2-956724f02ae833a6d8fb02d663a4f1a881a7182e.tar.xz
pbs2-956724f02ae833a6d8fb02d663a4f1a881a7182e.zip
Bootos API public Feld wird nun auch berücksichtigt
Diffstat (limited to 'application')
-rwxr-xr-xapplication/controllers/ResourceController.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index ecc021c..1487b61 100755
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -884,6 +884,8 @@ class ResourceController extends Zend_Controller_Action
}
} else {
$bootos = $bootosMapper->findBy(array('groupid' => $groupID));
+ $childBootos = $this->getbootosOfChildGroups($groupID, 1);
+ $bootos = array_merge($bootos, $childBootos);
}
if($bootos == null){
@@ -940,6 +942,25 @@ class ResourceController extends Zend_Controller_Action
echo $xml;
}
+ private function getbootosOfChildGroups($groupID, $depth) {
+ $groupgroupsMapper = new Application_Model_GroupGroupsMapper();
+ $results = $groupgroupsMapper->findBy(array('parentID' => $groupID));
+ $bootosMapper = new Application_Model_BootOsMapper();
+ if(count($results)) {
+ $bootos = array();
+ foreach($results as $result) {
+ $newbootos = $bootosMapper->findBy(array("groupID" => $result->getGroupID(), "public" => $depth));
+ if(count($newbootos)) {
+ $bootos = array_merge($bootos, $newbootos);
+ }
+ $bootos = array_merge($bootos, $this->getbootosOfChildGroups($result->getGroupID(), $depth + 1));
+ }
+ return $bootos;
+ } else {
+ return array();
+ }
+ }
+
public function getpoolAction() {
list($rightroles1) = $this->rightrolesMapper->findBy(array('rightID' => '79', 'roleID' => $this->membership->getRoleID()));
if($rightroles1 == null){
@@ -1374,4 +1395,4 @@ class ResourceController extends Zend_Controller_Action
return $path;
}
-} \ No newline at end of file
+}