summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9717f4d)
raw | patch | inline | side by side (parent: 9717f4d)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Jun 2007 14:45:14 +0000 (14:45 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Jun 2007 14:45:14 +0000 (14:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6667 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/environment/class_selectPrinterDialog.inc | patch | blob | history | |
plugins/personal/environment/selectPrinterDialog.tpl | patch | blob | history |
diff --git a/plugins/personal/environment/class_selectPrinterDialog.inc b/plugins/personal/environment/class_selectPrinterDialog.inc
index 7480772150c6d827b408c14e1c1c9b01a315e0e8..ec6f875d4ef187ad017a03990e838aeccc11b2a1 100644 (file)
var $regex = "*";
var $depselect = "/";
var $deplist = "/";
+ var $subtreesearch = FALSE;
function selectPrinterDialog ($config, $dn= NULL,$alreadyused=array() )
{
$this->depselect = $_POST['depselectPrinter'];
}
+ 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);
$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'));
{
$a_return=array();
$ldap = $this->config->get_ldap_link();
- $ldap->cd($this->depselect);
/* Set tag attribute if we've tagging activated */
$tag= "";
$tag= "(gosaUnitTag=".$ui->gosaUnitTag.")";
}
- $ldap->search("(&(objectClass=gotoPrinter)$tag(cn=".$this->regex."))",array("*"));
+ if ($this->subtreesearch){
+ $ldap->cd($this->depselect);
+ $ldap->search("(&(objectClass=gotoPrinter)$tag(cn=".$this->regex."))",array("*"));
+ } else {
+ $ldap->cd("ou=printers,ou=systems,".$this->depselect);
+ $ldap->search("(&(objectClass=gotoPrinter)$tag(cn=".$this->regex."))",array("*"));
+ }
while($printer = $ldap->fetch()){
if(isset($this->AlreadyAssigned[$printer['cn'][0]])) continue;
diff --git a/plugins/personal/environment/selectPrinterDialog.tpl b/plugins/personal/environment/selectPrinterDialog.tpl
index d30845c97f869ac30182d7a067798b071b3fb827..e58f71465fbe0b378e6c48ab165f6451f1b53408 100644 (file)
</td>
</tr>
</table>
+ <table summary="" style="width:100%;border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+ <tr><td>
+ <input type=checkbox name="subtrees" value="1" {$subtrees} onClick="mainform.submit()" title="{t}Select to search within subtrees{/t}">{t}Ignore subtrees{/t}
+ </tr></td>
+ </table>
<table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
<tr>
<td>