Bugzilla – Attachment 125233 Details for
Bug 28762
Item status shows incorrectly on course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28762: Move notforloan fallback into object
Bug-28762-Move-notforloan-fallback-into-object.patch (text/plain), 1.91 KB, created by
Martin Renvoize (ashimema)
on 2021-09-24 09:26:30 UTC
(
hide
)
Description:
Bug 28762: Move notforloan fallback into object
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-24 09:26:30 UTC
Size:
1.91 KB
patch
obsolete
>From 4c9603b56d73637ed9fd48c09a438771db7f0d66 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Sep 2021 10:25:53 +0100 >Subject: [PATCH] Bug 28762: Move notforloan fallback into object > >--- > Koha/Item.pm | 13 +++++++++++++ > .../intranet-tmpl/prog/en/includes/item-status.inc | 5 ++--- > 2 files changed, 15 insertions(+), 3 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 60d80a5c3eb..a324f29b05c 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1173,6 +1173,19 @@ sub itemtype { > return Koha::ItemTypes->find( $self->effective_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(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc >index 2d8eeddddb1..61a645dbc7f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc >@@ -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 %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28762
:
123233
|
123234
|
123236
|
123237
|
124661
|
124666
|
124667
|
124668
|
124744
|
125220
|
125228
|
125229
|
125233
|
161563
|
161564
|
161565
|
161566
|
161567
|
161568
|
161569
|
161570
|
161571
|
161572
|
161573
|
161574
|
161584
|
161585
|
161586
|
161587
|
161588
|
161589
|
161590
|
161591
|
163310
|
163311
|
163312
|
163313
|
163314
|
163315
|
163316
|
163317
|
165843
|
165844
|
165845
|
165846
|
165847
|
165848
|
165849
|
165850
|
169172
|
169273
|
169274
|
169275
|
169276
|
169277
|
169278
|
169279
|
169280
|
169281
|
169311
|
169312
|
169313
|
169314
|
169354
|
169355
|
169356
|
169357
|
169358
|
169359
|
169360
|
169361
|
169362
|
169363
|
169364
|
169365
|
169366
|
169367
|
169393