From dcc1cc99ef6fd0d9c9c3ac98b51be34aa271fabd Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Fri, 3 Jun 2016 14:49:25 -0400
Subject: [PATCH] Bug 15853 - Add author and link columns to opac course
 reserves table

To test:
1 - Add some course reserves
2 - View the table in staff and opac, there is no column for author or
link
3 - Apply patch
4 - You shoudl see these columns
5 - Link should contain item uri if present, fallback to title 856$u,
  then be blank if niether

Sponsored by:
    Southeastern Wisconsin Information Technology Exchange, Inc (SWITCH)
    (http://caspian.switchinc.org/)
---
 .../prog/en/modules/course_reserves/course-details.tt          | 10 ++++++++++
 .../opac-tmpl/bootstrap/en/modules/opac-course-details.tt      |  9 +++++++++
 2 files changed, 19 insertions(+)

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 0bd675b..ea9fda8 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
@@ -73,6 +73,7 @@
                 <thead>
                     <tr>
                         <th class="antithe">Title</th>
+                        <th>Author</th>
                         <th>Barcode</th>
                         <th>Call number</th>
                         [% IF item_level_itypes %]<th>Item type</th>[% END %]
@@ -84,6 +85,7 @@
                         [% IF CAN_user_coursereserves_add_reserves %]<th class="NoSort">&nbsp;<!-- Edit --></th>[% END %]
                         [% IF CAN_user_coursereserves_delete_reserves %]<th class="NoSort">&nbsp;<!-- Remove --></th>[% END %]
                         <th class="NoSort">Other course reserves</th>
+                        <th>Link</th>
                     </tr>
                 </thead>
 
@@ -91,6 +93,7 @@
                     [% FOREACH cr IN course_reserves %]
                         <tr>
                             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
+                            <td>[% cr.item.author %]</td>
                             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% cr.item.itemnumber %]&amp;biblionumber=[% cr.item.biblionumber %]&amp;bi=[% cr.item.biblioitemnumber %]">[% cr.item.barcode %]</a></td>
                             <td>[% cr.item.itemcallnumber %]</td>
                             [% IF item_level_itypes %]
@@ -194,6 +197,13 @@
                                     [% END %]
                                 [% END %]
                             </td>
+                            <td>
+                                [% IF (cr.item.uri) %]
+                                    <a href="[% cr.item.uri %]">Item URI</a>
+                                [% ELSIF (cr.item.url) %]
+                                    <a href="[% cr.item.url %]">Record URL</a>
+                                [% END %]
+                            </td>
                         </tr>
                     [% END %]
                 </tbody>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
index 70d45b1..fd2e739 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
@@ -50,6 +50,7 @@
                         <thead>
                             <tr>
                                 <th class="anti-the">Title</th>
+                                <th>Author</th>
                                 <th>Item type</th>
                                 <th>Location</th>
                                 <th>Collection</th>
@@ -58,6 +59,7 @@
                                 <th>Status</th>
                                 <th class="title-string">Date due</th>
                                 <th>Notes</th>
+                                <th>Link</th>
                             </tr>
                         </thead>
 
@@ -65,6 +67,7 @@
                             [% FOREACH cr IN course_reserves %]
                                 <tr>
                                     <td><a href="opac-detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
+                                    <td>[% cr.item.author %]</td>
                                     <td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td>
                                     <td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td>
                                     <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td>
@@ -78,6 +81,12 @@
                                             [% cr.item.itemnotes %]
                                         [% END %]
                                     </td>
+                                    <td>[% IF (cr.item.uri) %]
+                                            <a href="[% cr.item.uri %]">Item URI</a>
+                                        [% ELSIF (cr.item.url) %]
+                                            <a href="[% cr.item.url %]">Record URL</a>
+                                        [% END %]
+                                    </td>
                                 </tr>
                             [% END %]
                         </tbody>
-- 
2.1.4