Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cbf8ed02

Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt

  • ID cbf8ed0240f2cf87a37ebaff9aa36844f66d0a49
  • Vorgänger c2b23333
  • Nachfolger 084c45b1

Dateimanagement: Robustere Mandantenkonfigurierung

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)

Unterschiede anzeigen:

SL/File.pm
319 319
  my ($self, $backend_name) = @_;
320 320
  my $class = 'SL::File::Backend::' . $backend_name;
321 321
  my $obj   = undef;
322
  die $::locale->text('no backend enabled') if $backend_name eq 'None';
322 323
  eval {
323 324
    eval "require $class";
324 325
    $obj = $class->new;
325
    die 'backend not enabled' unless $obj->enabled;
326
    die $::locale->text('backend "#1" not enabled',$backend_name) unless $obj->enabled;
326 327
    1;
327 328
  } or do {
328
    die 'backend class not found';
329
    die $::locale->text('backend "#1" not found',$backend_name);
329 330
  };
330 331
  return $obj;
331 332
}
bin/mozilla/gl.pl
955 955

  
956 956
  my ($init) = @_;
957 957

  
958
  $::request->layout->add_javascripts("autocomplete_chart.js", "kivi.GL.js", "kivi.RecordTemplate.js");
958
  $::request->layout->add_javascripts("autocomplete_chart.js", "kivi.File.js", "kivi.GL.js", "kivi.RecordTemplate.js");
959 959

  
960 960
  my @old_project_ids = grep { $_ } map{ $::form->{"project_id_$_"} } 1..$::form->{rowcount};
961 961

  
locale/de/all
3004 3004
  'The login is not unique.'    => 'Der Loginname ist nicht eindeutig.',
3005 3005
  'The long description is missing.' => 'Der Langtext fehlt.',
3006 3006
  'The master templates where not found.' => 'Der Vorlagensatz wurde nicht gefunden.',
3007
  'The maximum of uploadable filesize' => 'Die maximale Dateigröße in Bytes die hochladbar ist',
3007
  'The maximum of uploadable filesize in Megabyte' => 'Die maximale Dateigröße in Megabytes, die hochladbar ist',
3008 3008
  'The name and description are not unique.' => 'Name und Beschreibung sind nicht einmalig.',
3009 3009
  'The name in row %d has already been used before.' => 'Der Name in Zeile %d wurde vorher bereits benutzt.',
3010 3010
  'The name is invalid.'        => 'Der Name ist ungültigt.',
......
3591 3591
  'averconsumed_br'             => 'Ø mtl.',
3592 3592
  'back'                        => 'zurück',
3593 3593
  'back_br'                     => 'Zurk.',
3594
  'backend "#1" not enabled'    => 'Dateimanagement-Subsystem "#1" nicht aktiviert',
3595
  'backend "#1" not found'      => 'Dateimanagement-Subsystem "#1" unbekannt',
3594 3596
  'balance'                     => 'Betriebsvermögensvergleich/Bilanzierung',
3595 3597
  'bank_collection_payment_list_#1' => 'bankeinzugszahlungsliste_#1',
3596 3598
  'bank_transfer_payment_list_#1' => 'ueberweisungszahlungsliste_#1',
......
3713 3715
  'next'                        => 'vor',
3714 3716
  'no'                          => 'nein',
3715 3717
  'no article assigned yet'     => 'noch kein Artikel zugewiesen',
3718
  'no backend enabled'          => 'Kein Dateimanagement-Subsystem aktiviert',
3716 3719
  'no bestbefore'               => 'keine Mindesthaltbarkeit',
3717 3720
  'no chargenumber'             => 'keine Chargennummer',
3718 3721
  'no execution for this client' => 'keine Ausführung für diesen Mandanten',
