Bug 26323: Retrieve the correct NOT_LOAN value

From the template we are assuming that items.notforloan is mapped with
the NOT_LOAN authorised value category, but that is not necessarily the
case.

We must retrieve the correct AV category

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-09-03 15:37:15 +02:00
parent 3cd40f7baf
commit 5da1e809b7
3 changed files with 5 additions and 5 deletions

View File

@ -161,7 +161,7 @@
[% IF checkout_info.itemtype_notforloan %]
<li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
[% ELSIF checkout_info.item_notforloan %]
[% item_notforloan_lib = AuthorisedValues.GetByCode( 'NOT_LOAN', checkout_info.item_notforloan, 0 ) %]
[% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => checkout_info.item_notforloan ) %]
<li><i class="fa fa-li fa-warning"></i>Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib | html %])[% END %].</li>
[% END %]
[% END %]
@ -220,7 +220,7 @@
[% IF checkout_info.itemtype_notforloan %]
<li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
[% ELSIF checkout_info.item_notforloan %]
[% item_notforloan_lib = AuthorisedValues.GetByCode( 'NOT_LOAN', checkout_info.item_notforloan, 0 ) %]
[% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => checkout_info.item_notforloan ) %]
<li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib | html %])[% END %].</li>
[% END %]
[% END %]

View File

@ -197,13 +197,13 @@
Not for loan status updated.
<br />Old value:
[% IF errmsgloo.NotForLoanStatusUpdated.from %]
[% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) | html %].
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.from ) | html %].
[% ELSE %]
Available for loan.
[% END %]
<br />New value:
[% IF errmsgloo.NotForLoanStatusUpdated.to %]
[% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) | html %].
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.to ) | html %].
[% ELSE %]
Available for loan.
[% END %]

View File

@ -677,7 +677,7 @@
[% END %]
[% IF ( itemloo.notforloan ) %]
<span class="nfl">Not for loan ([% AuthorisedValues.GetByCode( 'NOT_LOAN', itemloo.notforloan ) | html %])</span>
<span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
[% END %]
</td>
<td>