Code

Updated printer.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Oct 2008 07:08:10 +0000 (07:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Oct 2008 07:08:10 +0000 (07:08 +0000)
-Updated fixed message if no ppdPath is configured.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12757 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/ppd/class_printerPPDDialog.inc
gosa-plugins/goto/admin/systems/ppd/printerPPDDialog.tpl

index 244129c6f861cbb66d926e72c24e3878fe8e0414..b9ffea9037e098a1a4a05431c66be9d6f057f33a 100644 (file)
@@ -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);
index c80d6c308defb0185df2dc318981e55b76498b86..8cafc3b26323dc540a825f1da90a2d6b2b0c028d 100644 (file)
@@ -1,24 +1,32 @@
 <h2><img alt="P" class="center" src="plugins/systems/images/select_printer.png" align="middle">&nbsp;{t}Printer driver{/t}</h2>
-<table summary="" width="100%">
-       <tr>
-               <td width="50%" style="vertical-align:top">
-                       {t}Model{/t}: <i>{$ppdString}</i>&nbsp;
-                       <input type="submit" name="SelectPPD" value="{t}Select{/t}">
-               </td>
-               <td style="border-left: 1px solid rgb(160, 160, 160);padding-left:10px;">
-                       {t}New driver{/t}&nbsp;
-                       <input type="file" value="" name="NewPPDFile">
-                       <input type="submit" name="SubmitNewPPDFile" value="{t}Upload{/t}">
-               </td>
-       </tr>
-</table>
-{if $showOptions eq 1}
-<p class="seperator">&nbsp;</p>
-<h2><img alt="L" class="center" src="images/lists/on.png" align="middle">&nbsp;{t}Options{/t}</h2>
-{$properties}
+{if !$path_valid}
+<p>
+       <b>{msgPool type=invalidConfigurationAttribute param=ppdPath}</b>
+</p>
+{else}
+       <table summary="" width="100%">
+               <tr>
+                       <td width="50%" style="vertical-align:top">
+                               {t}Model{/t}: <i>{$ppdString}</i>&nbsp;
+                               <input type="submit" name="SelectPPD" value="{t}Select{/t}">
+                       </td>
+                       <td style="border-left: 1px solid rgb(160, 160, 160);padding-left:10px;">
+                               {t}New driver{/t}&nbsp;
+                               <input type="file" value="" name="NewPPDFile">
+                               <input type="submit" name="SubmitNewPPDFile" value="{t}Upload{/t}">
+                       </td>
+               </tr>
+       </table>
+       {if $showOptions eq 1}
+       <p class="seperator">&nbsp;</p>
+       <h2><img alt="L" class="center" src="images/lists/on.png" align="middle">&nbsp;{t}Options{/t}</h2>
+       {$properties}
+       {/if}
 {/if}
 <p class="plugbottom">
        <input type="hidden" name="PPDDisSubmitted" value="1">
+       {if $path_valid}
        <input type="submit" name="SavePPD" value="{msgPool type=applyButton}">
+       {/if}
        <input type="submit" name="ClosePPD" value="{msgPool type=cancelButton}">
 </p>