]> 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)
committerLucas Gass <lucas@bywatersolutions.com>
Sat, 21 Sep 2019 15:31:28 +0000 (15:31 +0000)
commitf8c8d6df0a571fd1e604e0cd03f47c512dca0d00
treebc6649d314d74f4dadd7d93e3b6f1fec4997602f
parent371eb680acde7273f5b0ed4335f0c1c0515c694c
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>
(cherry picked from commit 8d5a50384fb65a508b0cf944e6f6c070df888aaf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.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