Code

Added up down buttons
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Nov 2005 09:11:43 +0000 (09:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Nov 2005 09:11:43 +0000 (09:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1992 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index f75d80d630417a30c931e869ddc2632ceedaff77..cd62e289eb2d87b8c735234444e93e158e043234 100644 (file)
@@ -118,8 +118,28 @@ class appgroup extends plugin
     }
   }
   
-  function getOneDown($prio){
-    return($prio); 
+  function getOneDown($appl){
+    $prio = $this->gosaMemberApplication[$appl]['Pri'];
+    $prios = array();
+    $next = 10000;
+    $key_use = false;
+    foreach($this->gosaMemberApplication as $key => $app){
+      if($app['Cat'] != $this->gosaMemberApplication[$appl]['Cat']) continue;
+
+      
+
+      if($app['Pri']> $prio){
+        if($app['Pri'] < $next){
+          $next     = $app['Pri'];
+          $key_use  = $key;
+        }
+      }
+    }
+
+    if($next != 0){
+      $this->gosaMemberApplication[$appl]['Pri']= $next;
+      $this->gosaMemberApplication[$key_use]['Pri']= $prio;
+    }
   }
   
   function getNextFree($prio,$cat)
@@ -468,8 +488,6 @@ class appgroup extends plugin
     plugin::save();
 
     /* Copy members */
-
-    print_a($this->attrs["gosaMemberApplication"]);
     $this->attrs["gosaMemberApplication"]= array();
     foreach ($this->gosaMemberApplication as $val){
       if(!preg_match("/__SEPARATOR__/i",$val['App'])){