Code

Updated FAI template entry.
[gosa.git] / gosa-plugins / fai / admin / fai / class_divListFai.inc
index f31cd2920504a203b812ab400b56c1f727f378a0..f171d9c0655394c665cdec7be0d473340f13db80 100644 (file)
@@ -30,7 +30,7 @@ class divListFai extends MultiSelectWindow
 
     /* Set list strings */
     $this->SetTitle(  _("List of classes"));
-    $this->SetSummary(_("List of deployment classes and packages"));
+    $this->SetSummary(_("List of deployment classes and products"));
 
     /* Result page will look like a headpage */
     $this->SetHeadpageMode();
@@ -74,9 +74,9 @@ class divListFai extends MultiSelectWindow
      */
     if($this->parent->opsi instanceof opsi && $this->parent->opsi->enabled()){
       $this->AddCheckBox("ShowOpsiNetboot" , sprintf(_("Display objects of type '%s'."),
-        _("Opsi netboot product")),_("Show opsi netboot pruducts")   ,true);
+        _("OPSI netboot product")),_("Show netboot products")   ,true);
       $this->AddCheckBox("ShowOpsiLocal" , sprintf(_("Display objects of type '%s'."),
-        _("Opsi local product")),_("Show opsi locale pruducts")   ,true);
+        _("OPSI local product")),_("Show local products")   ,true);
     }
 
     /* Add SubSearch checkbox */
@@ -129,7 +129,7 @@ class divListFai extends MultiSelectWindow
     $add_sep = false;
 
     /* Get complete fai acls, to be able to check if we must show or hide the snapshot abilities */ 
-    $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
+    $acl_all = $ui->has_complete_category_acls($this->parent->acl_base,$this->module);
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header(false);
@@ -143,7 +143,7 @@ class divListFai extends MultiSelectWindow
     $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
 
-    $acl = $ui->get_permissions($this->parent->fai_base,"fai/faiProfile");
+    $acl = $ui->get_permissions($this->parent->acl_base,"fai/faiProfile");
     if($this->parent->lock_type == "freeze" && !$this->parent->allow_freeze_object_attach){
       $s.= "...|<input class='center' type='image' src='plugins/fai/images/freeze.png' alt=''>".
         "&nbsp;"._("Freezed")."|\n";
@@ -169,7 +169,7 @@ class divListFai extends MultiSelectWindow
             "Create_package"   , _("PK") , "faiPackage"));
 
       foreach($arr as $ar){
-        $acl = $ui->get_permissions($this->parent->fai_base,"fai/".$ar[4]);
+        $acl = $ui->get_permissions($this->parent->acl_base,"fai/".$ar[4]);
         if(preg_match("/c/",$acl)){
           $s.= "...|<input class='center' type='image' src='".$ar[0]."' alt=''>".
             "&nbsp;".$ar[1]."|".$ar[2]."|\n";
@@ -222,9 +222,9 @@ class divListFai extends MultiSelectWindow
         "FAItemplate"        => array("IMG"=> "plugins/fai/images/fai_template.png",       
           "NAME"=>_("Templates") ,     "KZL"=> "T",  "VAR"=>"ShowTemplates"),
         "opsi_netboot"       => array("IMG"=> "plugins/opsi/images/netboot_package.png",       
-          "NAME"=>_("Opsi netboot package") ,     "KZL"=> "ON",  "VAR"=>"ShowOpsiNetboot"),
+          "NAME"=>_("OPSI netboot product") ,     "KZL"=> "ON",  "VAR"=>"ShowOpsiNetboot"),
         "opsi_local"         => array("IMG"=> "plugins/opsi/images/local_package.png",       
-          "NAME"=>_("Opsi local package")   ,     "KZL"=> "OL",  "VAR"=>"ShowOpsiLocal"));
+          "NAME"=>_("OPSI local product")   ,     "KZL"=> "OL",  "VAR"=>"ShowOpsiLocal"));
 
 
     /* Dynamic action col, depending on snapshot icons */
@@ -269,7 +269,7 @@ class divListFai extends MultiSelectWindow
        /* Add copy & cut icons */
        $ui = get_userinfo();
        $action ="";
-       $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
+       $acl_all = $ui->has_complete_category_acls($this->parent->acl_base,$this->module);
 
        if(preg_match("/^opsi_/",$type)){
          $editlink ="<a href='?plug=".$_GET['plug']."&amp;edit_opsi_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
@@ -313,11 +313,15 @@ class divListFai extends MultiSelectWindow
 
         $display = "<div style='overflow:hidden; height:1em;'>".$display."</div>";
 
-       /* Create each field */
+        /* Some objects are non ldap objects which do not have a dn.
+         */
+        if(!isset($value['dn'])) $value['dn'] = "";
+
+        /* Create each field */
        $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
            "attach" => "style='width:20px;'");
        $field1 = array("string" => $img , "attach" => "style='text-align:center;width:20px;'");
