Bug 10350 - Capitalization: Home Library column in staff detail items table
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / detail.tt
index 4bea111..9ebb4cb 100644 (file)
@@ -1,4 +1,20 @@
+[% USE AuthorisedValues %]
+
+[% ShowCourseReserves = 0 %]
+[% IF UseCourseReserves %]
+    [% FOREACH item IN itemloop %]
+       [% IF item.course_reserves %]
+           [% FOREACH r IN item.course_reserves %]
+               [% IF r.course.enabled == 'yes' %]
+                   [% ShowCourseReserves = 1 %]
+               [% END %]
+           [% END %]
+        [% END %]
+    [% END %]
+[% END %]
+
 [% INCLUDE 'doc-head-open.inc' %]
+[% INCLUDE 'greybox.inc' %]
 <title>Koha &rsaquo; Catalog &rsaquo;
   [% IF ( unknownbiblionumber ) %]
     Unknown record
@@ -36,16 +52,92 @@ function verify_images() {
         });
 }
      $(document).ready(function() {
-        $('#bibliodetails > ul').tabs();
+        $('#bibliodetails').tabs();
+        $('#search-form').focus();
      });
-     [% IF ( AmazonEnabled ) %]$(window).load(function() {
+     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
         verify_images();
      });[% END %]
 //]]>
 </script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+    function activate_filters(id) {
+        table = $("#" + id + " table");
+        if (table.length == 1) {
+            filters_row = table.find('thead tr.filters_row');
+            if (table.find('thead tr.columnFilter').length == 0) {
+                table.dataTable().columnFilter({
+                    'sPlaceHolder': 'head:after'
+                });
+                filters_row.addClass('columnFilter');
+            }
+            filters_row.show();
+        }
+
+        $('#' + id + '_activate_filters')
+            .text(_("Deactivate filters"))
+            .unbind('click')
+            .click(function() {
+                deactivate_filters(id);
+                return false;
+            });
+    }
+
+    function deactivate_filters(id) {
+        filters_row = $("#" + id + " table").find('thead tr.filters_row');
+
+        filters_row.find('input[type="text"]')
+            .val('')            // Empty filter text boxes
+            .trigger('keyup')   // Filter (display all rows)
+            .trigger('blur');   // Reset value to the column name
+        filters_row.hide();
+
+        $('#' + id + '_activate_filters')
+            .text(_("Activate filters"))
+            .unbind('click')
+            .click(function() {
+                activate_filters(id);
+                return false;
+            });
+    }
+
+    $(document).ready(function() {
+        var ids = ['holdings', 'otherholdings'];
+        for (var i in ids) {
+            var id = ids[i];
+            table = $('#' + id + ' table');
+
+            // Duplicate the table header row for columnFilter
+            thead_row = table.find('thead tr');
+            clone = thead_row.clone().addClass('filters_row');
+            thead_row.before(clone);
+
+            // Enable sorting
+            table.dataTable($.extend(true, {}, dataTablesDefaults, {
+                'sDom': 't',
+                'bPaginate': false,
+                'bAutoWidth': false
+            }));
+
+            // Show a link to activate filtering
+            link = $('<a>')
+                .attr('href', '#')
+                .attr('id', id + '_activate_filters');
+            table.before(link);
+            deactivate_filters(id);
+        }
+    });
+//]]>
+</script>
 </head>
 
