From 137f4c76564560f78104eff26f5af1c90739e812 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 23 Oct 2008 07:08:10 +0000 Subject: [PATCH] Updated printer. -Updated fixed message if no ppdPath is configured. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12757 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/ppd/class_printerPPDDialog.inc | 15 +++++++ .../admin/systems/ppd/printerPPDDialog.tpl | 42 +++++++++++-------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc b/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc index 244129c6f..b9ffea903 100644 --- a/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc +++ b/gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc @@ -45,6 +45,12 @@ class printerPPDDialog extends plugin $this->pathToPPD = ""; } + /* Check if ppdPath is set in gosa.conf. + */ + if(empty($this->pathToPPD)){ + msg_dialog::display(_("Configuration error"), msgPool::invalidConfigurationAttribute("ppdPath"), ERROR_DIALOG); + } + /* It seams that we have an existing PPD path, so go on */ if(!((!is_dir($this->pathToPPD))||(empty($this->pathToPPD)))){ @@ -87,6 +93,15 @@ class printerPPDDialog extends plugin $smarty= get_smarty(); $smarty->assign("ppdString", _("Can't get ppd informations.")); $smarty->assign("showOptions", ""); + $smarty->assign("path_valid", TRUE); + + if(empty($this->ppdPath)){ + + /* Print out template */ + $smarty->assign("path_valid", FALSE); + $display.= $smarty->fetch(get_template_path('printerPPDDialog.tpl', TRUE,dirname(__FILE__))); + return($display); + } /* Check these paths */ $paths = array($this->pathToPPD, $this->pathToPPD.$this->pathToModified); diff --git a/gosa-plugins/goto/admin/systems/ppd/printerPPDDialog.tpl b/gosa-plugins/goto/admin/systems/ppd/printerPPDDialog.tpl index c80d6c308..8cafc3b26 100644 --- a/gosa-plugins/goto/admin/systems/ppd/printerPPDDialog.tpl +++ b/gosa-plugins/goto/admin/systems/ppd/printerPPDDialog.tpl @@ -1,24 +1,32 @@

P {t}Printer driver{/t}

- - - - - -
- {t}Model{/t}: {$ppdString}  - - - {t}New driver{/t}  - - -
-{if $showOptions eq 1} -

 

-

L {t}Options{/t}

-{$properties} +{if !$path_valid} +

+ {msgPool type=invalidConfigurationAttribute param=ppdPath} +

+{else} + + + + + +
+ {t}Model{/t}: {$ppdString}  + + + {t}New driver{/t}  + + +
+ {if $showOptions eq 1} +

 

+

L {t}Options{/t}

+ {$properties} + {/if} {/if}

+ {if $path_valid} + {/if}

-- 2.30.2