X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=d448685f31f4b53c9a2483ea6ae0fc5541a8806d;hb=422f2f17365ea7879c14b902c5db1e4cd7023e48;hp=1445eba05c40dcc049435ddc362c1e9e2b33ea27;hpb=b65a230d60e86d2c18a3ab7222379905aea5ecd7;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index 1445eba05..d448685f3 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -44,633 +44,158 @@ 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', + '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}}) { - $main::auth->assert($access_map{$form->{type}}); - - } elsif ($form->{type} eq 'packing_list') { - $main::lxdebug->message(0, "1"); - if (!$main::auth->assert('sales_order_edit', 1)) { - $main::lxdebug->message(0, "2"); - $main::auth->assert('invoice_edit') ; - } - $main::lxdebug->message(0, "3"); + if ($::form->{type} && $access_map{$::form->{type}}) { + $::auth->assert($access_map{$::form->{type}}); } else { - $main::auth->assert('DOES_NOT_EXIST'); + $::auth->assert('DOES_NOT_EXIST'); } } sub search { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - my ($name, $account, $onload); + $::lxdebug->enter_sub; assert_bp_access(); - # $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') - # setup customer/vendor selection - BP->get_vc(\%myconfig, \%$form); - - if (@{ $form->{"all_$form->{vc}"} || [] }) { - map { $name .= "