Code

Commit LHM-local patch
[gosa.git] / trunk / gosa-plugins / systems / admin / systems / class_divListSystem.inc
index 88cd4f5113b85369796f13431959b182498c635e..f03f1744bd3afa0d68134938ea21e36243888c13 100644 (file)
@@ -44,6 +44,9 @@ class divListSystem extends MultiSelectWindow
   /* Subsearch checkbox */
   var $SubSearch;
 
+  /* Search descriptions checkbox */
+  var $DescSearch;
+
   var $parent             ;
   var $ui                 ;
 
@@ -142,6 +145,9 @@ class divListSystem extends MultiSelectWindow
     $this->AddCheckBox(SEPERATOR);
     $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
 
+    /* Add DescSearch checkbox */
+    $this->AddCheckBox("DescSearch", msgPool::selectToView("","descsearch"), msgPool::selectToView("","descsearch_small"), false);
+
     /*                  Name                 ,Text                              ,Default  , Connect with alphabet  */
     $this->AddRegex   ("Regex",     _("Display systems matching"),"*" , true);
     $this->AddRegex   ("UserRegex", _("Display systems of user"), "*" , false, "images/lists/search-user.png");
@@ -355,11 +361,14 @@ class divListSystem extends MultiSelectWindow
       /* Add create FAI CD icon 
        */
       $acl_cd = preg_match("/w/",$ui->get_permissions($val['dn'],"workstation/workgeneric","createFAICD"));
-      if(in_array("gotoWorkstation",$val['objectClass']) && $acl_cd){
-        $action2= "<input class='center' type='image' src='plugins/systems/images/cdrom.png' alt='"._("Create CD")."'   
+      $isocd_command= $this->config->search("workgeneric", "ISOCMD",array('tabs'));
+      if (check_command($isocd_command)){
+        if(in_array("gotoWorkstation",$val['objectClass']) && $acl_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;
+        }else{
+          $action2= $empty.$action2;
+        }
       }
 
       if(isset($val['message'])){
@@ -385,12 +394,20 @@ class divListSystem extends MultiSelectWindow
       $cnts[$type] ++;
 
       /* Create each field */
+      $filtered_dn = str_replace('\\,', '\\2C', LDAP::fix($val['dn']));
       $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']))."'");
+      if(isset($ogs_release[$filtered_dn])){
+        $field2 = array("string" => sprintf($editlink,$key,$display)."&nbsp;<img src=
+            'plugins/ogroups/images/select_ogroup.png' class='center' alt='' title='".
+            sprintf(_("Member of %s object group"),trim($ogs_release[$filtered_dn]['CN'],", "))."'>",
+            "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', LDAP::fix($filtered_dn))."'");
+      }else{
+        $field2 = array("string" => sprintf($editlink,$key,$display),
+            "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', LDAP::fix($filtered_dn))."'");
+      }
       $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),
           "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
 
@@ -401,11 +418,11 @@ class divListSystem extends MultiSelectWindow
         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'],", ").
+        }elseif(isset($ogs_release[$filtered_dn])){
+          $release = trim($ogs_release[$filtered_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'],", "))."'"; 
+            title='".sprintf(_("Inherited from %s"),trim($ogs_release[$filtered_dn]['CN'],", "))."'>";
+          $release_attach = "title='".sprintf(_("Inherited from %s"),trim($ogs_release[$filtered_dn]['CN'],", "))."'"; 
         }
         $field2a = array("string" => $release."&nbsp;","attach"=>$release_attach." style='width:100px;'");
         $this->AddElement( array($field0,$field1,$field2,$field2a,$field3));
@@ -420,15 +437,15 @@ class divListSystem extends MultiSelectWindow
       $num_deps = count($this->Added_Departments);
     }
 
-    $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"));
+    $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;";