Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0b5b8355

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 0b5b835542cf5ff0ec074108ee7a62ecc00b1f87
  • Vorgänger 3eb3d1b1
  • Nachfolger a67ad20f

SL::DBUpgrade2::add_print_templates: Anpassung auf Mandantenumstellung

Unterschiede anzeigen:

SL/DBUpgrade2/Base.pm
90 90
    croak "File '${src_dir}/$_' does not exist" unless -f "${src_dir}/$_";
91 91
  }
92 92

  
93
  my %users         = $::auth->read_all_users;
94
  my @template_dirs = uniq map { $_ = $_->{templates}; s:/+$::; $_ } values %users;
93
  my $template_dir = $::instance_conf->reload->get_templates;
94
  $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: template_dir $template_dir");
95 95

  
96
  $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: template_dirs " . join('  ', @template_dirs));
96
  return 1 if !$template_dir;
97 97

  
98 98
  foreach my $src_file (@files) {
99
    foreach my $template_dir (@template_dirs) {
100
      my $dest_file = $template_dir . '/' . $src_file;
99
    my $dest_file = $template_dir . '/' . $src_file;
101 100

  
102
      if (-f $dest_file) {
103
        $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: dest_file exists, skipping: ${dest_file}");
104
        next;
105
      }
101
    if (-f $dest_file) {
102
      $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: dest_file exists, skipping: ${dest_file}");
103
      next;
104
    }
106 105

  
107
      my $dest_dir = File::Basename::dirname($dest_file);
106
    my $dest_dir = File::Basename::dirname($dest_file);
108 107

  
109
      if ($dest_dir && !-d $dest_dir) {
110
        File::Path::make_path($dest_dir) or die "Cannot create directory '${dest_dir}': $!";
111
      }
108
    if ($dest_dir && !-d $dest_dir) {
109
      File::Path::make_path($dest_dir) or die "Cannot create directory '${dest_dir}': $!";
110
    }
112 111

  
113
      File::Copy::copy($src_dir . '/' . $src_file, $dest_file) or die "Cannot copy '${src_dir}/${src_file}' to '${dest_file}': $!";
112
    File::Copy::copy($src_dir . '/' . $src_file, $dest_file) or die "Cannot copy '${src_dir}/${src_file}' to '${dest_file}': $!";
114 113

  
115
      $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: copied '${src_dir}/${src_file}' to '${dest_file}'");
116
    }
114
    $::lxdebug->message(LXDebug::DEBUG1(), "add_print_templates: copied '${src_dir}/${src_file}' to '${dest_file}'");
117 115
  }
118 116

  
119 117
  return 1;

Auch abrufbar als: Unified diff