From: hickert Date: Fri, 19 Oct 2007 08:30:29 +0000 (+0000) Subject: Reverted sme changes made for multiple user edit X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ad83372e8db10f28da3b9b00cd3aa85cae1516ac;p=gosa.git Reverted sme changes made for multiple user edit git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7594 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_location.inc b/include/class_location.inc index 7b86a7979..a66561302 100644 --- a/include/class_location.inc +++ b/include/class_location.inc @@ -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", diff --git a/include/class_plugin.inc b/include/class_plugin.inc index ccb7e5406..4d753e7cc 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -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 diff --git a/include/class_tabs.inc b/include/class_tabs.inc index 059e47700..a39c7505b 100644 --- a/include/class_tabs.inc +++ b/include/class_tabs.inc @@ -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; }