From 08816a565a7713d4ee81c42baa07b676b4270414 Mon Sep 17 00:00:00 2001
From: Rogan Hamby <rhamby@equinoxinitiative.org>
Date: Tue, 14 Jan 2020 14:38:36 -0500
Subject: [PATCH] Bug 15377: Remove 'checked out' items from course reserves

1) removes the restriction of not allowing a reserve to be removed if it is onloan
2) adds a column to the display that says with the item is checked out or available based on the onloan flag

testplan: add an item to course reserves, check the item out, check that the Ciruclation column changes to Checked Out and that you can remove it
---
 .../prog/en/modules/course_reserves/course-details.tt |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt
index 5b45fc9..df19b3b 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt
@@ -86,6 +86,7 @@
                         <th>Public note</th>
                         <th>Link</th>
                         <th class="NoSort">Other course reserves</th>
+                        <th>Circulation</th>
                         [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %]
                             <th class="NoSort">Actions</th>
                         [% END %]
@@ -216,6 +217,16 @@
                                 [% END %]
                             </td>
 
+                            <td class="status">
+                                <span>
+                                [% IF cr.item.onloan %]
+                                    Checked Out
+                                [% ELSE %]
+                                    Available
+                                [% END %]
+                                </span>
+                            </td>
+
                             [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %]
                                 <td class="actions">
                                     [% IF CAN_user_coursereserves_add_reserves %]
@@ -223,11 +234,7 @@
                                     [% END %]
 
                                     [% IF CAN_user_coursereserves_delete_reserves %]
-                                        [% IF cr.item.onloan %]
-                                            <a class="btn btn-default btn-xs disabled checkedout delete_item" href="#" data-toggle="tooltip" data-placement="left" title="This item is checked out">
-                                        [% ELSE %]
-                                            <a class="btn btn-default btn-xs delete_item" href="course-details.pl?course_id=[% course.course_id | html %]&amp;action=del_reserve&amp;cr_id=[% cr.cr_id | html %]">
-                                        [% END %]
+                                        <a class="btn btn-default btn-xs delete_item" href="course-details.pl?course_id=[% course.course_id | html %]&amp;action=del_reserve&amp;cr_id=[% cr.cr_id | html %]">
                                         <i class="fa fa-trash"></i> Remove</a>
                                     [% END %]
                                 </td>
-- 
1.7.10.4