Koha/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc
Jonathan Druart 9215ca42d2
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-09-06 13:17:47 +01:00

25 lines
1.3 KiB
HTML

[% IF blocking_error %]
[% SWITCH blocking_error %]
[% CASE 'unknown_patron' %]
<div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
[% CASE 'cannot_see_patron_infos' %]This account cannot view requested patron information.
[% CASE 'unknown_biblio' %]
<div class="dialog message">Bibliographic record not found.</div>
[% CASE 'unknown_item' %]
<div class="dialog message">Item not found.</div>
[% CASE 'unknown_subscription' %]
<div class="dialog message">Subscription not found.</div>
[% CASE 'unknown_basket' %]
<div class="dialog message">Basket not found.</div>
[% CASE 'unknown_vendor' %]
<div class="dialog message">Vendor not found.</div>
[% CASE 'wrong_csrf_token' %]
<div class="dialog message">The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.</div>
[% CASE 'budget_is_locked' %]
<div class="dialog message">The budget is locked, fund creation is not possible.</div>
[% CASE %][% blocking_error | html %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% STOP %] [%# Will stop gracefully without processing any more of the template document.%]
[% END %]