Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / bin / mozilla / admin.pl
index 9fe0bab..6d518fc 100755 (executable)
@@ -61,6 +61,13 @@ require "bin/mozilla/admin_printer.pl";
 
 use strict;
 
+# parserhappy(R):
+
+#  $locale->text('periodic')
+#  $locale->text('income')
+#  $locale->text('perpetual')
+#  $locale->text('balance')
+
 our $cgi;
 our $form;
 our $locale;
@@ -431,16 +438,16 @@ sub edit_user_form {
   closedir TEMPLATEDIR;
 
   @alldir = grep !/\.(html|tex|sty|odt|xml|txb)$/, @alldir;
-  @alldir = grep !/^(webpages|mastertemplates|\.svn)$/, @alldir;
+  @alldir = grep !/^(webpages|print|\.svn)$/, @alldir;
 
   $form->{ALL_TEMPLATES} = [ map { { "name", => $_, "selected" => $_ eq $myconfig->{templates} } } @alldir ];
 
   # mastertemplates
-  opendir TEMPLATEDIR, "$::lx_office_conf{paths}->{templates}/mastertemplates" or $form->error("$::lx_office_conf{paths}->{templates}/mastertemplates" . " : $ERRNO");
+  opendir TEMPLATEDIR, "$::lx_office_conf{paths}->{templates}/print" or $form->error("$::lx_office_conf{paths}->{templates}/print" . " : $ERRNO");
   my @allmaster = readdir(TEMPLATEDIR);
   closedir TEMPLATEDIR;
 
-  @allmaster  = sort grep { -d ("$::lx_office_conf{paths}->{templates}/mastertemplates" . "/$_") && !/^\.\.?$/ } @allmaster;
+  @allmaster  = sort grep { -d ("$::lx_office_conf{paths}->{templates}/print" . "/$_") && !/^\.\.?$/ } @allmaster;
   @allmaster = reverse grep !/Default/, @allmaster;
   push @allmaster, 'Default';
   @allmaster = reverse @allmaster;
@@ -544,8 +551,8 @@ sub save_user {
       # copy templates to the directory
 
       my $oldcurrdir = getcwd();
-      if (!chdir("$::lx_office_conf{paths}->{templates}/mastertemplates/$form->{mastertemplates}")) {
-        $form->error("$ERRNO: chdir $::lx_office_conf{paths}->{templates}/mastertemplates/$form->{mastertemplates}");
+      if (!chdir("$::lx_office_conf{paths}->{templates}/print/$form->{mastertemplates}")) {
+        $form->error("$ERRNO: chdir $::lx_office_conf{paths}->{templates}/print/$form->{mastertemplates}");
       }
 
       my $newdir = File::Spec->catdir($oldcurrdir, $form->{templates});
@@ -566,7 +573,7 @@ sub save_user {
               chdir($oldcurrdir);
               $form->error("$ERRNO: symlink $File::Find::name");
             }
-          } elsif (-f $_ && $_ =~ m/.*?\.(html|tex|sty|odt|xml|txb|eps|pdf|png|jpg)$/) {
+          } elsif (-f $_) {
             if (!copy($_, File::Spec->catfile($newdir, $File::Find::name))) {
               chdir($oldcurrdir);
               $form->error("$ERRNO: cp $File::Find::name");