diff --git a/include/application.php b/include/application.php
index 0126067..34a8001 100644
--- a/include/application.php
+++ b/include/application.php
@@ -1329,16 +1329,25 @@ class Application {
}
public function objectGetChildren($bIncludeDeleted = false)
+ {
+ return $this->objectGetChildrenClassSpecific('', $IncludeDeleted);
+ }
+
+ public function objectGetChildrenClassSpecific($sClass = '', $bIncludeDeleted = false)
{
$aChildren = array();
/* Get versions */
- foreach($this->getVersions(false, true, $bIncludeDeleted) as $oVersion)
+ foreach($this->getVersions(false, true, $bIncludeDeleted) as $oVersion)
{
- $aChildren += $oVersion->objectGetChildren($bIncludeDeleted);
+ if($sClass != 'version')
+ $aChildren += $oVersion->objectGetChildren($bIncludeDeleted);
$aChildren[] = $oVersion;
}
+ if($sClass == 'version')
+ return $aChildren;
+
/* Get urls */
$sQuery = "SELECT * FROM appData WHERE type = '?' AND appId = '?'";
$hResult = query_parameters($sQuery, "url", $this->iAppId);
diff --git a/include/objectManager.php b/include/objectManager.php
index 326f6fd..cfabde9 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -886,13 +886,6 @@ class ObjectManager
return FALSE;
}
- /* We only allow moving to non-queued objects */
- if(!$hResult = $oObject->objectGetEntries('accepted'))
- {
- echo "Failed to get list of objects.
\n";
- return FALSE;
- }
-
/* Display some help text */
echo "
Move all child objects of ".$oObject->objectMakeLink()." to the entry "; echo "selected below, and delete ".$oObject->objectMakeLink()." afterwards.
\n"; @@ -903,21 +896,52 @@ class ObjectManager "Move here"), "color4"); - for($i = 0; $oRow = query_fetch_object($hResult); $i++) + if(method_exists($oObject, 'objectGetParent')) { - $oCandidate = new $this->sClass(null, $oRow); - if($oCandidate->objectGetId() == $this->iId) + $oParent = $oObject->objectGetParent(); + + $aParentChildren = $oParent->objectGetChildrenClassSpecific($this->sClass); + + echo "Children of " . $oParent->objectMakeLink() . "