Code

Updated headers
[gosa.git] / gosa-core / plugins / admin / groups / class_groupManagement.inc
index 3f77e0bd1d9a682c506f12bf91c80b4514cb42f3..7a764e80ebc9dcc6c8429ce55fb56b14697fce52 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 groupManagement extends plugin
@@ -146,9 +148,56 @@ class groupManagement extends plugin
       $s_action = "multiple_edit";
     }
 
+    if(isset($_POST['menu_action']) && preg_match("/^trigger_event_DaemonEvent_notify/",$_POST['menu_action'])){
+      $s_action = "notify";
+    }
 
     $smarty= get_smarty();
 
+
+
+    /********************
+      Create notification event
+     ********************/
+
+    if($s_action == "notify"){
+
+      $ids = $this->list_get_selected_items();
+      $uids = array();
+      foreach($ids as $id){
+        $uids[] = $this->grouplist[$id]['cn'][0];
+      }
+      if(count($uids)){
+        $this->grouptab = new DaemonEvent_notify($this->config);
+        $this->grouptab->add_targets($uids);
+      }
+    }
+
+    /* Abort event dialog */
+    if(isset($_POST['abort_event_dialog'])){
+      $this->grouptab = FALSE;
+    }
+
+    /* Save event */
+    if(isset($_POST['save_event_dialog'])){
+      $o_queue = new gosaSupportDaemon();
+      $o_queue->append($this->grouptab);
+      if($o_queue->is_error()){
+        msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."),
+              $o_queue->get_error()),ERROR_DIALOG);
+      }else{
+        $this->grouptab = FALSE;
+      }
+    }
+
+    /* Display event */
+    if($this->grouptab instanceof DaemonEvent){
+      $this->grouptab->save_object();
+      return($this->grouptab->execute());
+    }
+
+
+
     /********************
       Copy & Paste Handling  ...
      ********************/
@@ -175,7 +224,7 @@ class groupManagement extends plugin
            react on this. */
         $this->dn= "new";
 
-        /* Create new usertab object */
+        /* Create new grouptab object */
         $this->grouptab= new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $this->dn);
 
         /* Set up the group ACL's for this 'dn' */
@@ -686,12 +735,9 @@ class groupManagement 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->DivListGroup->selectedBase);
-
       /* Get dialog */
       $data = $this->CopyPasteHandler->execute();
+      $this->CopyPasteHandler->SetVar("base",$this->DivListGroup->selectedBase);
 
       /* Return dialog data */
       if(!empty($data)){