sql/Pg-upgrade2/filemanagement_feature.sql
2 2
-- @description: "Zusätzliche Config flags für Filemanagement"
3 3
-- @depends: release_3_4_1
4 4
ALTER TABLE defaults ADD COLUMN doc_delete_printfiles       boolean DEFAULT false;
5
ALTER TABLE defaults ADD COLUMN doc_max_filesize            integer DEFAULT 1000000;
5
ALTER TABLE defaults ADD COLUMN doc_max_filesize            integer DEFAULT 10000000;
6 6
ALTER TABLE defaults ADD COLUMN doc_storage                 boolean DEFAULT false;
7 7
ALTER TABLE defaults ADD COLUMN doc_storage_for_documents   text default 'Filesystem';
8 8
ALTER TABLE defaults ADD COLUMN doc_storage_for_attachments text default 'Filesystem';
9 9
ALTER TABLE defaults ADD COLUMN doc_storage_for_images      text default 'Filesystem';
10 10
ALTER TABLE defaults ADD COLUMN doc_files                   boolean DEFAULT false;
11
ALTER TABLE defaults ADD COLUMN doc_files_rootpath          text default '';
11
ALTER TABLE defaults ADD COLUMN doc_files_rootpath          text default './documents';
12 12
ALTER TABLE defaults ADD COLUMN doc_webdav                  boolean DEFAULT false;
13 13
ALTER TABLE defaults ADD COLUMN doc_database                boolean DEFAULT false;
t/file/filesystem.t
85 85
  $result=$@;
86 86
};
87 87
$result = substr($result,0,14);
88
print $result."\n";
88
#print $result."\n";
89 89
ok($result eq "No object type","correct error 'No object type'");
90 90

  
91 91
$::form->{object_type} ='sales_order';
......
99 99
  $result=$@;
100 100
};
101 101
$result = substr($result,0,12);
102
print $result."\n";
102
#print $result."\n";
103 103
ok($result eq "No file type","correct error 'No file type'");
104 104

  
105 105
clear_up();
templates/webpages/client_config/_features.html
37 37
  <tr>
38 38
    <td align="right">[% LxERP.t8('Storage Type for generated/imported PDF Documents') %]</td>
