Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4412b603

Von Tamino Steinert vor 8 Monaten hinzugefügt

  • ID 4412b603dcffbd030ef278eec6463c8e34b0157d
  • Vorgänger 2872818f
  • Nachfolger 1f0fb5c0

S:F:B:Webdav: Lege beim Speichern Dateiversion an

Unterschiede anzeigen:

SL/File/Backend/Filesystem.pm
4 4

  
5 5
use parent qw(SL::File::Backend);
6 6
use SL::DB::File;
7
use SL::DB::FileVersion;
7 8

  
8 9
use File::Copy;
9 10
use File::Slurp;
......
92 93
    print OUT $params{file_contents};
93 94
    close(OUT);
94 95
  }
96

  
97
  # save file version
95 98
  my $doc_path = $::lx_office_conf{paths}->{document_path};
96 99
  my $rel_file = $tofile;
97 100
  $rel_file    =~ s/$doc_path//;
98

  
99 101
  my $fv = SL::DB::FileVersion->new(
100
                            file_id       => $dbfile->id,
101
                            version       => $dbfile->backend_data,
102
                            file_location => $rel_file,
103
                            doc_path      => $doc_path,
104
                            backend       => 'Filesystem',
105
                            guid          => create_uuid_as_string(UUID_V4),
106
                          )->save;
102
    file_id       => $dbfile->id,
103
    version       => $dbfile->backend_data,
104
    file_location => $rel_file,
105
    doc_path      => $doc_path,
106
    backend       => 'Filesystem',
107
    guid          => create_uuid_as_string(UUID_V4),
108
  )->save;
109

  
107 110
  if ($params{mtime}) {
108 111
    utime($params{mtime}, $params{mtime}, $tofile);
109 112
  }

Auch abrufbar als: Unified diff