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