Es wurde das BAckend "None" eingeführt, falls kein Backend enabled ist.
Fehlermeldung nun in deutsch falls kein Backend vorhanden.
Die Hochladbare Dateigröße ist nun in der Mandantenkonfig in Megabytes (default 10Mb)
my ($self, $backend_name) = @_;
my $class = 'SL::File::Backend::' . $backend_name;
my $obj = undef;
+ die $::locale->text('no backend enabled') if $backend_name eq 'None';
eval {
eval "require $class";
$obj = $class->new;
- die 'backend not enabled' unless $obj->enabled;
+ die $::locale->text('backend "#1" not enabled',$backend_name) unless $obj->enabled;
1;
} or do {
- die 'backend class not found';
+ die $::locale->text('backend "#1" not found',$backend_name);
};
return $obj;
}
my ($init) = @_;
- $::request->layout->add_javascripts("autocomplete_chart.js", "kivi.GL.js", "kivi.RecordTemplate.js");
+ $::request->layout->add_javascripts("autocomplete_chart.js", "kivi.File.js", "kivi.GL.js", "kivi.RecordTemplate.js");
my @old_project_ids = grep { $_ } map{ $::form->{"project_id_$_"} } 1..$::form->{rowcount};
'The login is not unique.' => 'Der Loginname ist nicht eindeutig.',
'The long description is missing.' => 'Der Langtext fehlt.',
'The master templates where not found.' => 'Der Vorlagensatz wurde nicht gefunden.',
- 'The maximum of uploadable filesize' => 'Die maximale Dateigröße in Bytes die hochladbar ist',
+ 'The maximum of uploadable filesize in Megabyte' => 'Die maximale Dateigröße in Megabytes, die hochladbar ist',
'The name and description are not unique.' => 'Name und Beschreibung sind nicht einmalig.',
'The name in row %d has already been used before.' => 'Der Name in Zeile %d wurde vorher bereits benutzt.',
'The name is invalid.' => 'Der Name ist ungültigt.',
'averconsumed_br' => 'Ø mtl.',
'back' => 'zurück',
'back_br' => 'Zurk.',
+ 'backend "#1" not enabled' => 'Dateimanagement-Subsystem "#1" nicht aktiviert',
+ 'backend "#1" not found' => 'Dateimanagement-Subsystem "#1" unbekannt',
'balance' => 'Betriebsvermögensvergleich/Bilanzierung',
'bank_collection_payment_list_#1' => 'bankeinzugszahlungsliste_#1',
'bank_transfer_payment_list_#1' => 'ueberweisungszahlungsliste_#1',
'next' => 'vor',
'no' => 'nein',
'no article assigned yet' => 'noch kein Artikel zugewiesen',
+ 'no backend enabled' => 'Kein Dateimanagement-Subsystem aktiviert',
'no bestbefore' => 'keine Mindesthaltbarkeit',
'no chargenumber' => 'keine Chargennummer',
'no execution for this client' => 'keine Ausführung für diesen Mandanten',
-- @description: "Zusätzliche Config flags für Filemanagement"
-- @depends: release_3_4_1
ALTER TABLE defaults ADD COLUMN doc_delete_printfiles boolean DEFAULT false;
-ALTER TABLE defaults ADD COLUMN doc_max_filesize integer DEFAULT 1000000;
+ALTER TABLE defaults ADD COLUMN doc_max_filesize integer DEFAULT 10000000;
ALTER TABLE defaults ADD COLUMN doc_storage boolean DEFAULT false;
ALTER TABLE defaults ADD COLUMN doc_storage_for_documents text default 'Filesystem';
ALTER TABLE defaults ADD COLUMN doc_storage_for_attachments text default 'Filesystem';
ALTER TABLE defaults ADD COLUMN doc_storage_for_images text default 'Filesystem';
ALTER TABLE defaults ADD COLUMN doc_files boolean DEFAULT false;
-ALTER TABLE defaults ADD COLUMN doc_files_rootpath text default '';
+ALTER TABLE defaults ADD COLUMN doc_files_rootpath text default './documents';
ALTER TABLE defaults ADD COLUMN doc_webdav boolean DEFAULT false;
ALTER TABLE defaults ADD COLUMN doc_database boolean DEFAULT false;
$result=$@;
};
$result = substr($result,0,14);
-print $result."\n";
+#print $result."\n";
ok($result eq "No object type","correct error 'No object type'");
$::form->{object_type} ='sales_order';
$result=$@;
};
$result = substr($result,0,12);
-print $result."\n";
+#print $result."\n";
ok($result eq "No file type","correct error 'No file type'");
clear_up();
<tr>
<td align="right">[% LxERP.t8('Storage Type for generated/imported PDF Documents') %]</td>
<td>[% L.select_tag('defaults.doc_storage_for_documents',
- [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
- default = SELF.defaults.doc_storage_for_documents) %]</td>
+ [ [ 'None', LxERP.t8('None') ],[ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
+ default = SELF.defaults.doc_storage_for_documents,
+ onchange="return checkavailable_filebackend(this);") %]</td>
<td>[% LxERP.t8('Use this storage backend for all generated PDF-Files') %]</td>
</tr>
<tr>
<td align="right">[% LxERP.t8('Storage Type for Attachments') %]</td>
<td>[% L.select_tag('defaults.doc_storage_for_attachments',
- [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
- default = SELF.defaults.doc_storage_for_attachments) %]</td>
+ [ [ 'None', LxERP.t8('None') ], [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
+ default = SELF.defaults.doc_storage_for_attachments,
+ onchange="return checkavailable_filebackend(this);") %]</td>
<td>[% LxERP.t8('Use this storage backend for all uploaded attachments') %]</td>
</tr>
<tr>
<td align="right">[% LxERP.t8('Storage Type for images') %]</td>
<td>[% L.select_tag('defaults.doc_storage_for_images',
- [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
- default = SELF.defaults.doc_storage_for_images) %]</td>
+ [ [ 'None', LxERP.t8('None') ], [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ],
+ default = SELF.defaults.doc_storage_for_images,
+ onchange="return checkavailable_filebackend(this);") %]</td>
<td>[% LxERP.t8('Use this storage backend for uploaded images') %]</td>
</tr>
<tr>
</tr>
<tr>
<td align="right">[% LxERP.t8('max filesize') %]</td>
- <td>[% L.input_tag('defaults.doc_max_filesize',SELF.defaults.doc_max_filesize, size=>10) %]</td>
- <td>[% LxERP.t8('The maximum of uploadable filesize') %]</td>
+ <td>[% L.input_tag('doc_max_filesize_MB','', size=10, onchange="verifyMBSize(this);") %]
+ [% L.hidden_tag('defaults.doc_max_filesize',SELF.defaults.doc_max_filesize) %] MB</td>
+ <td>[% LxERP.t8('The maximum of uploadable filesize in Megabyte') %]</td>
</tr>
<tr><td class="listheading" colspan="4">[% LxERP.t8("Storage Backends") %]</td></tr>
<tr>
</tr>
<tr>
<td align="right">[% LxERP.t8('Root path for file storage') %]</td>
- <td>[% L.input_tag('defaults.doc_files_rootpath',SELF.defaults.doc_files_rootpath, style=style) %]</td>
+ <td>[% L.input_tag('defaults.doc_files_rootpath',SELF.defaults.doc_files_rootpath, style=style, onchange="verifyRootPath(this);") %]</td>
<td>[% LxERP.t8('This is the root directory for the File storage backend, must be writable for webserver') %]</td>
</tr>
<tr>
</tr>
<tr>
<td align="right">[% LxERP.t8('Database') %]</td>
- <td>[% L.yes_no_tag('defaults.doc_database', SELF.defaults.doc_database) %]</td>
+ <td>[% L.yes_no_tag('defaults.doc_database', SELF.defaults.doc_database, disabled=1) %]</td>
<td>[% LxERP.t8('Use Database Storage backend (not implemented yet!)') %]</td>
</tr>
$('#new_templates,#new_master_templates').prop('disabled', existing);
}
+function verifyMBSize(elem) {
+ var fsize = parseInt($('#doc_max_filesize_MB').val());
+ $('#defaults_doc_max_filesize').val(fsize*1000000.0);
+ $('#doc_max_filesize_MB').val(fsize);
+}
+
+function verifyRootPath(elem) {
+ if ( elem.value == "" ) {
+ elem.value="./documents";
+ }
+}
+
+function checkavailable_filebackend(elem) {
+ var selval = elem.value;
+ if ( selval == 'Webdav' && $("#defaults_doc_webdav").val() == 0 ) {
+ elem.value = 'Filesystem';
+ } else if ( selval == 'ExtDMS' ) {
+ elem.value = 'Filesystem';
+ } if ( selval == 'DB' && $("#defaults_doc_database").val() == 0 ) {
+ elem.value = 'Filesystem';
+ }
+ if ( elem.value == 'Filesystem' && $("#defaults_doc_files").val() == 0 ) {
+ elem.value = 'None';
+ }
+ return false;
+}
+
$(function() {
warehouse_selected([% SELF.defaults.warehouse_id || -1 %], [% SELF.defaults.bin_id || -1 %], 'bin_id');
warehouse_selected([% SELF.defaults.warehouse_id_ignore_onhand || -1 %], [% SELF.defaults.bin_id_ignore_onhand || -1 %], 'bin_id_ignore_onhand');
enable_template_controls();
+ $('#doc_max_filesize_MB').val(parseInt($('#defaults_doc_max_filesize').val())/1000000.0);
$('#use_templates_existing,#use_templates_new').change(enable_template_controls);
})
-->