From 57076b412201c57062a58993ea7c7e30555d73fe Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 17 Feb 2017 10:18:58 +0000 Subject: [PATCH] Bug 18002 - Successfully working budget and fund form display order Created onboardinginclude2.inc for fund form Added perl If statement logic into acqui-home.pl to control onboarding include display --- acqui/acqui-home.pl | 9 ++++ admin/aqbudgetperiods.pl | 4 +- .../prog/en/includes/onboardinginclude.inc | 57 +++------------------- .../prog/en/includes/onboardinginclude2.inc | 57 ++++++++++++++++++++++ .../prog/en/modules/acqui/acqui-home.tt | 8 ++- 5 files changed, 81 insertions(+), 54 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index fe53174..c1fcf39 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -107,6 +107,15 @@ 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 8258578..1aad2e8 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -120,7 +120,9 @@ elsif ( $op eq 'add_validate' ) { } else { # ELSE ITS AN ADD my $budget_period_id=AddBudgetPeriod($budget_period_hashref); - print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl?step=2"); + my $step= $input->param( 'step' ); + $template->param( step => $step); + print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); exit; } $op='else'; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc index f64848c..b372886 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc @@ -13,56 +13,14 @@ border-radius:25px; } -
- ×

+ ×

[% IF displayonboardscreen == "acquisitions" %] - [% IF step == 2 %] -
-
- [% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund - [% IF ( budget_period_description ) %] - [% budget_name %] for Budget '[% budget_period_description %]' - [% END %] - - - -
    - [% IF ( budget_parent_id ) %] -
  1. - Fund parent: - [% budget_parent_name %] - [% budget_parent_id %] - [% budget_parent_name %] - -
  2. - [% END %] - -
  3. - - -
  4. - -
  5. - - -
  6. - -
  7. - - -
  8. - -
    - Cancel - -
    - - - [% ELSE %]

    Create a budget

    +
    1. @@ -93,20 +51,17 @@
    -
    - + - Cancel
- [% END %] + [% ELSIF displayonboardscreen == "label" %] +

testing

-[% ELSIF displayonboardscreen == "label" %] -

testing

-[% END %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc new file mode 100644 index 0000000..00d4afd --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc @@ -0,0 +1,57 @@ + + +
+
+
+ [% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund + [% IF ( budget_period_description ) %] + [% budget_name %] for Budget '[% budget_period_description %]' + [% END %] + + + +
    + [% IF ( budget_parent_id ) %] +
  1. + Fund parent: + [% budget_parent_name %] + [% budget_parent_id %] - [% budget_parent_name %] + +
  2. + [% END %] +
  3. + + +
  4. + +
  5. + + +
  6. + +
  7. + + +
  8. + +
    + Cancel + +
    +
+
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index 5240eee..ac29397 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -118,8 +118,12 @@ $(document).ready(function() { [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %] [% UNLESS ( loop_budget ) %] [% IF ( CAN_user_acquisition_period_manage ) %] - [% displayonboardscreen = "acquisitions" %] - [% INCLUDE onboardinginclude.inc %] + [% displayonboardscreen = "acquisitions" %] + [% IF stepfund == 1 %] + [% INCLUDE onboardinginclude.inc %] + [% ELSE %] + [% INCLUDE onboardinginclude2.inc %] + [% END %] [% ELSE %]
Your administrator must define a budget in Administration
[% END %] -- 2.1.4