Code

Updated divlists.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 May 2007 08:58:02 +0000 (08:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 May 2007 08:58:02 +0000 (08:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6244 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_divListApplication.inc
plugins/admin/departments/class_divListDepartment.inc
plugins/admin/fai/class_divListFai.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/mimetypes/class_divListMimeTypes.inc
plugins/admin/ogroups/class_divListOGroup.inc
plugins/admin/systems/class_divListSystem.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/macro/class_divListMacros.inc

index 77e82f12526ee3c53f965f29861cf80aa70b9241..71ef2ad71ed9f03cd70bc0517ad968c64becb4c9 100755 (executable)
@@ -95,14 +95,24 @@ class divListApplication extends MultiSelectWindow
     /* Load possible departments */
     $ui= get_userinfo();
     $tdeps= $ui->get_module_departments("application");
-
+    $first = "";
+    $found = FALSE;
     $ids = $this->config->idepartments;
 
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
         $value = $ids[$dep['dn']];
+
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }  
+  
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
@@ -110,6 +120,13 @@ class divListApplication extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     /* Get acls */
     $ui       = get_userinfo();
     $acl      = $ui->get_permissions("cn=dummy,".$this->selectedBase,"application/application");
index a5a0762bf469b585d87f938e6d4978b1b2db839e..d1107a570d53df6042c1125c6e453c6e4b896200 100755 (executable)
@@ -93,6 +93,7 @@ class divListDepartment extends MultiSelectWindow
 
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 5fbd58d4bd0856038bcbf302d5fb6191dd88f18e..122f089126aa38c652105e4e83427eb606b1a96f 100644 (file)
@@ -132,6 +132,7 @@ class divListFai extends MultiSelectWindow
   
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 9b1802474d332b8fdccb42786be1afbc96c2cf5e..8e31b350d513160ea583ad907d767fd90a2ce47d 100644 (file)
@@ -116,6 +116,7 @@ class divListGroup extends MultiSelectWindow
 
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 0d961ba4b1cdcdc0a71be48f67e0a8e0845dab54..ce907fa3b79fbc35fac01e329767c7d711ab1636 100755 (executable)
@@ -120,6 +120,7 @@ class divListMimeTypes extends MultiSelectWindow
     
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 959dfaab7a3b4e1d792c017ae2d13127529d5002..7b4e81e67a96bf452cac89412dd2882b82e5d7ea 100755 (executable)
@@ -120,6 +120,7 @@ class divListOGroup extends MultiSelectWindow
   
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 72870d701538b356052c28f878f88e61a4c5cb2f..882805955156323da232ea7d1436fd9171cecada 100644 (file)
@@ -133,6 +133,7 @@ class divListSystem extends MultiSelectWindow
 
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 58722ecb96f5f460c929e6b6e7dbeedac8809659..42bd1f549bf9ce2e718da5d4cf5581f3ce77b613 100755 (executable)
@@ -102,6 +102,7 @@ class divListBlocklist extends MultiSelectWindow
   
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 0dfd3dc80ce6584786333d31bb315e51f90b0aa4..aeb111f78c0b52545210af523f66cfc8c23e491b 100755 (executable)
@@ -101,6 +101,7 @@ class divListConference extends MultiSelectWindow
 
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
+          $found = TRUE;
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
index 0e3600bd4f8af8f3ec101d5bd65ad0827a1813a5..f3c13d969448c8c8706a585fa616a15505252b0b 100755 (executable)
@@ -101,6 +101,7 @@ class divListMacro extends MultiSelectWindow
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $found = TRUE;
         } else {
           $options.= "<option value='".$dep['dn']."'>$value</option>";
         }