From: cajus Date: Fri, 22 Jun 2007 14:53:34 +0000 (+0000) Subject: Updated to have subtree search X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d8bf4152567b95681430b1149edb498d8c46fa7;p=gosa.git Updated to have subtree search git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6668 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_selectPrinterDialog.inc b/plugins/personal/environment/class_selectPrinterDialog.inc index 2f2afb95c..693e3425b 100644 --- a/plugins/personal/environment/class_selectPrinterDialog.inc +++ b/plugins/personal/environment/class_selectPrinterDialog.inc @@ -17,6 +17,7 @@ class selectPrinterDialog extends plugin var $deplist = array("/"); var $module = array("printer"); var $ui = NULL; + var $subtreesearch = FALSE; function selectPrinterDialog ($config, $dn= NULL,$alreadyused=array() ) { @@ -72,6 +73,12 @@ class selectPrinterDialog extends plugin } } + if(isset($_POST['subtrees'])){ + $this->subtreesearch= TRUE; + } else { + $this->subtreesearch= FALSE; + } + if((isset($_GET['search']))&&(!empty($_GET['search']))){ $this->regex=$_GET['search']."*"; $this->regex=preg_replace("/\*\*/","*",$this->regex); @@ -84,6 +91,7 @@ class selectPrinterDialog extends plugin $smarty->assign("gotoPrinterKeys",array_flip($this->getPrinter())); $smarty->assign("apply", apply_filter()); $smarty->assign("alphabet", generate_alphabet()); + $smarty->assign("subtrees", $this->subtreesearch?"checked":""); $smarty->assign("search_image", get_template_path('images/search.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); $smarty->assign("infoimage", get_template_path('images/info.png')); @@ -122,7 +130,12 @@ class selectPrinterDialog extends plugin $module = $this->module; $base = $this->depselect; $attrs = array("cn","description"); - $res = get_list($filter,$module,$base,$attrs); + if ($this->subtreesearch){ + $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT, GL_SUBSEARCH); + } else { + $base= "ou=printers,ou=systems,".$base; + $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT); + } foreach($res as $printer) { diff --git a/plugins/personal/environment/selectPrinterDialog.tpl b/plugins/personal/environment/selectPrinterDialog.tpl index d30845c97..e58f71465 100644 --- a/plugins/personal/environment/selectPrinterDialog.tpl +++ b/plugins/personal/environment/selectPrinterDialog.tpl @@ -37,6 +37,11 @@ + + +
+ {t}Ignore subtrees{/t} +