Bug 26922: Regression tests
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / detail.tt
blob5c0f779436de9310dc9972e86d6c950ea8044b4a
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE AuthorisedValues %]
6 [% USE Branches %]
7 [% USE Biblio %]
8 [% USE Price %]
9 [% USE TablesSettings %]
10 [% PROCESS 'i18n.inc' %]
11 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
12 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
14 [% IF Koha.Preference('AmazonAssocTag') %]
15     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
16 [% ELSE %]
17     [% AmazonAssocTag = '' %]
18 [% END %]
20 [% ShowCourseReserves = 0 | html %]
21 [% IF UseCourseReserves %]
22     [% FOREACH item IN itemloop %]
23        [% IF item.course_reserves %]
24            [% FOREACH r IN item.course_reserves %]
25                [% IF r.course.enabled == 'yes' %]
26                    [% ShowCourseReserves = 1 | html %]
27                [% END %]
28            [% END %]
29         [% END %]
30     [% END %]
31 [% END %]
33 [% SET footerjs = 1 %]
34 [% INCLUDE 'doc-head-open.inc' %]
35 <title>Koha &rsaquo; Catalog &rsaquo;
36   [% IF ( unknownbiblionumber ) %]
37     Unknown record
38   [% ELSE %]
39     Details for [% INCLUDE 'biblio-title-head.inc' %]
40   [% END %]
41 </title>
42 [% INCLUDE 'doc-head-close.inc' %]
43 </head>
45 <body id="catalog_detail" class="catalog">
47 [% INCLUDE 'header.inc' %]
48 [% INCLUDE 'cat-search.inc' %]
50 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo;
51   [% IF ( unknownbiblionumber ) %]
52     Unknown record
53   [% ELSE %]
54     [% INCLUDE 'biblio-title.inc' link = 1 %] &rsaquo; Details
55   [% END %]
56 </div>
58 <div class="main container-fluid">
59     <div class="row">
60         <div class="col-sm-10 col-sm-push-2">
61             <main>
62                 <div class="row">
64 [% IF ( unknownbiblionumber ) %]
65   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
66 [% ELSE %]
68 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
69 [% CoceProviders   = Koha.Preference('CoceProviders') %]
70 [% CoceHost        = Koha.Preference('CoceHost') %]
72 [% INCLUDE 'cat-toolbar.inc' %]
73     [% IF decoding_error %]
74         <div>
75            <span class="biberror">
76             There is an error with this bibliographic record, the view may be degraded.</span>
77             <span class="error"><br/> Error: [% decoding_error | html %]</span>
78         </div>
79     [% END %]
80     [% IF ( ocoins ) %]
81         <!-- COinS / OpenURL -->
82         <span class="Z3988" title="[% ocoins | html %]"></span>
83     [% END %]
85     [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
86         [% IF ( XSLTDetailsDisplay ) %]
87             <div id="catalogue_detail_biblio" class="col-xs-9">
88         [% ELSE %]
89             <div id="catalogue_detail_biblio" class="col-xs-9">
90         [% END %]
91     [% ELSE %]
92         <div id="catalogue_detail_biblio" class="col-xs-12">
93     [% END %]
95         [% XSLTBloc | $raw %]
97         [% IF shelves.count %]
98             <span class="results_summary"><span class="label">Lists that include this title: </span>
99             [% FOREACH s IN shelves %]
100                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
101                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
102             [% END %]
103             </span>
104         [% END %]
105         [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
106                 <span class="results_summary"><span class="label">Tags:</span>
107                     [% FOREACH TagLoo IN TagLoop %]
108                         [% IF ( CAN_user_tools_moderate_tags ) %]
109                         <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
110                         [% ELSE %]
111                         [% TagLoo.term | html %]
112                         [% END %]
113                         <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
114                     [% END %]
115                     </span>
116         [% END %]
117         <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>
118         [% IF !item_level_itypes ||  Koha.Preference("BiblioItemtypeInfo") %]
119            <span class="results_summary itemtype"><span class="label">Itemtype:</span>
120           [% IF ( !noItemTypeImages && imageurl ) %]
121               <img src="[% imageurl | html %]" alt="" />
122           [% END %]
123           [% IF ( description ) %]
124             [% description | html %]
125           [% ELSE %]
126             [% itemtype | html %]
127           [% END %]
128           </span>
129         [% END %]
131         [% IF ( holdcount ) %]
132             <span class="results_summary">
133                 <span class="label">Holds:</span>
134                 <span class="number_box">
135                     [% IF CAN_user_reserveforothers_place_holds %]
136                         <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
137                     [% ELSE %]
138                         <span>[% holdcount | html %]</span>
139                     [% END %]
140                 </span>
141             </span>
142         [% END %]
144         [% IF illrequests.count %]
145             <span class="results_summary">
146                 <span class="label">ILL requests:</span>
147                 [% IF CAN_user_ill %]
148                     [% FOREACH ill IN illrequests %]
149                         <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 %]
150                     [% END %]
151                 [% ELSE %]
152                     [% FOREACH ill IN illrequests %]
153                         <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
154                     [% END %]
155                 [% END %]
156             </span>
157         [% END %]
159         [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
160             <span class="results_summary">
161                 <span class="label">Article requests:</span>
162                 <span class="number_box">
163                     <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
164                 </span>
165             </span>
166         [% END %]
168         [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
169             </div>
170             <div class="col-xs-3 bookcoverimg">
171                 <div id="biblio-cover-slider" class="cover-slider">
172                     [% IF ( LocalCoverImages ) %]
173                         [% IF localimages.count %]
174                             [% FOREACH image IN localimages %]
175                                 <div class="cover-image local-coverimg">
176                                     <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
177                                         <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" />
178                                     </a>
179                                     <div class="hint">Local cover image</div>
180                                 </div>
181                             [% END %]
182                         [% END %]
183                     [% END %]
185                     [% IF ( AdlibrisEnabled && normalized_isbn ) %]
186                         <div class="cover-image" id="adlibris-coverimg">
187                             <a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]">
188                                 <img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" />
189                             </a>
190                             <div class="hint">Image from Adlibris</div>
191                         </div>
192                     [% END %]
194                     [% IF ( AmazonCoverImages && normalized_isbn) %]
195                         <div class="cover-image" id="amazon-bookcoverimg">
196                             <a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link">
197                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="Amazon cover image" />
198                             </a>
199                             <div class="hint">Image from Amazon.com</div>
200                         </div>
201                     [% END %]
203                     [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
204                         [% coce_id = normalized_ean || normalized_isbn %]
205                         <div class="cover-image" id="coce-coverimg">
206                             [% IF ( coce_id ) %]
207                                 <span title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span>
208                             [% ELSE %]
209                                 <span class="no-image">No cover image available</span>
210                             [% END %]
211                             <div class="hint">Image from Coce</div>
212                         </div>
213                     [% END %]
215                     [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
216                         <div class="cover-image" id="custom-coverimg">
217                             <a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]">
218                                 <img id="custom-img" alt="Custom cover image" src="[% biblio.custom_cover_image_url | url %]" />
219                             </a>
220                             <div class="hint">Custom cover image</div>
221                         </div>
222                     [% END %]
223                 </div> <!-- /.cover-slider -->
224             </div> <!-- /.bookcoverimg.col-xs-3 -->
225         [% ELSE %]
226         </div> <!-- /.col-xs-* -->
227         [% END # /IF ( AmazonCoverImages, etc ) %]
228 </div>
229 <div id="bibliodetails" class="toptabs">
231 <ul>
232     [% IF (SeparateHoldings) %]
233         <li>
234             <a href="#holdings">[% Branches.GetLoggedInBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
235         </li>
236         <li>
237             <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
238         </li>
239     [% ELSE %]
240         <li>
241             <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
242         </li>
243     [% END %]
244 [% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
245 [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
246 [% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
247 [% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
248 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
249 [% IF ( LocalCoverImages ) %]
250     [% IF ( localimages.count || CAN_user_tools_upload_local_cover_images ) %]
251         <li>
252             <a href="#images">Images ([% localimages.count || 0 | html %])</a>
253         </li>
254     [% END %]
255 [% END %]
256 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]<li id="media_tab"><a href="#html5media">Play media</a></li>[% END %]
257 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
258     <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
259 [% END %]
260 [% FOREACH tab IN tabs %]
261     <li><a href="#[% tab.id | uri %]">[% tab.title | html %]</a></li>
262 [% END %]
263 </ul>
265 [% items_table_block_iter = 0 %]
266 [% BLOCK items_table %]
267     [% items_table_block_iter = items_table_block_iter + 1 %]
268     <div class="[% tab | html %]_table_table_controls">
269         [% IF (StaffDetailItemSelection) %]
270             | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> |
271             <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
272             <span class="itemselection_actions">
273               | Actions:
274               [% IF CAN_user_tools_items_batchdel %]
275                 <a class="itemselection_action_delete"><i class="fa fa-trash"></i> Delete selected items</a>
276               [% END %]
277               [% IF CAN_user_tools_items_batchmod %]
278                 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
279               [% END %]
280             </span>
281         [% END %]
282     </div>
283     <table class="items_table" id="[% tab | html %]_table">
284         <thead>
285             <tr>
286                 [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %]
287                 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
288                     <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th>
289                 [% END %]
290                 [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
291                 <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
292                 <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
293                 [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %]
294                 <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
295                 [% IF volinfo %]
296                 [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting%]
297                         <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron" class="title-string">Serial enumeration / chronology</th>
298                     [% ELSE %]
299                         <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
300                     [% END %]
301                 [% END %]
302                 <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
303                 <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen" class="title-string">Last seen</th>
304                 <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned" class="title-string">Date accessioned</th>
305                 <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed" class="title-string">Date last borrowed</th>
306                 <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th>
307                 [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %]
308                 [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %]
309                 [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %]
310                 [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %]
311                 [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %]
312                 [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %]
313                 [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
314                 [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
315                 [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
316                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
317                 [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort">&nbsp;</th>[% END %]
318             </tr>
319         </thead>
320         <tbody>
321             [% FOREACH item IN items %]
322                 <tr>
323                 [% IF (StaffDetailItemSelection) %]
324                     <td style="text-align:center;vertical-align:middle">
325                         <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
326                     </td>
327                 [% END %]
328                     [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
329                         <td class="cover">
330                             <div class="bookcoverimg">
331                                 <div class="cover-slider">
332                                     [% FOREACH image IN item.cover_images %]
333                                         <div class="cover-image local-coverimg">
334                                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
335                                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" />
336                                             </a>
337                                         </div>
338                                     [% END %]
339                                 </div>
340                             </div>
341                         </td>
342                     [% END %]
344                     [% IF ( item_level_itypes ) %]
345                         <td class="itype">
346                             [% IF !noItemTypeImages && item.imageurl %]
347                                 <img src="[% item.imageurl | html %]" alt="[% item.translated_description | html %]" title="[% item.translated_description | html %]" />
348                             [% END %]
349                             <span class="itypedesc">[% item.translated_description | html %]</span>
350                         </td>
351                     [% END %]
352                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
353                     <td class="homebranch">
354                         <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
355                         <span class="shelvingloc">
356 <!--
357 If permanent location is defined, show description or code and display current location in parentheses. If not, display current location.
358 Note that permanent location is a code, and location may be an authval.
360                             [% IF item.permanent_location %]
361                                 [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
362                                 [% permloc_authval | html %]
363                                 [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %]
364                                     ([% item.location | html %])
365                                 [% END %]
366                             [% ELSE %]
367                                 [% item.location | html %]
368                             [% END %]
369                         </span>
370                     </td>
371                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
372                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
373                     [% IF ( volinfo ) %]
374                         <td class="enumchron">
375                             [% IF itemdata_publisheddate %]<span title="[% item.publisheddate | html %]">[% END %]
376                             [% IF ( itemdata_enumchron ) %]
377                                 [% IF item.enumchron && item.serialseq %]
378                                     <span class="enum">[% item.enumchron | html %]</span>
379                                     [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
380                                         <span class="sep"> -- </span>
381                                         <span class="serialseq">[% item.serialseq | html %]</span>
382                                     [% END %]
383                                 [% ELSIF item.enumchron %]
384                                     <span class="enum">[% item.enumchron | html %]</span>
385                                 [% ELSIF item.serialseq %]
386                                     <span class="serialseq">[% item.serialseq | html %]</span>
387                                 [% END %]
388                                 [% IF ( item.publisheddate ) %]
389                                     <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
390                                 [% END %]
391                             [% END %]
392                             </span>
393                         </td>
394                     [% END %]
395                     <td class="status">
397                         [% IF item.CheckedOutFor %]
398                           [% IF item.onsite_checkout %]
399                             <span>Currently in local use
400                           [% ELSE %]
401                             <span class="datedue">Checked out
402                           [% END %]
403                                 [% UNLESS ( item.NOTSAMEBRANCH ) %]
404                                   [% IF item.onsite_checkout %]
405                                     by
406                                   [% ELSE %]
407                                     to
408                                   [% END %]
409                                   [% INCLUDE 'patron-title.inc' patron=item.CheckedOutFor hide_patron_infos_if_needed=1 %]
410                                 [% END %]
411                                 : due [% item.datedue | html %]
412                             </span>
413                         [% ELSIF ( item.transfertwhen ) %]
414                             <span class="intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %] to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
415                         [% END %]
417                         [% IF ( item.itemlost ) %]
418                             [% IF itemlostloop %]
419                                 [% FOREACH itemlostloo IN itemlostloop %]
420                                     [% IF itemlostloo.authorised_value == item.itemlost %]
421                                         <span class="lost">[% itemlostloo.lib | html %]</span>
422                                     [% END %]
423                                 [% END %]
424                             [% ELSE %]
425                                 <span class="lost">Unavailable (lost or missing)</span>
426                             [% END %]
427                         [% END %]
429                         [% IF ( item.withdrawn ) %]
430                             [% IF itemwithdrawnloop %]
431                                 [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %]
432                                     [% IF itemwithdrawnloo.authorised_value == item.withdrawn %]
433                                         <span class="wdn">[% itemwithdrawnloo.lib | html %]</span>
434                                     [% END %]
435                                 [% END %]
436                             [% ELSE %]
437                                 <span class="wdn">Withdrawn</span>
438                             [% END %]
439                         [% END %]
441                         [% IF ( item.damaged ) %]
442                             [% IF itemdamagedloop %]
443                                 [% FOREACH itemdamagedloo IN itemdamagedloop %]
444                                     [% IF itemdamagedloo.authorised_value == item.damaged %]
445                                         <span class="dmg">[% itemdamagedloo.lib | html %]</span>
446                                     [% END %]
447                                 [% END %]
448                             [% ELSE %]
449                                 <span class="dmg">Damaged</span>
450                             [% END %]
451                         [% END %]
453                         [% IF ( item.itemnotforloan || item.notforloan_per_itemtype ) %]
454                             <span class="notforloan">Not for loan
455                             [% IF ( item.notforloanvalue ) %]
456                                 <span class="reason">([% item.notforloanvalue | html %])</span>
457                             [% END %]
458                             </span>
459                         [% END %]
461                         [% SET hold = item.first_hold %]
462                         [% IF hold %]
463                             [% IF hold.waitingdate %]
464                                 <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
465                                 [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
466                                     <span class="heldfor">Hold for:</span>
467                                     [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
468                                 [% END %]
469                             [% ELSE %]
470                                 <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
471                             [% END %]
472                         [% END %]
473                         [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold ) %]
474                             <span class="available">Available</span>
475                         [% END %]
477                         [% IF ( item.restricted ) %]
478                             <span class="restricted">([% item.restrictedvalue | html %])</span>
479                         [% END %]
481                     </td>
482                     <td class="datelastseen"><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
483                     <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
484                     <td class="datelastborrowed"><span title="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</span></td>
485                     <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>
486                     [% IF ( itemdata_uri ) %]
487                         [% IF item.uri.split(' \| ').size > 1 %]
488                             <td class="uri">
489                                 [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
490                             </td>
491                         [% ELSE %]
492                             <td class="uri">
493                                 [% IF item.uri %]
494                                     <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
495                                 [% END %]
496                             </td>
497                         [% END %]
498                     [% END %]
499                     [% IF ( itemdata_copynumber ) %]
500                         <td class="copynumber">[% item.copynumber | html %]</td>
501                     [% END %]
502                     [% IF ( itemdata_stocknumber ) %]
503                         <td class="stocknumber">[% item.stocknumber | html %]</td>
504                     [% END %]
505                     [% IF materials %]
506                         <td class="materials"> [% item.materials | html %] </td>
507                     [% END %]
508                     [% IF ( itemdata_itemnotes ) %]
509                         <td><div class="itemnotes">[% item.itemnotes | $raw %]</div></td>
510                     [% END %]
511                     [% IF itemdata_nonpublicnotes %]
512                         <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
513                     [% END %]
514                     [% IF ( hostrecords ) %]
515                         <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
516                     [% END %]
517                     [% IF ( analyze ) %]
518                         <td>
519                             [% IF ( item.countanalytics ) %]
520                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
521                             [% END %]
522                         </td>
523                     [% END %]
524                     [% IF ( analyze ) %]
525                         <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
526                     [% END %]
528                 [% IF ShowCourseReserves %]
529                     <td>
530                         [% IF item.course_reserves %]
531                             [% FOREACH r IN item.course_reserves %]
532                                 [% IF r.course.enabled == 'yes' %]
533                                     <p>
534                                       <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
535                                          [% r.course.course_name | html %]
536                                          <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
537                                          [% IF r.course.section %] [% r.course.section | html %] [% END %]
538                                          [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
539                                       </a>
540                                    </p>
541                                [% END %]
542                            [% END %]
543                        [% END %]
544                     </td>
545                 [% END %]
547                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]
548                     <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>
549                 [% END %]
551                 [% IF CAN_user_editcatalogue_edit_items %]
552                     <td class="actions">
553                         [% UNLESS item.cannot_be_edited %]
554                             [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
555                                 <div class="btn-group">
556                                     <a  class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
557                                     <ul class="dropdown-menu pull-right">
558                                         <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
559                                     </ul>
560                                 </div>
561                             [% ELSE %]
562                                 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a>
563                             [% END %]
564                         [% END %]
565                     </td>
566                 [% END %]
567                 </tr>
568             [% END %]
569         </tbody>
570     </table>
572 [% END %][%# end of block items_table %]
574 <div id="holdings">
576 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
577     <span class="results_summary NovelistSelect" style="display:none;">
578         <span class="label">Novelist Select: </span>
579         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
580     </span>
581 [% END %]
583 [% IF ( count ) %]
584     [% IF ( showncount ) %]
585         [% PROCESS items_table tab="holdings" items=itemloop %]
586         [% END %]
587                 [% IF ( hiddencount ) %]
588                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
589                 [% END %]               
590                 [% IF ( debug_display ) %]
591                 <br /><br />
592                 <table>
593                         <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
594                         <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
595                         <tr><td>serial</td><td>[% serial | html %]</td></tr>
596                 </table>
597                 [% END %]
598 [% ELSE %]
599     [% IF ( ALTERNATEHOLDINGS ) %]
600     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
601         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
602     [% END %]
603     [% ELSE %]
604     <div id="noitems">No physical items for this record</div>
605     [% END %]
606 [% END %]
608 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
609     <span class="results_summary NovelistSelect" style="display:none;">
610         <span class="label">Novelist Select: </span>
611         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
612     </span>
613 [% END %]
614     </div>
616 [% IF (SeparateHoldings) %]
617     <div id="otherholdings">
618         [% IF (otheritemloop.size) %]
619             [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
620         [% ELSE %]
621             <span class="nootheritems">No other items.</span>
622         [% END %]
623     </div>
624 [% END %]
626 [% IF ( MARCNOTES || notes ) %]
628 <div id="description">
629 <div class="content_set">
631 [% IF ( MARCNOTES ) %]
632     [% FOREACH MARCNOTE IN MARCNOTES %]
633         <p>
634         [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
635             <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
636         [% ELSE %]
637             [% MARCNOTE.marcnote | html | html_line_break %]
638         [% END %]
639         </p>
640     [% END %]
641 [% ELSE %]
642     [% IF ( notes ) %]
643         <p>[% notes | html %]</p>
644     [% END %]
645 [% END %]
646 </div>
647 </div>
649 [% END %]
651 [% IF ( subscriptionsnumber ) %]
652 <div id="subscriptions">
653 <div id="catalogue_detail_subscriptions">
654     <h2>This is a serial subscription</h2>
655     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
656     [% FOREACH subscription IN subscriptions %]
657             [% IF subscription.branchcode %]
658                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
659             [% END %]
660             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
661             [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
662             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
663             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
664             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
665             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
666             [% IF ( subscription.latestserials ) %]
667             <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
668             <table>
669                 <tr>
670                     <th>Issue #</th>
671                     <th>Date arrived</th>
672                     <th>Date published</th>
673                     <th>Status</th>
674                     <th>Note</th>
675                 </tr>
676             [% FOREACH latestserial IN subscription.latestserials %]
677                 <tr>
678                     <td>[% latestserial.serialseq | html %]</td>
679                     <td><span title="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</span></td>
680                     <td><span title="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</span></td>
681                     <td>
682                       [% IF ( latestserial.status1 ) %]Expected[% END %]
683                       [% IF ( latestserial.status2 ) %]Arrived[% END %]
684                       [% IF ( latestserial.status3 ) %]Late[% END %]
685                       [% IF ( latestserial.status4 ) %]Missing[% END %]
686                       [% IF ( latestserial.status41 ) %]Missing (never received)[% END %]
687                       [% IF ( latestserial.status42 ) %]Missing (sold out)[% END %]
688                       [% IF ( latestserial.status43 ) %]Missing (damaged)[% END %]
689                       [% IF ( latestserial.status44 ) %]Missing (lost)[% END %]
690                       [% IF ( latestserial.status5 ) %]Not issued[% END %]
691                       [% IF ( latestserial.status6 ) %]Delete[% END %]
692                       [% IF ( latestserial.status7 ) %]Claimed[% END %]
693                       [% IF ( latestserial.status8 ) %]Stopped[% END %]
694                     </td>
695                     <td>[% latestserial.notes | html %]</td>
696                 </tr>
697             [% END %]
698             </table>
699             [% END %]
700             <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]">Subscription details</a>
701     [% END %]
702 </div>
703 </div>
704 [% END %]
706 [% IF Koha.Preference('AcquisitionDetails') %]
707 <div id="acq_details">
708   [% IF orders.count %]
709     <table id="orders">
710       <thead>
711         <tr>
712           <th>Vendor</th>
713           <th>Invoice</th>
714           <th>Basket group</th>
715           <th>Basket</th>
716           <th>Order number</th>
717           <th class="title-string">Creation date</th>
718           <th class="title-string">Receive date</th>
719           <th>Status</th>
720           <th>Quantity</th>
721           <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
722           <th>Internal note</th>
723           <th>Subscription</th>
724           <th>Subscription callnumber</th>
725         </tr>
726       </thead>
727       <tbody>
728       [% FOR order IN orders %]
729         [% SET basket = order.basket %]
730         [% SET vendor = basket.bookseller %]
731           <tr>
732             <td>
733                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
734             </td>
735             <td>
736             [% IF order.invoiceid %]
737                 [% IF CAN_user_acquisition %]
738                     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
739                        title="Invoice detail page">
740                        [% order.invoice.invoicenumber | html %]</a>
741                 [% ELSE %]
742                     [% order.invoice.invoicenumber | html %]
743                 [% END %]
744             [% END %]
745             </td>
746             <td>
747             [% IF basket.basketgroupid %]
748                 [% SET basket_group = basket.basket_group %]
749                 [% IF CAN_user_acquisition_group_manage %]
750                     <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% vendor.id | uri %]&basketgroupid=[% basket_group.id | uri %]">[% basket_group.name | html%] ([% basket_group.id | html %])</a>
751                 [% ELSE %]
752                     [% basket_group.name | html %] ([% basket_group.id | html %])
753                 [% END %]
754             [% END %]
755             </td>
756             <td>[% IF CAN_user_acquisition_order_manage %]
757                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
758             [% ELSE %]
759                 [% basket.basketname | html %] ([% basket.basketno | html %])
760             [% END %]</td>
761             <td>[% order.ordernumber | html %]</td>
762             <td><span title="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</span></td>
763             <td><span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</span></td>
764             <td>
765               [% SWITCH order.orderstatus %]
766                 [% CASE 'new' %]New
767                 [% CASE 'ordered' %]Ordered
768                 [% CASE 'partial' %]Partial
769                 [% CASE 'complete' %]Complete
770                 [% CASE 'cancelled' %]Cancelled
771               [% END %]
772             </td>
773             <td>[% order.quantity | html %]</td>
774             <td>[% IF ( order.unitprice_tax_included > 0 ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
775             <td>[% order.order_internalnote | html %]</td>
776             <td>
777                 [% IF order.subscriptionid %]
778                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
779                 [% END %]
780             </td>
781             <td>
782                 [% IF order.subscriptionid %]
783                     [% order.subscription.callnumber | html %]
784                 [% END %]
785             </td>
786           </tr>
787       [% END %]
788       </tbody>
789     </table>
790   [% ELSE %]
791     <span class="noorder">There is no order for this bibliographic record.</span>
792   [% END %]
793 </div>
794 [% END %]
796 [% IF suggestions.count %]
797     <div id="suggestion_details">
798         [% IF nb_archived_suggestions > 0 %]
799             <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw  %]
800         [% END %]
801         <table id="suggestions" class="sorted">
802             <thead>
803                 <tr>
804                     <th class="NoSort">&nbsp;</th>
805                     <th class="anti-the">Suggestion</th>
806                     <th>Suggested by - on</th>
807                     <th>Managed by - on</th>
808                     <th>Last modification by - on</th>
809                     <th>Library</th>
810                     <th>Fund</th>
811                     <th>Status</th>
812                 </tr>
813             </thead>
814             <tbody>
815             [% FOREACH suggestion IN suggestions %]
816                 <tr>
817                     <td>[% suggestion.suggestionid | html %]</td>
818                     <td>
819                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show" title="suggestion" >
820                             [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
821                         <br />
822                         [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
823                         [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
824                         [% IF ( suggestion.isbn ) %]; ISBN:<em>[% suggestion.isbn | html %]</em> [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in <em>[% suggestion.publicationyear | html %]</em> [% END %][% IF ( suggestion.place ) %] in <em>[% suggestion.place | html %]</em> [% 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 %]
825                     </td>
826                     <td>
827                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
828                         [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
829                     </td>
830                     <td>
831                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
832                         [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
833                     </td>
834                     <td>
835                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
836                         [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
837                     </td>
838                     <td>
839                         [% Branches.GetName( suggestion.branchcode ) | html %]
840                     </td>
841                     <td>
842                         [% suggestion.fund.budget_name | html %]
843                     </td>
844                     <td>
845                         [% IF    suggestion.STATUS == 'ASKED'     %]Pending
846                         [% ELSIF suggestion.STATUS == 'ACCEPTED'  %]Accepted
847                         [% ELSIF suggestion.STATUS == 'ORDERED'   %]Ordered
848                         [% ELSIF suggestion.STATUS == 'REJECTED'  %]Rejected
849                         [% ELSIF suggestion.STATUS == 'CHECKED'   %]Checked
850                         [% ELSIF suggestion.STATUS == 'AVAILABLE' %]Available
851                         [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
852                             [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
853                         [% ELSE %]Status unknown
854                         [% END %]
855                         [% IF suggestion.reason %]
856                             <br />([% suggestion.reason | html %])
857                         [% END %]
858                     </td>
859                 </tr>
860                 [% END %]
861             </tbody>
862         </table>
863     </div>
864 [% END %]
866 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
867 <div id="editions"><h4>Editions</h4>
868 <table>
869 [% 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 %]
870 [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
871 <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 %]
872   [% IF ( XISBN.publishercode ) %]
873 [% 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 %]
874     [% END %]
875                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
876                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
877 </td>
879 [% END %]
880 </table></div>[% END %]
881 [% END %]
883 [% IF ( LocalCoverImages ) %]
884     <div id="images">
885         [% IF localimages.count %]
886             <p>Click on an image to view it in the image viewer</p>
887             <ul class="thumbnails">
888                 [% FOREACH image IN localimages %]
889                     [% IF image %]
890                         <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
891                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
892                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" />
893                             </a>
894                             [% IF CAN_user_tools_upload_local_cover_images %]
895                                 <a href="#" class="remove"><i class="fa fa-trash"></i> Delete image</a>
896                             [% END %]
897                         </li>
898                     [% END %]
899                 [% END %]
900             </ul>
901         [% ELSE # - No image passed JavaScript takes care %]
902             <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
903         [% END %]
904         [% IF ( CAN_user_tools_upload_local_cover_images ) %]
905             <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>
906             </p>
907         [% END %]
908     </div>
909 [% END %]
911 [% IF ( HTML5MediaEnabled ) %]
912 <div id="html5media">
913           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
914             <p>
915                 [% IF HTML5MediaSet.is_youtube %]
916                     <iframe id="player" type="text/html" width="640" height="360"
917                         src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
918                 [% ELSE %]
919                   <[% HTML5MediaParent | html %] controls preload=none>
920                     <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
921                     [[% HTML5MediaParent | html %] tag not supported by your browser.]
922                   </[% HTML5MediaParent | html %]>
923                 [% END %]
924             </p>
925           [% END %]
926 </div>
927 [% END %]
930 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
931     <div id="NovelistSelect" class="novelistSelect">
932         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
933     </div>
934 [% END %]
936 [% FOREACH tab IN tabs %]
937     <div id="[% tab.id | html %]">
938         [% tab.content | $raw %]
939     </div>
940 [% END %]
942 </div><!-- /bibliodetails -->
944 <div id="export" style="margin-top: 1em;">
945 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
946 <table>  <tr>
947       <th>Save record</th>   </tr>
948     <tr><td> Select download format:    <select name="format">
949         <option value="mods">MODS (XML)</option>
950         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
951         <option value="marcxml">MARCXML</option>
952         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
953         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
954         <input type="submit" name="save" value="Download record" /></td>
955   </tr>
956   <tr><td>
957     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
958   </td></tr>
959 </table>
960 </form>
961 </div>
963 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
964     <div class="modal-dialog modal-lg">
965     <div class="modal-content">
966     <div class="modal-header">
967         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
968         <h3 id="marcPreviewLabel">MARC preview</h3>
969     </div>
970     <div class="modal-body">
971         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
972     </div>
973     <div class="modal-footer">
974         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
975     </div>
976     </div>
977     </div>
978 </div>
980             </main>
981         </div> <!-- /.col-sm-10.col-sm-push-2 -->
983         <div class="col-sm-2 col-sm-pull-10">
984             <aside>
985                 [% INCLUDE 'biblio-view-menu.inc' %]
986             </aside>
987         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
988      </div> <!-- /.row -->
990 [% END %]
992 [% MACRO jsinclude BLOCK %]
993     [% INCLUDE 'catalog-strings.inc' %]
994     [% Asset.js("js/catalog.js") | $raw %]
995     [% Asset.js("js/coce.js") | $raw %]
996     <script>
997         var interface = "[% interface | html %]";
998         var theme = "[% theme | html %]";
999         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1000         function verify_images() {
1001             // Loop over each container in the template which contains covers
1002             $(".cover-slider").each(function(){
1003                 $(this).find(".cover-image").each( function( index ){
1004                     var div = $(this);
1005                     // Find the image in the container
1006                     var img = div.find("img")[0];
1007                     if( $(img).length > 0 ){
1008                         if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1009                             // No image loaded in the container. Remove the slide
1010                             div.remove();
1011                         } else {
1012                             // All slides start hidden. If this is the first one, show it.
1013                             if( index == 0 ){
1014                                 div.show();
1015                             }
1016                             // Check if Amazon image is present
1017                             if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1018                                 w = img.width;
1019                                 h = img.height;
1020                                 if ((w == 1) || (h == 1)) {
1021                                     // Amazon returned single-pixel placeholder
1022                                     // Remove the container
1023                                     div.remove();
1024                                 }
1025                             }
1026                             if( div.attr("id") == "custom-img" ){
1027                                 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1028                                     // No image was loaded via the CustomCoverImages system preference
1029                                     // Remove the container
1030                                     div.remove();
1031                                 }
1032                             }
1033                             if( div.attr("id") == "coce-coverimg" ){
1034                                 // Identify which service's image is being loaded by Coce
1035                                 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1036                                     div.find(".hint").html(_("Coce image from Amazon.com"));
1037                                 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1038                                     div.find(".hint").html(_("Coce image from Google Books"));
1039                                 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1040                                     div.find(".hint").html(_("Coce image from Open Library"));
1041                                 }
1042                             }
1043                         }
1044                     }
1045                 });
1046             });
1048             $(".cover-slider").each(function(){
1049                 var coverSlide = this;
1050                 var coverImages = $(this).find(".cover-image");
1051                 if( coverImages.length > 1 ){
1052                     coverImages.each(function( index ){
1053                         // If more that one image is present, add a navigation link
1054                         // for activating the slide
1055                         var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1056                         if( index == 0 ){
1057                             // Set the first navigation link as active
1058                             $(covernav).addClass("nav-active");
1059                         }
1060                         $(covernav).html("<i class=\"fa fa-circle\"></i>");
1061                         $(coverSlide).append( covernav );
1062                     });
1063                 }
1065                 if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1066                     $(coverSlide).remove();
1067                 } else {
1068                     $(coverSlide).addClass("cover-slides");
1069                 }
1070             });
1072             $("#editions img").each(function(i){
1073                 if ( this.src.indexOf('amazon.com') >= 0 ) {
1074                     w = this.width;
1075                     h = this.height;
1076                     if ((w == 1) || (h == 1)) {
1077                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1078                     } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1079                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1080                     }
1081                 }
1082             });
1083         }
1085         function removeLocalImage(imagenumber) {
1086             var thumbnail = $("#imagenumber-" + imagenumber );
1087             var copy = thumbnail.html();
1088             thumbnail.find("img").css("opacity", ".2");
1089             thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1090             $.ajax({
1091                 url: "/cgi-bin/koha/svc/cover_images?action=delete&imagenumber=" + imagenumber,
1092                 success: function(data) {
1093                     $(data).each( function(i) {
1094                         if ( this.deleted == 1 ) {
1095                             thumbnail.remove();
1096                         } else {
1097                             thumbnail.html( copy );
1098                             alert(_("An error occurred on deleting this image"));
1099                         }
1100                         if ( $('ul.thumbnails > li').length == 0 ) {
1101                             showNoImageMessage();
1102                         }
1103                     });
1104                 },
1105                 error: function(data) {
1106                     thumbnail.html( copy );
1107                     alert(_("An error occurred on deleting this image"));
1108                 }
1109             });
1110         }
1112         function showNoImageMessage() {
1113             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1114             no_images_msg = '<p>' + no_images_msg + '</p>';
1115             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1116                 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>");
1117                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1118             [% END %]
1119             $('#images').html(no_images_msg);
1120         }
1122         [% IF StaffDetailItemSelection %]
1123             function itemSelectionBuildDeleteLink(div) {
1124                 var itemnumbers = new Array();
1125                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1126                     itemnumbers.push($(this).val());
1127                 });
1128                 if (itemnumbers.length > 0) {
1129                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
1130                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1131                     url += '&biblionumber=[% biblionumber | uri %]';
1132                     url += '&src=CATALOGUING';
1133                     $('a.itemselection_action_delete').attr('href', url);
1134                 } else {
1135                     return false;
1136                 }
1137                 return true
1138             }
1140             function itemSelectionBuildModifyLink(div) {
1141                 var itemnumbers = new Array();
1142                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1143                     itemnumbers.push($(this).val());
1144                 });
1145                 if (itemnumbers.length > 0) {
1146                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
1147                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1148                     url += '&biblionumber=[% biblionumber | uri %]';
1149                     url += '&src=CATALOGUING';
1150                     $('a.itemselection_action_modify').attr('href', url);
1151                 } else {
1152                     return false;
1153                 }
1154                 return true;
1155             }
1157             function itemSelectionBuildActionLinks(tab) {
1158                 var div = $("#" + tab);
1159                 var delete_link_ok = itemSelectionBuildDeleteLink(div);
1160                 var modify_link_ok = itemSelectionBuildModifyLink(div);
1161                 if (modify_link_ok || delete_link_ok) {
1162                     $('.itemselection_actions', div).show();
1163                 } else {
1164                     $('.itemselection_actions', div).hide();
1165                 }
1166             }
1168             $(document).ready(function() {
1169                 $('table.items_table').each(function() {
1170                     var div = $(this).parent().attr("id");
1171                     itemSelectionBuildActionLinks(div);
1172                 });
1174                 $("input[name='itemnumber'][type='checkbox']").change(function() {
1175                     var div = $(this).parents('table').parent().parent().attr("id");
1176                     itemSelectionBuildActionLinks(div);
1177                 });
1179                 $(".SelectAll").on("click",function(e){
1180                     e.preventDefault();
1181                     var tab = $(this).data("tab");
1182                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1183                     itemSelectionBuildActionLinks(tab);
1184                 });
1186                 $(".ClearAll").on("click",function(e){
1187                     e.preventDefault();
1188                     var tab = $(this).data("tab");
1189                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1190                     itemSelectionBuildActionLinks(tab);
1191                 });
1192             });
1193         [% END %]
1195         $(document).ready(function() {
1196             $('#bibliodetails').tabs();
1197         [% IF count == 0 and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %]
1198             $('#bibliodetails').tabs("option", "active", $('#media_tab').index() );
1199         [% END %]
1200             $('#search-form').focus();
1201             $('.thumbnails > li > .remove').click(function() {
1202                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1204                 if ( result == true ) {
1205                     var imagenumber = $(this).parent().attr('id').split('-')[1];
1206                     removeLocalImage(imagenumber);
1207                 }
1209                 return false;
1210             });
1211             [% IF ( IntranetCoce && CoceProviders ) %]
1212                 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1213             [% END %]
1215             $("body").on("click",".previewMARC", function(e){
1216                 e.preventDefault();
1217                 var page = $(this).attr("href");
1218                 $("#marcPreview .modal-body").load(page + " table");
1219                 $('#marcPreview').modal({show:true});
1220             });
1221             $("#marcPreview").on("hidden.bs.modal", function(){
1222                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1223             });
1224             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1225                 novSelect.loadContentForQuery({
1226                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1227                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1228                     version : '2.1'
1229                 },
1230                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1231                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1232                 function(d){
1233                     if ( d.length > 0 ){ //If no content
1234                         $(".NovelistSelect").show();
1235                     }
1236                  });
1237              [% END %]
1238              $(".print-label").on("click", function(e){
1239                 e.preventDefault();
1240                 link = $(this).attr("href");
1241                 openWindow(link,"Print spine label",400,400);
1242              });
1243              $(".cover-slider").on("click",".cover-nav", function(e){
1244                  e.preventDefault();
1245                 var cover_slider = $(this).parent();
1246                 // Adding click handler for cover image navigation links
1247                 var num = $(this).data("num");
1248                 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1249                 $(this).addClass("nav-active");
1250                 $(cover_slider).find(".cover-image").hide();
1251                 $(cover_slider).find(".cover-image").eq( num ).show();
1252              });
1253         });
1255         $(window).load(function() {
1256             verify_images();
1257         });
1258     </script>
1259     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1260         <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1261     [% END %]
1262     [% INCLUDE 'datatables.inc' %]
1263     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1264     [% INCLUDE 'columns_settings.inc' %]
1265     [% Asset.js("js/browser.js") | $raw %]
1266     [% Asset.js("js/table_filters.js") | $raw %]
1267     <script>
1268         var browser;
1269         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1270         browser.show();
1272         $(document).ready(function() {
1273             var ids = ['holdings_table', 'otherholdings_table'];
1274             var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json')  | $raw %] ];
1275             var has_images = ["[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]"];
1276             for (var i in ids) {
1277                 var id = ids[i];
1278                 if ( !has_images[i] ) { // remove the cover_image column
1279                     columns_settings.splice(1,1);
1280                 }
1281                 var dt_parameters = {
1282                     'sDom': 't',
1283                     'bPaginate': false,
1284                     'bAutoWidth': false,
1285                     "bKohaColumnsUseNames": true,
1286                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1287                 };
1288                 var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters');
1289             }
1291             [% IF Koha.Preference('AcquisitionDetails') %]
1292                 var columns_settings = [% TablesSettings.GetColumns('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
1293                 var acquisitiondetails_table = KohaTable("orders", {
1294                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1295                     'bPaginate': false,
1296                     'bAutoWidth': false,
1297                     "aaSorting": [[ 4, "desc" ]],
1298                 }, columns_settings);
1299             [% END %]
1301             [% IF suggestions.count %]
1302                 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1303                     "aoColumnDefs": [
1304                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
1305                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
1306                     ],
1307                     "sPaginationType": "full"
1308                 }));
1309             [% END %]
1310         });
1311     </script>
1312 [% END %]
1313 [% INCLUDE 'intranet-bottom.inc' %]