Bug 28762: Move notforloan fallback into object
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
8ff4d3740e
commit
294447d07e
2 changed files with 15 additions and 3 deletions
13
Koha/Item.pm
13
Koha/Item.pm
|
@ -1835,6 +1835,19 @@ sub item_type {
|
|||
return shift->itemtype;
|
||||
}
|
||||
|
||||
=head3 not_for_loan
|
||||
|
||||
my $nfl = $item->not_for_loan;
|
||||
|
||||
Returns the effective not for loan status of the item
|
||||
|
||||
=cut
|
||||
|
||||
sub not_for_loan {
|
||||
my ($self) = @_;
|
||||
return $self->notforloan ? $self->notforloan : $self->itemtype->notforloan;
|
||||
}
|
||||
|
||||
=head3 orders
|
||||
|
||||
my $orders = $item->orders();
|
||||
|
|
|
@ -43,10 +43,9 @@
|
|||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF ( item.notforloan || item.effective_itemtype.notforloan ) %]
|
||||
[% IF ( item.not_for_loan ) %]
|
||||
[% SET itemavailable = 0 %]
|
||||
[% SET notforloan = item.notforloan || item.effective_itemtype.notforloan %]
|
||||
[% notforloan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => notforloan ) %]
|
||||
[% notforloan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.not_for_loan ) %]
|
||||
[% IF notforloan_description %]
|
||||
<span class="item-status notforloan">[% notforloan_description | html %]</span>
|
||||
[% ELSE %]
|
||||
|
|
Loading…
Reference in a new issue