Code

Updated workService.
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationService.inc
index 1e4e348b657ac4ce6041c4f74ae6f115da775c37..3897dfe71e05bdf46e3cdfe2545ac5203469eecd 100644 (file)
@@ -3,6 +3,8 @@
 class workservice extends plugin
 {
   var $gotoScannerEnable;
+  var $gotoLpdEnable = array();
+
   /* Generic terminal attributes */
   var $gotoXMonitor= "";
   var $gotoXDriver= "";
@@ -35,7 +37,7 @@ class workservice extends plugin
 
 
   /* attribute list for save action */
-  var $attributes= array("gotoXMonitor",
+  var $attributes= array("gotoXMonitor","gotoLpdEnable",
       "gotoXDriver", "gotoXResolution", "gotoXColordepth",
       "gotoXHsync", "gotoXVsync",
       "gotoScannerEnable", "gotoScannerClients",
@@ -61,6 +63,15 @@ class workservice extends plugin
         "1400x1050" =>  "1400x1050", 
         "1600x1200" =>  "1600x1200");
 
+    /* Load gotoLpdEnable 
+     */
+    $this->gotoLpdEnable = array();
+    if(isset($this->attrs['gotoLpdEnable']['count'])){
+      for($i = 0 ; $i < $this->attrs['gotoLpdEnable']['count']; $i ++){
+        $this->gotoLpdEnable[] = $this->attrs['gotoLpdEnable'][$i];
+      }
+    }
+
     if($this->config->get_cfg_value("resolutions") != ""){
       $file = $this->config->get_cfg_value("resolutions");
 
@@ -229,8 +240,6 @@ class workservice extends plugin
 
   function execute()
   {
-    $this->send_goto_reload();
-
     /* Call parent execute */
     plugin::execute();
 
@@ -253,6 +262,34 @@ class workservice extends plugin
       }
     }
 
+
+    /**********
+      gotoLpdEnable 
+     **********/
+    if(isset($_POST['gotoLpdEnable_Close'])){
+      $this->dialog = NULL;
+    }
+    if(isset($_POST['gotoLpdEnable_Ok'])){
+      $this->dialog->save_object();
+      $this->gotoLpdEnable = $this->dialog->save();
+      $this->dialog = NULL;
+    }
+
+    if(isset($_POST['gotoLpdEnable_Edit'])){
+      $this->dialog = new gotoLpdEnable($this->config,$this->gotoLpdEnable,$this);
+    }
+
+    if($this->dialog instanceof plugin){
+      $this->dialog->save_object();
+      return($this->dialog->execute());
+    }
+
+
+    /**********
+      Ende: gotoLpdEnable 
+     **********/
+
+
     /* Show main page */
     $smarty= get_smarty();
 
@@ -439,17 +476,18 @@ class workservice extends plugin
     $this->cleanup();
 
 
-    /* Send goto reload event to gosaSupportDaemon */
-    if(count($this->attrs)){
-      $this->send_goto_reload(); 
-    }
-
     $ldap->modify ($this->attrs); 
     new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     if (!$ldap->success()){
       msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
     }
     $this->handle_post_events("modify");
+
+    /* Send goto reload event to gosaSupportDaemon */
+    if(count($this->attrs)){
+      $this->send_goto_reload(); 
+    }
+
   }
 
 
@@ -495,6 +533,7 @@ class workservice extends plugin
             "gotoXVsync"            => _("VSync"),
             "AutoSync"              => _("Use DDC"),
             "gotoScannerEnable"     => _("Scanner enabled"),
+            "gotoLpdEnable"         => _("Printer enabled"),
             "gotoXKbModel"          => _("Keyboard model"),
             "gotoXKbLayout"         => _("Keyboard layout"),
             "gotoXKbVariant"        => _("Keyboard variant"),