summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 305d808)
raw | patch | inline | side by side (parent: 305d808)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 16 Apr 2008 07:05:19 +0000 (07:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 16 Apr 2008 07:05:19 +0000 (07:05 +0000) |
-Fixed copy & Paste
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10486 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10486 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
index 4bd6e9d0bb3f66d12a6ba48699782a20554d497f..71121377c2bbea1cc80d7152eaec4575c1bc344b 100644 (file)
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current["BASE"]);
- $mimefilter = session::get('mimefilter');
-
- if($this->isReleaseMimeType && (isset($mimefilter['release']))){
- $baseDn = str_replace($this->config->current['BASE'],$this->base,$mimefilter['release']);
- $baseDn = preg_replace("/".get_ou('mimetypeou').".*/",get_ou('mimetypeou').$this->base,$mimefilter['release']);
- $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",$baseDn,array("cn"));
- if($ldap->count()){
- $attrs = $ldap->fetch();
- if($this->dn != $attrs['dn']) {
- $message[]= msgPool::duplicated(_("Name"));
- }
- }
+ if($this->is_release()){
+ $base = $this->parent->parent->mime_release;
}else{
- $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",get_ou('mimetypeou').$this->base,array("cn"));
- if ($ldap->count()){
- $attrs = $ldap->fetch();
- if($this->dn != $attrs['dn']) {
- $message[]= msgPool::duplicated(_("Name"));
- }
- }
+ $base = $this->base;
}
+ $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",$base,array("cn"));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ if($this->dn != $attrs['dn']) {
+ $message[]= msgPool::duplicated("cn");
+ }
+ }
return($message);
}
+
/** Helper functions **/
/* Set a new picture */
}
+
+ function is_release()
+ {
+ if(is_object($this->parent->parent)){
+ return($this->parent->parent->IsReleaseManagementActivated());
+ }else{
+ /* Check if we should enable the release selection */
+ $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
+ if(!empty($tmp)){
+ return(true);
+ }
+ }
+ return(FALSE);
+ }
+
+
function PrepareForCopyPaste($source)
{
plugin::PrepareForCopyPaste($source);
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc
index c12bbdf8fc52b9609b88d2eca5262b6a25a21c85..54a04b55b66633741da4bdc457ae13abe3f4b46d 100644 (file)
/* Dialog attributes */
var $ui = NULL;
var $DivListMimeTypes = NULL;
- var $enableReleaseManagement = false;
var $mimetabs = NULL;
var $snapDialog = NULL;
var $CopyPasteHandler = NULL;
- var $start_pasting_copied_objects = FALSE;
+ var $start_pasting_copied_objects = FALSE;
+ var $enableReleaseManagement = false;
var $mime_base = "";
var $mime_release = "";
$this->DivListMimeTypes->DisableCheckBox("SubSearch");
}
-
/* Set default release */
if(!$this->IsReleaseManagementActivated()){
$this->mime_base = get_ou("mimetypeou").$this->config->current['BASE'];
/* These vars will be stored if you try to open a locked mime,
to be able to perform your last requests after showing a warning message */
- session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^mime_edit_/","/^mime_del_/","/^item_selected/","/^remove_multiple_mimetypes/"));
+ session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^mime_edit_/","/^mime_del_/",
+ "/^item_selected/","/^remove_multiple_mimetypes/"));
$smarty = get_smarty(); // Smarty instance
$s_action = ""; // Contains the action to proceed
$s_entry = preg_replace("/_.$/","",$s_entry);
-
-
/* handle C&P from layers menu */
if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
$s_action = "copy_multiple";
$s_action = "del_multiple";
}
+
/****************
Copy & Paste handling
****************/
if (count($message) == 0){
/* Save data data to ldap */
- $this->mimetabs->set_release($this->mime_base);
$this->mimetabs->save();
if (!isset($_POST['edit_apply'])){
above dialog */
add_lock ($this->dn, $this->ui->dn);
-
/* Register mimetabs to trigger edit dialog */
$this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
$this->mimetabs->parent = &$this;
}
-
-
/********************
Delete MULTIPLE entries confirmed
********************/
$Flags = GL_NONE | GL_SIZELIMIT;
$Filter = "(&(|(cn=".$Regex.")(description=".$Regex."))(objectClass=gotoMimeType))";
$tmp = array();
- $Releases = $this->getReleases();
if(!$this->IsReleaseManagementActivated()){
$use_base = $this->mime_base;
reset ($this->mimetypes);
}
+
function remove_from_parent()
{
/* Optionally execute a command after we're done */
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
- $this->start_pasting_copied_objects = FALSE;
$dn = $this->mimetypes[$s_entry]['dn'];
$this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
}
+
/* Add entries to queue */
if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
/* Cleanup object queue */
$this->CopyPasteHandler->cleanup_queue();
- $this->start_pasting_copied_objects = FALSE;
/* Add new entries to CP queue */
foreach($this->list_get_selected_items() as $id){
if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
/* Get dialog */
+ $this->CopyPasteHandler->SetVar("base",preg_replace("/^".normalizePreg(get_ou("mimetypeou"))."/","",$this->mime_base));
+ $this->CopyPasteHandler->SetVar("parent",&$this);
$data = $this->CopyPasteHandler->execute();
- $this->CopyPasteHandler->SetVar("base",$this->DivListMimeTypes->selectedBase);
/* Return dialog data */
if(!empty($data)){
}
/* Automatically disable status for pasting */
- #if(!$this->CopyPasteHandler->entries_queued()){
- # $this->start_pasting_copied_objects = FALSE;
- #}
+ if(!$this->CopyPasteHandler->entries_queued()){
+ $this->start_pasting_copied_objects = FALSE;
+ }
return("");
}
diff --git a/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc b/gosa-plugins/goto/admin/mimetypes/tabs_mimetypes.inc
index 9597704cafcc64f1794f3193192a3719d8fef839..a2fc2bb40569000ae178b841c9e138260f246ef8 100644 (file)
class mimetabs extends tabs
{
- var $Release= "";
var $parent = FALSE;
function mimetabs($config, $data, $dn,$category)
$this->addSpecialTabs();
}
- function set_release($newRelease)
- {
- $this->Release= preg_replace('/,'.get_ou('mimetypeou').'.*$/', '', $newRelease);
- if ($this->Release != ""){
- $this->Release= ",".$this->Release;
- }
- }
-
function save($ignore_account= FALSE)
{
$baseobject= $this->by_object['mimetype'];
if($this->parent->IsReleaseManagementActivated()){
$new_dn= "cn=".$baseobject->cn.",".$this->parent->mime_release;
}else{
- $new_dn= "cn=".$baseobject->cn.",".get_ou('mimeou').$baseobject->base;
+ $new_dn= "cn=".$baseobject->cn.",".get_ou('mimetypeou').$baseobject->base;
}
/* Move group? */