Code

Fixed sorting in printer lists
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 31 Oct 2008 15:33:26 +0000 (15:33 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 31 Oct 2008 15:33:26 +0000 (15:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12849 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/personal/environment/class_environment.inc
gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc
gosa-plugins/goto/personal/environment/environment.tpl
gosa-plugins/goto/personal/environment/selectPrinterDialog.tpl

index e3bdb3b148187b95c6bfc72166573963fac2961e..c6f82a34a4c0346c4dc53fa5e53571771b847288 100644 (file)
@@ -996,7 +996,6 @@ class environment extends plugin
     }
 
     $smarty->assign("gotoPrinter",$this->printOutPrinterDevices());
-    $smarty->assign("gotoPrinterKeys",array_flip($this->printOutPrinterDevices()));
 
     /* General behavior */
     if(is_object($this->dialog)){
@@ -1360,7 +1359,7 @@ class environment extends plugin
 
     if(is_array($this->gotoPrinter)){
       foreach($this->gotoPrinter as $printer){
-        if($printer['mode'] == "admin"){
+        if($printer['mode'] == 'admin'){
           $a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Administrator");
         }else{
           $a_return[$printer['cn'][0]]= $printer['cn'][0]; 
@@ -1370,6 +1369,7 @@ class environment extends plugin
         }
       }
     }
+               asort($a_return);
     return($a_return);
   }
 
index b4da61ca1b797729710c4fd83c15404ceb802e87..71023aa93325192df62398aab5936b4b5e6982ea 100644 (file)
@@ -80,12 +80,12 @@ class selectPrinterDialog extends plugin
     }
 
     $printer_list = $this->getPrinter(); 
+               asort($printer_list);
 
     $smarty->assign("regexPrinter"    ,$this->regex);
     $smarty->assign("deplistPrinter"  ,$this->deplist);
     $smarty->assign("depselectPrinter",$this->depselect);
     $smarty->assign("gotoPrinters",$printer_list);
-    $smarty->assign("gotoPrinterKeys",array_flip($printer_list));
     $smarty->assign("apply", apply_filter());
     $smarty->assign("alphabet", generate_alphabet());
     $smarty->assign("subtrees", $this->subtreesearch?"checked":"");
index 18622d63be590d00f9daed0f151b10e3f20c2d8d..1e27d4846aecee6a32e8e75440a6a9cd7e72bbc6 100644 (file)
      <td>
 {render acl=$gotoPrinterACL}
       <select style="width:100%;" name="gotoPrinterSel[]" multiple size=5 id="gotoPrinter">
-       {html_options values=$gotoPrinterKeys output=$gotoPrinter}
+       {html_options options=$gotoPrinter}
        <option disabled>&nbsp;</option>
       </select>
 {/render}
      <td>
 {render acl=$gotoPrinterACL}
       <select style="width:100%;" name="gotoPrinterSel[]" multiple size=5 id="gotoPrinter">
-       {html_options values=$gotoPrinterKeys output=$gotoPrinter}
+       {html_options options=$gotoPrinter}
        <option disabled>&nbsp;</option>
       </select>
 {/render}
index e1b5b207eff1bb4964b854b36f585c7e2c347a37..02bb97bab9dac19a2aa9e3bf5fdad9da0a9d776b 100644 (file)
@@ -13,7 +13,7 @@
                                <div class="contentboxb">
                                <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
                                <select style="width:100%;height:450px" size=20 name="gotoPrinter[]" id="gotoPrinter" multiple>
-                               {html_options values=$gotoPrinterKeys output=$gotoPrinters}
+                               {html_options options=$gotoPrinters}
                                <option disabled>&nbsp;</option>
                                         </select><br>
                                        </p>