Code

Reverted sme changes made for multiple user edit
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Oct 2007 08:30:29 +0000 (08:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Oct 2007 08:30:29 +0000 (08:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7594 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_location.inc
include/class_plugin.inc
include/class_tabs.inc

index 7b86a797914d0e489df6e922674effac4494ca39..a66561302e42b8ad7990d6692126002ebcc12e59 100644 (file)
@@ -45,10 +45,10 @@ $class_mapping= array(
                 "ldifimport" => "plugins/addons/ldapmanager/class_import.inc",
                 "ldif" => "plugins/addons/ldapmanager/class_ldif.inc",
                 "ldifexport" => "plugins/addons/ldapmanager/class_export.inc",
+                "bugsubmitter" => "plugins/addons/bugsubmitter/class_bugsubmitter.inc",
                 "gosa_logview" => "plugins/addons/logview/class_gosa_logview.inc",
                 "log_tabs" => "plugins/addons/logview/tabs_log.inc",
                 "logview" => "plugins/addons/logview/class_logview.inc",
-                "bugsubmitter" => "plugins/addons/bugsubmitter/class_bugsubmitter.inc",
                 "acltab" => "plugins/admin/acl/tabs_acl.inc",
                 "aclroletab" => "plugins/admin/acl/tabs_acl_role.inc",
                 "aclManagement" => "plugins/admin/acl/class_aclManagement.inc",
@@ -272,6 +272,7 @@ $class_mapping= array(
                 "LDAP" => "include/class_ldap.inc",
                 "log" => "include/class_log.inc",
                 "dhcpPlugin" => "include/class_dhcpPlugin.inc",
+                "multi_plug" => "include/class_multi_plug.inc",
                 "Step_Ldap" => "setup/class_setupStep_Ldap.inc",
                 "Step_Finish" => "setup/class_setupStep_Finish.inc",
                 "setup_step" => "setup/class_setupStep.inc",
index ccb7e5406d772e97cd0eb290aec7ba1a32215e1e..4d753e7cc9af7aadb84123d5da8b77d83cd21f24 100644 (file)
@@ -122,6 +122,9 @@ class plugin
   /* This variable indicates that this class can handle multiple dns at once. */
   var $multiple_support = FALSE; 
 
+  /* This aviable indicates, that we are currently in multiple edit handle */
+  var $multiple_support_active = FALSE; 
+
   /*! \brief plugin constructor
 
     If 'dn' is set, the node loads the given 'dn' from LDAP
index 059e477002fec37f0c6f4dfdc1071a256d95926f..a39c7505b18c04306ebba071906c4252d0655390 100644 (file)
@@ -33,8 +33,6 @@ class tabs
   var $by_object= array();
   var $SubDialog = false;
 
-  var $multiple_entries = FALSE;
-
   function tabs(&$config, $data, $dn, $acl_category= "")
   {
     /* Save dn */
@@ -43,26 +41,7 @@ class tabs
 
     $baseobject= NULL;
 
-    /* Check specified dn 
-     */
-    if(is_string($dn)){
-
-    }elseif(is_array($dn)&&count($dn) == 1){
-      $this->dn = $dn[key($dn)];
-    }elseif(is_array($dn)&&count($dn) > 1){
-      $this->multiple_entries = TRUE;
-    }
-
     foreach ($data as &$tab){
-
-      /* Check we want to handle multiple obejcts at once 
-       *  and if this is supported by enabled plugins 
-       */
-      $tmp = get_class_vars($tab['CLASS']);
-      if($this->multiple_entries  && !$tmp['multiple_support']){
-        continue;
-      } 
-
       $this->by_name[$tab['CLASS']]= $tab['NAME'];
 
       if ($baseobject === NULL){
@@ -80,13 +59,37 @@ class tabs
         $this->current= $tab['CLASS'];
       }
     }
+  }
 
-    /* Return false if tabs */
-    if(!count($this->by_object)){
+  
+  function multiple_support_available()
+  {
+    foreach($this->by_object as $name => $obj){
+      if($obj->multiple_support){
+        return(TRUE);
+      }
+    }
+    return(FALSE);
+  }  
+
+  function enable_multiple_support()
+  {
+    if(!$this->multiple_support_available()){
       return(FALSE);
+    }else{
+      foreach($this->by_object as $name => $obj){
+        if($obj->multiple_support){
+          $this->by_object[$name]->multiple_support_active = TRUE;
+        }else{
+          unset($this->by_object[$name]);
+          unset($this->by_name[$name]);
+        }
+      }
     }
+    return(TRUE);
   }
 
+
   function execute()
   {
     /* Rotate current to last */
@@ -269,27 +272,19 @@ class tabs
 
   function save($ignore_account= FALSE)
   {
-    if($this->multiple_entries){
-      foreach ($this->by_object as $key => &$obj){
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
-            $key, "Saving");
-        $obj->save();
-      }
-    }else{
-      /* Save all plugins */
-      foreach ($this->by_object as $key => &$obj){
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
-            $key, "Saving");
+    /* Save all plugins */
+    foreach ($this->by_object as $key => &$obj){
+      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
+          $key, "Saving");
 
-        $obj->dn= $this->dn;
+      $obj->dn= $this->dn;
 
-        if ($obj->is_account || $ignore_account || $obj->ignore_account){
-          if ($obj->save() == 1){
-            return (1);
-          }
-        } else {
-          $obj->remove_from_parent();
+      if ($obj->is_account || $ignore_account || $obj->ignore_account){
+        if ($obj->save() == 1){
+          return (1);
         }
+      } else {
+        $obj->remove_from_parent();
       }
     }
     return (0);
@@ -344,14 +339,12 @@ class tabs
 
   function addSpecialTabs()
   {
-    if(!$this->multiple_entries){
-      $this->by_name['acl']= _("ACL");
-      $this->by_object['acl']= new acl($this->config, $this, $this->dn);
-      $this->by_object['acl']->parent= &$this;
-      $this->by_name['reference']= _("References");
-      $this->by_object['reference']= new reference($this->config, $this->dn);
-      $this->by_object['reference']->parent= &$this;
-    }
+    $this->by_name['acl']= _("ACL");
+    $this->by_object['acl']= new acl($this->config, $this, $this->dn);
+    $this->by_object['acl']->parent= &$this;
+    $this->by_name['reference']= _("References");
+    $this->by_object['reference']= new reference($this->config, $this->dn);
+    $this->by_object['reference']->parent= &$this;
   }