From e6408d5392081942f4f7f9600102da4e6dc3baba Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Oct 2007 11:46:46 +0000 Subject: [PATCH] Updated printer ppd settings : For each printer there is a copy of the original ppd created, like this: http://server/ppd/modified/vendor/printer_name-ppd.ppd If the printer was renamed, the ppdPath wasn't updated too. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7534 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_printGeneric.inc | 6 ++++++ plugins/admin/systems/class_printerPPDDialog.inc | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 92290222d..f85cc5689 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -716,6 +716,12 @@ class printgeneric extends plugin if($this->PPDdialogToSave){ $this->PPDdialogToSave->save_ppd(); } + if($this->orig_dn != $this->dn){ + $this->PPDdialogToSave = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD); + $this->PPDdialogToSave->cn = $this->cn; + $this->PPDdialogToSave->generateProperties(); + $this->PPDdialogToSave->update_ppd_url(); + } /* Remove previously selected ppd file.*/ if($this->initial_PPD != $this->gotoPrinterPPD){ diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index 6a9c37df6..ecdacd44c 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -349,7 +349,8 @@ class printerPPDDialog extends plugin /* Save modified ppd */ - function save_ppd(){ + function save_ppd() + { if($this->ppdManager){ $this->ppdManager->saveProperties($this->pathToPPD.$this->pathToModified.$this->selectedPPD['link'],$this->ppdConfig); } @@ -493,6 +494,11 @@ class printerPPDDialog extends plugin print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path)); } } + + function update_ppd_url() + { + $this->SelectPPD("modified/".$this->selectedPPD['link']); + } function check() { -- 2.30.2