From 21b1eab2887ee22380fe53de5a162a65511baf21 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 18 Nov 2021 15:17:03 +0000 Subject: [PATCH] Bug 28854: Simplified status handling for bundle inventory check Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/item-status.inc | 84 ------------------- .../prog/en/modules/circ/returns.tt | 9 +- 2 files changed, 8 insertions(+), 85 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc deleted file mode 100644 index ca6dc1d1ff..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc +++ /dev/null @@ -1,84 +0,0 @@ -[% USE AuthorisedValues %] -[% USE Branches %] -[% USE Koha %] -[% USE KohaDates %] -[% PROCESS 'i18n.inc' %] -[% transfer = item.get_transfer() %] -[% IF item.checkout %] - - [% IF item.checkout.onsite_checkout %] - [% t('Currently in local use by') | html %] - [% ELSE %] - [% t('Checked out to') | html %] - [% END %] - [% INCLUDE 'patron-title.inc' patron=item.checkout.patron hide_patron_infos_if_needed=1 %] - : [% tx('due {date_due}', { date_due = item.checkout.date_due }) | html %] - -[% ELSIF transfer %] - [% datesent = BLOCK %][% transfer.datesent | $KohaDates %][% END %] - [% tx('In transit from {frombranch} to {tobranch} since {datesent}', { frombranch = Branches.GetName(transfer.frombranch), tobranch = Branches.GetName(transfer.tobranch), datesent = datesent }) %] -[% END %] - -[% IF item.itemlost %] - [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = item.itemlost }) %] - [% IF itemlost_description %] - [% itemlost_description | html %] - [% ELSE %] - [% t('Unavailable (lost or missing)') | html %] - [% END %] -[% END %] - -[% IF item.withdrawn %] - [% withdrawn_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.withdrawn', authorised_value = item.withdrawn }) %] - [% IF withdrawn_description %] - [% withdrawn_description | html %] - [% ELSE %] - [% t('Withdrawn') | html %] - [% END %] -[% END %] - -[% IF item.damaged %] - [% damaged_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.damaged', authorised_value = item.damaged }) %] - [% IF damaged_description %] - [% damaged_description | html %] - [% ELSE %] - [% t('Damaged') | html %] - [% END %] -[% END %] - -[% IF item.notforloan || item.effective_itemtype.notforloan %] - - [% t('Not for loan') | html %] - [% notforloan_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.notforloan', authorised_value = item.notforloan }) %] - [% IF notforloan_description %] - ([% notforloan_description | html %]) - [% END %] - -[% END %] - -[% hold = item.holds.next %] -[% IF hold %] - - [% IF hold.waitingdate %] - Waiting at [% Branches.GetName(hold.get_column('branchcode')) | html %] since [% hold.waitingdate | $KohaDates %]. - [% ELSE %] - Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName(hold.get_column('branchcode')) | html %]. - [% END %] - [% IF Koha.Preference('canreservefromotherbranches') %] - [% t('Hold for:') | html %] - [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %] - [% END %] - -[% END %] -[% UNLESS item.notforloan || item.effective_itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || transfer || hold %] - [% t('Available') | html %] -[% END %] - -[% IF ( item.restricted ) %] - [% restricted_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.restricted', authorised_value = item.restricted }) %] - [% IF restricted_description %] - ([% restricted_description | html %]) - [% ELSE %] - [% t('Restricted') | html %] - [% END %] -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index ad7791bc35..6f010715e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -442,7 +442,14 @@ [% bundle_item.biblio.author | html %] [% ItemTypes.GetDescription(bundle_item.itype) | html %] [% bundle_item.barcode | html %] - [% INCLUDE 'item-status.inc' item=bundle_item %] + + [% IF bundle_item.itemlost %] + [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = bundle_item.itemlost }) %] + [% itemlost_description | html %] + [% ELSE %] + Present + [% END %] + [% ELSIF !bundle_item.itemlost %] -- 2.39.5