Code

Updated department management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 Jun 2008 09:08:20 +0000 (09:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 Jun 2008 09:08:20 +0000 (09:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11319 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentManagement.inc
gosa-core/plugins/admin/departments/class_divListDepartment.inc

index 2d84632ef94ea9034797092cf825e800cae6aca0..27f9c5527643975fdbe7b3854e8ced7356b7dc3b 100644 (file)
@@ -81,13 +81,11 @@ class departmentManagement extends plugin
         $s_action = "del";
         $s_entry  = preg_replace("/dep_".$s_action."_/i","",$key);
         $s_entry  = preg_replace("/_.*$/","",$s_entry);
         $s_action = "del";
         $s_entry  = preg_replace("/dep_".$s_action."_/i","",$key);
         $s_entry  = preg_replace("/_.*$/","",$s_entry);
-        $s_entry  = base64_decode($s_entry);
         // Post for edit
       }elseif(preg_match("/dep_edit_.*/",$key)){
         $s_action="edit";
         $s_entry  = preg_replace("/dep_".$s_action."_/i","",$key);
         $s_entry  = preg_replace("/_.*$/","",$s_entry);
         // Post for edit
       }elseif(preg_match("/dep_edit_.*/",$key)){
         $s_action="edit";
         $s_entry  = preg_replace("/dep_".$s_action."_/i","",$key);
         $s_entry  = preg_replace("/_.*$/","",$s_entry);
-        $s_entry  = base64_decode($s_entry);
         // Post for new
       }elseif(preg_match("/^remove_multiple_departments/",$key)){
         $s_action="del_multiple";
         // Post for new
       }elseif(preg_match("/^remove_multiple_departments/",$key)){
         $s_action="del_multiple";
@@ -143,7 +141,7 @@ class departmentManagement extends plugin
      * The entry which will be edited is defined in $s_entry
      */
     if (( $s_action=="edit") && (!isset($this->deptabs->config))){
      * The entry which will be edited is defined in $s_entry
      */
     if (( $s_action=="edit") && (!isset($this->deptabs->config))){
-      $this->dn= $this->config->departments[trim($s_entry)];
+      $this->dn= $this->departments[trim($s_entry)]['dn'];
 
       if (($user= get_lock($this->dn)) != ""){
         return(gen_locked_message ($user, $this->dn));
 
       if (($user= get_lock($this->dn)) != ""){
         return(gen_locked_message ($user, $this->dn));
@@ -490,13 +488,20 @@ class departmentManagement extends plugin
 
     /* In case of a valid back button create entry 
      */
 
     /* In case of a valid back button create entry 
      */
-    if(isset($tmp[$base_back])){
-      $tmp = array();
-      $tmp['dn']          = $base_back;
-      $tmp['ou'][0]       = "..";
-      $tmp['objectClass'] = array("organizationalUnit","gosaDepartment");
-      $tmp['description'][0] = msgPool::backButton();
-      $deps= array_merge(array($tmp),$deps);
+    if(isset($tmp[$base])){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd($this->config->current['BASE']);
+      $ldap->cat($base );
+      $attr = $ldap->fetch();
+      foreach($types as $oc => $type){
+        if(in_array($oc,$attr['objectClass'])){
+          $attr[$type['ATTR']][0] = ".";
+        }
+      }
+      if(isset($attr['description'])){
+         unset($attr['description']);
+      }
+      $deps= array_merge(array($attr),$deps);
     }
 
     $this->departments = array_values($deps);
     }
 
     $this->departments = array_values($deps);
index 469b0163bc93a34d4c6c0f1d270874bcc1686db4..1b4f2e527f2792e90ac3d15a0da2b2c7c6f1c5b3 100644 (file)
@@ -210,6 +210,7 @@ class divListDepartment extends MultiSelectWindow
         "IMG"       => "plugins/departments/images/country.png", "ABBR" => "c");
     $types['locality']           = array("ACL" => "locality",     "ATTR" => "l",
         "TITLE"     => _("Department"),
         "IMG"       => "plugins/departments/images/country.png", "ABBR" => "c");
     $types['locality']           = array("ACL" => "locality",     "ATTR" => "l",
         "TITLE"     => _("Department"),
+        "IMG_FULL"  => "plugins/departments/images/locality.png", 
         "IMG"       => "plugins/departments/images/locality.png", "ABBR" => "l");
     $types['organizationalUnit'] = array("ACL" => "department",   "ATTR" => "ou",
         "TITLE"     => _("Department"),
         "IMG"       => "plugins/departments/images/locality.png", "ABBR" => "l");
     $types['organizationalUnit'] = array("ACL" => "department",   "ATTR" => "ou",
         "TITLE"     => _("Department"),
@@ -217,12 +218,15 @@ class divListDepartment extends MultiSelectWindow
         "IMG"       => "images/lists/folder.png", "ABBR" => "ou");
     $types['organization']       = array("ACL" => "organization", "ATTR" => "o",
         "TITLE"     => _("Department"),
         "IMG"       => "images/lists/folder.png", "ABBR" => "ou");
     $types['organization']       = array("ACL" => "organization", "ATTR" => "o",
         "TITLE"     => _("Department"),
+        "IMG_FULL"  => "plugins/departments/images/organization.png", 
         "IMG"       => "plugins/departments/images/organization.png", "ABBR" => "o");
     $types['Alias??']            = array("ACL" => "alias"     ,    "ATTR" => "alias?",
         "TITLE"     => _("Department"),
         "IMG"       => "plugins/departments/images/organization.png", "ABBR" => "o");
     $types['Alias??']            = array("ACL" => "alias"     ,    "ATTR" => "alias?",
         "TITLE"     => _("Department"),
+        "IMG_FULL"  => "plugins/departments/images/department_alias.png", 
         "IMG"       => "plugins/departments/images/department_alias.png", "ABBR" => "alias");
     $types['Referal??']          = array("ACL" => "referal",       "ATTR" => "referal?",
         "TITLE"     => _("Department"),
         "IMG"       => "plugins/departments/images/department_alias.png", "ABBR" => "alias");
     $types['Referal??']          = array("ACL" => "referal",       "ATTR" => "referal?",
         "TITLE"     => _("Department"),
+        "IMG_FULL"  => "plugins/departments/images/department_referal.png", 
         "IMG"       => "plugins/departments/images/department_referal.png", "ABBR" => "referal");
 
     $this->departments = $list;
         "IMG"       => "plugins/departments/images/department_referal.png", "ABBR" => "referal");
 
     $this->departments = $list;