39 39
    <td>[% L.select_tag('defaults.doc_storage_for_documents',
40
         [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
41
                               default = SELF.defaults.doc_storage_for_documents) %]</td> 
40
         [ [ 'None', LxERP.t8('None') ],[ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
41
                               default = SELF.defaults.doc_storage_for_documents,
42
                               onchange="return checkavailable_filebackend(this);") %]</td>
42 43
    <td>[% LxERP.t8('Use this storage backend for all generated PDF-Files') %]</td>
43 44
  </tr>
44 45
  <tr>
45 46
    <td align="right">[% LxERP.t8('Storage Type for Attachments') %]</td>
46 47
    <td>[% L.select_tag('defaults.doc_storage_for_attachments',
47
         [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
48
                               default = SELF.defaults.doc_storage_for_attachments) %]</td> 
48
         [ [ 'None', LxERP.t8('None') ], [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
49
                               default = SELF.defaults.doc_storage_for_attachments,
50
                               onchange="return checkavailable_filebackend(this);") %]</td>
49 51
    <td>[% LxERP.t8('Use this storage backend for all uploaded attachments') %]</td>
50 52
  </tr>
51 53
  <tr>
52 54
    <td align="right">[% LxERP.t8('Storage Type for images') %]</td>
53 55
    <td>[% L.select_tag('defaults.doc_storage_for_images',
54
         [ [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
55
                               default = SELF.defaults.doc_storage_for_images) %]</td> 
56
         [ [ 'None', LxERP.t8('None') ], [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ]  ],
57
                               default = SELF.defaults.doc_storage_for_images,
58
                               onchange="return checkavailable_filebackend(this);") %]</td>
56 59
    <td>[% LxERP.t8('Use this storage backend for uploaded images') %]</td>
57 60
  </tr>
58 61
  <tr>
......
62 65
  </tr>
63 66
  <tr>
64 67
   <td align="right">[% LxERP.t8('max filesize') %]</td>
65
   <td>[% L.input_tag('defaults.doc_max_filesize',SELF.defaults.doc_max_filesize, size=>10) %]</td>
66
   <td>[% LxERP.t8('The maximum of uploadable filesize') %]</td>
68
   <td>[% L.input_tag('doc_max_filesize_MB','', size=10, onchange="verifyMBSize(this);") %]
69
       [% L.hidden_tag('defaults.doc_max_filesize',SELF.defaults.doc_max_filesize) %] MB</td>
70
   <td>[% LxERP.t8('The maximum of uploadable filesize in Megabyte') %]</td>
67 71
  </tr>
68 72
  <tr><td class="listheading" colspan="4">[% LxERP.t8("Storage Backends") %]</td></tr>
69 73
  <tr>
......
73 77
  </tr>
74 78
  <tr>
75 79
   <td align="right">[% LxERP.t8('Root path for file storage') %]</td>
76
   <td>[% L.input_tag('defaults.doc_files_rootpath',SELF.defaults.doc_files_rootpath, style=style) %]</td>
80
   <td>[% L.input_tag('defaults.doc_files_rootpath',SELF.defaults.doc_files_rootpath, style=style, onchange="verifyRootPath(this);") %]</td>
77 81
   <td>[% LxERP.t8('This is the root directory for the File storage backend, must be writable for webserver') %]</td>
78 82
  </tr>
79 83
  <tr>
......
83 87
  </tr>
84 88
  <tr>
85 89
   <td align="right">[% LxERP.t8('Database') %]</td>
86
   <td>[% L.yes_no_tag('defaults.doc_database', SELF.defaults.doc_database) %]</td>
90
   <td>[% L.yes_no_tag('defaults.doc_database', SELF.defaults.doc_database, disabled=1) %]</td>
87 91
   <td>[% LxERP.t8('Use Database Storage backend (not implemented yet!)') %]</td>
88 92
  </tr>
89 93

  
templates/webpages/client_config/form.html
38 38
  $('#new_templates,#new_master_templates').prop('disabled', existing);
39 39
}
40 40

  
41
function verifyMBSize(elem) {
42
  var fsize = parseInt($('#doc_max_filesize_MB').val());
43
  $('#defaults_doc_max_filesize').val(fsize*1000000.0);
44
  $('#doc_max_filesize_MB').val(fsize);
45
}
46

  
47
function verifyRootPath(elem) {
48
  if ( elem.value == "" ) {
49
    elem.value="./documents";
50
  }
51
}
52

  
53
function checkavailable_filebackend(elem) {
54
  var selval = elem.value;
55
  if ( selval == 'Webdav' && $("#defaults_doc_webdav").val() == 0 ) {
56
     elem.value = 'Filesystem';
57
  } else if ( selval == 'ExtDMS' ) {
58
     elem.value = 'Filesystem';
59
  } if ( selval == 'DB' && $("#defaults_doc_database").val() == 0 ) {
60
     elem.value = 'Filesystem';
61
  }
62
  if ( elem.value == 'Filesystem' && $("#defaults_doc_files").val() == 0 ) {
63
     elem.value = 'None';
64
  }
65
  return false;
66
}
67

  
41 68
$(function() {
42 69
  warehouse_selected([% SELF.defaults.warehouse_id || -1 %], [% SELF.defaults.bin_id || -1 %], 'bin_id');
43 70
  warehouse_selected([% SELF.defaults.warehouse_id_ignore_onhand || -1 %], [% SELF.defaults.bin_id_ignore_onhand || -1 %], 'bin_id_ignore_onhand');
44 71

  
45 72
  enable_template_controls();
73
  $('#doc_max_filesize_MB').val(parseInt($('#defaults_doc_max_filesize').val())/1000000.0);
46 74
  $('#use_templates_existing,#use_templates_new').change(enable_template_controls);
47 75
})
48 76
    -->

Auch abrufbar als: Unified diff