From b08101f5ec22fb94fb6550a5b2858019cd460aad Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 17 Feb 2017 01:55:00 +0000 Subject: [PATCH] Bug 18002 - Created two includes onboardinginclude.inc and onboardinginclude2.inc which contain the budget and fund creation forms respectively Both these forms successfully insert records into the database --- acqui/acqui-home.pl | 9 ++ admin/aqbudgetperiods.pl | 8 +- admin/aqbudgets.pl | 5 ++ .../prog/en/includes/onboardinginclude.inc | 97 ++++++++++------------ .../prog/en/includes/onboardinginclude2.inc | 62 ++++++++++++++ .../prog/en/modules/acqui/acqui-home.tt | 15 +++- .../prog/en/modules/admin/aqbudgetperiods.tt | 2 +- .../prog/en/modules/admin/aqbudgets.tt | 2 +- 8 files changed, 142 insertions(+), 58 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..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)); diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 7ce5783..1935aee 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -113,14 +113,18 @@ if ( $op eq 'add_form' ) { elsif ( $op eq 'add_validate' ) { ## add or modify a budget period (confirmation) - ## update budget period data +## update budget period data if ( $budget_period_id ne '' ) { $$budget_period_hashref{$_}||=0 for qw(budget_period_active budget_period_locked); my $status=ModBudgetPeriod($budget_period_hashref); } else { # ELSE ITS AN ADD my $budget_period_id=AddBudgetPeriod($budget_period_hashref); - } + my $stepfund = $input->param( 'step' ); + $template->param( stepfund => $stepfund ); + print $input->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); + exit; +} $op='else'; } 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/onboardinginclude.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc index b26f070..b372886 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude.inc @@ -1,7 +1,3 @@ -[% USE Koha %] -[% USE KohaDates %] -[% USE Branches %] - +
+ ×

+ [% IF displayonboardscreen == "acquisitions" %] +

Create a budget

+
+
+ + + +
    +
  1. + + +
    [% INCLUDE 'date-format.inc' %]
    +
  2. -[% step = 1 %] - -
    - ×

    -[% IF displayonboardscreen == "acquisitions" %] -

    Create a budget

    - -
    - - -
      -
    1. - - -
      [% INCLUDE 'date-format.inc' %]
      -
    2. - -
    3. - - -
      [% INCLUDE 'date-format.inc' %]
      -
    4. +
    5. + + +
      [% INCLUDE 'date-format.inc' %]
      +
    6. -
    7. - - -
    8. +
    9. + + +
    10. -
    11. - - -
    12. +
    13. + + +
    14. -
    15. - - [% IF ( budget_period_active ) %][% ELSE %] [% END %] -
    16. -
    - +
  3. + + [% IF ( budget_period_active ) %][% ELSE %] [% END %] +
  4. +
+
+
+ + + +
+
+
+ [% ELSIF displayonboardscreen == "label" %] +

testing

-
- - Cancel - - - -[% 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..51ea060 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc @@ -0,0 +1,62 @@ + + +
+
+
+ [% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund + [% IF ( budget_period_description ) %] + [% budget_name %] for Budget '[% budget_period_description %]' + [% END %] + + + +
    + [% budget_parent_id = 0 %] +
  1. + Fund parent: + [% budget_parent_name %] + [% budget_parent_id %] - [% budget_parent_name %] + +
  2. +
  3. + + +
  4. + +
  5. + + +
  6. + +
  7. + + +
  8. + + + + [% IF ( budget_id ) %] + + [% END %] + +
+
+ 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 0bc0982..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 @@ -1,5 +1,9 @@ [% USE Price %] [% USE Branches %] +[% USE Koha %] +[% USE KohaDates %] +[% USE Branches %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions [% INCLUDE 'doc-head-close.inc' %] @@ -9,6 +13,9 @@ +[% INCLUDE 'calendar.inc' %] + +