Code

Replace {t}Delete{/t} with {msgPool type=delButton}
[gosa.git] / gosa-plugins / systems / admin / systems / class_systemManagement.inc
index 916730435d30e00ebf0b3b507561e9e04ed24a4e..b1f33c1b94cc54845aaa48774812e569175d0b45 100644 (file)
@@ -1,21 +1,23 @@
 <?php
 /*
-   This code is part of GOsa (https://gosa.gonicus.de)
-   Copyright (C) 2003  Cajus Pollmeier
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 class systems extends plugin
@@ -515,7 +517,7 @@ class systems extends plugin
             $mac[]= $attrs['macAddress'][0];
           }
         }
-        $events = DaemonEvent::get_event_types();
+        $events = DaemonEvent::get_event_types(SYSTEM_EVENT);
         $type = preg_replace("/^[a-z]*_event_/","",$s_action);
 
         /* Prepare event to be added 
@@ -879,7 +881,7 @@ class systems extends plugin
         /* Get macAddress to be able to an installation event 
          */ 
         if($this->systab instanceof ArpNewDeviceTabs || session::is_set('SelectedSystemType')){
-          $events = DaemonEvent::get_event_types();
+          $events = DaemonEvent::get_event_types(SYSTEM_EVENT);
          
           /* Get mac of currently edited entry */ 
           $mac = "";
@@ -896,11 +898,11 @@ class systems extends plugin
 
           /* Add installation event
            */
-          if(!empty($mac) && isset($events['BY_CLASS']['DaemonEvent_install'])){
-            $evt = $events['BY_CLASS']['DaemonEvent_install'];
+          if(!empty($mac) && isset($events['BY_CLASS']['DaemonEvent_reinstall'])){
+            $evt = $events['BY_CLASS']['DaemonEvent_reinstall'];
             $tmp = new $evt['CLASS_NAME']($this->config);
             $tmp->add_targets(array($mac));
-            $tmp->set_type(TRIGGERED_EVENT);
+            $tmp->set_type(SCHEDULED_EVENT);
             $o_queue = new gosaSupportDaemon();
             $o_queue->append($tmp);
             if($o_queue->is_error()){
@@ -937,7 +939,7 @@ class systems extends plugin
       } else {
         /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
-        show_errors($message);
+        msgDialog::displayChecks($message);
       }
     }
 
@@ -972,6 +974,7 @@ class systems extends plugin
 
       $dialog     = FALSE;
       $hide_apply = $this->dn == "new";
+      $hide_apply = ($this->dn == "new") || (preg_match("/".normalizePreg(get_ou("incomingou"))."/",$this->dn));
       if(is_object($this->systab) && !isset($this->systab->by_object)){
         $dialog = TRUE;
         $hide_apply = TRUE;
@@ -1376,13 +1379,10 @@ class systems extends plugin
   
     /* Return C&P dialog */
     if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
-    
-      /* Load entry from queue and set base */
-      $this->CopyPasteHandler->load_entry_from_queue();
-      $this->CopyPasteHandler->SetVar("base",$this->DivListSystem->selectedBase);
 
       /* Get dialog */
       $data = $this->CopyPasteHandler->execute();
+      $this->CopyPasteHandler->SetVar("base",$this->DivListSystem->selectedBase);
 
       /* Return dialog data */
       if(!empty($data)){