From 913138d0379487ac2418575d0082e1cbea277432 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 11 Feb 2008 14:23:57 +0000 Subject: [PATCH] Fixed sorting git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8828 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../groups/apps/class_groupApplication2.inc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc index af4e2145b..bf9777f57 100644 --- a/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc +++ b/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc @@ -514,6 +514,11 @@ class appgroup2 extends plugin $o_to = $all[$to]; $o_from = $all[$id]; + + if($o_to['PARENT'] == $o_from['UNIQID'] && $dir == "down"){ + $to = $this->_get_next($to,$o_from['PARENT']); + $o_to = $all[$to]; + } /* Target is ENTRY && same BASE, just switch */ @@ -563,7 +568,7 @@ class appgroup2 extends plugin } - function _get_next($id) + function _get_next($id,$parent = 0) { $all_l = $this->_get_entries_for_release($this->FAIrelease); for($i = 0 ; $i < count($all_l) ; $i ++){ @@ -572,8 +577,14 @@ class appgroup2 extends plugin break; } } - while(isset($all_l[$i]) && !in_array($all_l[$i]['TYPE'],array("ENTRY","FOLDER")) && $i < count($all_l)){ - $i++; + if($parent != 0){ + while(isset($all_l[$i]) && $all_l[$i]['PARENT'] != $parent){ + $i++; + } + }else{ + while(isset($all_l[$i]) && !in_array($all_l[$i]['TYPE'],array("ENTRY","FOLDER")) && $i < count($all_l)){ + $i++; + } } if(!isset($all_l[$i])){ return(FALSE); -- 2.30.2