Code

Renanmed opsi class
[gosa.git] / gosa-plugins / systems / admin / systems / class_divListSystem.inc
index 37a0893b1af0f23bd69b370f6a9807bb9e3bedb9..32da5bbbc7c646b4c54cb497c2d721b3d6a02420 100644 (file)
@@ -64,7 +64,6 @@ class divListSystem extends MultiSelectWindow
 
     /* Result page will look like a headpage */
     $this->SetHeadpageMode();
-    $this->SetInformation(_("This menu allows you to add, remove and change the properties of specific systems. You can only add systems which have already been started once."));
 
     $this->EnableAplhabet   (true);
 
@@ -73,37 +72,72 @@ class divListSystem extends MultiSelectWindow
     $this->EnableSaveButton (false);
 
     /* Dynamic action col, depending on snapshot icons */
-    $action_col_size = 110;
+    $action_col_size = 120;
     if($this->parent->snapshotEnabled()){
       $action_col_size += 38;
     }
 
     /* Toggle all selected / deselected */
-    $chk = "<input type='checkbox' id='select_all' name='select_all'
+    $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
                onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
 
     /* set Page header */
     $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>"&nbsp;","attach"=>"style='width:20px;'"));
-    $this->AddHeader(array("string"=>_("System / Department")));
+    $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 */
-    $this->AddCheckBox("ShowServers",         _("Select to see servers"),            _("Show servers"),          true);
-    $this->AddCheckBox("ShowTerminals",       _("Select to see Linux terminals"),    _("Show terminals") ,       true);
-    $this->AddCheckBox("ShowWorkstations",    _("Select to see Linux workstations"), _("Show workstations"),     true);
-    $this->AddCheckBox("ShowWinWorkstations", _("Select to see MicroSoft Windows based workstations"), _("Show windows based workstations"),true);
-    $this->AddCheckBox("ShowPrinters",        _("Select to see network printers"),    _("Show network printers") ,true);
-    $this->AddCheckBox("ShowPhones",          _("Select to see VOIP phones"),         _("Show phones") ,          true);
-    $this->AddCheckBox("ShowDevices",         _("Select to see network devices"),     _("Show network devices"),  true);
+
+    if(class_available("servtabs")){
+      $this->AddCheckBox("ShowServers",        
+          msgPool::selectToView(  _("servers")),            
+          sprintf(_("Show %s"),   _("servers")),true);
+    }
+    if(class_available("termtabs")){
+      $this->AddCheckBox("ShowTerminals",       
+          msgPool::selectToView(  _("Linux terminals")),    
+          sprintf(_("Show %s"),   _("terminals")),true);
+    }
+    if(class_available("worktabs")){
+      $this->AddCheckBox("ShowWorkstations",
+          msgPool::selectToView(  _("Linux workstations")), 
+          sprintf(_("Show %s"),   _("workstations")),true);
+    }
+    if(class_available("wintabs")){
+      $this->AddCheckBox("ShowWinWorkstations", 
+          msgPool::selectToView(  _("MicroSoft Windows based workstations")), 
+          sprintf(_("Show %s"),   _("windows based workstations")),true);
+    }
+    if(class_available("printtabs")){
+      $this->AddCheckBox("ShowPrinters",
+          msgPool::selectToView(  _("network printers")),   
+          sprintf(_("Show %s"),   _("network printers")) ,true);
+    }
+    if(class_available("phonetabs")){
+      $this->AddCheckBox("ShowPhones",
+          msgPool::selectToView(  _("VoIP phones")),        
+          sprintf(_("Show %s"),   _("phones")) ,true);
+    }
+    if(class_available("componenttabs")){
+      $this->AddCheckBox("ShowDevices",
+          msgPool::selectToView(  _("network devices")),    
+          sprintf(_("Show %s"),   _("network devices")),  true);
+    }
 
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
-    $this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Search in subtrees"), false);
+    $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
 
     /*                  Name                 ,Text                              ,Default  , Connect with alphabet  */
     $this->AddRegex   ("Regex",     _("Display systems matching"),"*" , true);
