Bug 28854: Simplified status handling for bundle inventory check
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 18 Nov 2021 15:17:03 +0000 (15:17 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 13 Jul 2022 13:35:32 +0000 (10:35 -0300)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

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 (file)
index ca6dc1d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-[% USE AuthorisedValues %]
-[% USE Branches %]
-[% USE Koha %]
-[% USE KohaDates %]
-[% PROCESS 'i18n.inc' %]
-[% transfer = item.get_transfer() %]
-[% IF item.checkout %]
-    <span class="datedue">
-        [% 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 %]
-    </span>
-[% ELSIF transfer %]
-    [% datesent = BLOCK %][% transfer.datesent | $KohaDates %][% END %]
-    <span class="intransit">[% tx('In transit from {frombranch} to {tobranch} since {datesent}', { frombranch = Branches.GetName(transfer.frombranch), tobranch = Branches.GetName(transfer.tobranch), datesent = datesent }) %]</span>
-[% END %]
-
-[% IF item.itemlost %]
-    [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = item.itemlost }) %]
-    [% IF itemlost_description %]
-        <span class="lost">[% itemlost_description | html %]</span>
-    [% ELSE %]
-        <span class="lost">[% t('Unavailable (lost or missing)') | html %]</span>
-    [% END %]
-[% END %]
-
-[% IF item.withdrawn %]
-    [% withdrawn_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.withdrawn', authorised_value = item.withdrawn }) %]
-    [% IF withdrawn_description %]
-        <span class="wdn">[% withdrawn_description | html %]</span>
-    [% ELSE %]
-        <span class="wdn">[% t('Withdrawn') | html %]</span>
-    [% END %]
-[% END %]
-
-[% IF item.damaged %]
-    [% damaged_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.damaged', authorised_value = item.damaged }) %]
-    [% IF damaged_description %]
-        <span class="dmg">[% damaged_description | html %]</span>
-    [% ELSE %]
-        <span class="dmg">[% t('Damaged') | html %]</span>
-    [% END %]
-[% END %]
-
-[% IF item.notforloan || item.effective_itemtype.notforloan %]
-    <span>
-        [% t('Not for loan') | html %]
-        [% notforloan_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.notforloan', authorised_value = item.notforloan }) %]
-        [% IF notforloan_description %]
-            ([% notforloan_description | html %])
-        [% END %]
-    </span>
-[% END %]
-
-[% hold = item.holds.next %]
-[% IF hold %]
-    <span>
-        [% 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 %]
-    </span>
-[% END %]
-[% UNLESS item.notforloan || item.effective_itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || transfer || hold %]
-    <span>[% t('Available') | html %]</span>
-[% END %]
-
-[% IF ( item.restricted ) %]
-    [% restricted_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.restricted', authorised_value = item.restricted }) %]
-    [% IF restricted_description %]
-        <span class="restricted">([% restricted_description | html %])</span>
-    [% ELSE %]
-        <span class="restricted">[% t('Restricted') | html %]</span>
-    [% END %]
-[% END %]
index ad7791b..6f01071 100644 (file)
                                                         <td>[% bundle_item.biblio.author | html %]</td>
                                                         <td>[% ItemTypes.GetDescription(bundle_item.itype) | html %]</td>
                                                         <td>[% bundle_item.barcode | html %]</td>
-                                                        <td>[% INCLUDE 'item-status.inc' item=bundle_item %]</td>
+                                                        <td>
+                                                            [% IF bundle_item.itemlost %]
+                                                                [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = bundle_item.itemlost }) %]
+                                                                <span class="lost">[% itemlost_description | html %]</span>
+                                                            [% ELSE %]
+                                                                Present
+                                                            [% END %]
+                                                        </td>
                                                     </tr>
                                                     [% ELSIF !bundle_item.itemlost %]
                                                     <tr data-barcode="[% bundle_item.barcode | html %]">