Code

Fixed missing images problem in group headpage
[gosa.git] / plugins / admin / fai / class_faiManagement.inc
index 900d1bd2b838fba4d94b53c7ad900e996edb71fb..1bb4fdc72085494d789db6f63ecf8b9558374ce8 100644 (file)
@@ -263,6 +263,7 @@ class faiManagement extends plugin
                        $this->dialog= new $a_setup[0]($this->config,
                                        $this->config->data['TABS'][$a_setup[2]],$this->dn);
                        $this->is_dialog = true;
+                       $_SESSION['objectinfo'] = $this->dn;
                }
 
 
@@ -319,7 +320,7 @@ class faiManagement extends plugin
                                $name = $this->dialog->save();
 
                                $this->dialog = new $a_setup[0]($this->config,
-                                               $this->config->data['TABS'][$a_setup[2]],$this->dn);
+                                               $this->config->data['TABS'][$a_setup[2]],$this->dn,$name);
                                $this->dialog->by_object[$a_setup[1]]->cn = $name;
                                $this->is_dialog = true;
                        }               
@@ -342,9 +343,9 @@ class faiManagement extends plugin
                        unset($this->dialog);
                        $this->dialog=NULL;
                        $this->is_dialog = false;
+                       unset($_SESSION['objectinfo']);
                }
 
-
                /* This check if the given tab could be saved 
                 * If it was possible to save it, remove dialog object. 
                 * If it wasn't possible, show errors and keep dialog.
@@ -360,10 +361,10 @@ class faiManagement extends plugin
                                unset($this->dialog);
                                $this->dialog=NULL;
                                $this->is_dialog=false;
+                               unset($_SESSION['objectinfo']);
                        }
                }
 
-
                /* If dialog is set, but $this->is_dialog==false, then 
                 *  only the "abort" button is shown, this are dialogs that must not be saved.  
                 * If is_dialog == true, we are currently editing tab objects.
@@ -396,6 +397,16 @@ class faiManagement extends plugin
                 * Assign all reguired vars to template engine
                 */
 
+               /* Prepare departments */
+               $options= "";
+               foreach ($this->config->idepartments as $key => $value){
+                       if ($faifilter['base'] == $key){
+                               $options.= "<option selected value='$key'>$value</option>";
+                       } else {
+                               $options.= "<option value='$key'>$value</option>";
+                       }
+               }
+
                /* Create listhead, it will be shown on top of the divlist. 
                 * It provides general navigation and object creation
                 */
@@ -435,6 +446,11 @@ class faiManagement extends plugin
 
                        " <input type='image' src='images/fai_new_packages.png' align='middle' 
                        title='"._("New package list")."' name='Create_package' alt='"._("PK")."'>&nbsp;".
+
+                       " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
+
+                       _("Current base")."&nbsp;<select name='base' onChange='mainform.submit()'>$options</select>".
+                       " <input type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
                        
                        "</div>";
 
@@ -509,7 +525,7 @@ class faiManagement extends plugin
                                                if(!$faifilter['ShowScripts']){ 
                                                        $abort = true;
                                                }
-                                       $img="<img src='images/fai_script' title='"._("Scripts")."' alt='S'>";
+                                       $img="<img src='images/fai_script.png' title='"._("Scripts")."' alt='S'>";
                                        $info = _("Scripts");
                                        break;
                                        case "FAIvariable"                      : 
@@ -541,7 +557,7 @@ class faiManagement extends plugin
                                        $info = _("Templates");
                                        break;
                                        default                                         : 
-                                       $img="<img src='images/empty.png' >";$info = "";break;
+                                       $img="<img src='images/empty.png' alt=''>";$info = "";break;
 
                                }
                                
@@ -671,6 +687,15 @@ class faiManagement extends plugin
                }
                ksort($this->objects);
                reset ($this->objects);
+       
+               /* use numeric index, thats a bit more secure */        
+               $tmp0 = array();
+               foreach($this->objects as $obj){
+                       $tmp0[]= $obj;
+               }
+               $this->objects = array();
+               $this->objects = $tmp0;
+
        }
 
        function remove_lock()