-    $this->AddRegex   ("UserRegex", _("Display systems of user"), "*" , false, "images/search_user.png");
+    $this->AddRegex   ("UserRegex", _("Display systems of user"), "*" , false, "images/lists/search-user.png");
   }
 
   function GenHeader()
@@ -114,67 +148,13 @@ class divListSystem extends MultiSelectWindow
     $options= "";
 
     /* Get all departments within this subtree */
-    $base = $this->config->current['BASE'];
-
-    /* Add base */
-    $tmp = array();
-    $tmp[] = array("dn"=>$this->config->current['BASE']);
-    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
-                    array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
-
-    $deps = array();
-    foreach($tmp as $tm){
-      $deps[$tm['dn']] = $tm['dn'];
-    }
-
-    /* Load possible departments */
-    $ui= get_userinfo();
-    $first = "";
-    $found = FALSE;
-    $department = $departments = array();
-    foreach($this->module as $module){
-      $d = $ui->get_module_departments($module);      
-      foreach($d as $department){
-        $departments[$department] = $department;
-      }
-    }
-
-    /* Load possible departments */
-    $ui= get_userinfo();
-    $ids = $this->config->idepartments;
-    $first = "";
-    $found = FALSE;
-    foreach($ids as $dep => $name){
-      if(isset($deps[$dep]) && in_array_ics($dep, $departments)){
-
-        /* Keep first base dn in mind, we could need this
-         *  info if no valid base was found
-         */
-        if(empty($first)) {
-          $first = $dep['dn'];
-        }
-
-        $value = $ids[$dep];
-        if ($this->selectedBase == $dep){
-          $found = TRUE;
-          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
-        } else {
-          $options.= "<option value='".$dep."'>$value</option>";
-        }
-      }
-    }
-
-
-    /* The currently used base is not visible with your acl setup.
-     * Set base to first useable base.
-     */
-    if(!$found){
-      $this->selectedBase = $first;
-    }
+    $base     = $this->config->current['BASE'];
+    $options  = $this->create_department_list($this->module);
 
     /* If there is at least one c (Create) and one w (Write) acl in this combination
         display the snapshot paste icon. BUT check the correct acls in the management plugin */
     $all_module_acls = "";
+    $ui = get_userinfo();
     foreach($this->module as $module){
       $all_module_acls .= $ui->has_complete_category_acls($this->selectedBase,$module);
     }
@@ -187,82 +167,70 @@ class divListSystem extends MultiSelectWindow
 
     /* Add base selection */
     $listhead .= _("Base")."&nbsp; <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
-      " <input class='center' type='image' src='images/list_submit.png' align='middle'
+      " <input class='center' type='image' src='images/lists/submit.png' align='middle'
       title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;";
 
     /* Handle create icons */ 
     $s = ".|"._("Actions")."|\n";
-    $s.= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+    $s.= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
-      $s.= "...|<img src='images/select_terminal.png' alt='' border='0' class='center'>".
+
+    if(class_available("termtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_terminal.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Terminal")."|"."newsystem_terminal|\n";
     }
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
-      $s.= "...|<img src='images/select_workstation.png' alt='' border='0' class='center'>".
+    if(class_available("worktabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_workstation.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Workstation")."|"."newsystem_workstation|\n";
     }
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/servgeneric"))){
-      $s.= "...|<img src='images/select_server.png' alt='' border='0' class='center'>".
+    if(class_available("servtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/servgeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_server.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Server")."|"."newsystem_server|\n";
     }
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
-      $s.= "...|<img src='images/select_phone.png' alt='' border='0' class='center'>".
+    if(class_available("phonetabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_phone.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Phone")."|"."newsystem_phone|\n";
     }
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
-      $s.= "...|<img src='images/select_printer.png' alt='' border='0' class='center'>".
+    if(class_available("printtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_printer.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Printer")."|"."newsystem_printer|\n";
     }
