]> git.koha-community.org Git - koha.git/commit
Bug 22786: Prevent fund creation for locked budgets
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sun, 23 Jun 2019 00:29:42 +0000 (19:29 -0500)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 9 Sep 2019 07:57:05 +0000 (09:57 +0200)
commit8d5a50384fb65a508b0cf944e6f6c070df888aaf
tree88b313142b8a3f88e3d8b3bb5e28f8f84f82fa7c
parentfec88c6414a7269a91d07388c00784c09bbb0494
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&amp;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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9215ca42d28bec10f55a9c660bb5816045bb9656)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
admin/aqbudgets.pl
koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc
koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-toolbar.inc