From 009c15a320661927c998307324f3a450bddf85da Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 18 Aug 2017 11:37:24 +0000 Subject: [PATCH] Bug 18002: Followup - Changes based on test feedback In this patch the following changes have been made based on test feedback: * Added POD to GetHighestBudgetPeriod * Removed unconditional warns in Budgets.pm * Fixed typos and uncommented hint and date field * Changed manual link Made the acquisition onboarding tool less visible in the right hand side of the screen rather than in the middle obscuring the rest of the acquisition home page Implemented conditional so this tool is only displayed when the user is superlibrarian Test plan: 1. Restart memcached: sudo service memcached restart 2. Drop and recreate the database 3. Go through the web installer selecting all data values (except the basic currencies) 4. After the web installer is finished log into the staff interface using database admin credentials 5. Create a patron and assign superlibrarian permissions to them 6. Log out of staff interface and log back in as the new user you just created 7. Go to More->Acquisitions 8. Notice yellow/orange warning message telling you to create a budget 9. Apply the patches attached to this bug report 10. Repeat steps 1,2,3,4,5,6,7 11. Notice instead of warning messages a currency creation form appears on the right hand side of the page along with explanation of what a currency is and why the user is being asked to fill this form out. Fill out and submit this form. 12. A budget creation form is displayed along with an explanation of budgets above it. Fill this form out and submit it. 13. A fund creation form appears (again with explanation text above it), fill it out and submit it 14. The acquisition onboard tool disappears from the right of the screen and a table of created funds is displayed and should show the fund you just created 15. On the left of the screen below the text 'Administration' click on 'Funds' and delete the fund you just created 16. Click on More->Acquisitions and observe how the funds form is displayed rather than the currency or budget forms (because we already have a currency and budget in the database). Fill out the fund form and submit it. 17. Again you'll notice the fund table is displayed 18. On the left of the screen click on 'Budget' and delete your budget 19. Navigate to More->Acquisitions and observe how this time the budget form is displayed. Fill out this form and submit it. You should be redirected to the Budget Information page (aqbudgetperiods.pl) where you can click Actions->Add fund to add a fund. 20. Repeat steps 1,2,3,4,5,6,7 but making sure to install all sample data in the web installer including the basic currencies 21. Notice this time because you have installed basic currencies the first form to appear is the budget creation form 22. Repeat step 15 and then create a patron that does not have the superlibrarian permissions and log out and log back in. 23. Go to the Acquisitions module and notice that the yellow message telling you that your administrator must define a budget is displayed Sponsored by: Catalyst IT Signed-off-by: David Bourgault --- C4/Budgets.pm | 10 +++++- acqui/acqui-home.pl | 36 ++++++++++++---------- koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 34 ++++++++++++++++++++ .../prog/en/includes/onboardinginclude1.inc | 21 +++---------- .../prog/en/includes/onboardinginclude2.inc | 19 ++---------- .../prog/en/includes/onboardinginclude3.inc | 21 ++----------- .../prog/en/modules/acqui/acqui-home.tt | 24 +-------------- .../prog/en/modules/admin/aqbudgetperiods.tt | 2 +- 8 files changed, 74 insertions(+), 93 deletions(-) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 12c0d04..82c3b41 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -148,9 +148,17 @@ sub GetPeriodsCount { # ------------------------------------------------------------------- +=head2 GetHighestBudgetPeriod + + &my $budgetid = C4::Budgets->GetHighestBudgetPeriod(); + +Retrieve the highest budget + +=cut + sub GetHighestBudgetPeriod{ my $dbh = C4::Context->dbh; - warn my $data = $dbh->selectrow_array("SELECT MAX(budget_period_id) FROM aqbudgetperiods"); + my $data = $dbh->selectrow_array("SELECT MAX(budget_period_id) FROM aqbudgetperiods"); return $data; } # ------------------------------------------------------------------- diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 1e54f9c..a032b6e 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -53,6 +53,7 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( my $status = $query->param('status') || "ASKED"; my $suggestions_count = CountSuggestion($status); +my $userid = $query->param('userid'); my $budget_arr = GetBudgetHierarchy; @@ -124,11 +125,6 @@ $template->param( suggestions_count => $suggestions_count, ); - - - - - my $aqstep; my $cur = Koha::Acquisition::Currencies->get_active; @@ -141,18 +137,24 @@ if ( $cur ) { my $budget = GetPeriodsCount(); my $budgetid = C4::Budgets->GetHighestBudgetPeriod(); if (!@budget_loop){ -if (!$cur) { - $aqstep = 1; - $template->param( step => $aqstep ); -} elsif ($budget && $budgetid == 1){ - $aqstep = 3; - $template->param( step => $aqstep ); -} elsif ($budgetid > 1) { - print $query->redirect("/cgi-bin/koha/admin/aqbudgetperiods.pl"); - exit; -} else { - $aqstep = 2; - $template->param( step => $aqstep ); + if (!$cur) { + $aqstep = 1; + $template->param( step => $aqstep ); + } elsif ($budget && $budgetid == 1){ + $aqstep = 3; + $template->param( step => $aqstep ); + } elsif ($budgetid > 1) { + print $query->redirect("/cgi-bin/koha/admin/aqbudgetperiods.pl"); + exit; + } else { + $aqstep = 2; + $template->param( step => $aqstep ); + } } + +if ( C4::Context->IsSuperLibrarian() ) { + my $displayonboard = 1; + $template->param( displayonboard => $displayonboard ); } + output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index b9e5f8d..fe451eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -3025,3 +3025,37 @@ div#aqhelp{ padding:20px; width:50%; } + +#onboardingModal{ + z-index:1; + background-color:#EDF4F6; + padding: .2em 0; + width: 32%; + float:right; + position:relative; + top: 10px; + padding-left:10px; + padding-right:10px; + border-radius:10px; +} + +#acqui-onboard{ + text-align: center; + padding-bottom:15px; +} + +#currency_code_onboard{ + width:40%; +} + +#budget_period_description_onboard{ + width:55%; +} + +#budget_name_onboard{ + width:55%; +} + +#budget_code_onboard{ + width:55%; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc index 5d92b50..7e69d38 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude1.inc @@ -1,21 +1,8 @@ - -
-

