Code

Fixed divlists
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 13:26:31 +0000 (13:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 13:26:31 +0000 (13:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6426 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/macro/class_divListMacros.inc

index d96120e501306e17728c2bbd8f8446356525e95a..0d09ea54bcf50cc85923c3b4c1504df61cb2cb0c 100755 (executable)
@@ -80,18 +80,24 @@ class divListBlocklist extends MultiSelectWindow
     $base = $this->config->current['BASE'];
 
     /* Add base */
-    $deps[] = array("dn"=>$this->config->current['BASE']);
-    $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+    $tmp = array();
+    $tmp[] = array("dn"=>$this->config->current['BASE']);
+    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
 
+    $deps = array();
+    foreach($tmp as $tm){
+      $deps[$tm['dn']] = $tm['dn'];
+    }
+
     /* 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)){
+    $first = "";
+    $found = FALSE;
+    foreach($ids as $dep => $name){
+      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
 
         /* Keep first base dn in mind, we could need this
          *  info if no valid base was found
@@ -99,13 +105,13 @@ class divListBlocklist extends MultiSelectWindow
         if(empty($first)) {
           $first = $dep['dn'];
         }
-  
-        $value = $ids[$dep['dn']];
-        if ($this->selectedBase == $dep['dn']){
+
+        $value = $ids[$dep];
+        if ($this->selectedBase == $dep){
           $found = TRUE;
-          $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index d1afa402fa6747cc95b4692db1561c2ecdbd8f09..7819f676115cc17f9e43919bba74eb599258f67c 100755 (executable)
@@ -78,20 +78,25 @@ class divListConference extends MultiSelectWindow
     $base = $this->config->current['BASE'];
 
     /* Add base */
-    $deps[] = array("dn"=>$this->config->current['BASE']);
-    $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+    $tmp = array();
+    $tmp[] = array("dn"=>$this->config->current['BASE']);
+    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
 
+    $deps = array();
+    foreach($tmp as $tm){
+      $deps[$tm['dn']] = $tm['dn'];
+    }
+  
     /* Load possible departments */
-    $ui     = get_userinfo();
+    $ui= get_userinfo();
+    $tdeps= $ui->get_module_departments("gofonconference");
+    $ids = $this->config->idepartments;
     $first = "";
     $found = FALSE;
-    $tdeps  = $ui->get_module_departments("gofonconference");
-    $ids    = $this->config->idepartments;
+    foreach($ids as $dep => $name){
+      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
 
-    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
          */
@@ -99,12 +104,12 @@ class divListConference extends MultiSelectWindow
           $first = $dep['dn'];
         }
 
-        $value = $ids[$dep['dn']];
-        if ($this->selectedBase == $dep['dn']){
+        $value = $ids[$dep];
+        if ($this->selectedBase == $dep){
           $found = TRUE;
-          $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }
index 6d8284c5bab73375a50510c04aa3ff1784f22eab..8fc64b956806c2f1598214661e0010f9b248bb03 100755 (executable)
@@ -78,18 +78,24 @@ class divListMacro extends MultiSelectWindow
     $found = FALSE;
 
     /* Add base */
-    $deps[] = array("dn"=>$this->config->current['BASE']);
-    $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+    $tmp = array();
+    $tmp[] = array("dn"=>$this->config->current['BASE']);
+    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
 
+    $deps = array();
+    foreach($tmp as $tm){
+      $deps[$tm['dn']] = $tm['dn'];
+    }
+
     /* Load possible departments */
     $ui= get_userinfo();
     $tdeps= $ui->get_module_departments("gofonmacro");
-
     $ids = $this->config->idepartments;
-
-    foreach($deps as $dep){
-      if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+    $first = "";
+    $found = FALSE;
+    foreach($ids as $dep => $name){
+      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
 
         /* Keep first base dn in mind, we could need this
          *  info if no valid base was found
@@ -98,12 +104,12 @@ class divListMacro extends MultiSelectWindow
           $first = $dep['dn'];
         }
 
-        $value = $ids[$dep['dn']];
-        if ($this->selectedBase == $dep['dn']){
-          $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+        $value = $ids[$dep];
+        if ($this->selectedBase == $dep){
           $found = TRUE;
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }