To recreate: 1 - Have a budget 2 - Lock it 3 - Click on a fund from acqui-home to view funds for the budget 4 - Select new->New fund for budget 5 - Note the link displays as disabled 6 - Click it and note it is not disabled 7 - Add a new budget
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