summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58c69f2)
raw | patch | inline | side by side (parent: 58c69f2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Nov 2005 11:15:20 +0000 (11:15 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Nov 2005 11:15:20 +0000 (11:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1974 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/class_groupApplication.inc | patch | blob | history | |
plugins/admin/groups/class_groupManagement.inc | patch | blob | history |
diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index 5131abcd5b337da0aaedb7dca53a6b8766390333..93f72545d04c504096ad7d943aa42297c23cfd31 100644 (file)
$this->curbase = $this->config->current['BASE'];
}
- function getOneUp($prio)
+ function getOneUp($appl)
{
-
-
- }
-
- function getOneDown(){
+ $prio = $this->gosaMemberApplication[$appl]['Pri'];
+ $prios = array();
+ $next = 0;
+ $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 getOneDown($prio){
+ return($prio);
}
+ function getNextFree($prio,$cat)
+ {
+ $ret = $prio;
+ $prios =array();
+ foreach($this->gosaMemberApplication as $app){
+ if($cat == $app['Cat']){
+ $prios[$app['Pri']]=$app['Pri'];
+ }
+ }
+ while(isset($prios[$ret])){
+ $ret ++;
+ }
+ return($ret);
+ }
+
function execute()
{
if($found != false){
if($act == "one_up"){
- $this->gosaMemberApplication[$found]['Pri'] = $this->gosaMemberApplication[$found]['Pri'] -1;
+ $this->getOneUp($found);
}elseif($act == "one_down") {
- $this->gosaMemberApplication[$found]['Pri'] = $this->gosaMemberApplication[$found]['Pri'] +1;
+ $this->getOneDown($found);
}
}
}
$div2->SetHeight(300);
$menu = $this->CreateCatMenu();
- $str_noprio = " [ "._("Priority: %s")." ] ";
+ $str_noprio = " %s ";
$linkopen = "<img src='images/folder.png'> <a href='?plug=".$_GET['plug']."&act=open&id=%s'>%s</a>";
$app = "<img src='images/select_application.png'> %s".$str_noprio;
function addApp($cn)
{
- $this->gosaMemberApplication[$cn."|".$this->curCatDir]= array("App"=>$cn,"Cat"=>$this->curCatDir,"Pri"=>"100");
+ $this->gosaMemberApplication[$cn."|".$this->curCatDir]= array("App"=>$cn,"Cat"=>$this->curCatDir,"Pri"=>$this->getNextFree(1,$this->curCatDir));
$this->used_apps[$cn]=$cn;
$this->is_modified= TRUE;
}
diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index 4e21b8bdff40fa088b9b921763681680ef0fbd2e..2f444c58e6f436b43c6216ba6cca1ffe8bdc82c6 100644 (file)
function execute()
{
/* Call parent execute */
- plugin::execute();
+// plugin::execute();
/* Save data */
$groupfilter= get_global("groupfilter");