Summary: | Can create new funds for locked budgets | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, lucas, oleonard |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00,19.05.03
|
|
Circulation function: | |||
Bug Depends on: | 9628 | ||
Bug Blocks: | 23524 | ||
Attachments: |
Bug 22786: Prevent fund creation for locked budgets
Bug 22786: Prevent fund creation for locked budgets Bug 22786: Prevent fund creation for locked budgets Bug 22786: Prevent fund creation for locked budgets |
Description
Nick Clemens (kidclamp)
2019-04-26 17:23:03 UTC
1. It seems that there is an ergonomic issue, the link should not be there. I guess we should reuse the tooltip behavior we have on the patron's detail page. Other links are impacted as well. Owen, do you agree? 2. There is a business logic issue, we must raise an exception when we want to create a new fund for a budget that is locked (do we really want that?) (In reply to Jonathan Druart from comment #1) > Owen, do you agree? Yes. Created attachment 90938 [details] [review] Bug 22786: Prevent fund creation for locked budgets If a budget is locked, there is a "New fund for $budget" link that is disabled but clickable. We should ensure that the link is not clickable and prevent it at controller level (do we need it at module level, ie. Koha::Acquisition::Fund->store?) Test plan: - Create a budget, lock it - Go to /cgi-bin/koha/admin/aqbudgetperiods.pl - Click on the name of the budget you just created => The "New > New fund for $budget_name" button should be disabled - Click it anyway => Without this patch the form to add a new fund is displayed => With this patch applied nothing happens - Hit /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=XXX With XXX the budget's id => Without this patch the form is displayed => With this patch applied you get a message: "The budget is locked, fund creation is not possible." And you are not able to create a new fund QA notes: 1. See description 2. The add_validate op can still be forced, let trust librarians with administration permissions for now. Created attachment 92479 [details] [review] Bug 22786: Prevent fund creation for locked budgets If a budget is locked, there is a "New fund for $budget" link that is disabled but clickable. We should ensure that the link is not clickable and prevent it at controller level (do we need it at module level, ie. Koha::Acquisition::Fund->store?) Test plan: - Create a budget, lock it - Go to /cgi-bin/koha/admin/aqbudgetperiods.pl - Click on the name of the budget you just created => The "New > New fund for $budget_name" button should be disabled - Click it anyway => Without this patch the form to add a new fund is displayed => With this patch applied nothing happens - Hit /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=XXX With XXX the budget's id => Without this patch the form is displayed => With this patch applied you get a message: "The budget is locked, fund creation is not possible." And you are not able to create a new fund QA notes: 1. See description 2. The add_validate op can still be forced, let trust librarians with administration permissions for now. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> https://bugs.koha-community.org/show_bug.cgi?id=22876 Created attachment 92480 [details] [review] Bug 22786: Prevent fund creation for locked budgets If a budget is locked, there is a "New fund for $budget" link that is disabled but clickable. We should ensure that the link is not clickable and prevent it at controller level (do we need it at module level, ie. Koha::Acquisition::Fund->store?) Test plan: - Create a budget, lock it - Go to /cgi-bin/koha/admin/aqbudgetperiods.pl - Click on the name of the budget you just created => The "New > New fund for $budget_name" button should be disabled - Click it anyway => Without this patch the form to add a new fund is displayed => With this patch applied nothing happens - Hit /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=XXX With XXX the budget's id => Without this patch the form is displayed => With this patch applied you get a message: "The budget is locked, fund creation is not possible." And you are not able to create a new fund QA notes: 1. See description 2. The add_validate op can still be forced, let trust librarians with administration permissions for now. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 92505 [details] [review] Bug 22786: Prevent fund creation for locked budgets If a budget is locked, there is a "New fund for $budget" link that is disabled but clickable. We should ensure that the link is not clickable and prevent it at controller level (do we need it at module level, ie. Koha::Acquisition::Fund->store?) Test plan: - Create a budget, lock it - Go to /cgi-bin/koha/admin/aqbudgetperiods.pl - Click on the name of the budget you just created => The "New > New fund for $budget_name" button should be disabled - Click it anyway => Without this patch the form to add a new fund is displayed => With this patch applied nothing happens - Hit /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=XXX With XXX the budget's id => Without this patch the form is displayed => With this patch applied you get a message: "The budget is locked, fund creation is not possible." And you are not able to create a new fund QA notes: 1. See description 2. The add_validate op can still be forced, let trust librarians with administration permissions for now. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Passing QA here, I don't really like that we can force add a fund, especially since we can do it with no code or name or amount. Hit that a bunch and create lots of new empty funds, then you can edit and add amounts http://localhost:8081/cgi-bin/koha/admin/aqbudgets.pl?op=add_validate&budget_period_id=1 Opening a new bug 23524 for fact that you can still edit/delete funds Nice work! Pushed to master for 19.11.00 Pushed to 19.05.x for 19.05.04 backported to 18.11.x for 18.11.10 |