diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc
index eeb9d53eae2bd18050a6a8c2a828b4a489927d1f..99f784c5a7703751a5dafbe97cba54b6ec4d1211 100644 (file)
* The entry which will be edited is defined in $s_entry
*/
if (( $s_action=="edit") && (!isset($this->deptabs->config))){
- $s_entry = convert_department_dn(base64_decode($s_entry));
$this->dn= $this->config->departments[trim($s_entry)];
if (($user= get_lock($this->dn)) != ""){
* The entry which will be deleted is defined in $s_entry
*/
if ($s_action =="del"){
- $s_entry = convert_department_dn(base64_decode($s_entry));
$this->dn= $this->config->departments[trim($s_entry)];
/* Check locking */
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);
}
$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.= " \n";
$display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
$display.= "</p>";
}
return ($display);
}else{
-
- /* Check if there is a snapshot dialog open */
- if($str = $this->showSnapshotDialog($this->DivListDepartment->selectedBase,"")){
- return($str);
- }
-
/* Display dialog with group list */
$this->DivListDepartment->parent = $this;
$this->DivListDepartment->execute();
}
$this->departments= array();
- $tmp = array();
- foreach ($res as $key => $value){
- #$tmp[get_sub_department(convert_department_dn($value['dn']))] = $key;
- $tmp[$key] = get_sub_department(convert_department_dn($value['dn']));
+
+ /* 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) ] = ".";
}
- natcasesort($tmp);
- foreach($tmp as $key => $q){
- $value = $res [$key];
+
+ foreach ($res as $key => $value){
+
/* Don't display base as entry on subsearch */
if(($value['dn'] == $base) && ($this->DivListDepartment->SubSearch)){
continue;
}
- $this->departments[base64_encode($value['dn'])]= $value;
+ $cdn= convert_department_dn($value['dn']);
+
+ /* Append to dep list */
+ if(isset($value["description"][0])){
+ $this->departments[$cdn]= get_sub_department($cdn)." - [".$value["description"][0]."]";
+ }else{
+ $this->departments[$cdn]= get_sub_department($cdn);//$value["description"][0];
+ }
}
+ natcasesort ($this->departments);
+ reset ($this->departments);
}
function remove_from_parent()
$this->config->make_idepartments();
$this->DivListDepartment->save_object();
}
-
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>