From 728685d36dff0db29ea5f924f3c4efb490a2cc7f Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 17 Feb 2017 22:55:29 +0000 Subject: [PATCH] Bug 18002 - Successful insertion of budget and fund in the acquisitions onboarding tool followed by the acquisition home page being displayed. Also the order of the form display in the acquisition onboarding tool is now correct with the budget being displayed first then fund. --- acqui/acqui-home.pl | 18 +++++++------- admin/aqbudgetperiods.pl | 4 +-- admin/aqbudgets.pl | 5 ++++ .../prog/en/includes/onboardinginclude2.inc | 29 +++++++++++++--------- .../prog/en/modules/admin/aqbudgets.tt | 2 +- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index c1fcf39..04bb261 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -66,6 +66,15 @@ my $totspent_active = 0; my $totordered_active = 0; my $totavail_active = 0; +my $budgets = GetBudgetPeriod(1); +if ($budgets > 0){ + my $stepfund = 2; + $template->param( stepfund => $stepfund ); +} else { + my $stepfund = 1; + $template->param( stepfund => $stepfund ); +} + my @budget_loop; foreach my $budget ( @{$budget_arr} ) { next unless (CanUserUseBudget($loggedinuser, $budget, $userflags)); @@ -107,15 +116,6 @@ foreach my $budget ( @{$budget_arr} ) { push @budget_loop, $budget; } -my $budgets = GetBudgetPeriod(); -if ($budgets > 0) { - my $stepfund = 2; - $template->param( stepfund => $stepfund ); -}else{ - my $stepfund = 1; - $template->param( stepfund => $stepfund ); -} - $template->param( type => 'intranet', loop_budget => \@budget_loop, diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 1aad2e8..1935aee 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -120,8 +120,8 @@ elsif ( $op eq 'add_validate' ) { } else { # ELSE ITS AN ADD my $budget_period_id=AddBudgetPeriod($budget_period_hashref); - my $step= $input->param( 'step' ); - $template->param( step => $step); + my $stepfund = $input->param( 'step' ); + $template->param( stepfund => $stepfund ); print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); exit; } diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 483ff8f..57e2bb2 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -180,6 +180,7 @@ if ($op eq 'add_form') { # END $OP eq ADD_FORM #---------------------- DEFAULT DISPLAY BELOW --------------------- + # called by default form, used to confirm deletion of data in DB } elsif ($op eq 'delete_confirm') { @@ -221,6 +222,10 @@ if ($op eq 'add_form') { $budget_hash->{budget_id} = AddBudget( $budget_hash ); ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); $budget_modified = 1; + + print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); + exit; + } my $set_owner_to_children = $input->param('set_owner_to_children'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc index 00d4afd..51ea060 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc @@ -25,14 +25,13 @@
    - [% IF ( budget_parent_id ) %] -
  1. - Fund parent: - [% budget_parent_name %] - [% budget_parent_id %] - [% budget_parent_name %] - -
  2. - [% END %] + [% budget_parent_id = 0 %] +
  3. + Fund parent: + [% budget_parent_name %] + [% budget_parent_id %] - [% budget_parent_name %] + +
  4. @@ -48,10 +47,16 @@
  5. -
    - Cancel - -
    + + + [% IF ( budget_id ) %] + + [% END %] + + +
    + Cancel +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt index a3c9ee9..6e09b87 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt @@ -453,7 +453,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") -[% IF op == 'add_form' && !error_not_authorised_to_modify %] +[% IF op == 'add_form' %]
    [% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund -- 2.1.4