X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=173f8b6c182b858b10ea18ebdaab10679f63a9bf;hb=02e1cec838a274a87b1a1c69f9c07d2c86ce4127;hp=654a267767d1913402b34d285a727f1189b5946b;hpb=e74c2ab4728dfdc932cd290db005ce2250e9d61b;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index 654a26776..173f8b6c1 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -39,9 +39,13 @@ use List::Util qw(first); 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', @@ -53,28 +57,25 @@ sub assert_bp_access { ); if ($form->{type} && $access_map{$form->{type}}) { - $auth->assert($access_map{$form->{type}}); - - } elsif ($form->{type} eq 'packing_list') { - $lxdebug->message(0, "1"); - if (!$auth->assert('sales_order_edit', 1)) { - $lxdebug->message(0, "2"); - $auth->assert('invoice_edit') ; - } - $lxdebug->message(0, "3"); + $main::auth->assert($access_map{$form->{type}}); } else { - $auth->assert('DOES_NOT_EXIST'); + $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; + + my ($name, $account, $onload); assert_bp_access(); # $locale->text('Sales Invoices') - # $locale->text('Packing Lists') # $locale->text('Sales Orders') # $locale->text('Purchase Orders') # $locale->text('Quotations') @@ -85,7 +86,7 @@ sub search { # setup customer/vendor selection BP->get_vc(\%myconfig, \%$form); - if (@{ $form->{"all_$form->{vc}"} }) { + if (@{ $form->{"all_$form->{vc}"} || [] }) { map { $name .= "