Code

Updated manager selection
[gosa.git] / gosa-core / plugins / admin / departments / class_departmentManagement.inc
index 781744d20e6f32ec2410c47b7207baf7646a317d..84382e4e3be9cad97338a1f75d92eee08518eb74 100644 (file)
 
 class departmentManagement extends management
 {
-  var $plHeadline     = "Departments";
-  var $plDescription  = "Manage Departments";
+  var $plHeadline     = "Directory structure";
+  var $plDescription  = "Manage organizations, organizational units, localities, countries and more";
   var $plIcon         = "plugins/departments/images/plugin.png";
 
   // Tab definition 
   protected $tabClass = "deptabs";
   protected $tabType = "DEPTABS";
-  protected $aclCategory = "departement";
+  protected $aclCategory = "department";
   protected $aclPlugin   = "generic";
   protected $objectName   = "department";
 
@@ -44,6 +44,7 @@ class departmentManagement extends management
     } 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));
@@ -101,7 +102,8 @@ class departmentManagement extends management
   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));
   }
 
@@ -109,13 +111,10 @@ class departmentManagement extends management
   // Overriden save handler - We've to take care about the department tagging here.
   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();
@@ -124,12 +123,24 @@ class departmentManagement extends management
       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)
   {
-    $this->headpage->setBase(array_pop($entry));
+    $headpage = $this->getHeadpage();
+    $headpage->setBase(array_pop($entry));
   }
 
 
@@ -152,6 +163,14 @@ class departmentManagement extends management
     return("<a href='?plug=".$_GET['plug']."&amp;PID=$pid&amp;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="", $aclPlugin="")
+  {
+    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.