Revision bf980f4c
Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt
SL/File/Backend/Filesystem.pm | ||
---|---|---|
85 | 85 |
die "unknown version" if $params{version} && |
86 | 86 |
($params{version} < 0 || $params{version} > $params{dbfile}->backend_data) ; |
87 | 87 |
my $path = $self->_filesystem_path($params{dbfile},$params{version}); |
88 |
die "no file found in backend" if !-f $path; |
|
88 |
die "no file found in backend or configuration to filesystem is wrong" if !-f $path;
|
|
89 | 89 |
my @st = stat($path); |
90 | 90 |
my $dt = DateTime->from_epoch(epoch => $st[9])->clone(); |
91 | 91 |
$main::lxdebug->message(LXDebug->DEBUG2(), "dt=" .$dt); |
... | ... | |
109 | 109 |
} |
110 | 110 |
|
111 | 111 |
sub enabled { |
112 |
return 0 unless $::instance_conf->get_doc_files || $::instance_conf->get_doc_files_rootpath;
|
|
113 |
$main::lxdebug->message(LXDebug->DEBUG2(), "root path=" . $::instance_conf->get_doc_files_rootpath . " isdir=" .( -d $::instance_conf->get_doc_files_rootpath?"YES":"NO"));
|
|
114 |
return 0 unless -d $::instance_conf->get_doc_files_rootpath;
|
|
112 |
return 0 unless $::instance_conf->get_doc_files; |
|
113 |
return 0 unless $::lx_office_conf{paths}->{document_path};
|
|
114 |
return 0 unless -d $::lx_office_conf{paths}->{document_path};
|
|
115 | 115 |
return 1; |
116 | 116 |
} |
117 | 117 |
|
... | ... | |
123 | 123 |
sub _filesystem_path { |
124 | 124 |
my ($self, $dbfile, $version) = @_; |
125 | 125 |
|
126 |
die "No files backend enabled" unless $::instance_conf->get_doc_files || $::instance_conf->get_doc_files_rootpath;
|
|
126 |
die "No files backend enabled" unless $::instance_conf->get_doc_files || $::lx_office_conf{paths}->{document_path};
|
|
127 | 127 |
|
128 | 128 |
# use filesystem with depth 3 |
129 | 129 |
$version = $dbfile->backend_data if !$version || $version < 1 || $version > $dbfile->backend_data; |
130 | 130 |
my $iddir = sprintf("%04d", $dbfile->id % 1000); |
131 |
my $path = File::Spec->catdir($::instance_conf->get_doc_files_rootpath, $iddir, $dbfile->id);
|
|
131 |
my $path = File::Spec->catdir($::lx_office_conf{paths}->{document_path}, $::auth->client->{id}, $iddir, $dbfile->id);
|
|
132 | 132 |
$main::lxdebug->message(LXDebug->DEBUG2(), "file path=" .$path." id=" .$dbfile->id." version=".$version." basename=".$dbfile->id . '_' . $version); |
133 | 133 |
if (!-d $path) { |
134 | 134 |
File::Path::make_path($path, { chmod => 0770 }); |
Auch abrufbar als: Unified diff
Filesystem Wurzelverzeichnis nun in kivitendo.conf
Das Rootverzeichnis für die Dokumente ist nun nicht mehr per Mandantenkonfig einstellbar
sondern ist unter [paths] in kivitendo.conf zu setzen.
Siehe auch Doku und kivitendo.conf.default
behebt nochmals #525 (redmine)