Enhancement: Make web installer log errors to error log
[koha.git] / admin / systempreferences.pl
index b7e1df4..b81c2ad 100755 (executable)
@@ -44,6 +44,7 @@ use strict;
 use warnings;
 
 use CGI;
+use MIME::Base64;
 use C4::Auth;
 use C4::Context;
 use C4::Koha;
@@ -72,7 +73,8 @@ my %tabsysprefs;
     $tabsysprefs{emailPurchaseSuggestions}="Acquisitions";
     $tabsysprefs{RenewSerialAddsSuggestion}="Acquisitions";
     $tabsysprefs{AcqCreateItem}="Acquisitions";
-    $tabsysprefs{pdfformat}="Acquisitions";
+    $tabsysprefs{OrderPdfFormat}="Acquisitions";
+    $tabsysprefs{OrderPdfTemplate}="Acquisitions";
     $tabsysprefs{CurrencyFormat}="Acquisitions";
 
 # Admin
@@ -456,6 +458,8 @@ sub GetPrefParams {
     if ( not defined( $data->{'type'} ) ) {
         $params->{'type-free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 );
+    } elsif ( $data->{'type'} eq 'Upload' ) {
+        $params->{'type-upload'} = 1;
     } elsif ( $data->{'type'} eq 'Choice' ) {
         $params->{'type-choice'} = 1;
     } elsif ( $data->{'type'} eq 'YesNo' ) {
@@ -688,6 +692,13 @@ if ( $op eq 'add_form' ) {
             $value = $params->{'value'};
         }
     }
+
+    if ( $input->param('preftype') eq 'Upload' ) {
+        my $lgtfh = $input->upload('value');
+        $value = join '', <$lgtfh>;
+        $value = encode_base64($value);
+    }
+
     if ( $sth->rows ) {
         unless ( C4::Context->config('demo') ) {
             my $sth = $dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?");