From: hickert Date: Mon, 19 May 2008 07:39:06 +0000 (+0000) Subject: Added release col to system management. Sorting does now work currently. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=76838e6cc89d8b540262b7f8e359abcbfbfa6baa;p=gosa.git Added release col to system management. Sorting does now work currently. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10945 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc index 0bba4f6d5..9b4f5f00a 100644 --- a/gosa-plugins/systems/admin/systems/class_divListSystem.inc +++ b/gosa-plugins/systems/admin/systems/class_divListSystem.inc @@ -85,6 +85,12 @@ class divListSystem extends MultiSelectWindow $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'")); $this->AddHeader(array("string"=>_("Systems")." / "._("Department"))); + + /* Add header for selected FAI release, if fai is active */ + if($this->parent->fai_activated){ + $this->AddHeader(array("string"=>_("Release"),"attach"=>"style='width:100px;'")); + } + $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'")); /* Text ,Value ,Name ,Is selected */ @@ -444,15 +450,28 @@ class divListSystem extends MultiSelectWindow } $cnts[$type] ++; - /* Create each field */ $field0 = array("string" => "" , - "attach" => "style='width:20px;'"); + "attach" => "style='width:20px;'"); + $field1 = array("string" => sprintf($img['img'],$val['dn']), + "attach" => "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($editlink,$key,$display), + "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"); + $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), + "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"); + + if($this->parent->fai_activated){ + + $release =" "; + if(isset($val['FAIclass'][0]) && preg_match("/:/",$val['FAIclass'][0])){ + $release = preg_replace("/^.*:/","",$val['FAIclass'][0]); + } - $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'"); - $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"); - $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"); - $this->AddElement( array($field0,$field1,$field2,$field3)); + $field2a = array("string" => $release,"attach"=>"style='width:100px;'"); + $this->AddElement( array($field0,$field1,$field2,$field2a,$field3)); + }else{ + $this->AddElement( array($field0,$field1,$field2,$field3)); + } } /* Create summary string for list footer */ diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index c30b3aa8b..7bb89b751 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -42,6 +42,7 @@ class systems extends plugin var $dns = array(); var $system_activation_object = ""; // The object to activate (NewDevice) + var $fai_activated = FALSE; function systems (&$config, $ui) { @@ -49,6 +50,12 @@ class systems extends plugin $this->config= $config; $this->ui= $ui; + /* Add FAIstate to attributes if FAI is activated */ + $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs')); + if(!empty($tmp)){ + $this->fai_activated = TRUE; + } + /* Creat dialog object */ $this->DivListSystem = new divListSystem($this->config,$this); @@ -61,7 +68,6 @@ class systems extends plugin if($this->config->search("ArpNewDevice","CLASS",array('tabs')) != ""){ $this->arp_handling_active = TRUE; } - } @@ -1140,7 +1146,13 @@ class systems extends plugin /* Add departments if subsearch is disabled */ if(!$this->DivListSystem->SubSearch){ - $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,3,1); + + /* Add FAIstate to attributes if FAI is activated */ + if($this->fai_activated){ + $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,4,1); + }else{ + $this->DivListSystem->AddDepartments($this->DivListSystem->selectedBase,3,1); + } } $this->reload(); $this->DivListSystem->setEntries($this->terminals); @@ -1250,7 +1262,7 @@ class systems extends plugin } /* Attributes to fetch */ - $sys_attrs = array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode"); + $sys_attrs = array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode","FAIclass"); $sys_categories = array("terminal", "workstation", "server", "phone" ,"printer","incoming"); /* Add FAIstate to attributes if FAI is activated */