Code

Added . to list of available departments. To be able to set obtions for the current...
[gosa.git] / plugins / admin / departments / class_departmentManagement.inc
index b095805fbf705cdd7a464ffbadfd8180f277bd5d..815f40da2b874a87de132c048275da4bac52637c 100644 (file)
@@ -155,7 +155,7 @@ class departmentManagement extends plugin
         return(gen_locked_message($user, $this->dn));
       } else {
         add_lock ($this->dn, $this->ui->dn);
-        $smarty->assign("info", sprintf(_("You're about to delete the whole LDAP subtree placed under '%s'."), LDAP::fix($this->dn)));
+        $smarty->assign("info", sprintf(_("You're about to delete the whole LDAP subtree placed under '%s'."), @LDAP::fix($this->dn)));
         $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE));
         return ($display);
       }
@@ -295,7 +295,7 @@ class departmentManagement extends plugin
       $display= $this->deptabs->execute();
       if (!$this->deptabs->by_object[$this->deptabs->current]->dialog){
         $display.= "<p style=\"text-align:right\">\n";
-        $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+        $display.= "<input type=submit name=\"edit_finish\" value=\""._("Save")."\">\n";
         $display.= "&nbsp;\n";
         $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
         $display.= "</p>";
@@ -344,6 +344,12 @@ class departmentManagement extends plugin
     }
 
     $this->departments= array();
+
+    /* Add current base to the list of available departments, but only if its naming attribute is 'ou' */
+    if(preg_match("/^ou=/",$base)){
+      $this->departments [ convert_department_dn($base) ] = ".";
+    }
+
     foreach ($res as $key => $value){
 
       /* Don't display base as entry on subsearch */
@@ -400,6 +406,19 @@ class departmentManagement extends plugin
     $this->config->make_idepartments();
     $this->DivListDepartment->save_object();
   }
+
+  function plInfo()
+  {
+    return (array("plDescription" => _("Departments"),
+                  "plSelfModify" => FALSE,
+                  "plDepends" => array("objectClass" => "gosaDepartment", "description" => _("Departments")),
+                  "description" => _("Description"),
+                  "c" => _("Country"),
+                  "l" => _("Location"),
+                  "telephoneNumber" => _("Telephone"),
+                  "ou" => _("Department name") ));
+  }
+
   
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: