Code

Updated divlists.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Apr 2007 05:44:56 +0000 (05:44 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Apr 2007 05:44:56 +0000 (05:44 +0000)
Set initial selectedBase to first available base, in header contruction.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6177 594d385d-05f5-0310-b6e9-bd551577e9d8

12 files changed:
plugins/admin/acl/class_aclRole.inc
plugins/admin/acl/class_divListACL.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/admin/users/class_divListUsers.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/macro/class_divListMacros.inc

index 62e81dbcd2fe8d37272b387e1a7b9dfa307885c5..ef54ec83f73fdb2f9fd7ac025d36325be673fad0 100644 (file)
@@ -790,7 +790,7 @@ class aclrole extends plugin
   {
     /* New entry gets presets... */
     if ($new){
-      $this->aclType= 'base';
+      $this->aclType= 'sub';
       $this->recipients= array();
       $this->aclContents= array();
     } else {
index 0507b7074d215abdef09a812b7ee7836475753b7..56fe9ae35a6626d23a1953af9f66c9060801248a 100644 (file)
@@ -70,6 +70,9 @@ class divListACL extends MultiSelectWindow
     $Copy_Paste = "";
 
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", "acl", $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -80,6 +83,14 @@ class divListACL extends MultiSelectWindow
     $ids    = $this->config->idepartments;
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+  
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -89,6 +100,13 @@ class divListACL extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     /* Allow copy & paste for roles */ 
     $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"acl");
     $acl      = $ui->get_permissions($this->selectedBase,"acl/acl");
index 2b7f588621ee04fec436b003699bb777e06102e0..f8e56b0fa631b25a8511e0d42a91599a0d043313 100755 (executable)
@@ -65,6 +65,9 @@ class divListDepartment extends MultiSelectWindow
     $options= "";
 
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -78,6 +81,13 @@ class divListDepartment extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -87,6 +97,12 @@ class divListDepartment extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
 
     /* Generate list head */
     $ui = get_userinfo();
index 1a735a3a2f8aa1cf46a91276c59e6acc10c9951e..95e193f1dcb5805a76cefcb5ec537f56530e2c43 100644 (file)
@@ -106,6 +106,9 @@ class divListFai extends MultiSelectWindow
     $options= "";
 
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -116,6 +119,14 @@ class divListFai extends MultiSelectWindow
     $ids = $this->config->idepartments;
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+  
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -125,6 +136,13 @@ class divListFai extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     /* Add seperator */
     $add_sep = false;
 
index 518e36740b90c3ccc8cf1d7189665373edad52c9..a5056b283e7a6c6878f6ab9a0137f0c15550ca15 100644 (file)
@@ -88,6 +88,9 @@ class divListGroup extends MultiSelectWindow
 
     
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -101,6 +104,13 @@ class divListGroup extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this 
+         *  info if no valid base was found 
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -110,6 +120,13 @@ class divListGroup 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 */
     $acls   = $ui->get_permissions($this->selectedBase,"groups/group");
     $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups");
index 8fbd5c22519b90192f73c0e97d19b037b01ad610..cbda3fee7961756da002f92eb441d5d48498f6fe 100755 (executable)
@@ -50,8 +50,6 @@ class divListMimeTypes extends MultiSelectWindow
       $action_col_size += 38;
     }
 
-
-
     /* Toggle all selected / deselected */
     $chk = "<input type='checkbox' id='select_all' name='select_all'
                onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
@@ -94,6 +92,9 @@ class divListMimeTypes extends MultiSelectWindow
     $options= "";
 
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
         array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -107,6 +108,13 @@ class divListMimeTypes extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+    
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -116,6 +124,13 @@ class divListMimeTypes 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,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype");
index 5ac05bc7791c0596c10ad727188cb3e9bebe9a51..ed0e70025dce798bf04f3fb18ea1bc4573bad500 100755 (executable)
@@ -92,6 +92,9 @@ class divListOGroup extends MultiSelectWindow
     $options= "";
 
     /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
@@ -105,6 +108,13 @@ class divListOGroup extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+  
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -114,6 +124,13 @@ class divListOGroup extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     /* Add a seperator after displaying c&p and snapshot icons ? */
     $add_sep = false;
   
index 5615a0bd2e96e3792b3f6cc3eb2ed0c81a9f23f4..a5bc398d632a2cb10f82c370f22dc1d46124d6e4 100644 (file)
@@ -106,6 +106,8 @@ class divListSystem extends MultiSelectWindow
 
     /* Load possible departments */
     $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
     $department = $departments = array();
     foreach($this->module as $module){
       $d = $ui->get_module_departments($module);      
@@ -119,6 +121,13 @@ class divListSystem extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -128,6 +137,13 @@ class divListSystem extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     /* If there is at least one c (Create) and one w (Write) acl in this combination
         display the snapshot paste icon. BUT check the correct acls in the management plugin */
     $all_module_acls = "";
index 87ad2017afb63b07cc534772a62537c233e73cd0..ed888b8a0fe796e9488a63d44193b5252c8b1b0e 100644 (file)
@@ -99,6 +99,9 @@ class divListUsers extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
         if(empty($first)) {
           $first = $dep['dn'];
         }
@@ -112,6 +115,10 @@ class divListUsers extends MultiSelectWindow
         }
       }
     }
+
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base. 
+     */
     if(!$found){
       $this->selectedBase = $first;
     }
index 02c616324a8ca285fd80ee9b7d540145e65d01a2..27ff3d696a476087cada001da344b067fd4527b4 100755 (executable)
@@ -82,11 +82,21 @@ class divListBlocklist extends MultiSelectWindow
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
 
     /* Load possible departments */
+    $first = "";
+    $found = FALSE;
     $ui= get_userinfo();
     $tdeps= $ui->get_module_departments("gofaxlist");
     $ids = $this->config->idepartments;
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+  
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -96,6 +106,13 @@ class divListBlocklist 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($this->selectedBase,"gofaxlist/blocklist");
index 180cf03fd1403362768b0cb789a640260b746542..c16d99d4ef0e4bf3c953402512f158264f29cddf 100755 (executable)
@@ -81,11 +81,21 @@ class divListConference extends MultiSelectWindow
 
     /* Load possible departments */
     $ui     = get_userinfo();
+    $first = "";
+    $found = FALSE;
     $tdeps  = $ui->get_module_departments("gofonconference");
     $ids    = $this->config->idepartments;
 
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+  
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -95,6 +105,13 @@ class divListConference 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 */
     $acls     = $ui->get_permissions($this->selectedBase,"gofonconference/conference");
     $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"gofonconference") ;
index d3712660b052f5545ee997596fc8a70e4ecea7e3..c759479a48a33f98785355a041c9c9526f17f049 100755 (executable)
@@ -74,6 +74,8 @@ class divListMacro extends MultiSelectWindow
 
     /* Get all departments within this subtree */
     $base = $this->config->current['BASE'];
+    $first = "";
+    $found = FALSE;
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
 
@@ -86,6 +88,13 @@ class divListMacro extends MultiSelectWindow
     foreach($deps as $dep){
       if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
 
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
         $value = $ids[$dep['dn']];
         if ($this->selectedBase == $dep['dn']){
           $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -95,6 +104,13 @@ class divListMacro extends MultiSelectWindow
       }
     }
 
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
     $acls  = $ui->get_permissions($this->selectedBase,"gofonmacro/macro");
 
     /* Add default header */