Code

fixed problem with klicking apply more than once
[gosa.git] / plugins / admin / systems / class_glpiPrinterAccount.inc
index abaa32acb67dccdee0244424b772778fc6dd5423..5af98b686c62eef30c23c5fa26c8530a1e4aba1a 100644 (file)
@@ -196,10 +196,10 @@ class glpiPrinterAccount extends plugin
 
     /* Show tab dialog headers */
     if ($this->is_account){
-      $display= $this->show_header(_("Remove inventory"),
+      $display= $this->show_disable_header(_("Remove inventory"),
           _("This server has inventory features enabled. You can disable them by clicking below."));
     } else {
-      $display= $this->show_header(_("Add inventory"),
+      $display= $this->show_enable_header(_("Add inventory"),
           _("This server has inventory features disabled. You can enable them by clicking below."));
       return ($display);
     }
@@ -376,7 +376,8 @@ class glpiPrinterAccount extends plugin
       if(!in_array($id,$users)){
 
         /* If this user doesn't exists in glpi db, we must create him */
-        $atr = $ldap->fetch($ldap->cat($id));
+        $ldap->cat($id, array('cn', 'mail', 'telephoneNumber'));
+        $atr = $ldap->fetch();
         $tmp = array();
         $use = array( "cn"              =>"name",
             "mail"            =>"email",
@@ -599,7 +600,8 @@ class glpiPrinterAccount extends plugin
      *  Assign contact and technical responsible person 
      */
     if(isset($users[$this->contact_num])){
-      $tr = $ldap->fetch($ldap->cat($users[$this->contact_num]));
+      $ldap->cat($users[$this->contact_num], array('givenName', 'sn', 'uid'));
+      $tr = $ldap->fetch();
       $str = "";
       if(isset($tr['givenName'][0])){   $str .= $tr['givenName'][0]." ";      }
       if(isset($tr['sn'][0])) {         $str .= $tr['sn'][0]." ";             }
@@ -613,7 +615,8 @@ class glpiPrinterAccount extends plugin
        Assign name ... to smarty, if set
      */ 
     if(isset($users[$this->tech_num])){
-      $tr = $ldap->fetch($ldap->cat($users[$this->tech_num]));
+      $ldap->cat($users[$this->tech_num], array('givenName', 'sn', 'uid'));
+      $tr = $ldap->fetch();
       $str = "";
       if(isset($tr['givenName'][0])){   $str .= $tr['givenName'][0]." ";      }
       if(isset($tr['sn'][0])) {         $str .= $tr['sn'][0]." ";             }
@@ -675,7 +678,8 @@ class glpiPrinterAccount extends plugin
   /* Check supplied data */
   function check()
   {
-    $message= array();
+    /* Call common method to give check the hook */
+    $message= plugin::check();
 
     //    if($this->TechnicalResponsible == ""){
     //      $message[] = _("Please select a technical responsible person for this entry.");
@@ -753,7 +757,37 @@ class glpiPrinterAccount extends plugin
     return($ret);
   }  
 
+     /* Return plugin informations for acl handling */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Glpi"),
+          "plDescription" => _("Printer inventory extension"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 0,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("printer"),
+
+          "plProvidedAcls"=> array(
+            "flags_serial"         => _("Supports serial interface"),
+            "flags_par"            => _("Supports parallel interface"),
+            "flags_usb"            => _("Supports usb interface"),
+            "tech_num"             => _("Technical responsible"),
+            "comments"             => _("Comments"),
+            "location"             => _("Location"),
+            "contact_num"          => _("Contact person"),
+            "type"                 => _("Type"),
+            "FK_glpi_enterprise"   => _("Manufacturer"),
+
+            "Attachment_name"             => _("Attachment name"),
+            "Attachment_comment"          => _("Attachment comment"),
+            "Attachment_mime"             => _("Attachment mime type"),
+            "Attachment_filename"         => _("Attachment filename"),
+        
+            "ManageCartridges"            => _("Cartridge settings"))
+          ));
+  }
 }
-
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>