Code

Added http://servername/ppd/ to gotoPrinterPPD
[gosa.git] / plugins / admin / fai / class_faiManagement.inc
index c6663ea20c5875974ec5068a8a9fcc0dfc7ea398..970995784fe3792a11910635d0d8b0bc6f05b498 100644 (file)
@@ -84,6 +84,9 @@ class faiManagement extends plugin
 
        function execute()
        {
+       /* Call parent execute */
+       plugin::execute();
+
                $display        = "";
                $smarty         = get_smarty();
                $s_action       = "";
@@ -263,6 +266,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 +323,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 +346,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 +364,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.
@@ -457,7 +461,7 @@ class faiManagement extends plugin
 
                /* Create list with objects */
                $divlist = new divlist("faiManagement"); 
-               $divlist->SetEntriesPerPage(20);
+               $divlist->SetEntriesPerPage(0);
                $divlist->SetSummary(_("This table displays all systems, in the selected tree."));
 
                $divlist->SetHeader(array(
@@ -488,10 +492,10 @@ class faiManagement extends plugin
 
 
                        $title = $this->config->departments[$key];
-                       $field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>",                     "attach"=>"style='width:20px;'");
+                       $field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>",                     "attach"=>"style='text-align:center;width:20px;'");
                        $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "title='".$title."'");
                        $field2 = array("string" => "");
-                       $field3 = array("string" => "","attach"=>"style='text-align:right;border-right:none;'");
+                       $field3 = array("string" => "","attach"=>"style='width:48px;text-align:right;border-right:none;'");
 
                        $divlist->AddEntry( array($field0,$field1,$field2,$field3));
 
@@ -524,7 +528,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"                      : 
@@ -556,7 +560,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;
 
                                }
                                
@@ -567,10 +571,10 @@ class faiManagement extends plugin
                                                $desc= "";
                                        }
 
-                                       $field1 = array("string" => $img , "attach" => "style='height:26px;width=20px;'");
+                                       $field1 = array("string" => $img , "attach" => "style='text-align:center;width=20px;'");
                                        $field2 = array("string" => preg_replace(array("/%KEY%/","/%NAME%/"),array($key,$value['cn'].$desc),$editlink) , "attach" => "");
                                        $field3 = array("string" => $info, "attach" => "");
-                                       $field4 = array("string" => preg_replace("/%KEY%/",$key,$action) , "attach"=>"style='text-align:right;border:none'");
+                                       $field4 = array("string" => preg_replace("/%KEY%/",$key,$action) , "attach"=>"style='width:48px;text-align:right;border:none'");
                                        $divlist->AddEntry(array($field1,$field2,$field3,$field4));
 
                        }
@@ -686,6 +690,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()