Code

Requrie new schema for gosaAccount
[gosa.git] / gosa-core / include / class_multi_plug.inc
index 89f02568790d8d230cb0fda96a537d0cd256c90c..af39e67d72956abc368808cdf6179ba01236735d 100644 (file)
@@ -1,21 +1,23 @@
 <?php
 /*
-   This code is part of GOsa (https://oss.gonicus.de/labs/gosa/)
-   Copyright (C) 2007 Fabian Hickert
-
-   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
  */
 
 /*
@@ -131,6 +133,8 @@ class multi_plug
   public $config  = NULL;
   private $s_class= "";
   public $current = "";
+  public $by_object = array();
+  public $by_name = array();
 
   /*! \brief    Creates a multi_plug object
      @param   object  $config GOsa Configuration object
@@ -152,8 +156,11 @@ class multi_plug
     /* Initialize collector object 
      * Used to display the ui and to collect the user input.
      */
-    $this->o_tab    = new $class($config,$tab,"new",$acl_category);
+    $this->o_tab    = new $class($config,$tab,"new",$acl_category, TRUE, TRUE);
     $this->o_tab->set_acl_base($acl_base);
+    $this->by_object = &$this->o_tab->by_object;
+    $this->by_name   = &$this->o_tab->by_name;
+    $this->current   = &$this->o_tab->current;
 
     /* Check if the specified tab object supports multiple edits 
      */
@@ -166,7 +173,7 @@ class multi_plug
       /* Initialize the objects we want to edit at once 
        */
       foreach($dns as $dn){
-        $obj = new $class($config,$tab,$dn,$acl_category);
+        $obj = new $class($config,$tab,$dn,$acl_category, TRUE, TRUE);
         $obj->set_acl_base($acl_base);
         $this->a_handles[] = $obj;
       }
@@ -197,6 +204,11 @@ class multi_plug
         if(!isset($base[$key])){
           $base[$key] = $add[$key]; 
         }else{
+
+          if(!isset($base[$key]['count'])){
+            $base[$key]['count'] = count($base[$key]);
+          }
+
           if(!isset($add[$key]['count'])){
             $add[$key]['count'] = count($add[$key]);
           }
@@ -278,7 +290,8 @@ class multi_plug
    */
   public function execute()
   {
-    return($this->o_tab->execute());
+    $str = $this->o_tab->execute();
+    return($str);
   }