Code

Display value instead of keys for ppd options.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Oct 2005 07:34:39 +0000 (07:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Oct 2005 07:34:39 +0000 (07:34 +0000)
Save PPD when printer is saved.

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

plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_printerPPDDialog.inc
plugins/admin/systems/printerPPDDialog.tpl
plugins/admin/systems/printerPPDSelectionDialog.tpl

index b883023405c5654d2f4e6d670fbe3dc4ae460b9e..1e66617693e9ad6fab2a6872fd45951dae6ca5a5 100644 (file)
@@ -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();
index f3675f554977e2691ba099d73a9b0f958a5ca644..b5547fff8d403e7e6deff08c8ed2867bbac5d670 100644 (file)
@@ -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;
             }
           }
 
index 5b8a8a5f878bd6aa6ecef2b799047bdb6af2fbaf..9a68fc43ba5c10bc3c3a8cb2e4eb1d149328cdbf 100644 (file)
@@ -13,8 +13,8 @@
 <br>
 <h2><img src="images/house.png">&nbsp;{t}Options{/t}</h2>
 {$properties}
-<p class="seperator">&nbsp;</p>
-<br>
-<input type="hidden" name="PPDDisSubmitted" value="1">
-<input type="submit" name="SavePPD" value="{t}Save{/t}">
-<input type="submit" name="ClosePPD" value="{t}Close{/t}">
+<p class="plugbottom">
+       <input type="hidden" name="PPDDisSubmitted" value="1">
+       <input type="submit" name="SavePPD" value="{t}Use{/t}">
+       <input type="submit" name="ClosePPD" value="{t}Close{/t}">
+</p>
index 5b913ccac1780ef41d4b611a628ed89318a13d9d..defe4ea643b62eb0eed1a4c970162065a632a37d 100644 (file)
           </tr>
         </table>
               {$apply}
+
+      </div>
+      <br>
+      <br>
+      <div class="contentboxh" style="height:20px;">
+        <p class="contentboxh" style="font-size:12px">
+          <img src="{$launchimage}" align="right" alt="[U]">
+          <b>{t}Upload new PPD file{/t}</b>
+        </p>
+      </div>
+      <div class="contentboxb">
+        <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+          <tr>
+            <td >
+              <img alt="" src="{$tree_image}" align=middle>
+              &nbsp;{t}Select the PPD file you want to upload.{/t}
+            </td>
+          </tr>
+        </table>
+        <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+          <tr>
+            <td >
+              <input type="file" value="" name="PPDUpload">
+            </td>
+          </tr>
+        </table>
+        <div align="right">
+          <table summary="" style="border-top: 1px solid rgb(176, 176, 176); background: rgb(238, 238, 238) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" width="100%"><tbody><tr><td align="right" width="100%">
+          <input type="submit" value="{t}Upload{/t}"></td></tr></tbody></table>
+        </div>
       </div>
     </td>
   </tr>
 </table>
 
 <p class="plugbottom">
-<input type="submit" name="SavePPDSelection" value="{t}Use{/t}">
+<input type="submit" name="SavePPDSelection" value="{t}Select{/t}">
   &nbsp;
 <input type="submit" name="ClosePPDSelection" value="{t}Close{/t}">
 </p>