-    if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
-      $s.= "...|<img src='images/select_component.png' alt='' border='0' class='center'>".
+    if(class_available("componenttabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_component.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Component")."|"."newsystem_component|\n";
     }
+    if(class_available("opsiGeneric") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"opsi/opsiGeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_component.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Opsi")."|"."newsystem_opsi_client|\n";
+    }
 
-    $events  = DaemonEvent::get_event_types(SYSTEM_EVENT);
+    if($this->parent->si_active){
+      $events  = DaemonEvent::get_event_types(SYSTEM_EVENT);
 
-    $s.= "..|<img src='images/rocket.png' alt='' border='0' class='center'>".
-      "&nbsp;"._("Trigger action")."|\n";
-    foreach($events['TRIGGERED'] as $name => $event){
-      $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_".$name."\n";
-    }
+      $s.= "..|<img src='images/rocket.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Trigger action")."|\n";
+      foreach($events['TRIGGERED'] as $name => $event){
+        $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_".$name."\n";
+      }
 
-    $s.= "..|<img src='images/clock.png' alt='' border='0' class='center'>".
-      "&nbsp;"._("Schedule action")."|\n";
-    foreach($events['SCHEDULED'] as $name =>  $event){
-      $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|schedule_event_".$name."\n";
+      $s.= "..|<img src='plugins/systems/images/clock.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Schedule action")."|\n";
+      foreach($events['SCHEDULED'] as $name =>  $event){
+        $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|schedule_event_".$name."\n";
+      }
     }
 
-    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+    $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
-    /* Add multiple copy & cut icons */
-    if(is_object($this->parent->CopyPasteHandler)){
-      $s.= "..|---|\n";
-      $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-    }
+    $s.= "..|<img src='images/lists/unlocked.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Activate systems")."|activate_multiple|\n";
 
-    /* Get copy & paste icon */
-    $Copy_Paste ="";
-    if(preg_match("/(c.*w|w.*c)/",$all_module_acls) &&  $this->parent->CopyPasteHandler){
-      $s .= "..|---|\n";
-      if($this->parent->CopyPasteHandler->entries_queued()){
-        $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
-        $s.="..|".$img."&nbsp;"._("Paste")."|editPaste|\n";
-      }else{
-        $img = "<img border='0' class='center' src='images/cant_editpaste.png' alt=''>";
-        $s.="..|".$img."&nbsp;"._("Paste")."\n";
-      }
-    }
+    /* Add Copy & Paste header */
+    $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
 
     /* Add snapshot icons */
-    if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
-      $s .= "..|---|\n";
-      $s .= $this->get_snapshot_header(TRUE);
-    }
+    $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
 
     $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);
