From: psc Date: Mon, 29 Mar 2010 10:34:38 +0000 (+0000) Subject: Followup commit for #2000 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7686963f1f914138291e3dbbfbb58137a20d1967;p=gosa.git Followup commit for #2000 When creating a printer via a workstation use a different formular name for the printer description, otherwise the description conflicts with the workstation description. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@17346 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/trunk/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index 17e92cdd6..97820940f 100644 --- a/trunk/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/trunk/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -11,6 +11,7 @@ class printgeneric extends plugin var $cn = ""; var $l = ""; var $description = ""; + var $printer_description = ""; var $labeledURI = ""; var $gotoPrinterPPD = ""; var $initial_PPD = ""; @@ -149,6 +150,10 @@ class printgeneric extends plugin } $this->orig_cn = $this->cn; $this->orig_base = $this->base; + + if (!preg_match('/Printer/i', $this->BelongsTo)) { + $this->printer_description = $this->description; + } } function set_acl_base($base) @@ -391,7 +396,11 @@ class printgeneric extends plugin /* Assign attributes */ foreach ($this->attributes as $attr){ - $smarty->assign("$attr", $this->$attr); + $smarty->assign("$attr", $this->$attr); + } + + if (!preg_match("/Printer/", $this->BelongsTo)) { + $smarty->assign("printer_description", $this->printer_description); } if(isset($_POST['AddUser'])){ @@ -659,6 +668,10 @@ class printgeneric extends plugin if(is_object($this->netConfigDNS)){ $this->netConfigDNS->save_object(); } + + if (!isset($_POST['edit_cancel']) && isset($_POST['printer_description'])) { + $this->printer_description = get_post('printer_description'); + } /* Set new base if allowed */ $tmp = $this->get_allowed_bases(); @@ -748,7 +761,7 @@ class printgeneric extends plugin if(preg_match("/workstation/i",$this->BelongsTo)){ $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/",get_ou('printerRDN'),$this->dn); } - + if(!$this->is_account) return; if(isset($this->parent->by_object['workgeneric'])){ if($this->parent->by_object['workgeneric']->cn == "wdefault"){ @@ -845,6 +858,10 @@ class printgeneric extends plugin $this->attrs= $attrs; } + if (!empty($this->printer_description)) { + $this->attrs['description'] = $this->printer_description; + } + /* Append printer user */ $this->attrs['gotoUserPrinter']=array(); diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/printer.tpl b/trunk/gosa-plugins/goto/admin/systems/goto/printer.tpl index b384ac4b0..bf432cefd 100644 --- a/trunk/gosa-plugins/goto/admin/systems/goto/printer.tpl +++ b/trunk/gosa-plugins/goto/admin/systems/goto/printer.tpl @@ -47,7 +47,7 @@ {render acl=$descriptionACL} - + {/render}