X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fbp.pl;h=654a267767d1913402b34d285a727f1189b5946b;hb=06a22a8b9282269c33e1462a87ed5140ec858794;hp=a39cdd1b145f7e88bb2c9a4df33487860ed2a755;hpb=72539cb39a3d19f930a8e0e41e46bf41afe9a8f1;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index a39cdd1b1..654a26776 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -32,14 +32,47 @@ #====================================================================== use SL::BP; +use Data::Dumper; +use List::Util qw(first); 1; +require "bin/mozilla/common.pl"; + # end of main +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', + 'request_quotation' => 'request_quotation_edit', + 'check' => 'cash', + 'receipt' => 'cash', + ); + + 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"); + + } else { + $auth->assert('DOES_NOT_EXIST'); + } +} + sub search { $lxdebug->enter_sub(); + assert_bp_access(); + # $locale->text('Sales Invoices') # $locale->text('Packing Lists') # $locale->text('Sales Orders') @@ -152,18 +185,18 @@ sub search { } # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { # with JavaScript Calendar $button1 = qq| -