@@ -276,21 +244,10 @@ class divListSystem extends MultiSelectWindow
 
   function setEntries($terminals)
   {
-    $img1  = "<img class='center' src='images/printer.png'            alt='C' title='"._("Cups Server")  ."'>";
-    $img2  = "<img class='center' src='images/scanner.png'            alt='L' title='"._("Log Db") ."'>";
-    $img3  = "<img class='center' src='images/select_terminal.png'    alt='L' title='"._("Syslog Server") ."'>";
-    $img4  = "<img class='center' src='images/mailto.png'             alt='M' title='"._("Mail Server")  ."'>";
-    $img5  = "<img class='center' src='images/select_phone.png'       alt='I' title='"._("Imap Server") ."'>";
-    $img6  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Nfs Server")   ."'>";
-    $img7  = "<img class='center' src='images/select_winstation.png'  alt='K' title='"._("Kerberos Server") ."'>";
-    $img8  = "<img class='center' src='images/select_phone.png'       alt='A' title='"._("Asterisk Server") ."'>";
-    $img9  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Fax Server") ."'>";
-    $img10 = "<img class='center' src='images/save.png'               alt='L' title='"._("Ldap Server") ."'>";
-
     $empty    ="<img src='images/empty.png' style='width:16px ; height: 16px;' class='center' alt=''>";
 
     /* Dynamic action col, depending on snapshot icons */
-    $action_col_size = 110;
+    $action_col_size = 120;
     if($this->parent->snapshotEnabled()){
       $action_col_size += 38;
     }
@@ -300,38 +257,47 @@ class divListSystem extends MultiSelectWindow
 
     /* ACL mapping */
     $ui = get_userinfo();
-    $tabs = array(
-          "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
-          "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
-          "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
-          "printer"     => array("CLASS"=>"PRINTTABS",    "TABCLASS" =>"printtabs",     "ACL"=> "printer/printgeneric"),
-          "phone"       => array("CLASS"=>"PHONETABS",    "TABCLASS" =>"phonetabs",     "ACL"=> "phone/phoneGeneric"),
-          "winstation"  => array("CLASS"=>"WINTABS",      "TABCLASS" =>"wintabs",       "ACL"=> "winworkstation/wingeneric"),
-          "incoming"    => array("CLASS"=>"",             "TABCLASS" =>"",              "ACL"=> "incoming/systems"),
-          "component"   => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
-
+    $tabs = $this->parent->get_tab_defs();
 
     $cnts = array("component" => 0 , "terminal" => 0 , "workstation" => 0 , 
-                  "printer" => 0 , "phone" => 0 , "server" => 0,
+                  "printer" => 0 , "phone" => 0 , "server" => 0,"opsi_client" => 0,
                   "NewDevice" => 0, "winstation"=> 0);
 
+    /* Get list of all objectGroups and their member and release configuration 
+     */
+    $ogroups = array();
+    if($this->parent->fai_activated){
+      $ogroups = get_sub_list("(&(objectClass=gosaGroupOfNames)(FAIclass=*)(member=*))",array("ogroups"),
+          get_ou("ogroupou"),$this->config->current['BASE'],array("FAIclass","member","cn"),GL_NO_ACL_CHECK | GL_SUBSEARCH);
+      foreach($ogroups as $ogroup){
+        for($i = 0 ; $i < $ogroup['member']['count'] ; $i++){
+          if(preg_match("/:/",$ogroup['FAIclass'][0])) {
+            if(!isset($og_list[$ogroup['member'][$i]])){
+              $ogs_release[$ogroup['member'][$i]]['STR'] = ""; 
+              $ogs_release[$ogroup['member'][$i]]['CN'] = ""; 
+            }
+            $ogs_release[$ogroup['member'][$i]]['STR'] .= preg_replace("/^.*:/","",$ogroup['FAIclass'][0]).", ";
+            $ogs_release[$ogroup['member'][$i]]['CN']  .= $ogroup['cn'][0].", ";
+          }
+        }
+      }
+    }
+
     // Test Every Entry and generate divlist Array
     foreach($terminals as $key => $val){
 
       /* Get system type, it is used to fetch the acls for the current object.
           "winstation" acls are stored as 2winworkstation", so we have to map this here */
-      $type     = $this->parent->get_system_type($val);
-      if($type == "winstation") {
-        $acl_type = "winworkstation";
-      }else{
-        $acl_type = $type;
-      }
 
       /* Map NewDevice acls to workstation acls */
+      $type     = $this->parent->get_system_type($val);
       if($type == "NewDevice" || $type == "ArpNewDevice"){
         $type     = "incoming";
-        $acl_type = "incoming";
       }
+      $acl_type = $tabs[$type]['ACLC'];
+      $s_acl    = $tabs[$type]['ACL'];
+      $category = preg_replace("/\/.*$/","",$s_acl);
+      $class    = preg_replace("/^.*\//","",$s_acl);
 
       /* Get complete category acls */
       $acl_all  = $ui->has_complete_category_acls($val['dn'],$acl_type) ;
@@ -339,44 +305,21 @@ class divListSystem extends MultiSelectWindow
       /* Get specific generic acls */
       $acl      = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
 
-      $action ="";
-      if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
-        $action.= "<input class='center' type='image'
-          src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
-        $action.= "<input class='center' type='image'
-          src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
-      }
-      $action.= "<input class='center' type='image' src='images/edit.png' 
+      /* Add copy & cut functionality */
+      $action= $this->parent->get_copypaste_action($val['dn'],$category,$class);
+
+      $action.= "<input class='center' type='image' src='images/lists/edit.png' 
                     alt='"._("edit")."'     name='system_edit_%KEY%' title='"._("Edit system")."'>";
-      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-        $action.= $this->GetSnapShotActions($val['dn']);
-      }else{
-        $action.= $empty."&nbsp;".$empty."&nbsp;";
-      }
 
+      $action.= $this->parent->get_snapshot_action($val['dn'],$acl_type);
 
       if(preg_match("/d/",$acl)){
-        $action.= "<input class='center' type='image' src='images/edittrash.png' 
+        $action.= "<input class='center' type='image' src='images/lists/trash.png'
           alt='"._("delete")."'   name='system_del_%KEY%' title='"._("Delete system")."'>";
       }else{
-        $action.= $empty;    
+        $action.= $empty;
       }
 
-      /* Generate picture list, which is currently disabled */
-      if(in_array("goCupsServer"    ,$val['objectClass'])) $cups    = $img1;   else $cups  =$empty;
-      if(in_array("goLogDBServer"   ,$val['objectClass'])) $logdb   = $img2;   else $logdb =$empty;
-      if(in_array("goSyslogServer"  ,$val['objectClass'])) $syslog  = $img3;   else $syslog=$empty;
-      if(in_array("goImapServer"    ,$val['objectClass'])) $imap    = $img4;   else $imap  =$empty;
-      if(in_array("sambaSamAccount" ,$val['objectClass'])) $samba   = $img5;   else $samba =$empty;
-      if(in_array("goShareServer"   ,$val['objectClass'])) $nfs     = $img6;   else $nfs   =$empty;
-      if(in_array("goKrbServer"     ,$val['objectClass'])) $krb     = $img7;   else $krb   =$empty;
-      if(in_array("goFonServer"     ,$val['objectClass'])) $fon     = $img8;   else $fon   =$empty;
-      if(in_array("goFaxServer"     ,$val['objectClass'])) $fax     = $img9;   else $fax   =$empty;
-      if(in_array("goLdapServer"    ,$val['objectClass'])) $ldap     = $img10;   else $ldap   =$empty;
-
-      $pics = $cups.$logdb.$syslog.$imap.$samba.$nfs.$krb.$fon.$fax.$ldap;
-      $pics = ""; // Pictures currently hidden
-
       $val['cn'][0]= preg_replace('/\$$/', '', $val['cn'][0]);
 
       // Generate Array to Add
@@ -390,24 +333,17 @@ class divListSystem extends MultiSelectWindow
         $display= $val["cn"][0].$dsc;
       }
 
