From 158f47c8e5be9459a91a457100d806cf73162944 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 27 Apr 2006 06:22:46 +0000 Subject: [PATCH] Only used printer will be shown now, in the printer add dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3136 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/environment/class_environment.inc | 2 +- .../personal/environment/class_selectPrinterDialog.inc | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 562b0278f..14cf03c42 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -611,7 +611,7 @@ class environment extends plugin /* First handle Add Post. Open a dialog that allows us to select a printer or two */ if(isset($_POST['gotoPrinterAdd'])){ $this->is_dialog=true; - $this->dialog = new selectPrinterDialog($this->config,$this->dn); + $this->dialog = new selectPrinterDialog($this->config,$this->dn,$this->gotoPrinter); } if(isset($_POST['PrinterCancel'])){ diff --git a/plugins/personal/environment/class_selectPrinterDialog.inc b/plugins/personal/environment/class_selectPrinterDialog.inc index efeca4e99..2400b2857 100644 --- a/plugins/personal/environment/class_selectPrinterDialog.inc +++ b/plugins/personal/environment/class_selectPrinterDialog.inc @@ -11,14 +11,14 @@ class selectPrinterDialog extends plugin var $ignore_account = TRUE; var $attributes = array(); var $objectclasses = array("whatever"); - var $use_existing = false; + var $AlreadyAssigned = array(); var $regex = "*"; var $depselect = "/"; var $deplist = "/"; - function selectPrinterDialog ($config, $dn= NULL,$use_existing=false ) + function selectPrinterDialog ($config, $dn= NULL,$alreadyused=array() ) { - $this->use_existing = $use_existing; + $this->AlreadyAssigned = $alreadyused; plugin::plugin ($config, $dn); $this->depselect = $this->config->current['BASE']; } @@ -87,6 +87,9 @@ class selectPrinterDialog extends plugin $ldap->cd($this->depselect); $ldap->search("(&(objectClass=gotoPrinter)(cn=".$this->regex."))",array("*")); while($printer = $ldap->fetch()){ + + if(isset($this->AlreadyAssigned[$printer['cn'][0]])) continue; + if($detailed ==true){ $a_return[$printer['cn'][0]] = $printer; }else{ -- 2.30.2