Code

Added subsearch to selectUserToPrinter
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 May 2007 07:10:57 +0000 (07:10 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 May 2007 07:10:57 +0000 (07:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6443 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_selectUserToPrinterDialog.inc
plugins/admin/systems/selectUserToPrinterDialog.tpl

index 8f1c8eca2a56ca190b6ee79423b2894097994226..f4964c15bee797ecb7c218125806ccee1182c5e6 100644 (file)
@@ -12,6 +12,7 @@ class selectUserToPrinterDialog extends plugin
   var $attributes           = array();
   var $objectclasses        = array("whatever");
   var $regex                = "*";
+  var $subtree              = FALSE;
   var $depselect            = "/";
   var $deplist              = "/";
 
@@ -74,6 +75,7 @@ class selectUserToPrinterDialog extends plugin
       $this->regex=$_POST['regexPrinter'];
       $this->depselect = $_POST['depselectPrinter'];
     }
+    $this->subtree= isset($_POST['SubSearch']);
 
     if((isset($_GET['search']))&&(!empty($_GET['search']))){
       $this->regex=$_GET['search']."*";
@@ -127,6 +129,7 @@ class selectUserToPrinterDialog extends plugin
     $smarty->assign("infoimage"           , get_template_path('images/info.png'));
     $smarty->assign("launchimage"         , get_template_path('images/small_filter.png'));
     $smarty->assign("deplist"             , $deps);
+    $smarty->assign("subtree", $this->subtree?"checked":"");
 
     $display.= $smarty->fetch(get_template_path('selectUserToPrinterDialog.tpl', TRUE,dirname(__FILE__)));
     return($display);
@@ -166,7 +169,11 @@ class selectUserToPrinterDialog extends plugin
     $attrs  = $this->searchAttrs;
     $cat    = $this->search_cat;
 
-    $res = get_list($filter,$cat,$base,$attrs);
+    if ($this->subtree){
+      $res= get_list($filter,$cat,$base,$attrs, GL_SUBSEARCH);
+    } else {
+      $res= get_list($filter,$cat,$base,$attrs);
+    }
     foreach($res as $printer){
       if(($detailed ==true)){
         if(isset($printer[$this->searchAppend])){
index 0d387ef4d3defb1292176638bc0e184dbe5146ab..5cd8e152ab1554b44a4c2f52900fd6b031b5037f 100644 (file)
                                <table summary="" style="width:100%;border-top:1px solid #B0B0B0;background-color:#F8F8F8">
                                {$alphabet}
                                </table>
+                                       <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+                                               <tr>
+                                                       <td>
+                                                               <input type='checkbox' name='SubSearch' value='1' title='{t}Select to search within subtrees{/t}' onClick='document.mainform.submit();' {$subtree}>&nbsp;{t}Ignore subtrees{/t}
+                                                       </td>
+                                               </tr>
+                                       </table>
                                <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
                                        <tr>
                                                <td>