X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_management.inc;h=81a798b5876e808fb4728848a4f9d7c178c33136;hb=30d939bbc772a9b8cdd9704e8034101e957ab972;hp=324da97b09a3aa70235408fe1302c88d76f1a61c;hpb=0966510b9b7f8e52e2a92b1a840b4dd7c3edb030;p=gosa.git diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 324da97b0..81a798b58 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -3,7 +3,7 @@ * This code is part of GOsa (http://www.gosa-project.org) * Copyright (C) 2003-2008 GONICUS GmbH * - * ID: $$Id: class_plugin.inc 14584 2009-10-12 14:04:22Z hickert $$ + * 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 @@ -60,6 +60,9 @@ class management // Whether to display the apply button or not protected $displayApplyBtn = ""; + // Whether to display a footer or not. + protected $skipFooter = false; + // Copy&Paste handler protected $cpHandler = null; @@ -76,7 +79,7 @@ class management // A list of configured actions/events protected $actions = array(); - function __construct($config,$ui,$plugname, $headpage) + function __construct(&$config,$ui,$plugname, $headpage) { $this->plugname = $plugname; $this->headpage = $headpage; @@ -226,6 +229,9 @@ class management } } + // Skip footer if requested; + if($this->skipFooter) return(""); + // In case an of locked entry, we may have opened a read-only tab. $str = ""; if(isset($this->tabObject->read_only) && $this->tabObject->read_only == TRUE){ @@ -327,7 +333,7 @@ class management // Delete the object $this->dn = $dn; - $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory); + $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true); $this->tabObject->set_acl_base($this->dn); $this->tabObject->delete (); $this->tabObject->parent = &$this; @@ -593,7 +599,14 @@ class management * } * } * } - **/ + **/ + + // Do not create a new tabObject while there is already one opened, + // the user may have just pressed F5 to reload the page. + if(is_object($this->tabObject)){ + return; + } + $tabType = $this->tabType; $tabClass = $this->tabClass; $aclCategory = $this->aclCategory; @@ -650,8 +663,8 @@ class management @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dns,"Edit entry initiated!"); // Now lock entries. - $tmp->lock_entries($this->ui->dn); if($tmp->multiple_available()){ + $tmp->lock_entries($this->ui->dn); $this->tabObject = $tmp; set_object_info($this->tabObject->get_object_info()); } @@ -680,6 +693,18 @@ class management $this->remove_lock(); $this->closeDialogs(); } + }elseif($this->dialogObject instanceOf plugin){ + $this->dialogObject->save_object(); + $msgs = $this->dialogObject->check(); + if(count($msgs)){ + msg_dialog::displayChecks($msgs); + return(""); + }else{ + $this->dialogObject->save(); + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dns,"Entry saved!"); + $this->remove_lock(); + $this->closeDialogs(); + } } }