From: Moritz Bunkus Date: Mon, 18 May 2009 14:08:42 +0000 (+0000) Subject: Nach der Projektauswahl die richtige Funktion aufrufen. X-Git-Tag: release-2.6.0rc1~38 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7148aad6ec1cb80332c9fba6232e3fc825807307;p=kivitendo-erp.git Nach der Projektauswahl die richtige Funktion aufrufen. Fix für Bug 940. --- diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index 3ab764c7e..1ed40a7f9 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -275,6 +275,8 @@ sub check_project { $auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); + my $nextsub = shift || 'update'; + for $i (1 .. $form->{rowcount}) { my $suffix = $i ? "_$i" : ""; my $prefix = $i ? "" : "global"; @@ -289,7 +291,7 @@ sub check_project { # check form->{project_list} how many there are $form->{rownumber} = $i; - &select_project($i ? undef : 1); + &select_project($i ? undef : 1, $nextsub); exit; } @@ -317,7 +319,7 @@ sub select_project { $auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); - my ($is_global) = @_; + my ($is_global, $nextsub) = @_; @column_index = qw(ndx projectnumber description); @@ -405,9 +407,10 @@ sub select_project { print qq|\n|; } - print qq| - - + print + $cgi->hidden('-name' => 'is_global', '-default' => [$is_global]) + . $cgi->hidden('-name' => 'project_selected_nextsub', '-default' => [$nextsub]) + . qq|
{$_} } qw(ndx lastndx nextsub is_global); + my $nextsub = $form->{project_selected_nextsub} || 'update'; - if ($form->{update}) { - call_sub($form->{"update"}); - } else { - &update; - } + map { delete $form->{$_} } qw(ndx lastndx nextsub is_global project_selected_nextsub); + + call_sub($nextsub); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 21991ea35..bf1270ece 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -908,7 +908,7 @@ sub get_project { $form->{projectnumber_1} = $form->{projectnumber}; delete $form->{sort}; - &check_project; + check_project('generate_projects'); # if there is one only, assign id $form->{project_id} = $form->{project_id_1};