Bug 11529: Clean up subtitle usage
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-basket.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Asset %]
5 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %]
6
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your cart</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %]<style>.item-status, .dt-buttons { display: inline; } @media print { body { height: 99%; } }</style>[% END %]
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='basket' %]
13     <div class="main">
14         <div class="container-fluid">
15             <div class="row-fluid">
16                 <div class="span12">
17                     <div id="userbasket">
18                         <h2>Your cart</h2>
19                             <div id="toolbar" class="toolbar noprint">
20                                 [% IF ( verbose ) %]
21                                     <a href="opac-basket.pl" class="brief">Brief display</a>
22                                 [% ELSE %]
23                                     <a href="opac-basket.pl" class="detail">More details</a>
24                                 [% END %]
25                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
26                                     <a class="send" href="opac-basket.pl">Send</a>
27                                 [% END %]
28                                 <a class="download" href="opac-basket.pl">Download</a>
29                                 <a class="empty" href="opac-basket.pl">Empty and close</a>
30                                 <a class="hide close" href="opac-basket.pl">Hide window</a>
31                                 [% IF ( verbose ) %]
32                                     <a class="print-large" href="#">Print</a>
33                                 [% END %]
34                             </div>
35
36                             <div id="selections-toolbar" class="toolbar noprint">
37                                 <a id="CheckAll" href="#">Select all</a>
38                                 <a id="CheckNone" href="#">Clear all</a>
39                                 <span class="sep">|</span>
40                                 <span class="links" id="tag_hides">
41                                     <span id="selections">Select titles to: </span>
42                                     <a href="#" class="deleteshelf disabled">Remove</a>
43                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
44                                         [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
45                                             <a href="#" class="newshelf disabled">Add to a list</a>
46                                         [% END %]
47                                         [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
48                                             <a href="#" class="hold disabled">Place hold</a>
49                                         [% END %]
50                                         [% IF ( TagsInputEnabled && loggedinusername ) %]
51                                             <a href="#" id="tagsel_tag" class="disabled">Tag</a>
52                                         [% END %]
53                                     [% END # / IF opacuserlogin %]
54                                 </span>
55                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
56                                 <span id="tagsel_form" style="display:none">
57                                     <label for="tagsel_new">New tag:</label>
58                                     <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
59                                     <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add">
60                                     <a href="#" id="tagsel_cancel">Cancel</a>
61                                 </span>
62                                 [% END %]
63                             </div>
64
65                         [% IF ( verbose ) %]
66                             <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
67                                 [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
68                                     <h3>
69                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
70                                                 [% BIBLIO_RESULT.title | html %]
71                                                 [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl | html %] [% END %][% END %]
72                                                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author | html %][% END %]
73                                     </h3>
74                                     <!-- COinS / Openurl -->
75                                     <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
76
77                                     <table class="table">
78                                         [% IF ( BIBLIO_RESULT.isbn ) %]
79                                             <tr>
80                                                 <th scope="row">ISBN</th>
81                                                 <td>[% BIBLIO_RESULT.isbn | html %]</td>
82                                             </tr>
83                                         [% END %]
84
85                                         [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
86                                         <tr>
87                                             <th scope="row">Author(s)</th>
88                                             <td>
89                                                [% IF ( BIBLIO_RESULT.author ) %]
90                                                    <p>[% BIBLIO_RESULT.author | html %]</p>
91                                                [% END %]
92                                                [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
93                                                    [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
94                                                    <p> [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
95                                                           [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]
96                                                               [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]
97                                                        [% END %]
98                                                    </p>
99                                                    [% END %]
100                                                [% END %]
101                                             </td>
102                                         </tr>
103                                         [% END %]
104
105                                         [% IF ( BIBLIO_RESULT.publishercode ) %]
106                                             <tr>
107                                                 <th scope="row">Publisher</th>
108                                                 <td>[% BIBLIO_RESULT.place | html %] [% BIBLIO_RESULT.publishercode | html %] [% BIBLIO_RESULT.publicationyear | html %]
109                                                 </td>
110                                             </tr>
111                                         [% END %]
112
113                                         [% IF ( BIBLIO_RESULT.pages ) %]
114                                             <tr>
115                                                 <th scope="row">Details</th>
116                                                 <td>[% BIBLIO_RESULT.pages | html %] [% BIBLIO_RESULT.illus | html %] [% BIBLIO_RESULT.item('size') | html %]</td>
117                                             </tr>
118                                         [% END %]
119
120                                         [% IF ( BIBLIO_RESULT.seriestitle ) %]
121                                         <tr>
122                                             <th scope="row">Collection</th>
123                                             <td> [% BIBLIO_RESULT.seriestitle | html %]</td>
124                                         </tr>
125                                         [% END %]
126
127                                         [% IF ( BIBLIO_RESULT.MARCSUBJCTS ) %]
128                                         <tr>
129                                             <th scope="row">Subject(s)</th>
130                                             <td>[% FOREACH MARCSUBJCT IN BIBLIO_RESULT.MARCSUBJCTS %]
131                                                    <p> [% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
132                                                         [% MARCSUBJECT_SUBFIELDS_LOO.separator | html %][% MARCSUBJECT_SUBFIELDS_LOO.value | html %][% END %]
133                                                    </p>
134                                                 [% END %]</td>
135                                         </tr>
136                                         [% END %]
137
138                                         [% IF ( BIBLIO_RESULT.copyrightdate ) %]
139                                             <tr><th scope="row">Copyright</th>
140                                                 <td> [% BIBLIO_RESULT.copyrightdate | html %]</td>
141                                             </tr>
142                                         [% END %]
143
144                                         [% IF ( BIBLIO_RESULT.MARCNOTES ) %]
145                                             <tr>
146                                                 <th scope="row">Notes</th>
147                                                 <td>
148                                                 [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %]
149                                                     <p>
150                                                     [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
151                                                         - <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
152                                                     [% ELSE %]
153                                                         - [% MARCNOTE.marcnote | html %]
154                                                     [% END %]
155                                                     </p>
156                                                 [% END %]
157                                                 </td>
158                                             </tr>
159                                         [% END %]
160
161                                         [% IF ( BIBLIO_RESULT.unititle ) %]
162                                             <tr>
163                                                 <th scope="row">Unified title</th>
164                                                 <td> [% BIBLIO_RESULT.unititle | html %]</td>
165                                             </tr>
166                                         [% END %]
167
168                                         [% IF ( BIBLIO_RESULT.serial ) %]
169                                             <tr>
170                                                 <th scope="row">Serial</th>
171                                                 <td>[% BIBLIO_RESULT.serial | html %]</td>
172                                             </tr>
173                                         [% END %]
174
175                                         [% IF ( BIBLIO_RESULT.dewey ) %]
176                                             <tr>
177                                                 <th scope="row">Dewey</th>
178                                                 <td>[% BIBLIO_RESULT.dewey | html %]</td>
179                                             </tr>
180                                         [% END %]
181
182                                         [% IF ( BIBLIO_RESULT.classification ) %]
183                                             <tr>
184                                                 <th scope="row">Classification</th>
185                                                 <td> [% BIBLIO_RESULT.classification | html %]</td>
186                                             </tr>
187                                         [% END %]
188
189                                         [% IF ( BIBLIO_RESULT.lccn ) %]
190                                             <tr>
191                                                 <th scope="row">LCCN</th>
192                                                 <td> [% BIBLIO_RESULT.lccn | html %]</td>
193                                             </tr>
194                                         [% END %]
195
196                                         [% IF BIBLIO_RESULT.MARCURLS.size %]
197                                             <tr>
198                                                 <th scope="row">URL(s)</th>
199                                                 <td>
200                                                    [% FOREACH MARCurl IN BIBLIO_RESULT.MARCURLS %]
201                                                         [% IF MARCurl.part %]<p>[% MARCurl.part | html %]</p>[% END %]
202
203                                                         [% IF OPACURLOpenInNewWindow %]
204                                                             <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">[% MARCurl.linktext | html %]</a>
205                                                         [% ELSE %]
206                                                             <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">[% MARCurl.linktext | html %]</a>
207                                                         [% END %]
208
209                                                         [% IF MARCurl.notes %][% FOREACH note IN MARCurl.notes %]<p>[% note.note | html %]</p>[% END %][% END %]
210                                                     [% END %]
211                                                 </td>
212                                             </tr>
213                                         [% END %]
214
215                                         <tr>
216                                             <th scope="row">Location(s) (Status)</th>
217                                             <td>
218                                                 [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]
219                                                     <ul>
220                                                         [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
221                                                             <li>
222                                                                 <strong>[% ITEM_RESULT.branchname | html %]</strong>
223                                                                 [% IF ( ITEM_RESULT.location_opac ) %]<span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>[% END %]
224                                                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
225                                                                     ([% ITEM_RESULT.itemcallnumber | html %])
226                                                                 [% END %]
227                                                                 ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
228                                                             </li>
229                                                         [% END %]
230                                                     </ul>
231                                                 [% ELSE %]
232                                                     This record has no items.
233                                                 [% END %]
234                                             </td>
235                                         </tr>
236                                     </table>
237                                 [% END # / FOREACH BIBLIO_RESULT %]
238                             </form>
239
240                         [% ELSE %]
241
242                             <form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
243                                 <table id="itemst" class="table table-bordered table-striped">
244                                     <thead>
245                                         <tr>
246                                             <th class="noprint">&nbsp;</th>
247                                             <th>Title</th>
248                                             <th>Author</th>
249                                             <th>Year</th>
250                                             <th>Location (Status)</th>
251                                         </tr>
252                                     </thead>
253                                     <tbody>
254                                     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
255                                         <tr>
256                                                 <td class="noprint">
257                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
258                                                 </td>
259                                             <td>
260                                                 <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest | html %]',[% BIBLIO_RESULT.biblionumber | html %])">[% BIBLIO_RESULT.title | html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl | html %][% END %][% END %]</a>
261                                                 <!-- COinS / Openurl -->
262                                                 <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
263                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
264                                                 <span id="newtag[% BIBLIO_RESULT.biblionumber | html %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
265                                                 [% END %]
266                                             </td>
267                                             <td>[% BIBLIO_RESULT.author | html %]</td>
268                                             <td>
269                                                 [% IF ( BIBLIO_RESULT.publicationyear ) %]
270                                                     [% BIBLIO_RESULT.publicationyear | html %]
271                                                 [% ELSE %]
272                                                     [% BIBLIO_RESULT.copyrightdate | html %]
273                                                 [% END %]
274                                             </td>
275                                             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
276                                                 <li>
277                                                     [% ITEM_RESULT.branchname | html %]
278                                                     [% IF ( ITEM_RESULT.location_opac ) %]<span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>[% END %]
279                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
280                                                         ([% ITEM_RESULT.itemcallnumber | html %])
281                                                     [% END %]
282                                                     ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
283                                                 </li>
284                                                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
285                                             </td>
286                                         </tr>
287                                     [% END # / FOREACH BIBLIO_RESULT %]
288                                     </tbody>
289                                 </table>
290                             </form>
291                         [% END # / verbose %]
292
293                             <form name="myform" action="opac-basket.pl" method="get">
294                                 <input type="hidden" name="records" id="records" />
295                             </form>
296
297                 </div> <!-- / #userbasket -->
298             </div> <!-- / .span10 -->
299         </div> <!-- / .row-fluid -->
300     </div> <!-- / .container-fluid -->
301 </div> <!-- / .main -->
302
303 [% INCLUDE 'opac-bottom.inc' %]
304
305 [% BLOCK jsinclude %]
306     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
307         [% INCLUDE 'datatables.inc' %]
308         <script>
309             //<![CDATA[
310
311             [% IF ( TagsInputEnabled && loggedinusername ) %]
312                 function tagSelected() {
313                     var bibs = document.getElementById('records').value;
314                     if (bibs) {
315                         $("#tagsel_tag").hide();
316                         $("#tag_hides").hide();
317                         $("#tagsel_form").show();
318                     } else {
319                         alert(MSG_NO_RECORD_SELECTED);
320                     }
321                 }
322
323                 function tagCanceled() {
324                     $("#tagsel_form").hide();
325                     $("#tagsel_tag").show();
326                     $("#tag_hides").show();
327                     $("#tagsel_new").val("");
328                     $(".tagstatus").empty().hide();
329                 }
330
331                 function tagAdded() {
332                     var checkedBoxes = $("input:checkbox:checked");
333                     if (!$(checkedBoxes).size()) {
334                         alert(MSG_NO_RECORD_SELECTED);
335                         return false;
336                     }
337
338                     var tag = $("#tagsel_new").val();
339                     if (!tag || (tag == "")) {
340                         alert(MSG_NO_TAG_SPECIFIED);
341                         return false;
342                     }
343
344                     var bibs = [];
345                     for (var i = 0; i < $(checkedBoxes).size(); i++) {
346                         var box = $(checkedBoxes).get(i);
347                         bibs[i] = $(box).val();
348                     }
349
350                     KOHA.Tags.add_multitags_button(bibs, tag);
351                     return false;
352                 }
353             [% END # / TagsInputEnabled && loggedinusername %]
354
355             $(document).ready(function(){
356                 $(".brief").click(function(e){
357                     e.preventDefault();
358                     showLess();
359                 });
360
361                 $(".detail").click(function(e){
362                     e.preventDefault();
363                     showMore();
364                 });
365
366                 $(".send").click(function(e){
367                     e.preventDefault();
368                     sendBasket();
369                 });
370
371                 $(".download").click(function(e){
372                     e.preventDefault();
373                     downloadBasket();
374                 });
375
376                 $(".empty").click(function(e){
377                     e.preventDefault();
378                     delBasket();
379                 });
380
381                 $(".deleteshelf").click(function(e){
382                     e.preventDefault();
383                     delSelRecords();
384                 });
385
386                 $(".newshelf").click(function(e){
387                     e.preventDefault();
388                     addSelToShelf();
389                 });
390
391                 $(".hold").click(function(e){
392                     e.preventDefault();
393                     holdSel();
394                 });
395
396                 $("#tagsel_tag").click(function(e){
397                     e.preventDefault();
398                     tagSelected();
399                 });
400
401                 $("#tagsel_button").click(function(e){
402                     e.preventDefault();
403                     tagAdded();
404                 });
405
406                 $("#tagsel_cancel").click(function(e){
407                     e.preventDefault();
408                     tagCanceled();
409                 });
410
411                 $("#CheckAll").click(function(){
412                     var checked = [];
413                     $(".checkboxed").checkCheckboxes("*", true).each(
414                         function() {
415                             selRecord(this.value,true);
416                         }
417                     );
418                     enableCheckboxActions();
419                     return false;
420                 });
421
422                 $("#CheckNone").click(function(){
423                     var checked = [];
424                     $(".checkboxed").unCheckCheckboxes("*",true).each(
425                         function() {
426                             selRecord(this.value,false);
427                         }
428                     );
429                     enableCheckboxActions();
430                     return false;
431                 });
432
433                 var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
434                     "order": [[ 1, "asc" ]],
435                     "columnDefs": [
436                       { "targets": [ 0,-1 ], "sortable": false, "searchable": false }
437                     ],
438                     "columns": [
439                         null,
440                         { "type": "anti-the" },
441                         null,
442                         null,
443                         null
444                     ],
445
446                 }));
447
448                 var buttons = new $.fn.dataTable.Buttons(itemst, {
449                      buttons: [
450                         'print'
451                     ]
452                 }).container().appendTo($('#toolbar'));
453
454                 $(".cb").change(function(){
455                     selRecord( $(this).val(), $(this).prop("checked") );
456                     enableCheckboxActions();
457                     return false;
458                 });
459                 enableCheckboxActions();
460             });
461
462             function enableCheckboxActions(){
463                 // Enable/disable controls if checkboxes are checked
464                 var checkedBoxes = $(".checkboxed input:checkbox:checked");
465                 if ($(checkedBoxes).size()) {
466                   $("#selections").html(_("With selected titles: "));
467                   $("#selections-toolbar .links a").removeClass("disabled");
468                 } else {
469                   $("#selections").html(_("Select titles to: "));
470                   $("#selections-toolbar .links a").addClass("disabled");
471                 }
472             }
473             //]]>
474         </script>
475 [% END # / BLOCK jsinclude %]