X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=d448685f31f4b53c9a2483ea6ae0fc5541a8806d;hb=d814a525b9f2fbc0bfae5591201d9185d6b1e8f4;hp=56f886fe170ac419247a1af84ab5fd32dda0c322;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index 56f886fe1..d448685f3 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -31,525 +31,171 @@ # #====================================================================== - use SL::BP; +use Data::Dumper; +use List::Util qw(first); 1; -# end of main +require "bin/mozilla/common.pl"; -sub search { - $lxdebug->enter_sub(); +use strict; +# end of main -# $locale->text('Sales Invoices') -# $locale->text('Packing Lists') -# $locale->text('Sales Orders') -# $locale->text('Purchase Orders') -# $locale->text('Quotations') -# $locale->text('RFQs') -# $locale->text('Checks') -# $locale->text('Receipts') +sub assert_bp_access { + my %access_map = ( + 'invoice' => 'invoice_edit', + 'sales_order' => 'sales_order_edit', + 'sales_quotation' => 'sales_quotation_edit', + 'purchase_order' => 'purchase_order_edit', + 'packing_list' => 'sales_delivery_order_edit|purchase_delivery_order_edit', + 'request_quotation' => 'request_quotation_edit', + 'check' => 'cash', + 'receipt' => 'cash', + ); + + if ($::form->{type} && $access_map{$::form->{type}}) { + $::auth->assert($access_map{$::form->{type}}); - # setup customer/vendor selection - BP->get_vc(\%myconfig, \%$form); - - if (@{ $form->{"all_$form->{vc}"} }) { - map { $name .= "