Bug 20469: Add item status to staff article request form
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 26 Mar 2018 11:20:53 +0000 (13:20 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2020 15:39:48 +0000 (17:39 +0200)
The template checks if an item is checked out, on hold (waiting or
transit), not for loan. (Note: This can be extended in the future
in a general include as we have at opac side.)

Test plan:
[1] Place an article request on an item on loan. Verify status on form.
[2] Place an article request on a waiting item. Check status again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

[EDIT] Simplified on 2020-07-27
Removed Koha::Item->is_waiting_or_transit.
Use Koha::Item->itemtype to check notforloan on itemtype level.
Adjusted commit message accordingly.

Additional test:
[3] Place an article request on a not for loan item. Check status.

NOTE: Not for loan is informational too. It does not say that this item
is not available for an article request. Depends on local situation.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt

index 10e69f4..d72c728 100644 (file)
         </ul>
     </div>
 [% END %]
+[% BLOCK item_status %]
+    [% IF myitem.onloan %]<span>Checked out</span>
+    [% ELSIF myitem.holds({ found => ['W', 'T'] }).count > 0 %]<span>On hold</span>
+    [% ELSIF myitem.notforloan > 0 OR myitem.itemtype.notforloan %]<span>Not for loan</span>
+    [% ELSIF myitem.notforloan < 0 %]<span>On order</span>
+    [% END %]
+[% END %]
 
 <body id="circ_article-requests" class="circ">
     [% INCLUDE 'header.inc' %]
                                     <th class="ar-collection">Collection</th>
                                     <th class="ar-itemtype">Item type</th>
                                     <th class="ar-callnumber">Call number</th>
+                                    <th class="ar-status">Status</th>
                                     <th class="ar-copynumber">Copy number</th>
                                     <th class="ar-enumchron">Enumeration</th>
                                     <th class="ar-barcode">Barcode</th>
 
                                             [% ar.item.itemcallnumber | html %]
                                         </td>
+                                        <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
                                         <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
                                         <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
                                         <td class="ar-barcode">[% ar.item.barcode | html %]</td>
                                     <th class="ar-collection">Collection</th>
                                     <th class="ar-itemtype">Item type</th>
                                     <th class="ar-callnumber">Call number</th>
+                                    <th class="ar-status">Status</th>
                                     <th class="ar-copynumber">Copy number</th>
                                     <th class="ar-enumchron">Enumeration</th>
                                     <th class="ar-barcode">Barcode</th>
 
                                             [% ar.item.itemcallnumber | html %]
                                         </td>
+                                        <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
                                         <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
                                         <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
                                         <td class="ar-barcode">[% ar.item.barcode | html %]</td>