Bug 24176: Add datalastseen column to holdings table
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / detail.tt
index ce1c863..dad9ade 100644 (file)
@@ -5,12 +5,15 @@
 [% USE AuthorisedValues %]
 [% USE Branches %]
 [% USE Biblio %]
-[% USE ColumnsSettings %]
+[% USE TablesSettings %]
+[% PROCESS 'i18n.inc' %]
+[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
+[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
 
 [% IF Koha.Preference('AmazonAssocTag') %]
-    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') | html %]
+    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
 [% ELSE %]
-    [% AmazonAssocTag = '' | html %]
+    [% AmazonAssocTag = '' %]
 [% END %]
 
 [% ShowCourseReserves = 0 | html %]
   [% IF ( unknownbiblionumber ) %]
     Unknown record
   [% ELSE %]
-    Details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]
+    Details for [% INCLUDE 'biblio-title-head.inc' %]
   [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% Asset.css("css/datatables.css") | $raw %]
 </head>
 
 <body id="catalog_detail" class="catalog">
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo;
   [% IF ( unknownbiblionumber ) %]
-    Unknown record
+    <span class="unknownrecord">Unknown record</span>
   [% ELSE %]
-    Details for <i>[% title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</i>
+    <span class="titledetails">Details for <i>[% INCLUDE 'biblio-title.inc' %]</i></span>
   [% END %]
 </div>
 
-<div id="doc3" class="yui-t2">
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
+                <div class="row">
 
 [% IF ( unknownbiblionumber ) %]
   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
 [% ELSE %]
-   <div id="bd">
-    <div id="yui-main">
-    <div class="yui-b">
+
+[% IntranetCoce    = Koha.Preference('IntranetCoce') %]
+[% CoceProviders   = Koha.Preference('CoceProviders') %]
+[% CoceHost        = Koha.Preference('CoceHost') %]
 
 [% INCLUDE 'cat-toolbar.inc' %]
+    [% IF decoding_error %]
+        <div>
+           <span class="biberror">
+            There is an error with this bibliographic record, the view may be degraded.</span>
+            <span class="error"><br/> Error: [% decoding_error | html %]</span>
+        </div>
+    [% END %]
     [% IF ( ocoins ) %]
         <!-- COinS / OpenURL -->
         <span class="Z3988" title="[% ocoins | html %]"></span>
     [% END %]
 
-    [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
+    [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
         [% IF ( XSLTDetailsDisplay ) %]
-            <div class="yui-gc">
-            <div id="catalogue_detail_biblio" class="yui-u first">
+            <div id="catalogue_detail_biblio" class="col-xs-9">
         [% ELSE %]
-            <div class="yui-gb">
-            <div id="catalogue_detail_biblio" class="yui-u first">
+            <div id="catalogue_detail_biblio" class="col-xs-9">
         [% END %]
     [% ELSE %]
-        [% IF ( XSLTDetailsDisplay ) %]
-            <div class="yui-g">
-            <div id="catalogue_detail_biblio">
-        [% ELSE %]
-            <div class="yui-g">
-            <div id="catalogue_detail_biblio" class="yui-u first">
-        [% END %]
+        <div id="catalogue_detail_biblio" class="col-xs-12">
     [% END %]
 
-    [% IF ( XSLTDetailsDisplay ) %]
         [% XSLTBloc | $raw %]
 
         [% IF shelves.count %]
             <span class="results_summary"><span class="label">Lists that include this title: </span>
             [% FOREACH s IN shelves %]
-                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
+                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
             [% END %]
             </span>
                     [% 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 | html %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
+        <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 | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
 
         [% IF ( holdcount ) %]
             <span class="results_summary">
                 <span class="label">Holds:</span>
                 <span class="number_box">
                     [% IF CAN_user_reserveforothers_place_holds %]
-                        <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | html %]">[% holdcount | html %]</a>
+                        <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
                     [% ELSE %]
                         <span>[% holdcount | html %]</span>
                     [% END %]
             </span>
         [% END %]
 
+        [% IF illrequests.count %]
+            <span class="results_summary">
+                <span class="label">ILL requests:</span>
+                [% IF CAN_user_ill %]
+                    [% FOREACH ill IN illrequests %]
+                        <a href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=[% ill.illrequest_id | uri %]">Request [% ill.illrequest_id | html %]</a>[% IF ! loop.last %], [% END %]
+                    [% END %]
+                [% ELSE %]
+                    [% FOREACH ill IN illrequests %]
+                        <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
+                    [% END %]
+                [% END %]
+            </span>
+        [% END %]
+
         [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
             <span class="results_summary">
                 <span class="label">Article requests:</span>
                 <span class="number_box">
-                    <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | html %]">[% article_requests_count | html %]</a>
+                    <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
                 </span>
             </span>
         [% END %]
 
-        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
-        </div><div class="yui-u" id="bookcoverimg">
-        [% IF ( LocalCoverImages ) %]
-            <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
-        [% END %]
-        [% IF ( AmazonCoverImages ) %]
-            <div id="amazon-bookcoverimg">
-            <a href="http://www.amazon[% AmazonTld | html %]/gp/reader/[% normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link">
-                <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" />
-        </a></div>
-        [% END %]
-        [% END %]
-    [% ELSE %]
+        [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
+            </div>
+            <div class="col-xs-3" id="bookcoverimg">
+                <div id="cover-slides">
+                    [% IF ( LocalCoverImages ) %]
+                        [% IF ( localimages.0 ) %]
+                            [% FOREACH image IN localimages %]
+                                [% IF image %]
+                                    <div class="cover-image local-coverimg">
+                                        <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image | uri %]">
+                                            <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image | uri %]" alt="Local cover image" />
+                                        </a>
+                                        <div class="hint">Local cover image</div>
+                                    </div>
+                                [% END %]
+                            [% END %]
+                        [% END %]
+                    [% END %]
 
-    <h3>[% title | html %]</h3>
-    [% FOREACH subtitl IN subtitle %]
-       <h4>[% subtitl.subfield | html %]</h4>
-    [% END %]
-            [% UNLESS ( item_level_itypes ) %]<img src="[% imageurl | html %]" alt="[% translated_description | html %]" title="[% translated_description | html %]">[% END %]
-            [% IF ( unititle ) %]<p>[% unititle | html %]</p>[% END %]
-            [% IF ( author ) %]<p>By <a href="/cgi-bin/koha/catalogue/search.pl?q=au:[% author |url %]">[% author | html %]</a></p>[% END %]
-        <ul>
-        [% IF ( MARCAUTHORS ) %]
-            <li><strong>Additional authors:</strong><ul>
-            [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
-                <li>[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% 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 | html %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a>[% END %]</li>
-                [% END %]
+                    [% IF ( AdlibrisEnabled && normalized_isbn ) %]
+                        <div class="cover-image" id="adlibris-coverimg">
+                            <a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]">
+                                <img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" />
+                            </a>
+                            <div class="hint">Image from Adlibris</div>
+                        </div>
+                    [% END %]
 
-        </ul>
-            </li>
-        [% END %]
-[% IF ( MARCSERIES ) %]
-               <li><strong>Series: </strong><ul>[% FOREACH MARCSERIE IN MARCSERIES %]
-               <li>[% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %] [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %]<a href="/cgi-bin/koha/catalogue/search.pl?q=se:[% MARCSERIES_SUBFIELDS_LOO.value |url %]">[% MARCSERIES_SUBFIELDS_LOO.value | html %]</a>[% END %][% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %]. [% MARCSERIES_SUBFIELDS_LOO.volumenum | html %][% END %][% END %]</li> 
-               [% END %]
-               </ul>
-               </li>
-[% END %]
-        [% IF ( publishercode ) %]
-    <li><strong>Published by:</strong>
-        <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:[% publishercode |url %]">
-            [% publishercode | html %]
-        </a> [% IF ( place ) %]([% place | html %])[% END %] [% IF ( publicationyear ) %], [% publicationyear | html %][% END %] [% IF ( editionstatement ) %][% editionstatement | html %][% END %] [% IF ( editionresponsibility ) %][% editionresponsibility | html %][% END %]
-    </li>
-    [% END %]
-        <li><strong>Description:</strong>
-                [% IF ( pages ) %] [% END %][% pages | html %] [% IF ( illus ) %][% illus | html %][% END %]
-                [% IF ( size ) %][% size | html %][% END %]
-        </li>
-[% IF ( MARCURLS ) %]<li>
-    
-    <strong>Online resources:</strong>
-    <ul>    [% FOREACH MARCurl IN MARCURLS %]
-               <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]
-                       <br />[% END %] 
-               <!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
-               <a href="[% MARCurl.MARCURL | html %]" title="[% MARCurl.MARCURL | html %]">[% MARCurl.linktext | html %]</a>
-                       [% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note | html %]</li>[% END %]</ul>[% END %]</li>
-            [% END %]</ul>
-</li>
-    [% END %]
+                    [% IF ( AmazonCoverImages && normalized_isbn) %]
+                        <div class="cover-image" id="amazon-bookcoverimg">
+                            <a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link">
+                                <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="Amazon cover image" />
+                            </a>
+                            <div class="hint">Image from Amazon.com</div>
+                        </div>
+                    [% END %]
 
-    [% IF ( OPACBaseURL ) %]
-        <li><strong>OPAC view:</strong>
-        <a href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]" 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 | html %]" title="MARC" rel="gb_page_center[600,500]">Show</a>
-        </li>
-        </ul>
-        </div>
-       
-    [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
-        <div class="yui-u" id="bookcoverimg">
-        [% IF ( LocalCoverImages ) %]
-            <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
-        [% END %]
-        [% IF ( AmazonCoverImages ) %]
-            <div id="amazon-bookcoverimg">
-            <a href="http://www.amazon[% AmazonTld | html %]/gp/reader/[% normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link">
-            <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" />
-            </a>
-        </div>
-        [% END %]
-        </div>
-    [% END %]
-        
-        <div class="yui-u" style="margin-top: 1em;">
-        <ul>
-        [% IF ( MARCISBNS ) %]
-            <li><strong>ISBN:</strong><ul>[% FOREACH MARCISBN IN MARCISBNS %]<li>[% MARCISBN | html %]</li>[% END %]</ul></li>
-        [% ELSE %]
-            [% IF ( normalized_isbn ) %]
-                <li><strong>ISBN:</strong> [% normalized_isbn | html %]</li>
-            [% END %]
-        [% END %]
-        [% IF ( issn ) %]
-            <li><strong>ISSN:</strong>[% issn | html %]</li>
-        [% END %]
-        [% IF ( collectiontitle ) %]
-            <li><strong>Collection: </strong>
-                [% collectiontitle | html %] [% IF ( collectionvolume ) %], [% collectionvolume | html %][% END %][% IF ( collectionissn ) %] (<strong>ISSN:</strong> [% collectionissn | html %])[% END %]
-            </li>
-        [% END %]
-        [% IF ( MARCSUBJCTS ) %]
-            <li><strong>Subjects:</strong> 
-            <ul>
-                [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
-                <li>[% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] [% MARCSUBJECT_SUBFIELDS_LOO.separator | html %] <a title="‡[% MARCSUBJECT_SUBFIELDS_LOO.code | html %] [% MARCSUBJECT_SUBFIELDS_LOO.value | html %]" href="/cgi-bin/koha/catalogue/search.pl?q=[% FOREACH link_loo IN MARCSUBJECT_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit | html %]:[% link_loo.link |url %][% END %]">[% MARCSUBJECT_SUBFIELDS_LOO.value | html %]</a>[% END %]</li>
-                [% END %]
-                </ul>
-            </li>
-        [% END %]
-        [% IF ( copyrightdate ) %]
-            <li><strong>Copyright:</strong> [% copyrightdate | html %]</li>
-        [% END %]
-     
-        [% IF ( classification ) %]
-            <li><strong>Classification:</strong> [% subclass | html %][% classification | html %]</li>
-        [% END %]
-        [% IF ( dewey ) %]
-            <li><strong>Dewey:</strong> [% dewey | html %]</li>
-        [% END %]
-        [% IF ( urlS ) %]
-            <li><strong>URL:</strong>
-                [% FOREACH url IN urlS %]
-                    <a href="[% url.url | html %]">[% url.url | html %]</a>
-                [% END %]
-            </li>
-        [% END %]
-        <!--This grabs all of the lists a bib record appears in -->
-        [% IF shelves.count %]
-            <li><strong>Lists that include this title: </strong>
-            <ul>
-            [% FOREACH s IN shelves %]
-                <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | html %]">[% s.shelfname | html %]</a></li>
-            [% END %]
-            </ul>
-            </li>
-        [% END %]
-        [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
-                <li><strong>Tags:</strong>
-                    <ul id="tagslist">
-                    [% FOREACH TagLoo IN TagLoop %]
-                        <li>
-                        [% IF ( CAN_user_tools_moderate_tags ) %]
-                        <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
-                        [% ELSE %]
-                        [% TagLoo.term | html %]
-                        [% END %]
-                        <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]</li>
+                    [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
+                        [% coce_id = normalized_ean || normalized_isbn %]
+                        <div class="cover-image" id="coce-coverimg">
+                            [% IF ( coce_id ) %]
+                                <span title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span>
+                            [% ELSE %]
+                                <span class="no-image">No cover image available</span>
+                            [% END %]
+                            <div class="hint">Image from Coce</div>
+                        </div>
                     [% END %]
-                    </ul></li>
-        [% END %]
-            [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="number_box"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | html %]">[% holdcount | html %]</a></span></li>[% ELSE %][% END %]
-        </ul>
-               [% END %]
 
-</div>
+                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
+                        <div class="cover-image" id="custom-coverimg">
+                            <a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]">
+                                <img id="custom-img" alt="Custom cover image" src="[% biblio.custom_cover_image_url | url %]" />
+                            </a>
+                            <div class="hint">Custom cover image</div>
+                        </div>
+                    [% END %]
+                </div> <!-- /#cover-slides -->
+            </div> <!-- /#bookcoverimg.col-xs-3 -->
+        [% ELSE %]
+        </div> <!-- /.col-xs-* -->
+        [% END # /IF ( AmazonCoverImages, etc ) %]
 </div>
 <div id="bibliodetails" class="toptabs">
 
 <ul>
     [% IF (SeparateHoldings) %]
         <li>
-            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
+            <a href="#holdings">[% Branches.GetLoggedInBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
         </li>
         <li>
             <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
             <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
         </li>
     [% END %]
-[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
+[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
 [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
 [% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
+[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</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>
     [% END %]
 [% END %]
-[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
+[% IF HTML5MediaEnabled && HTML5MediaSets.size %]<li id="media_tab"><a href="#html5media">Play media</a></li>[% END %]
 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
     <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
 [% END %]
+[% FOREACH tab IN tabs %]
+    <li><a href="#[% tab.id | uri %]">[% tab.title | html %]</a></li>
+[% END %]
 </ul>
 
 [% items_table_block_iter = 0 %]
     <table class="items_table" id="[% tab | html %]_table">
         <thead>
             <tr>
-                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
-                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
-                <th>Current location</th>
-                <th>Home library</th>
-                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
-                <th>Call number</th>
-                <th>Status</th>
-                <th>Last seen</th>
-                <th>Barcode</th>
-                [% IF ( volinfo ) %]<th>Serial enumeration / chronology</th>[% END %]
-                [% IF ( itemdata_uri ) %]<th>URL</th>[% END %]
-                [% IF ( itemdata_copynumber ) %]<th>Copy number</th>[% END %]
-                [% IF ( itemdata_stocknumber ) %]<th>Inventory number</th>[% END %]
-                [% IF materials %]<th>Materials specified</th>[% END %]
-                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
-                [% IF ( itemdata_nonpublicnotes ) %]<th>Non-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 ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %]
-                [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
+                [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %]
+                [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
+                <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current location</th>
+                <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
+                [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %]
+                <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
+                [% IF volinfo %]
+                [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting%]
+                        <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron" class="title-string">Serial enumeration / chronology</th>
+                    [% ELSE %]
+                        <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
+                    [% END %]
+                [% END %]
+                <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
+                <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen" class="title-string">Last seen</th>
+                <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned" class="title-string">Date accessioned</th>
+                <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed" class="title-string">Date last borrowed</th>
+                <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th>
+                [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %]
+                [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %]
+                [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %]
+                [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %]
+                [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %]
+                [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %]
+                [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
+                [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
+                [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
+                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
+                [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort">&nbsp;</th>[% END %]
             </tr>
         </thead>
         <tbody>
                             [% IF !noItemTypeImages && item.imageurl %]
                                 <img src="[% item.imageurl | html %]" alt="[% item.translated_description | html %]" title="[% item.translated_description | html %]" />
                             [% END %]
-                            [% item.translated_description | html %]
+                            <span class="itypedesc">[% item.translated_description | html %]</span>
                         </td>
                     [% END %]
                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
-                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
+                    <td class="homebranch">
+                        <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
+                        <span class="shelvingloc">
+<!--
+If permanent location is defined, show description or code and display current location in parentheses. If not, display current location.
+Note that permanent location is a code, and location may be an authval.
+-->
+                            [% IF item.permanent_location %]
+                                [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
+                                [% permloc_authval | html %]
+                                [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %]
+                                    ([% item.location | html %])
+                                [% END %]
+                            [% ELSE %]
+                                [% item.location | html %]
+                            [% END %]
+                        </span>
+                    </td>
                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
+                    [% IF ( volinfo ) %]
+                        <td class="enumchron">
+                            [% IF itemdata_publisheddate %]<span title="[% item.publisheddate | html %]">[% END %]
+                            [% IF ( itemdata_enumchron ) %]
+                                [% IF item.enumchron && item.serialseq %]
+                                    <span class="enum">[% item.enumchron | html %]</span>
+                                    [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
+                                        <span class="sep"> -- </span>
+                                        <span class="serialseq">[% item.serialseq | html %]</span>
+                                    [% END %]
+                                [% ELSIF item.enumchron %]
+                                    <span class="enum">[% item.enumchron | html %]</span>
+                                [% ELSIF item.serialseq %]
+                                    <span class="serialseq">[% item.serialseq | html %]</span>
+                                [% END %]
+                                [% IF ( item.publisheddate ) %]
+                                    <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
+                                [% END %]
+                            [% END %]
+                            </span>
+                        </td>
+                    [% END %]
                     <td class="status">
 
                         [% IF item.CheckedOutFor %]
                         [% END %]
 
                         [% IF ( item.itemnotforloan || item.notforloan_per_itemtype ) %]
-                            Not for loan
+                            <span class="notforloan">Not for loan
                             [% IF ( item.notforloanvalue ) %]
-                                ([% item.notforloanvalue | html %])
+                                <span class="reason">([% item.notforloanvalue | html %])</span>
                             [% END %]
+                            </span>
                         [% END %]
 
-                        [% IF ( item.reservedate ) %]
-                            [% IF ( item.waitingdate ) %]
-                                Waiting at [% Branches.GetName( item.ExpectedAtLibrary ) | html %] since [% item.waitingdate | $KohaDates %].
+                        [% SET hold = item.first_hold %]
+                        [% IF hold %]
+                            [% IF hold.waitingdate %]
+                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].</span>
+                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
+                                    <span class="heldfor">Hold for:</span>
+                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
+                                [% END %]
                             [% ELSE %]
-                                Item-level hold (placed [% item.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( item.ExpectedAtLibrary ) | html %].
-                            [% END %]
-                            [% IF ( canreservefromotherbranches ) %]
-                                Hold for:
-                                [% INCLUDE 'patron-title.inc' patron=item.ReservedFor hide_patron_infos_if_needed=1 %]
+                                <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
                             [% END %]
                         [% END %]
-                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %]
-                            Available
+                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold ) %]
+                            <span class="available">Available</span>
                         [% END %]
 
                         [% IF ( item.restricted ) %]
-                            <span class="restricted">([% item.restricted | html %])</span>
+                            <span class="restricted">([% item.restrictedvalue | html %])</span>
                         [% END %]
 
                     </td>
-                    <td class="datelastseen">[% item.datelastseen | $KohaDates %]</td>
-                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;biblionumber=[% item.biblionumber | html %]&amp;bi=[% item.biblioitemnumber | html %]#item[% item.itemnumber | html %]">[% item.barcode | html %]</a></td>
-                    [% IF ( volinfo ) %]
-                        <td class="enumchron">
-                            [% IF ( itemdata_enumchron ) %]
-                                [% IF item.enumchron && item.serialseq %]
-                                    <span class="enum">[% item.enumchron | html %]</span>
-                                    [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
-                                        <span class="sep"> -- </span>
-                                        <span class="serialseq">[% item.serialseq | html %]</span>
-                                    [% END %]
-                                [% ELSIF item.enumchron %]
-                                    <span class="enum">[% item.enumchron | html %]</span>
-                                [% ELSIF item.serialseq %]
-                                    <span class="serialseq">[% item.serialseq | html %]</span>
-                                [% END %]
-                                [% IF ( item.publisheddate ) %]
-                                    <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
-                                [% END %]
-                            [% END %]
-                        </td>
-                    [% END %]
+                    <td class="datelastseen"><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
+                    <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
+                    <td class="datelastborrowed"><span title="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</span></td>
+                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
                     [% IF ( itemdata_uri ) %]
-                        <td class="uri"><a href="[% item.uri | html %]">[% item.uri | html %]</a></td>
+                        [% IF item.uri.split(' \| ').size > 1 %]
+                            <td class="uri">
+                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
+                            </td>
+                        [% ELSE %]
+                            <td class="uri">
+                                [% IF item.uri %]
+                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
+                                [% END %]
+                            </td>
+                        [% END %]
                     [% END %]
                     [% IF ( itemdata_copynumber ) %]
                         <td class="copynumber">[% item.copynumber | html %]</td>
                         <td class="materials"> [% item.materials | html %] </td>
                     [% END %]
                     [% IF ( itemdata_itemnotes ) %]
-                        <td><div class="itemnotes">[% item.itemnotes | html %]</div></td>
+                        <td><div class="itemnotes">[% item.itemnotes | $raw %]</div></td>
                     [% END %]
                     [% IF itemdata_nonpublicnotes %]
                         <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
                     [% END %]
-                    [% IF ( SpineLabelShowPrintOnBibDetails ) %]
-                        <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | html %]" >Print label</a></td>
-                    [% END %]
                     [% IF ( hostrecords ) %]
-                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | html %]" >[% item.hosttitle | html %]</a>[% END %]</td>
+                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
                     [% END %]
                     [% IF ( analyze ) %]
                         <td>
                             [% IF ( item.countanalytics ) %]
-                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | html %]">[% item.countanalytics | html %] analytics</a>
+                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
                             [% END %]
                         </td>
                     [% END %]
                     [% IF ( analyze ) %]
-                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]">Create analytics</a></td>
+                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
                     [% END %]
 
                 [% IF ShowCourseReserves %]
                             [% 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 | html %]">
+                                      <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
                                          [% r.course.course_name | html %]
                                          <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
                                          [% IF r.course.section %] [% r.course.section | html %] [% END %]
                        [% END %]
                     </td>
                 [% END %]
+
+                [% IF ( SpineLabelShowPrintOnBibDetails ) %]
+                    <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
+                [% END %]
+
                 [% IF CAN_user_editcatalogue_edit_items %]
                     <td class="actions">
                         [% UNLESS item.cannot_be_edited %]
         [% PROCESS items_table tab="holdings" items=itemloop %]
         [% END %]
                 [% IF ( hiddencount ) %]
-                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | html %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
+                   <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
                 [% END %]              
                [% IF ( debug_display ) %]
                <br /><br />
         [% IF (otheritemloop.size) %]
             [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
         [% ELSE %]
-            No other items.
+            <span class="nootheritems">No other items.</span>
         [% END %]
     </div>
 [% END %]
     [% FOREACH MARCNOTE IN MARCNOTES %]
         <p>
         [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
-            <a href="[% MARCNOTE.marcnote | html %]">[% MARCNOTE.marcnote | html %]</a>
+            <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
         [% ELSE %]
-            [% MARCNOTE.marcnote FILTER html_line_break | html %]
+            [% MARCNOTE.marcnote | html | html_line_break %]
         [% END %]
         </p>
     [% END %]
 
 [% IF ( subscriptionsnumber ) %]
 <div id="subscriptions">
-<div class="yui-g">
 <div id="catalogue_detail_subscriptions">
     <h2>This is a serial subscription</h2>
     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
             [% END %]
             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+            [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetByCode( 'LOC', subscription.location ) | html %]</p>[% END %]
             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
-            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break | html %] </p>[% END %]
+            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
             [% IF ( subscription.latestserials ) %]
             [% FOREACH latestserial IN subscription.latestserials %]
                 <tr>
                     <td>[% latestserial.serialseq | html %]</td>
-                    <td>[% latestserial.planneddate | html %]</td>
-                    <td>[% latestserial.publisheddate | html %]</td>
+                    <td><span title="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</span></td>
+                    <td><span title="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</span></td>
                     <td>
                       [% IF ( latestserial.status1 ) %]Expected[% END %]
                       [% IF ( latestserial.status2 ) %]Arrived[% END %]
             [% END %]
             </table>
             [% END %]
-            <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | html %]">Subscription details</a>
+            <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]">Subscription details</a>
     [% END %]
 </div>
 </div>
-</div>
 [% END %]
 
 [% IF Koha.Preference('AcquisitionDetails') %]
 <div id="acq_details">
-  [% IF orders %]
+  [% IF orders.count %]
     <table id="orders">
       <thead>
         <tr>
           <th class="title-string">Receive date</th>
           <th>Status</th>
           <th>Quantity</th>
+          <th>Internal note</th>
           <th>Subscription</th>
           <th>Subscription callnumber</th>
         </tr>
               [% END %]
             </td>
             <td>[% order.quantity | html %]</td>
+            <td>[% order.order_internalnote | html %]</td>
             <td>
                 [% IF order.subscriptionid %]
                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
       </tbody>
     </table>
   [% ELSE %]
-    There is no order for this biblio.
+    <span class="noorder">There is no order for this bibliographic record.</span>
   [% END %]
 </div>
 [% END %]
 
+[% IF suggestions.count %]
+    <div id="suggestion_details">
+        [% IF nb_archived_suggestions > 0 %]
+            <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw  %]
+        [% END %]
+        <table id="suggestions" class="sorted">
+            <thead>
+                <tr>
+                    <th class="NoSort">&nbsp;</th>
+                    <th class="anti-the">Suggestion</th>
+                    <th>Suggested by - on</th>
+                    <th>Managed by - on</th>
+                    <th>Last modification by - on</th>
+                    <th>Library</th>
+                    <th>Fund</th>
+                    <th>Status</th>
+                </tr>
+            </thead>
+            <tbody>
+            [% FOREACH suggestion IN suggestions %]
+                <tr>
+                    <td>[% suggestion.suggestionid | html %]</td>
+                    <td>
+                        <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show" title="suggestion" >
+                            [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
+                        <br />
+                        [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
+                        [% IF ( suggestion.volumedesc ) %]; Volume:<i>[% suggestion.volumedesc | html %]</i> [% END %]
+                        [% IF ( suggestion.isbn ) %]; ISBN:<i>[% suggestion.isbn | html %]</i> [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in <i>[% suggestion.publicationyear | html %]</i> [% END %][% IF ( suggestion.place ) %] in <i>[% suggestion.place | html %]</i> [% END %][% IF ( suggestion.collectiontitle ) %]; [% suggestion.collectiontitle | html %] [% END %][% IF ( suggestion.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestion.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestion.note ) %]<div class="suggestion_note"><i class="fa fa-comment"></i> [% suggestion.note | html %]</div>[% END %]
+                    </td>
+                    <td>
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
+                        [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
+                    </td>
+                    <td>
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
+                        [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
+                    </td>
+                    <td>
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
+                        [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
+                    </td>
+                    <td>
+                        [% Branches.GetName( suggestion.branchcode ) | html %]
+                    </td>
+                    <td>
+                        [% suggestion.fund.budget_name | html %]
+                    </td>
+                    <td>
+                        [% IF    suggestion.STATUS == 'ASKED'     %]Pending
+                        [% ELSIF suggestion.STATUS == 'ACCEPTED'  %]Accepted
+                        [% ELSIF suggestion.STATUS == 'ORDERED'   %]Ordered
+                        [% ELSIF suggestion.STATUS == 'REJECTED'  %]Rejected
+                        [% ELSIF suggestion.STATUS == 'CHECKED'   %]Checked
+                        [% ELSIF suggestion.STATUS == 'AVAILABLE' %]Available
+                        [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
+                            [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
+                        [% ELSE %]Status unknown
+                        [% END %]
+                        [% IF suggestion.reason %]
+                            <br />([% suggestion.reason | html %])
+                        [% END %]
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+[% END %]
+
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
 <div id="editions"><h4>Editions</h4>
 <table>
-[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].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 | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
 [% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
-<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | html %]">[% XISBN.title | html %]</a> by [% XISBN.author | html %] &copy;[% XISBN.copyrightdate | html %]
+<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | uri %]">[% XISBN.title | html %]</a> by [% XISBN.author | html %] &copy;[% XISBN.copyrightdate | html %]
   [% IF ( XISBN.publishercode ) %]
 [% XISBN.publishercode | html %] [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %] [% IF ( XISBN.publicationyear ) %], [% XISBN.publicationyear | html %][% END %] [% IF ( XISBN.editionstatement ) %][% XISBN.editionstatement | html %][% END %] [% IF ( XISBN.editionresponsibility ) %][% XISBN.editionresponsibility | html %][% END %]
     [% END %]
 [% END %]
 
 [% IF ( LocalCoverImages ) %]
-<div id="images">
-[% IF ( localimages.0 ) %]
-    <p>Click on an image to view it in the image viewer</p>
-    <ul class="thumbnails">
-[% FOREACH image IN localimages %]
-    [% IF image %]
-        <li id="imagenumber-[% image | html %]">
-            <a class="thumbnail" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&amp;imagenumber=[% image | html %]">
-                <img alt="remove this image" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image | html %]" />
-                [% IF CAN_user_tools_upload_local_cover_images %]
-                  <span class="remove" title="remove this image">Delete image</span>
+    <div id="images">
+        [% IF ( localimages.0 ) %]
+            <p>Click on an image to view it in the image viewer</p>
+            <ul class="thumbnails">
+                [% FOREACH image IN localimages %]
+                    [% IF image %]
+                        <li id="imagenumber-[% image | html %]" class="thumbnail">
+                            <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image | uri %]">
+                                <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image | uri %]" />
+                            </a>
+                            [% IF CAN_user_tools_upload_local_cover_images %]
+                                <a href="#" class="remove"><i class="fa fa-trash"></i> Delete image</a>
+                            [% END %]
+                        </li>
+                    [% END %]
                 [% END %]
-            </a>
-        </li>
-    [% END %]
-[% END %]
-    </ul>
-[%# ELSE - No image passed JavaScript takes care %]
-[% END %]
-</div>
+            </ul>
+        [% ELSE # - No image passed JavaScript takes care %]
+            <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
+        [% END %]
+        [% IF ( CAN_user_tools_upload_local_cover_images ) %]
+            <p>Upload an image file: <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&amp;filetype=image"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
+            </p>
+        [% END %]
+    </div>
 [% END %]
 
 [% IF ( HTML5MediaEnabled ) %]
 <div id="html5media">
           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
             <p>
-              <[% HTML5MediaParent | html %] controls preload=none>
-                <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | html %]"[% HTML5MediaSet.typeblock | html %] />
-                [[% HTML5MediaParent | html %] tag not supported by your browser.]
-              </[% HTML5MediaParent | html %]>
+                [% IF HTML5MediaSet.is_youtube %]
+                    <iframe id="player" type="text/html" width="640" height="360"
+                        src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
+                [% ELSE %]
+                  <[% HTML5MediaParent | html %] controls preload=none>
+                    <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
+                    [[% HTML5MediaParent | html %] tag not supported by your browser.]
+                  </[% HTML5MediaParent | html %]>
+                [% END %]
             </p>
           [% END %]
 </div>
     </div>
 [% END %]
 
+[% FOREACH tab IN tabs %]
+    <div id="[% tab.id | html %]">
+        [% tab.content | $raw %]
+    </div>
+[% END %]
+
 </div><!-- /bibliodetails -->
 
-<div class="yui-g" id="export" style="margin-top: 1em;">
+<div id="export" style="margin-top: 1em;">
 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
 <table>  <tr>
-      <th>Save Record</th>   </tr>
+      <th>Save record</th>   </tr>
     <tr><td> Select download format:    <select name="format">
         <option value="mods">MODS (XML)</option>
         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
         <option value="marcxml">MARCXML</option>
         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
-        <input type="submit" name="save" value="Download Record" /></td>
+        <input type="submit" name="save" value="Download record" /></td>
   </tr>
   <tr><td>
     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
     </div>
 </div>
 
-</div>
-</div>
-<div class="yui-b">
-[% INCLUDE 'biblio-view-menu.inc' %]
-</div>
+            </main>
+        </div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+        <div class="col-sm-2 col-sm-pull-10">
+            <aside>
+                [% INCLUDE 'biblio-view-menu.inc' %]
+            </aside>
+        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+     </div> <!-- /.row -->
+
 [% END %]
-</div>
 
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'catalog-strings.inc' %]
     [% Asset.js("js/catalog.js") | $raw %]
-    [% INCLUDE 'greybox.inc' %]
-    <script type="text/javascript">
+    [% Asset.js("js/coce.js") | $raw %]
+    <script>
+        var interface = "[% interface | html %]";
+        var theme = "[% theme | html %]";
         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
         function verify_images() {
-            $("#bookcoverimg").each(function(i){
-                $(this).find('img').each(function(i){
-                   if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
-                        w = this.width;
-                        h = this.height;
-                        if ((w == 1) || (h == 1)) {
-                            $("#amazon-bookcoverimg").remove();
-                            $(".yui-gb").attr("class","yui-g");
-                        } else if ((this.complete != null) && (!this.complete)) {
-                            $("#amazon-bookcoverimg").remove();
-                            $(".yui-gb").attr("class","yui-g");
+            // Loop over each container in the template which contains covers
+            $(".cover-image").each( function( index ){
+                var div = $(this);
+                // Find the image in the container
+                var img = div.find("img")[0];
+                if( $(img).length > 0 ){
+                    if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
+                        // No image loaded in the container. Remove the slide
+                        div.remove();
+                    } else {
+                        // All slides start hidden. If this is the first one, show it.
+                        if( index == 0 ){
+                            div.show();
+                        }
+                        // Check if Amazon image is present
+                        if ( div.attr("id") == "amazon-bookcoverimg"  ) {
+                            w = img.width;
+                            h = img.height;
+                            if ((w == 1) || (h == 1)) {
+                                // Amazon returned single-pixel placeholder
+                                // Remove the container
+                                div.remove();
+                            }
+                        }
+                        if( div.attr("id") == "custom-img" ){
+                            if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
+                                // No image was loaded via the CustomCoverImages system preference
+                                // Remove the container
+                                div.remove();
+                            }
+                        }
+                        if( div.attr("id") == "coce-coverimg" ){
+                            // Identify which service's image is being loaded by Coce
+                            if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
+                                div.find(".hint").html(_("Coce image from Amazon.com"));
+                            } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
+                                div.find(".hint").html(_("Coce image from Google Books"));
+                            } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
+                                div.find(".hint").html(_("Coce image from Open Library"));
+                            }
                         }
                     }
-                });
-                if( $(this).find('img').length < 1 ) $(this).remove();
+                }
             });
+
+            var coverSlides = $(".cover-image");
+            if( coverSlides.length > 1 ){
+                coverSlides.each(function( index ){
+                    // If more that one slide is present, add a navigation link
+                    // for activating the slide
+                    var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
+                    if( index == 0 ){
+                        // Set the first navigation link as active
+                        $(covernav).addClass("nav-active");
+                    }
+                    $(covernav).html("<i class=\"fa fa-circle\"></i>");
+                    $("#cover-slides").append( covernav );
+
+                });
+            }
+
+            if( $(".cover-image:visible").length < 1 ){
+                $("#cover-slides").remove();
+            } else {
+                $("#cover-slides").addClass("cover-slides");
+            }
+
             $("#editions img").each(function(i){
-                if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
+                if ( this.src.indexOf('amazon.com') >= 0 ) {
                     w = this.width;
                     h = this.height;
                     if ((w == 1) || (h == 1)) {
                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
-                    } else if ((this.complete != null) && (!this.complete)) {
+                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
                     }
                 }
         }
 
         function removeLocalImage(imagenumber) {
+            var thumbnail = $("#imagenumber-" + imagenumber );
+            var copy = thumbnail.html();
+            thumbnail.find("img").css("opacity", ".2");
+            thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
             $.ajax({
                 url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber,
                 success: function(data) {
                     $(data).each( function(i) {
                         if ( this.deleted == 1 ) {
-                            $('#imagenumber-' + this.imagenumber).remove();
+                            thumbnail.remove();
+                        } else {
+                            thumbnail.html( copy );
+                            alert(_("An error occurred on deleting this image"));
                         }
                         if ( $('ul.thumbnails > li').length == 0 ) {
                             showNoImageMessage();
                     });
                 },
                 error: function(data) {
+                    thumbnail.html( copy );
                     alert(_("An error occurred on deleting this image"));
                 }
             });
             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
             no_images_msg = '<p>' + no_images_msg + '</p>';
             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
-                var please_upload = _("Please select the image file to upload. %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
+                var please_upload = _("Upload an image file: %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
             [% END %]
             $('#images').html(no_images_msg);
                 if (itemnumbers.length > 0) {
                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
-                    url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
+                    url += '&biblionumber=[% biblionumber | uri %]';
+                    url += '&src=CATALOGUING';
                     $('a.itemselection_action_delete').attr('href', url);
                 } else {
                     return false;
                 if (itemnumbers.length > 0) {
                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
-                    url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
+                    url += '&biblionumber=[% biblionumber | uri %]';
+                    url += '&src=CATALOGUING';
                     $('a.itemselection_action_modify').attr('href', url);
                 } else {
                     return false;
 
         $(document).ready(function() {
             $('#bibliodetails').tabs();
-            [% IF count == 0 %]
-                $('#bibliodetails').tabs("option", "active", 3);
-            [% END %]
+        [% IF count == 0 and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %]
+            $('#bibliodetails').tabs("option", "active", $('#media_tab').index() );
+        [% END %]
             $('#search-form').focus();
-            $('.thumbnails > li > a > span.remove').click(function() {
+            $('.thumbnails > li > .remove').click(function() {
                 var result = confirm(_("Are you sure you want to delete this cover image?"));
 
                 if ( result == true ) {
-                    var imagenumber = $(this).parent().parent().attr('id').split('-')[1];
+                    var imagenumber = $(this).parent().attr('id').split('-')[1];
                     removeLocalImage(imagenumber);
                 }
 
                 return false;
             });
-            [%# inject no images message %]
-            [% IF ( LocalCoverImages && ! localimages.0 ) %]
-                showNoImageMessage();
-            [% END %]
-            [% IF LocalCoverImages %]
-                KOHA.LocalCover.GetCoverFromBibnumber(true);
+            [% IF ( IntranetCoce && CoceProviders ) %]
+                KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
             [% END %]
+
             $("body").on("click",".previewMARC", function(e){
                 e.preventDefault();
                 var page = $(this).attr("href");
                 $("#marcPreview .modal-body").load(page + " table");
                 $('#marcPreview').modal({show:true});
             });
-            $("#marcPreview").on("hidden", function(){
+            $("#marcPreview").on("hidden.bs.modal", function(){
                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
                     }
                  });
              [% END %]
-
+             $(".print-label").on("click", function(e){
+                e.preventDefault();
+                link = $(this).attr("href");
+                openWindow(link,"Print spine label",400,400);
+             });
+             $("#cover-slides").on("click",".cover-nav", function(e){
+                 e.preventDefault();
+                // Adding click handler for cover image navigation links
+                var num = $(this).data("num");
+                $(".cover-nav").removeClass("nav-active");
+                $(this).addClass("nav-active");
+                $(".cover-image").hide();
+                $(".cover-image").eq( num ).show();
+             });
         });
 
-        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
+        $(window).load(function() {
             verify_images();
-        });[% END %]
+        });
     </script>
     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
-        [% Asset.js("https://imageserver.ebscohost.com/novelistselect/ns2init.js") | $raw %]
+        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
     [% END %]
     [% INCLUDE 'datatables.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
-    [% INCLUDE 'browser-strings.inc' %]
+    [% INCLUDE 'strings.inc' %]
     [% INCLUDE 'columns_settings.inc' %]
     [% Asset.js("js/browser.js") | $raw %]
     [% Asset.js("js/table_filters.js") | $raw %]
-    <script type="text/javascript">
+    <script>
         var browser;
         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
         browser.show();
 
         $(document).ready(function() {
             var ids = ['holdings_table', 'otherholdings_table'];
-
+            var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json')  | $raw %] ];
             for (var i in ids) {
                 var id = ids[i];
                 var dt_parameters = {
                     'bPaginate': false,
                     'bAutoWidth': false,
                     "aoColumnDefs": [
-                        { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
-                    ]
+                        { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
+                        { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                    ],
+                    "bKohaColumnsUseNames": true,
+                    "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
                 };
-                var table = KohaTable(id, dt_parameters, null, 'with_filters');
+                var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters');
             }
 
             [% IF Koha.Preference('AcquisitionDetails') %]
-                var columns_settings = [% ColumnsSettings.GetColumns('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
+                var columns_settings = [% TablesSettings.GetColumns('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
                 var acquisitiondetails_table = KohaTable("orders", {
                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
                     'bPaginate': false,
                     ]
                 }, columns_settings);
             [% END %]
+
+            [% IF suggestions.count %]
+                $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
+                    "aoColumnDefs": [
+                        { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
+                        { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
+                    ],
+                    "sPaginationType": "full"
+                }));
+            [% END %]
         });
     </script>
 [% END %]