Code

Updated printer ppd settings :
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Oct 2007 11:46:46 +0000 (11:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Oct 2007 11:46:46 +0000 (11:46 +0000)
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
plugins/admin/systems/class_printerPPDDialog.inc

index 92290222dc53fd2bdf02bd8dec5a04789f7a6f82..f85cc568932e1b202429ae16b05ccd93d2aded57 100644 (file)
@@ -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){
index 6a9c37df63c2872f1e1331a823f0a2f58b6c4ccb..ecdacd44c74cab59ffb30d334e805b5fc55f8992 100644 (file)
@@ -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()
   {