-       $field2 = array("string" => preg_replace(array("/%KEY%/","/%NAME%/","/%TITLE%/"),array($key,$display,preg_replace('/ /', '&nbsp;', @LDAP::fix($value['dn']))),$edi) , "attach" => "style=''");
+       $field2 = array("string" => preg_replace(array("/%KEY%/","/%NAME%/","/%TITLE%/"),array($key,$display,preg_replace('/ /', '&nbsp;', LDAP::fix($value['dn']))),$edi) , "attach" => "style=''");
        $field3 = array("string" => $info, "attach" => "style='width:200px;'");
        $field4 = array("string" => preg_replace("/%KEY%/",$key,$acti) , "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
        $this->AddElement(array($field0,$field1,$field2,$field3,$field4));
@@ -337,24 +341,33 @@ class divListFai extends MultiSelectWindow
      $template_str   = sprintf(_("Number of listed '%s'"),_("templates"));
      $package_str    = sprintf(_("Number of listed '%s'"),_("packages"));   
      $dep_str        = sprintf(_("Number of listed '%s'"),_("departments"));
+     $opsi_netboot   = sprintf(_("Number of listed '%s'"),_("netboot products"));
+     $opsi_local     = sprintf(_("Number of listed '%s'"),_("local products"));
+
+     $str = "<img class=\"center\" src=\"".$objects['FAIprofile']['IMG']."\"
+       title=\"".$profile_str."\" alt=\"".$profile_str."\">&nbsp;".$cnts['FAIprofile']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAIpartitionTable']['IMG']."\"
+       title=\"".$partition_str."\" alt=\"".$partition_str."\">&nbsp;".$cnts['FAIpartitionTable']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAIscript']['IMG']."\"
+       title=\"".$script_str."\" alt=\"".$script_str."\">&nbsp;".$cnts['FAIscript']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAIhook']['IMG']."\"
+       title=\"".$hook_str."\" alt=\"".$hook_str."\">&nbsp;".$cnts['FAIhook']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAIvariable']['IMG']."\"
+       title=\"".$variable_str."\" alt=\"".$variable_str."\">&nbsp;".$cnts['FAIvariable']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAItemplate']['IMG']."\"
+       title=\"".$template_str."\" alt=\"".$template_str."\">&nbsp;".$cnts['FAItemplate']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src=\"".$objects['FAIpackageList']['IMG']."\"
+       title=\"".$package_str."\" alt=\"".$package_str."\">&nbsp;".$cnts['FAIpackageList']."&nbsp;&nbsp;&nbsp;&nbsp;";
+     $str.= "<img class=\"center\" src='images/lists/folder.png'
+       title=\"".$dep_str."\" alt=\"".$dep_str."\">&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
 
-     $str = "<img class='center' src='".$objects['FAIprofile']['IMG']."'
-       title='".$profile_str."' alt='".$profile_str."'>&nbsp;".$cnts['FAIprofile']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAIpartitionTable']['IMG']."'
-       title='".$partition_str."' alt='".$partition_str."'>&nbsp;".$cnts['FAIpartitionTable']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAIscript']['IMG']."'
-       title='".$script_str."' alt='".$script_str."'>&nbsp;".$cnts['FAIscript']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAIhook']['IMG']."'
-       title='".$hook_str."' alt='".$hook_str."'>&nbsp;".$cnts['FAIhook']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAIvariable']['IMG']."'
-       title='".$variable_str."' alt='".$variable_str."'>&nbsp;".$cnts['FAIvariable']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAItemplate']['IMG']."'
-       title='".$template_str."' alt='".$template_str."'>&nbsp;".$cnts['FAItemplate']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='".$objects['FAIpackageList']['IMG']."'
-       title='".$package_str."' alt='".$package_str."'>&nbsp;".$cnts['FAIpackageList']."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $str.= "<img class='center' src='images/lists/folder.png'
-       title='".$dep_str."' alt='".$dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
-     $this->set_List_Bottom_Info($str);
+    if($this->parent->opsi instanceof opsi && $this->parent->opsi->enabled()){
+      $str.= "<img class=\"center\" src=\"".$objects['opsi_netboot']['IMG']."\"
+        title=\"".$opsi_netboot."\" alt=\"".$opsi_netboot."\">&nbsp;".$cnts['opsi_netboot']."&nbsp;&nbsp;&nbsp;&nbsp;";
+      $str.= "<img class=\"center\" src=\"".$objects['opsi_local']['IMG']."\"
+        title=\"".$opsi_local."\" alt=\"".$opsi_local."\">&nbsp;".$cnts['opsi_local']."&nbsp;&nbsp;&nbsp;&nbsp;";
+    }
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()