Bugzilla – Attachment 145009 Details for
Bug 32445
Status display of 'not for loan' items is broken in OPAC/staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32445: include item-status-schema-org.inc
Bug-32445-include-item-status-schema-orginc.patch (text/plain), 4.92 KB, created by
Martin Renvoize
on 2023-01-04 12:28:49 UTC
(
hide
)
Description:
Bug 32445: include item-status-schema-org.inc
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-01-04 12:28:49 UTC
Size:
4.92 KB
patch
obsolete
>From d94eea18436d7a070458e49c7d466fdbfa65e03f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 3 Jan 2023 11:55:25 +0100 >Subject: [PATCH] Bug 32445: include item-status-schema-org.inc > >Can be discussed, but it will prevent to fetch several times the same >related objects > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/includes/item-status-schema-org.inc | 9 ------ > .../bootstrap/en/includes/item-status.inc | 28 ++++++++++++++----- > .../bootstrap/en/modules/opac-detail.tt | 2 +- > 3 files changed, 22 insertions(+), 17 deletions(-) > delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc >deleted file mode 100644 >index 66e4f3656e9..00000000000 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc >+++ /dev/null >@@ -1,9 +0,0 @@ >-[% IF ( item.damaged or item.checkout.date_due or item.itemlost or item.transfertwhen or item.waiting ) %] >- <link property="availability" href="http://schema.org/OutOfStock" /> >-[% ELSIF ( item.withdrawn ) %] >- <link property="availability" href="http://schema.org/Discontinued" /> >-[% ELSIF ( item.itemnotforloan or item.notforloan_per_itemtype ) %] >- <link property="availability" href="http://schema.org/InStoreOnly" /> >-[% ELSE %] >- <link property="availability" href="http://schema.org/InStock" /> >-[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 7adeb1e0f2a..0573b90e068 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -12,6 +12,26 @@ > [% STOP %] > [% END %] > >+[% SET transfer = item.get_transfer %] >+[% IF transfer AND transfer.in_transit %] >+ [% SET transfertwhen = transfer.datesent %] >+ [% SET transfertfrom = transfer.frombranch %] >+ [% SET transfertto = transfer.tobranch %] >+[% END %] >+ >+[% SET waiting = item.holds.waiting.count %] >+[% IF include_schema_org %] >+ [% IF item.damaged or item.checkout.date_due or item.itemlost or transfertwhen or waiting %] >+ <link property="availability" href="http://schema.org/OutOfStock" /> >+ [% ELSIF item.withdrawn %] >+ <link property="availability" href="http://schema.org/Discontinued" /> >+ [% ELSIF item.notforloan or item.itemtype.notforloan %] >+ <link property="availability" href="http://schema.org/InStoreOnly" /> >+ [% ELSE %] >+ <link property="availability" href="http://schema.org/InStock" /> >+ [% END %] >+[% END %] >+ > [% IF ( item.itemlost ) %] > [% SET itemavailable = 0 %] > [% itemlost_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %] >@@ -47,19 +67,13 @@ > [% END %] > [% END %] > >-[% SET transfer = item.get_transfer %] >-[% IF transfer AND transfer.in_transit %] >- [% SET transfertwhen = transfer.datesent %] >- [% SET transfertfrom = transfer.frombranch %] >- [% SET transfertto = transfer.tobranch %] >-[% END %] > [% IF transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %] > [% SET itemavailable = 0 %] > <span class="item-status intransit">In transit from [% Branches.GetName( transfertfrom ) | html %] > to [% Branches.GetName( transfertto ) | html %] since [% transfertwhen | $KohaDates %]</span> > [% END %] > >-[% IF item.holds.waiting.count OR item.holds.processing.count %] >+[% IF waiting OR item.holds.processing.count %] > [% SET itemavailable = 0 %] > <span class="item-status onhold">On hold</span> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 7fde0c96a7e..e97198aed4a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1372,7 +1372,7 @@ > </td> > [% END # /IF itemdata_uri %] > [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %] >- <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT.object %]</td> >+ <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT.object include_schema_org = 1 %]</td> > [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes | $raw %]</td>[% END %] > [% IF ITEM_RESULT.checkout %] > <td class="date_due" data-order="[% ITEM_RESULT.checkout.date_due | html %]">[% ITEM_RESULT.checkout.date_due | $KohaDates as_due_date => 1 %]</td> >-- >2.39.0
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 32445
:
144542
|
144926
|
144927
|
144928
|
144929
|
144930
|
144971
|
144978
|
144987
|
144988
|
144989
|
144990
|
144991
|
144992
|
144993
|
144994
|
145004
|
145005
|
145006
|
145007
|
145008
|
145009
|
145010
|
145011
|
145014
|
145015
|
145016
|
145017
|
145018
|
145019
|
145020
|
145021