Acquisition onboarding wizard

+

Acquisition onboarding wizard

+

This onboarding wizard will take you through the process of setting up Acquistions

-

Start by completing this form to create a currency which you will be used to create your first budget and fund.
+

Start by completing this form to create a currency which you will use to create your first budget and fund.
A fund is the accounting value you use to create orders

@@ -33,7 +20,7 @@ [% currency.currency %] [% ELSE %] - Required + Required [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc index f2e6c27..608f973 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude2.inc @@ -1,23 +1,10 @@ -
[% IF displayonboardscreen == "acquisitions" %] -

Acquisition onboarding wizard

+

Acquisition onboarding wizard

Create a budget which is the highest level value in acquisitions accountancy.
After creating this budget you will be prompted to create a fund which is what you will use to set up orders.

- If you have previously created a budget (which was subsequently deleted) then you will be redirected to the Budget Administration page after creating a budget using this form. On the Budget Administration page click Actions->Add fund to create a fund + If you have previously created a budget (which was subsequently deleted) then you will be redirected to the budget administration page after creating a budget using this form. On the budget administration page click Actions->Add fund to create a fund

Create a budget

@@ -39,7 +26,7 @@
  • - +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc index 2e5fe73..c8d43d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboardinginclude3.inc @@ -1,21 +1,6 @@ [% USE Price %] - - -
    -

    Acquisition onboarding wizard

    +

    Acquisition onboarding wizard

    Fill out this form to create a fund which will be assigned to the budget you just created.
    A fund is an accounting value you will use to set up orders


    @@ -46,12 +31,12 @@
  • - +
  • - +
  • 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 90897b7..aee81a7 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 @@ -111,7 +111,7 @@ $(document).ready(function() { [% INCLUDE 'acquisitions-toolbar.inc' %] [% UNLESS ( loop_budget ) %] - [% IF ( CAN_user_acquisition_period_manage ) %] + [% IF ( CAN_user_acquisition_period_manage ) && displayonboard %] [% displayonboardscreen = "acquisitions" %] [% IF step == 1 %] [% INCLUDE onboardinginclude1.inc %] @@ -254,28 +254,6 @@ $(document).ready(function() {
  • [% END %] - - -

    -
    -

    Next steps

    -

    1. Create your first vendor

    -

    A vendor is the organisation your institution purchases items from i.e. suppliers
    - You must create a vendor before you can create any orders

    - Click here to create a vendor. -

    -

    2. Create your first basket

    -

    A basket is the conceptual container that holds orders. Each basket is assigned to a single vendor so you can perform multiple separate orders from a single vendor simultaneously. Because of its reliance on vendor the basket must be created after the vendor

    - To create a basket, click the 'New basket' button on the Vendor Information page which is displayed after you create a vendor -

    -

    3. Create an order

    -

    An order is a assignment of items purchased from a single vendor at a single time

    - You create an order by clicking "Add to basket" in the Basket page. From here you can choose the item(s) you want to purchase from existing MARC records in your Koha catalogue, subscription, new item record, external source, staged file (bibliographic file in the process of being uploaded), or from popularly held items. -

    -

    - For further information about creating a vendor, basket and order go to the Koha manual: - Koha manual Acquisitions section -
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index dee17f8..a3afa16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -340,7 +340,7 @@
  • - +
    [% INCLUDE 'date-format.inc' %]
  • -- 2.7.4