diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 3a1117f830db2d9a02ab4b01541325c7d3ddd07b..adf3ee14d37c42c1e5eeb5da3eada458bcf4026b 100644 (file)
} else {
$filter = new filter(get_template_path("dep-filter.xml", true));
}
} else {
$filter = new filter(get_template_path("dep-filter.xml", true));
}
+ $filter->setObjectStorage(array(''));
// Build headpage
$headpage = new listing(get_template_path("dep-list.xml", true));
// Build headpage
$headpage = new listing(get_template_path("dep-list.xml", true));
parent::__construct($config, $ui, "departments", $headpage);
$this->registerAction("open","openEntry");
parent::__construct($config, $ui, "departments", $headpage);
$this->registerAction("open","openEntry");
-
$this->registerAction("new_domain","newEntry");
$this->registerAction("new_country","newEntry");
$this->registerAction("new_locality","newEntry");
$this->registerAction("new_dcObject","newEntry");
$this->registerAction("new_organization","newEntry");
$this->registerAction("new_organizationalUnit","newEntry");
$this->registerAction("new_domain","newEntry");
$this->registerAction("new_country","newEntry");
$this->registerAction("new_locality","newEntry");
$this->registerAction("new_dcObject","newEntry");
$this->registerAction("new_organization","newEntry");
$this->registerAction("new_organizationalUnit","newEntry");
-
$this->registerAction("performRecMove","performRecMove");
$this->registerAction("tagDepartment","tagDepartment");
}
$this->registerAction("performRecMove","performRecMove");
$this->registerAction("tagDepartment","tagDepartment");
}
-
+ // Inject additional actions here.
function detectPostActions()
{
$actions = management::detectPostActions();
function detectPostActions()
{
$actions = management::detectPostActions();
return($actions);
}
return($actions);
}
+ // Action handler which allows department tagging - Creates the iframe contents.
function tagDepartment()
{
$plugname = $this->last_tabObject->base_name;
function tagDepartment()
{
$plugname = $this->last_tabObject->base_name;
exit();
}
exit();
}
-
+ // Overridden new handler - We've different types of departments to create!
function newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
$types= $this->get_support_departments();
function newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
$types= $this->get_support_departments();
return(management::newEntry($action,$target,$all,$this->tabClass,$types[$type]['TAB'],$this->aclCategory));
}
return(management::newEntry($action,$target,$all,$this->tabClass,$types[$type]['TAB'],$this->aclCategory));
}
+ // Overridden edit handler - We've different types of departments to edit!
function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
$types= $this->get_support_departments();
function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
$types= $this->get_support_departments();
- $type = $this->headpage->getType($target[0]);
+ $headpage = $this->getHeadpage();
+ $type = $headpage->getType($target[0]);
return(management::editEntry($action,$target,$all,$this->tabClass,$types[$type]['TAB'],$this->aclCategory));
}
return(management::editEntry($action,$target,$all,$this->tabClass,$types[$type]['TAB'],$this->aclCategory));
}
+
+ // Overriden save handler - We've to take care about the department tagging here.
protected function saveChanges()
{
protected function saveChanges()
{
- management::saveChanges();
-
- global $config;
- $config->get_departments();
- $config->make_idepartments();
- $this->config = $config;
+ $str = management::saveChanges();
+ if(!empty($str)) return($str);
+ $this->refreshDeps();
$plugname = $this->last_tabObject->base_name;
if($this->last_tabObject->by_object[$plugname]->must_be_tagged()){
$smarty = get_smarty();
$plugname = $this->last_tabObject->base_name;
if($this->last_tabObject->by_object[$plugname]->must_be_tagged()){
$smarty = get_smarty();
return($smarty->fetch(get_template_path("dep_iframe.tpl",TRUE)));
}
}
return($smarty->fetch(get_template_path("dep_iframe.tpl",TRUE)));
}
}
+
+ function refreshDeps()
+ {
+ global $config;
+ $config->get_departments();
+ $config->make_idepartments();
+ $this->config = $config;
+ $headpage = $this->getHeadpage();
+ $headpage->refreshBasesList();
+ }
-
+
+ // An action handler which enables to switch into deparmtment by clicking the names.
function openEntry($action,$entry)
{
function openEntry($action,$entry)
{
- $this->headpage->setBase(array_pop($entry));
+ $headpage = $this->getHeadpage();
+ $headpage->setBase(array_pop($entry));
}
}
+
+ // Overridden remove request method - Avoid removal of the ldap base.
protected function removeEntryRequested($action="",$target=array(),$all=array())
{
$target = array_remove_entries(array($this->config->current['BASE']),$target);
return(management::removeEntryRequested($action,$target,$all));
}
protected function removeEntryRequested($action="",$target=array(),$all=array())
{
$target = array_remove_entries(array($this->config->current['BASE']),$target);
return(management::removeEntryRequested($action,$target,$all));
}
+
+ // A filter which allows to open a department by clicking on the departments name.
static function filterDepLabel($row,$dn,$params,$ou,$pid,$base)
{
$ou = $ou[0];
static function filterDepLabel($row,$dn,$params,$ou,$pid,$base)
{
$ou = $ou[0];
return("<a href='?plug=".$_GET['plug']."&PID=$pid&act=listing_open_$row' title='$dn'>$ou</a>");
}
return("<a href='?plug=".$_GET['plug']."&PID=$pid&act=listing_open_$row' title='$dn'>$ou</a>");
}
+
+ // Finally remove departments and update departmnet browsers
+ function removeEntryConfirmed($action="",$target=array(),$all=array(),$altTabClass="",$altTabType="",$altAclCategory="")
+ {
+ management::removeEntryConfirmed($action,$target,$all, $altTabClass,$altTabType,$altAclCategory);
+ $this->refreshDeps();
+ }
/*! \brief Returns information about all container types that GOsa con handle.
@return Array Informations about departments supported by GOsa.
/*! \brief Returns information about all container types that GOsa con handle.
@return Array Informations about departments supported by GOsa.