-<body>
+<body id="catalog_detail" class="catalog">
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
@@ -73,7 +165,7 @@ function verify_images() {
         <span class="Z3988" title="[% ocoins %]"></span>
     [% END %]
 
-    [% IF ( AmazonEnabled ) %]
+    [% IF ( AmazonCoverImages ) %]
         [% IF ( XSLTDetailsDisplay ) %]
             <div class="yui-gc">
             <div id="catalogue_detail_biblio" class="yui-u first">
@@ -114,10 +206,11 @@ function verify_images() {
                     [% END %]
                     </span>
         [% END %]
+        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span>
         [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
 
-        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
-        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %][% END %]
+        [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
+        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %]
     [% ELSE %]
 
     <h3>[% title |html %]</h3>
@@ -129,7 +222,7 @@ function verify_images() {
             [% IF ( author ) %]<p>By <a href="/cgi-bin/koha/catalogue/search.pl?q=au:[% author |url %]">[% author %]</a></p>[% END %]
         <ul>
         [% IF ( MARCAUTHORS ) %]
-            <li><strong>Additional Authors:</strong><ul>
+            <li><strong>Additional authors:</strong><ul>
             [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
                 <li>[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value |url %]" href="/cgi-bin/koha/catalogue/search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>[% END %]</li>
                 [% END %]
@@ -157,7 +250,7 @@ function verify_images() {
         </li>
 [% IF ( MARCURLS ) %]<li>
     
-       <strong>Online Resources:</strong>
+    <strong>Online resources:</strong>
     <ul>    [% FOREACH MARCurl IN MARCURLS %]
                <li>[% IF ( MARCurl.part ) %][% MARCurl.part %]
                        <br />[% END %] 
@@ -169,15 +262,19 @@ function verify_images() {
     [% END %]
     
     [% IF ( OpacUrl ) %]
-       <li><strong>OPAC View:</strong>
+        <li><strong>OPAC view:</strong>
        <a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a>
                </li>
        [% END %]
+        <li id="catalogue_detail_marc_preview">
+            <strong>MARC Preview:</strong>
+            <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a>
+        </li>
         </ul>
         </div>
        
-[% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
-<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %][% END %]
+[% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
+<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %]
         
         <div class="yui-u" style="margin-top: 1em;">
         <ul>
@@ -254,175 +351,219 @@ function verify_images() {
 </div>
 <div id="bibliodetails" class="toptabs">
 
-<ul>   
-<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#holdings">Holdings</a></li>
-<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#description">Descriptions</a></li>
-[% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#subscriptions">Subscriptions</a></li>[% END %]
-[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#editions">Editions</a></li>[% END %][% END %]
-[% IF ( AmazonSimilarItems ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#related">Related Titles</a></li>[% END %]
-[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#images">Images</a></li>[% END %][% END %]
- </ul>
+<ul>
+    [% IF (SeparateHoldings) %]
+        <li><a href="#holdings">[% LoginBranchname %] holdings</a></li>
+        <li><a href="#otherholdings">Other holdings</a></li>
+    [% ELSE %]
+        <li><a href="#holdings">Holdings</a></li>
+    [% END %]
+<li><a href="#description">Descriptions</a></li>
+[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
+[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
+[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
+[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
+</ul>
 
-<div id="holdings">
-[% IF ( count ) %]
-    [% IF ( showncount ) %]
-        <table>
+[% BLOCK items_table %]
+    <table>
+        <thead>
             <tr>
                 [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
-                <th>Current Location</th>
-                <th>Home Library</th>
+                <th>Current location</th>
+                <th>Home library</th>
                 [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
-                <th>Call Number</th>
+                <th>Call number</th>
                 <th>Status</th>
                 <th>Last seen</th>
                 <th>Barcode</th>
-                [% IF ( volinfo ) %]<th>Publication Details</th>[% END %]
+                [% IF ( volinfo ) %]<th>Publication details</th>[% END %]
                 [% IF ( itemdata_uri ) %]<th>url</th>[% END %]
-                [% IF ( itemdata_copynumber ) %]<th>Copy No.</th>[% END %]
-                [% IF materials %]<th>Materials Specified</th>[% END %]
+                [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
+                [% IF materials %]<th>Materials specified</th>[% END %]
                 [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
-               [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine Label</th>[% END %]
-               [% IF ( hostrecords ) %]<th>Host Records</th>[% END %]
-               [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
+                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
+                [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
+                [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
+                [% IF ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %]
             </tr>
-            [% FOREACH itemloo IN itemloop %]
+        </thead>
+        <tbody>
+            [% FOREACH item IN items %]
                 <tr>
                     [% IF ( item_level_itypes ) %]
-                    <td class="itype">
-                        [% IF !noItemTypeImages && itemloo.imageurl %]
-                            <img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" />
-                        [% END %]
-                        [% itemloo.description %]
-                    </td>
+                        <td class="itype">
+                            [% IF !noItemTypeImages && item.imageurl %]
+                                <img src="[% item.imageurl %]" alt="[% item.description %]" title="[% item.description %]" />
+                            [% END %]
+                            [% item.description %]
+                        </td>
                     [% END %]
-                    <td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td>
-                    <td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td>
-                   [% IF ( itemdata_ccode ) %]<td>[% itemloo.ccode %]</td>[% END %]
-                    <td class="itemcallnumber">[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %]</td>
+                    <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
+                    <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td>
+                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
+                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
                     <td class="status">
 
-                [% IF ( itemloo.datedue ) %]
-                                               <span class="datedue">Checked out
-                    [% UNLESS ( itemloo.NOTSAMEBRANCH ) %]
-                          to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.borrowernumber %]">
-                         [% IF ( itemloo.hidepatronname ) %]
-                             [% itemloo.cardnumber %]
-                         [% ELSE %]
-                             [% itemloo.firstname %] [% itemloo.surname %]
-                         [% END %]
-                         </a>
-                    [% END %]
-                                               : due [% itemloo.datedue %]
-                                               </span>
-                [% ELSIF ( itemloo.transfertwhen ) %]
-                           In transit from [% itemloo.transfertfrom %],
-                           to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
-                                                       <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
-                [% END %]
+                        [% IF ( item.datedue ) %]
+                            <span class="datedue">Checked out
+                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
+                                    to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
+                                        [% IF ( item.hidepatronname ) %]
+                                            [% item.cardnumber %]
+                                        [% ELSE %]
+                                            [% item.firstname %] [% item.surname %]
+                                        [% END %]
+                                    </a>
+                                [% END %]
+                                : due [% item.datedue %]
+                            </span>
+                        [% ELSIF ( item.transfertwhen ) %]
+                            <span class="intransit">In transit from [% itemloo.transfertfrom %] to [% itemloo.transfertto %] since [% itemloo.transfertwhen %]</span>
+                        [% END %]
 
-                [% IF ( itemloo.itemlost ) %]
-                    [% IF ( itemloo.itemlostloop ) %]
-                    [% FOREACH itemlostloo IN itemloo.itemlostloop %]
-                        [% IF ( itemlostloo.selected ) %]
+                        [% IF ( item.itemlost ) %]
+                            [% IF ( item.itemlostloop ) %]
+                                [% FOREACH itemlostloo IN item.itemlostloop %]
+                                    [% IF ( itemlostloo.selected ) %]
                                         <span class="lost">[% itemlostloo.lib %]</span>
+                                    [% END %]
+                                [% END %]
+                            [% ELSE %]
+                                <span class="lost">Unavailable (lost or missing)</span>
+                            [% END %]
                         [% END %]
-                    [% END %]
-                    [% ELSE %]
-                                        <span class="lost">Unavailable (lost or missing)</span>
-                    [% END %]
-                [% END %]
 
-                [% IF ( itemloo.wthdrawn ) %]
-                                        <span class="wdn">Withdrawn</span>
-                [% END %]
+                        [% IF ( item.wthdrawn ) %]
+                            <span class="wdn">Withdrawn</span>
+                        [% END %]
 
-                [% IF ( itemloo.damaged ) %]
-                    [% IF ( itemloo.itemdamagedloop ) %]
-                        [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %]
-                        [% IF ( itemdamagedloo.selected ) %]
+                        [% IF ( item.damaged ) %]
+                            [% IF ( item.itemdamagedloop ) %]
+                                [% FOREACH itemdamagedloo IN item.itemdamagedloop %]
+                                    [% IF ( itemdamagedloo.selected ) %]
                                         <span class="dmg">[% itemdamagedloo.lib %]</span>
+                                    [% END %]
+                                [% END %]
+                            [% ELSE %]
+                                <span class="dmg">Damaged</span>
+                            [% END %]
                         [% END %]
+
+                        [% IF ( item.itemnotforloan ) %]
+                            Not for loan
+                            [% IF ( item.notforloanvalue ) %]
+                                ([% item.notforloanvalue %])
+                            [% END %]
                         [% END %]
-                    [% ELSE %]
-                                        <span class="dmg">Damaged</span>
-                    [% END %]
-                [% END %]
 
-                [% IF ( itemloo.itemnotforloan ) %]
-                    Not for loan 
-                    [% IF ( itemloo.notforloanvalue ) %]
-                        ([% itemloo.notforloanvalue %])
-                    [% END %]
-                [% END %]
+                        [% IF ( item.reservedate ) %]
+                            [% IF ( item.waitingdate ) %]
+                                Waiting
+                            [% ELSE %]
+                                Item-level hold
+                            [% END %]
+                            [% IF ( canreservefromotherbranches ) %]
+                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]">
+                                    [% IF ( item.hidepatronname ) %]
+                                        [% item.Reservedcardnumber %]
+                                    [% ELSE %]
+                                        [% item.ReservedForFirstname %] [% item.ReservedForSurname %]
+                                    [% END %]
+                                </a>
+                            [% END %]
+                            [% IF ( item.waitingdate ) %]
+                                at[% ELSE %]for delivery at
+                            [% END %]
+                            [% item.ExpectedAtLibrary %]
+                            [% IF ( item.waitingdate ) %]
+                                since [% item.waitingdate %]
+                            [% ELSE %]
+                                [% IF ( item.reservedate ) %]
+                                    (placed [% item.reservedate %])
+                                [% END %]
+                            [% END %]
+                        [% END %]
+                        [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %]
+                            Available
+                        [% END %]
 
-                            
-                [% IF ( itemloo.reservedate ) %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        Waiting
-                    [% ELSE %]
-                        Item-level hold
+                        [% IF ( item.restricted ) %]
+                            <span class="restricted">([% item.restricted %])</span>
+                        [% END %]
+
+                    </td>
+                    <td class="datelastseen">[% item.datelastseen %]</td>
+                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type %]&amp;itemnumber=[% item.itemnumber %]&amp;biblionumber=[% item.biblionumber %]&amp;bi=[% item.biblioitemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a></td>
+                    [% IF ( volinfo ) %]
+                        <td class="enumchron">
+                            [% IF ( itemdata_enumchron ) %]
+                                [% IF ( item.enumchron ) %]
+                                    [% item.enumchron %]
+                                    [% IF ( item.serialseq ) %] -- [% END %]
+                                [% END %]
+                                [% item.serialseq %]
+                                [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %]
+                            [% END %]
+                        </td>
                     [% END %]
-                    [% IF ( canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">
-                       [% IF ( itemloo.hidepatronname ) %]
-                           [% itemloo.Reservedcardnumber %]
-                       [% ELSE %]
-                           [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]
-                       [% END %]
-                   </a>[% END %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        at[% ELSE %]for delivery at
-                    [% END %]   [% itemloo.ExpectedAtLibrary %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        since [% itemloo.waitingdate %]
-                    [% ELSE %]
-                        [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %]
+                    [% IF ( itemdata_uri ) %]
+                        <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td>
+                    [% END %]
+                    [% IF ( itemdata_copynumber ) %]
+                        <td class="copynumber">[% item.copynumber %]</td>
+                    [% END %]
+                    [% IF materials %]
+                        <td class="materials"> [% item.materials %] </td>
+                    [% END %]
+                    [% IF ( itemdata_itemnotes ) %]
+                        <td><div class="itemnotes">[% item.itemnotes %]</div></td>
+                    [% END %]
+                    [% IF ( SpineLabelShowPrintOnBibDetails ) %]
+                        <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode %]" >Print label</a></td>
+                    [% END %]
+                    [% IF ( hostrecords ) %]
+                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber %]" >[% item.hosttitle %]</a>[% END %]</td>
+                    [% END %]
+                    [% IF ( analyze ) %]
+                        <td>
+                            [% IF ( item.countanalytics ) %]
+                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber %]">[% item.countanalytics %] analytics</a>
+                            [% END %]
+                        </td>
+                    [% END %]
+                    [% IF ( analyze ) %]
+                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
                     [% END %]
-                [% END %]
-                [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %]
-                                        Available
-                [% END %][% END %][% END %][% END %][% END %][% END %][% END %]
 
-                [% IF ( itemloo.restricted ) %]<span class="restricted">([% itemloo.restricted %])</span>[% END %]
-                        
+                [% IF ShowCourseReserves %]
+                    <td>
+                        [% IF item.course_reserves %]
+                            [% FOREACH r IN item.course_reserves %]
+                                [% IF r.course.enabled == 'yes' %]
+                                    <p>
+                                      <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id %]">
+                                         [% r.course.course_name %]
+                                         <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
+                                         [% IF r.course.section %] [% r.course.section %] [% END %]
+                                         [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
+                                      </a>
+                                   </p>
+                               [% END %]
+                           [% END %]
+                       [% END %]
                     </td>
-                    <td class="datelastseen">[% itemloo.datelastseen %]</td>
-                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% itemloo.type %]&amp;itemnumber=[% itemloo.itemnumber %]&amp;biblionumber=[% itemloo.biblionumber %]&amp;bi=[% itemloo.biblioitemnumber %]#item[% itemloo.itemnumber %]">[% itemloo.barcode %]</a></td>
-                               [% IF ( volinfo ) %]    <td class="enumchron">
-                                       [% IF ( itemdata_enumchron ) %]
-                                               [% IF ( itemloo.enumchron ) %]
-                                               [% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
-                                               [% END %]
-                                       [% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
-                                       [% END %]
-                               </td>[% END %]
-                               [% IF ( itemdata_uri ) %]
-                                       <td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
-                               [% END %]
-                               [% IF ( itemdata_copynumber ) %]
-                                       <td class="copynumber">[% itemloo.copynumber %]</td>
-                               [% END %]
-               [% IF materials %]
-                   <td class="materials"> [% itemloo.materials %] </td>
-               [% END %]
-                [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %]
-               [% IF ( SpineLabelShowPrintOnBibDetails ) %]
-                       <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print Label</a></td>
-               [% END %]
-                [% IF ( hostrecords ) %]
-                      <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td>
                 [% END %]
-                [% IF ( analyze ) %]<td>
-                       [% IF ( itemloo.countanalytics ) %]
-                               <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a>
-                       [% END %]</td>
-               [% END %]
-                [% IF ( analyze ) %]
-                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create Analytics</a></td>
-                [% END %]
-
                 </tr>
             [% END %]
-        </table>
+        </tbody>
+    </table>
+[% END %][%# end of block items_table %]
+
+<div id="holdings">
+[% IF ( count ) %]
+    [% IF ( showncount ) %]
+        [% PROCESS items_table items=itemloop %]
         [% END %]
                 [% IF ( hiddencount ) %]
                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
@@ -445,17 +586,19 @@ function verify_images() {
     [% END %]
 [% END %]
     </div>
+
+[% IF (SeparateHoldings) %]
+    <div id="otherholdings">
+        [% IF (otheritemloop.size) %]
+            [% PROCESS items_table items=otheritemloop %]
+        [% ELSE %]
+            No other items.
+        [% END %]
+    </div>
+[% END %]
     
 <div id="description">
 <div class="content_set">
-[% IF ( AmazonEnabled ) %]
-[% FOREACH AMAZON_EDITORIAL_REVIEW IN AMAZON_EDITORIAL_REVIEWS %]
-    [% IF ( AMAZON_EDITORIAL_REVIEW.Content ) %]
-    <h4>From [% AMAZON_EDITORIAL_REVIEW.Source %]:</h4>
-    <p>[% AMAZON_EDITORIAL_REVIEW.Content %]</p>
-    [% END %]
-[% END %]
-[% END %]
 
 [% IF ( MARCNOTES ) %]
     [% FOREACH MARCNOTE IN MARCNOTES %]
@@ -477,8 +620,12 @@ function verify_images() {
     <p> (There are [% subscriptionsnumber %] subscriptions associated with this title).</p> 
     [% FOREACH subscription IN subscriptions %]
            [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
-           [% IF ( subscription.branchcode ) %]<h3>At branch: [% subscription.branchcode %]</h3>[% END %][% END %]
-            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes %] </p>[% END %]
+           [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
+            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %]
+            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
+            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
+            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote %])</p>[% END %]
             [% IF ( subscription.latestserials ) %]
             <p> The [% subscription.staffdisplaycount %] latest issues related to this subscription:</p>
             <table>
@@ -492,26 +639,22 @@ function verify_images() {
                 <tr>
                     <td>[% latestserial.serialseq %]</td>
                     <td>[% latestserial.planneddate %]</td>
-                    <td>[% IF ( latestserial.status1 ) %]Expected
-                        [% ELSE %]
-                            [% IF ( latestserial.status2 ) %]Arrived
-                            [% ELSE %]
-                                [% IF ( latestserial.status3 ) %]Late
-                                [% ELSE %]
-                                    [% IF ( latestserial.status4 ) %]Missing
-                                    [% ELSE %]
-                                        [% IF ( latestserial.status5 ) %]Not Issued
-                                        [% END %]
-                                    [% END %]
-                                [% END %]
-                            [% END %]
-                        [% END %]</td>
+                    <td>
+                      [% IF ( latestserial.status1 ) %]Expected[% END %]
+                      [% IF ( latestserial.status2 ) %]Arrived[% END %]
+                      [% IF ( latestserial.status3 ) %]Late[% END %]
+                      [% IF ( latestserial.status4 ) %]Missing[% END %]
+                      [% IF ( latestserial.status5 ) %]Not issued[% END %]
+                      [% IF ( latestserial.status6 ) %]Delete[% END %]
+                      [% IF ( latestserial.status7 ) %]Claimed[% END %]
+                      [% IF ( latestserial.status8 ) %]Stopped[% END %]
+                    </td>
                     <td>[% latestserial.notes %]</td>
                 </tr>
             [% END %]
             </table>
             [% END %]
-                       <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]">Subscription Details</a>
+            <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]">Subscription details</a>
     [% END %]
 </div>
 </div>
@@ -521,7 +664,7 @@ function verify_images() {
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
 <div id="editions"><h4>Editions</h4>
 <table>
-[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( XISBN.AmazonEnabled ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
+[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
 [% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %]<img src="[% XISBN.imageurl %]" alt="[% XISBN.description %]" title="[% XISBN.description %]">[% END %]</td>[% END %]
 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a> by [% XISBN.author %] &copy;[% XISBN.copyrightdate %]
   [% IF ( XISBN.publishercode ) %]
@@ -535,19 +678,6 @@ function verify_images() {
 </table></div>[% END %]
 [% END %]
 
-[% IF ( AmazonEnabled ) %][% IF ( AmazonSimilarItems ) %]
-<div id="related">
-<h4>Similar Items</h4>
-<ul>
-[% FOREACH AMAZON_SIMILAR_PRODUCT IN AMAZON_SIMILAR_PRODUCTS %]
-[% FOREACH similar_biblionumber IN AMAZON_SIMILAR_PRODUCT.similar_biblionumbers %]
-<li><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" /> <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </li>
-[% END %]
-[% END %]
-</ul>
-</div>
-[% END %][% END %]
-
 [% IF ( LocalCoverImages ) %]
 <div id="images">
 [% IF ( localimages.0 ) %]
@@ -565,13 +695,27 @@ function verify_images() {
 </div>
 [% END %]
 
+[% IF ( HTML5MediaEnabled ) %]
+<div id="html5media">
+        <p>
+        <[% HTML5MediaParent %] controls preload=none>
+          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
+            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
+          [% END %]
+            [[% HTML5MediaParent %] tag not supported by your browser.]
+        </[% HTML5MediaParent %]>
+        </p>
+</div>
+[% END %]
+
+
 </div><!-- /bibliodetails -->
 
 <div class="yui-g" id="export" style="margin-top: 1em;">
 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
 <table>  <tr>
       <th>Save Record</th>   </tr>
-  <tr>     <td> Select Download Format:    <select name="format">
+    <tr><td> Select download format:    <select name="format">
         <option value="mods">MODS (XML)</option>
         <option value="dc">Dublin Core (XML)</option>
         <option value="marcxml">MARCXML</option>