Revision a9107c90
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/File.pm | ||
---|---|---|
43 | 43 |
|
44 | 44 |
__PACKAGE__->run_before('check_object_params', only => [ qw(list ajax_delete ajax_importdialog ajax_import ajax_unimport ajax_upload ajax_files_uploaded) ]); |
45 | 45 |
|
46 |
# gen: bitmask: bit 1 (value is 1 or 3) => file created |
|
47 |
# bit 2 (value is 2 or 3) => file from other source |
|
46 |
# gen: bitmask: bit 1 (value is 1, 3, 5 or 7) => file created |
|
47 |
# bit 2 (value is 2, 3, 6 or 7) => file from other source (e.g. directory for scanned documents) |
|
48 |
# bit 3 (value is 4, 5, 6 or 7) => upload as other source |
|
48 | 49 |
# gltype: is this used somewhere? |
49 | 50 |
# dir: is this used somewhere? |
50 | 51 |
# model: base name of the rose model |
51 | 52 |
# right: access right used for import |
52 | 53 |
my %file_types = ( |
53 | 54 |
'sales_quotation' => { gen => 1, gltype => '', dir =>'SalesQuotation', model => 'Order', right => 'import_ar' }, |
54 |
'sales_order' => { gen => 1, gltype => '', dir =>'SalesOrder', model => 'Order', right => 'import_ar' },
|
|
55 |
'sales_order' => { gen => 5, gltype => '', dir =>'SalesOrder', model => 'Order', right => 'import_ar' },
|
|
55 | 56 |
'sales_delivery_order' => { gen => 1, gltype => '', dir =>'SalesDeliveryOrder', model => 'DeliveryOrder', right => 'import_ar' }, |
56 | 57 |
'invoice' => { gen => 1, gltype => 'ar', dir =>'SalesInvoice', model => 'Invoice', right => 'import_ar' }, |
57 | 58 |
'credit_note' => { gen => 1, gltype => '', dir =>'CreditNote', model => 'Invoice', right => 'import_ar' }, |
58 |
'request_quotation' => { gen => 3, gltype => '', dir =>'RequestForQuotation', model => 'Order', right => 'import_ap' },
|
|
59 |
'purchase_order' => { gen => 3, gltype => '', dir =>'PurchaseOrder', model => 'Order', right => 'import_ap' },
|
|
60 |
'purchase_delivery_order' => { gen => 3, gltype => '', dir =>'PurchaseDeliveryOrder',model => 'DeliveryOrder', right => 'import_ap' },
|
|
61 |
'purchase_invoice' => { gen => 2, gltype => 'ap', dir =>'PurchaseInvoice', model => 'PurchaseInvoice',right => 'import_ap' },
|
|
59 |
'request_quotation' => { gen => 7, gltype => '', dir =>'RequestForQuotation', model => 'Order', right => 'import_ap' },
|
|
60 |
'purchase_order' => { gen => 7, gltype => '', dir =>'PurchaseOrder', model => 'Order', right => 'import_ap' },
|
|
61 |
'purchase_delivery_order' => { gen => 7, gltype => '', dir =>'PurchaseDeliveryOrder',model => 'DeliveryOrder', right => 'import_ap' },
|
|
62 |
'purchase_invoice' => { gen => 6, gltype => 'ap', dir =>'PurchaseInvoice', model => 'PurchaseInvoice',right => 'import_ap' },
|
|
62 | 63 |
'vendor' => { gen => 0, gltype => '', dir =>'Vendor', model => 'Vendor', right => 'xx' }, |
63 | 64 |
'customer' => { gen => 1, gltype => '', dir =>'Customer', model => 'Customer', right => 'xx' }, |
64 | 65 |
'part' => { gen => 0, gltype => '', dir =>'Part', model => 'Part', right => 'xx' }, |
65 |
'gl_transaction' => { gen => 2, gltype => 'gl', dir =>'GeneralLedger', model => 'GLTransaction', right => 'import_ap' },
|
|
66 |
'gl_transaction' => { gen => 6, gltype => 'gl', dir =>'GeneralLedger', model => 'GLTransaction', right => 'import_ap' },
|
|
66 | 67 |
'draft' => { gen => 0, gltype => '', dir =>'Draft', model => 'Draft', right => 'xx' }, |
67 | 68 |
'csv_customer' => { gen => 1, gltype => '', dir =>'Reports', model => 'Customer', right => 'xx' }, |
68 | 69 |
'csv_vendor' => { gen => 1, gltype => '', dir =>'Reports', model => 'Vendor', right => 'xx' }, |
69 | 70 |
'shop_image' => { gen => 0, gltype => '', dir =>'ShopImages', model => 'Part', right => 'xx' }, |
70 |
'letter' => { gen => 3, gltype => '', dir =>'Letter', model => 'Letter', right => 'sales_letter_edit | purchase_letter_edit' },
|
|
71 |
'letter' => { gen => 7, gltype => '', dir =>'Letter', model => 'Letter', right => 'sales_letter_edit | purchase_letter_edit' },
|
|
71 | 72 |
); |
72 | 73 |
|
73 | 74 |
#--- 4 locale ---# |
... | ... | |
498 | 499 |
my @sources; |
499 | 500 |
if ( $self->file_type eq 'document' ) { |
500 | 501 |
# TODO statt gen neue attribute in filetypes : |
502 |
if (($file_types{$self->object_type}->{gen}*1 & 4)==4) { |
|
503 |
# bit 3 is set => means upload |
|
504 |
my $source = { |
|
505 |
'name' => 'uploaded', |
|
506 |
'title' => $main::locale->text('uploaded Documents'), |
|
507 |
'chk_action' => 'uploaded_documents_delete', |
|
508 |
'chk_title' => $main::locale->text('Delete Documents'), |
|
509 |
'chkall_title' => $main::locale->text('Delete all'), |
|
510 |
'file_title' => $main::locale->text('filename'), |
|
511 |
'confirm_text' => $main::locale->text('delete'), |
|
512 |
'can_rename' => 1, |
|
513 |
'are_existing' => $self->existing ? 1 : 0, |
|
514 |
'rename_title' => $main::locale->text('Rename Attachments'), |
|
515 |
'can_upload' => 1, |
|
516 |
'can_delete' => 1, |
|
517 |
'upload_title' => $main::locale->text('Upload Documents'), |
|
518 |
'done_text' => $main::locale->text('deleted') |
|
519 |
}; |
|
520 |
push @sources , $source; |
|
521 |
} |
|
522 |
|
|
501 | 523 |
if (($file_types{$self->object_type}->{gen}*1 & 1)==1) { |
502 | 524 |
my $gendata = { |
503 | 525 |
'name' => 'created', |
... | ... | |
514 | 536 |
}; |
515 | 537 |
push @sources , $gendata; |
516 | 538 |
} |
539 |
|
|
517 | 540 |
if (($file_types{$self->object_type}->{gen}*1 & 2)==2) { |
518 | 541 |
my @others = SL::File->get_other_sources(); |
519 | 542 |
foreach my $scanner_or_mailrx (@others) { |
Auch abrufbar als: Unified diff
Dateimanagement: Hochladen als andere Quelle f. EK-Belege
Also dort, wo bisher auch der Import vom Scanner möglich ist.