summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
+}