-     
       /* Check if this is a terminal/workstation && if we are allowed to change the gotoRootPasswd */
-      $pwd_acl =""; 
-      if(in_array("gotoWorkstation",$val['objectClass'])){
-        $pwd_acl = $ui->get_permissions($val['dn'],"workstation/workgeneric","gotoRootPasswd");
-      }    
-      if(in_array("gotoTerminal",$val['objectClass'])){
-        $pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd");
-      }    
-      if(preg_match("/w/",$pwd_acl)){
-        $action2 = "<input class='center' type='image' src='images/certs.png' alt='"._("Password")."'   name='system_setpwd_%KEY%' title='"._("Set root password")."'>";
+      $display_key_for = array("terminal","workstation","server","component");
+      $pwd_acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL'],"userPassword");
+      if(preg_match("/w/",$pwd_acl) && in_array($type,$display_key_for)){
+        $action2 = "<input class='center' type='image' src='images/lists/key.png' alt='"._("Password")."'   name='system_setpwd_%KEY%' title='"._("Set password")."'>";
       }else{
         $action2 = $empty;
       }
 
-
       if(in_array("gotoWorkstation",$val['objectClass'])){
-        $action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'   
+        $action2= "<input class='center' type='image' src='plugins/systems/images/cdrom.png' alt='"._("Create CD")."'   
                       name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>&nbsp;".$action2;
       }else{
         $action2= $empty.$action2;
@@ -435,15 +371,34 @@ class divListSystem extends MultiSelectWindow
       }
       $cnts[$type] ++;
 
-
       /* Create each field */
       $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
-                      "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('/ /', '&nbsp;', @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));
+          "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('/ /', '&nbsp;', @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 ="&nbsp;";
+        $release_attach = ""; 
+        if(isset($val['FAIclass'][0]) && preg_match("/:/",$val['FAIclass'][0])){
+          $release        = preg_replace("/^.*:/","",$val['FAIclass'][0]);
+          $release_attach = ""; 
+        }elseif(isset($ogs_release[$val['dn']])){
+          $release = trim($ogs_release[$val['dn']]['STR'],", ").
+            "&nbsp;<img src='plugins/ogroups/images/select_ogroup.png' class='center' alt='' 
+            title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'>";
+          $release_attach = "title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'"; 
+        }
+        $field2a = array("string" => $release,"attach"=>$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 */
@@ -452,33 +407,33 @@ class divListSystem extends MultiSelectWindow
       $num_deps = count($this->Added_Departments);
     }
 
-    $num_ser_str = _("Number of listed servers");
-    $num_ws_str  = _("Number of listed workstations");
-    $num_ter_str = _("Number of listed terminals");
-    $num_pho_str = _("Number of listed phones");
-    $num_prt_str = _("Number of listed printers");
-    $num_com_str = _("Number of listed network components");
-    $num_new_str = _("Number of listed new devices");
-    $num_wws_str = _("Number of listed windows workstations");
-    $num_dep_str = _("Number of listed departments");
-
-    $str = "<img class='center' src='images/select_server.png'
+    $num_ser_str = sprintf(_("Number of listed '%s'"),_("servers"));
+    $num_ws_str  = sprintf(_("Number of listed '%s'"),_("workstations"));
+    $num_ter_str = sprintf(_("Number of listed '%s'"),_("terminals"));
+    $num_pho_str = sprintf(_("Number of listed '%s'"),_("phones"));
+    $num_prt_str = sprintf(_("Number of listed '%s'"),_("printers"));
+    $num_com_str = sprintf(_("Number of listed '%s'"),_("network components"));
+    $num_new_str = sprintf(_("Number of listed '%s'"),_("new devices"));
+    $num_wws_str = sprintf(_("Number of listed '%s'"),_("windows workstations"));
+    $num_dep_str = sprintf(_("Number of listed '%s'"),_("departments"));
+
+    $str = "<img class='center' src='plugins/systems/images/select_server.png'
       title='".$num_ser_str."' alt='".$num_ser_str."'>&nbsp;".$cnts['server']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_workstation.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_workstation.png'
       title='".$num_ws_str."' alt='".$num_ws_str."'>&nbsp;".$cnts['workstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_terminal.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_terminal.png'
       title='".$num_ter_str."' alt='".$num_ter_str."'>&nbsp;".$cnts['terminal']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_phone.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_phone.png'
       title='".$num_pho_str."' alt='".$num_pho_str."'>&nbsp;".$cnts['phone']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_printer.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_printer.png'
       title='".$num_prt_str."' alt='".$num_prt_str."'>&nbsp;".$cnts['printer']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_component.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_component.png'
       title='".$num_com_str."' alt='".$num_com_str."'>&nbsp;".$cnts['component']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_newsystem.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_newsystem.png'
       title='".$num_new_str."' alt='".$num_new_str."'>&nbsp;".$cnts['NewDevice']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_winstation.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_winstation.png'
       title='".$num_wws_str."' alt='".$num_wws_str."'>&nbsp;".$cnts['winstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/folder.png'
+    $str.= "<img class='center' src='images/lists/folder.png'
       title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
 
     $this->set_List_Bottom_Info($str);