From: hickert Date: Fri, 28 Oct 2005 07:34:39 +0000 (+0000) Subject: Display value instead of keys for ppd options. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dd1d3f7200ee868176421f3dfbdfc6736388bf63;p=gosa.git Display value instead of keys for ppd options. Save PPD when printer is saved. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1714 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index b88302340..1e6661769 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -32,6 +32,8 @@ class printgeneric extends plugin var $AdminMemberKeys =array(); var $is_terminalBased = false; + + var $PPDdialogToSave = NULL; var $member =array(); var $strings = ""; @@ -245,7 +247,11 @@ class printgeneric extends plugin } if(isset($_POST['EditDriver'])){ - $this->dialog = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD); + if($this->PPDdialogToSave){ + $this->dialog = $this->PPDdialogToSave; + }else{ + $this->dialog = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD); + } } if(isset($_POST['PrinterCancel'])){ @@ -254,8 +260,8 @@ class printgeneric extends plugin } if(isset($_POST['RemoveDriver'])){ - $this->gotoPrinterPPD = array(); + $this->PPDdialogToSave = NULL; } if(isset($_POST['SavePPD'])){ @@ -268,6 +274,7 @@ class printgeneric extends plugin $this->gotoPrinterPPD = array(); $this->gotoPrinterPPD = $this->dialog->save(); + $this->PPDdialogToSave = $this->dialog; unset($this->dialog); $this->dialog=NULL; } @@ -445,7 +452,11 @@ class printgeneric extends plugin if (!$this->is_account){ return; } - + + if($this->PPDdialogToSave){ + $this->PPDdialogToSave->save_ppd(); + } + $dn= $this->dn; plugin::save(); $ldap= $this->config->get_ldap_link(); diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index f3675f554..b5547fff8 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -131,12 +131,15 @@ class printerPPDDialog extends plugin } } + + function save_ppd(){ + $this->ppdManager->saveProperties($this->selectedPPD['link'],$this->ppdConfig); + } /* Save to LDAP */ function save() { /* return the selected PPD, and in future the selected options too */ - $this->ppdManager->saveProperties($this->selectedPPD['link'],$this->ppdConfig); return($this->selectedPPD['link']); } @@ -183,7 +186,8 @@ class printerPPDDialog extends plugin /* Add attributes of the current category */ foreach($obj as $attr => $settings){ - + + /* Skip all entries beginning with _ */ if($attr[0] == "_") continue; @@ -201,7 +205,7 @@ class printerPPDDialog extends plugin /* Get all values */ foreach( $settings as $vname => $value){ if($vname[0] != "_"){ - $values[$vname]= $vname; + $values[$vname]= $value; } } diff --git a/plugins/admin/systems/printerPPDDialog.tpl b/plugins/admin/systems/printerPPDDialog.tpl index 5b8a8a5f8..9a68fc43b 100644 --- a/plugins/admin/systems/printerPPDDialog.tpl +++ b/plugins/admin/systems/printerPPDDialog.tpl @@ -13,8 +13,8 @@

 {t}Options{/t}

{$properties} -

 

-
- - - +

+ + + +

diff --git a/plugins/admin/systems/printerPPDSelectionDialog.tpl b/plugins/admin/systems/printerPPDSelectionDialog.tpl index 5b913ccac..defe4ea64 100644 --- a/plugins/admin/systems/printerPPDSelectionDialog.tpl +++ b/plugins/admin/systems/printerPPDSelectionDialog.tpl @@ -47,13 +47,43 @@ {$apply} + + +
+
+
+

+ [U] + {t}Upload new PPD file{/t} +

+
+
+ + + + +
+ +  {t}Select the PPD file you want to upload.{/t} +
+ + + + +
+ +
+
+
+
+

- +