summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
authorSimon2011-04-08 14:28:58 +0200
committerSimon2011-04-08 14:28:58 +0200
commitb8c98e142e9fc23058a51b603a8536df62f2930f (patch)
tree6fd78a14ae9361ef604c118a847c256efc37a338 /application/models
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.tar.gz
pbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.tar.xz
pbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.zip
Endlosschleifen bei falschen Einträgen gefixt
Diffstat (limited to 'application/models')
-rw-r--r--application/models/GroupGroupsMapper.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/application/models/GroupGroupsMapper.php b/application/models/GroupGroupsMapper.php
index a1329fe..535c380 100644
--- a/application/models/GroupGroupsMapper.php
+++ b/application/models/GroupGroupsMapper.php
@@ -113,11 +113,14 @@ class Application_Model_GroupGroupsMapper
}
return $entries;
}
+ private $crawledNodes;
// Gets All groupIDs of the parent groups begins with the
public function getParentGroups($groupID, &$data=null, $level=0) {
-
- $data[$level][] = $groupID;
+ if($this->crawledNodes['parent'][$groupID] == 1)
+ return;
+ $this->crawledNodes['parent'][$groupID] = 1;
+ $data[$level][] = $groupID;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT parentID FROM pbs_groupgroups WHERE groupID="'.$groupID.'"';
$stmt = $db->query($query);
@@ -127,10 +130,13 @@ class Application_Model_GroupGroupsMapper
$data = $this->getParentGroups($row['parentID'], $data, $level+1);
}
return $data;
- }
-
+ }
// Gets all childs-groups from a given group
public function getChildGroups($groupID, &$data=null, $level=0) {
+ if($this->crawledNodes['child'][$groupID] == 1)
+ return;
+ $this->crawledNodes['child'][$groupID] = 1;
+
$data[$level][] = $groupID;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT groupID FROM pbs_groupgroups WHERE parentID="'.$groupID.'"';