From a9107c9083815fca4033b0a18c1c4e101944ae80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 24 Feb 2021 12:40:40 +0100 Subject: [PATCH] Dateimanagement: Hochladen als andere Quelle f. EK-Belege MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also dort, wo bisher auch der Import vom Scanner möglich ist. --- SL/Controller/File.pm | 41 ++++++++++++++++++++++++++++++++--------- doc/changelog | 2 ++ locale/de/all | 2 ++ locale/en/all | 2 ++ 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/SL/Controller/File.pm b/SL/Controller/File.pm index 94581102c..51dd5c0ac 100644 --- a/SL/Controller/File.pm +++ b/SL/Controller/File.pm @@ -43,31 +43,32 @@ use Rose::Object::MakeMethods::Generic __PACKAGE__->run_before('check_object_params', only => [ qw(list ajax_delete ajax_importdialog ajax_import ajax_unimport ajax_upload ajax_files_uploaded) ]); -# gen: bitmask: bit 1 (value is 1 or 3) => file created -# bit 2 (value is 2 or 3) => file from other source +# gen: bitmask: bit 1 (value is 1, 3, 5 or 7) => file created +# bit 2 (value is 2, 3, 6 or 7) => file from other source (e.g. directory for scanned documents) +# bit 3 (value is 4, 5, 6 or 7) => upload as other source # gltype: is this used somewhere? # dir: is this used somewhere? # model: base name of the rose model # right: access right used for import my %file_types = ( 'sales_quotation' => { gen => 1, gltype => '', dir =>'SalesQuotation', model => 'Order', right => 'import_ar' }, - 'sales_order' => { gen => 1, gltype => '', dir =>'SalesOrder', model => 'Order', right => 'import_ar' }, + 'sales_order' => { gen => 5, gltype => '', dir =>'SalesOrder', model => 'Order', right => 'import_ar' }, 'sales_delivery_order' => { gen => 1, gltype => '', dir =>'SalesDeliveryOrder', model => 'DeliveryOrder', right => 'import_ar' }, 'invoice' => { gen => 1, gltype => 'ar', dir =>'SalesInvoice', model => 'Invoice', right => 'import_ar' }, 'credit_note' => { gen => 1, gltype => '', dir =>'CreditNote', model => 'Invoice', right => 'import_ar' }, - 'request_quotation' => { gen => 3, gltype => '', dir =>'RequestForQuotation', model => 'Order', right => 'import_ap' }, - 'purchase_order' => { gen => 3, gltype => '', dir =>'PurchaseOrder', model => 'Order', right => 'import_ap' }, - 'purchase_delivery_order' => { gen => 3, gltype => '', dir =>'PurchaseDeliveryOrder',model => 'DeliveryOrder', right => 'import_ap' }, - 'purchase_invoice' => { gen => 2, gltype => 'ap', dir =>'PurchaseInvoice', model => 'PurchaseInvoice',right => 'import_ap' }, + 'request_quotation' => { gen => 7, gltype => '', dir =>'RequestForQuotation', model => 'Order', right => 'import_ap' }, + 'purchase_order' => { gen => 7, gltype => '', dir =>'PurchaseOrder', model => 'Order', right => 'import_ap' }, + 'purchase_delivery_order' => { gen => 7, gltype => '', dir =>'PurchaseDeliveryOrder',model => 'DeliveryOrder', right => 'import_ap' }, + 'purchase_invoice' => { gen => 6, gltype => 'ap', dir =>'PurchaseInvoice', model => 'PurchaseInvoice',right => 'import_ap' }, 'vendor' => { gen => 0, gltype => '', dir =>'Vendor', model => 'Vendor', right => 'xx' }, 'customer' => { gen => 1, gltype => '', dir =>'Customer', model => 'Customer', right => 'xx' }, 'part' => { gen => 0, gltype => '', dir =>'Part', model => 'Part', right => 'xx' }, - 'gl_transaction' => { gen => 2, gltype => 'gl', dir =>'GeneralLedger', model => 'GLTransaction', right => 'import_ap' }, + 'gl_transaction' => { gen => 6, gltype => 'gl', dir =>'GeneralLedger', model => 'GLTransaction', right => 'import_ap' }, 'draft' => { gen => 0, gltype => '', dir =>'Draft', model => 'Draft', right => 'xx' }, 'csv_customer' => { gen => 1, gltype => '', dir =>'Reports', model => 'Customer', right => 'xx' }, 'csv_vendor' => { gen => 1, gltype => '', dir =>'Reports', model => 'Vendor', right => 'xx' }, 'shop_image' => { gen => 0, gltype => '', dir =>'ShopImages', model => 'Part', right => 'xx' }, - 'letter' => { gen => 3, gltype => '', dir =>'Letter', model => 'Letter', right => 'sales_letter_edit | purchase_letter_edit' }, + 'letter' => { gen => 7, gltype => '', dir =>'Letter', model => 'Letter', right => 'sales_letter_edit | purchase_letter_edit' }, ); #--- 4 locale ---# @@ -498,6 +499,27 @@ sub _get_sources { my @sources; if ( $self->file_type eq 'document' ) { # TODO statt gen neue attribute in filetypes : + if (($file_types{$self->object_type}->{gen}*1 & 4)==4) { + # bit 3 is set => means upload + my $source = { + 'name' => 'uploaded', + 'title' => $main::locale->text('uploaded Documents'), + 'chk_action' => 'uploaded_documents_delete', + 'chk_title' => $main::locale->text('Delete Documents'), + 'chkall_title' => $main::locale->text('Delete all'), + 'file_title' => $main::locale->text('filename'), + 'confirm_text' => $main::locale->text('delete'), + 'can_rename' => 1, + 'are_existing' => $self->existing ? 1 : 0, + 'rename_title' => $main::locale->text('Rename Attachments'), + 'can_upload' => 1, + 'can_delete' => 1, + 'upload_title' => $main::locale->text('Upload Documents'), + 'done_text' => $main::locale->text('deleted') + }; + push @sources , $source; + } + if (($file_types{$self->object_type}->{gen}*1 & 1)==1) { my $gendata = { 'name' => 'created', @@ -514,6 +536,7 @@ sub _get_sources { }; push @sources , $gendata; } + if (($file_types{$self->object_type}->{gen}*1 & 2)==2) { my @others = SL::File->get_other_sources(); foreach my $scanner_or_mailrx (@others) { diff --git a/doc/changelog b/doc/changelog index efec8ec63..94f428f72 100644 --- a/doc/changelog +++ b/doc/changelog @@ -14,6 +14,8 @@ Mittelgroße neue Features: Kleinere neue Features und Detailverbesserungen: + - Dateimanagement: Dokumente können auch hochgeladen werden, dort, wo sie + bisher nur vom Scanner importiert werden konnten. - In der Mandantenkonfiguration ist einstellbar, ob UStID oder Steuernummer für Kunden oder Lieferanten eindeutig sein sollen. - Menü und Rechte für Produktivität: Zugriffskontrolle aufgeteilt und diff --git a/locale/de/all b/locale/de/all index 3f16ec327..1f5a291bd 100755 --- a/locale/de/all +++ b/locale/de/all @@ -3878,6 +3878,7 @@ $self->{texts} = { 'Updating the client fields in the database "#1" on host "#2:#3" failed.' => 'Die Aktualisierung der Mandantenfelder in der Datenbank "#1" auf Host "#2:#3" schlug fehl.', 'Upload' => 'Aktualisieren', 'Upload Attachments' => 'Anhänge hochladen', + 'Upload Documents' => 'Dokumente hochladen', 'Upload Images' => 'Bilder hochladen', 'Upload all marked' => 'Markierte aktualisieren', 'Upload file' => 'Datei hochladen', @@ -4387,6 +4388,7 @@ $self->{texts} = { 'unnamed record template' => 'unbenannte Belegvorlage', 'until' => 'bis', 'uploaded' => 'Hochgeladen', + 'uploaded Documents' => 'Hochgeladene Dokumente', 'use program settings' => 'benutze Programmeinstellungen', 'use user config' => 'Verwende Benutzereinstellung', 'used' => 'Verbraucht', diff --git a/locale/en/all b/locale/en/all index f9d1c2c22..14b13a596 100644 --- a/locale/en/all +++ b/locale/en/all @@ -3877,6 +3877,7 @@ $self->{texts} = { 'Updating the client fields in the database "#1" on host "#2:#3" failed.' => '', 'Upload' => '', 'Upload Attachments' => '', + 'Upload Documents' => '', 'Upload Images' => '', 'Upload all marked' => '', 'Upload file' => '', @@ -4386,6 +4387,7 @@ $self->{texts} = { 'unnamed record template' => '', 'until' => '', 'uploaded' => '', + 'uploaded Documents' => '', 'use program settings' => '', 'use user config' => '', 'used' => '', -- 2.20.1