Bug 8236: (QA followup) Tweak language, fix whitespace error
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shelves.tt
1 [% USE Koha %]
2 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
3 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
4
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]Your lists[% END %]</title>[% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-userlists' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-lists' bodyclass='scrollto' %][% END %]
10
11 [% BLOCK list_permissions %]
12     <li>
13         <label for="allow_add">Permissions: </label>
14         <select name="allow_add" id="allow_add">
15             [% IF allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
16             [% IF allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
17         </select>
18         &nbsp;<span>anyone else to add entries. (The owner of a list is always allowed to add entries, but needs permission to remove.)</span>
19     </li>
20     <li>
21         <label>&nbsp;</label>
22         <select name="allow_delete_own" id="allow_delete_own">
23             [% IF allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
24             [% IF allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
25         </select>
26         &nbsp;<span>anyone to remove his own contributed entries.</span>
27     </li>
28     <li>
29         <label>&nbsp;</label>
30         <select name="allow_delete_other" id="allow_delete_other">
31             [% IF allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
32             [% IF allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
33         </select>
34         &nbsp;<span>anyone to remove other contributed entries.</span>
35     </li>
36 [% END %]
37 [% BLOCK remove_share %]
38     [%# Use: add parameter shelfnumber and add end form tag %]
39     <form action="opac-shelves.pl" method="post" class="form-inline">
40         <input type="hidden" name="shelves" value="1" />
41         <input type="hidden" name="display" value="privateshelves" />
42         <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);" value="Remove share" />
43 [% END %]
44
45 [% INCLUDE 'masthead.inc' %]
46 <div class="main">
47     <ul class="breadcrumb noprint">
48         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
49         [% IF ( loggedinusername ) %]
50             <li><a href="/cgi-bin/koha/opac-user.pl">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</a> <span class="divider">&rsaquo;</span></li>
51         [% END %]
52
53         [% IF ( category1 ) %]
54             [% IF ( viewshelf || edit ) %]
55                 <li><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
56             [% ELSE %]
57                 <li>Your lists</li>
58             [% END %]
59         [% ELSIF ( category2 ) %]
60             [% IF ( viewshelf || edit ) %]
61                 <li><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
62             [% ELSE %]
63                 <li>Public lists</li>
64             [% END %]
65         [% ELSIF ( showprivateshelves ) %]
66             [% IF ( viewshelf || edit ) %]
67                 <li><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
68             [% ELSE %]
69                 <li>Your lists</li>
70             [% END %]
71         [% ELSIF ( showpublicshelves ) %]
72             [% IF ( viewshelf || edit || shelves ) %]
73                 <li><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
74             [% ELSE %]
75                 <li>Public lists</li>
76             [% END %]
77         [% END %]
78
79         [% IF ( viewshelf ) %]
80             <li><span class="divider">&rsaquo;</span> Contents of <i>[% shelfname | html %]</i></li>
81         [% END %]
82
83         [% IF ( shelves ) %]
84             <li><span class="divider">&rsaquo;</span> Create new list</li>
85         [% END %]
86
87         [% IF ( edit ) %]
88             <li><span class="divider">&rsaquo;</span> Edit list <i>[% shelfname | html %]</i></li>
89         [% END %]
90
91     </ul> <!-- / .breadcrumb -->
92
93     <div class="container-fluid">
94         <div class="row-fluid">
95             [% IF ( OpacNav||loggedinusername ) && !print %]
96                 <div class="span2">
97                     <div id="navigation">
98                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
99                     </div>
100                 </div>
101             [% END %]
102
103             [% IF ( OpacNav||loggedinusername ) %]
104                 <div class="span10">
105             [% ELSE %]
106                 <div class="span12">
107             [% END %]
108                 <div id="usershelves" class="maincontent">
109
110                     [% IF ( paramsloop ) %]
111                         [% FOREACH paramsloo IN paramsloop %]
112                             [% IF ( paramsloo.already ) %]<div class="alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
113                             [% IF ( paramsloo.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</div>[% END %]
114                             [% IF ( paramsloo.status ) %]<div class="alert">[% paramsloo.string %]</div>[% END %]
115                             [% IF ( paramsloo.nobarcode ) %]<div class="alert">ERROR: No barcode given.</div>[% END %]
116                             [% IF ( paramsloo.noshelfnumber ) %]<div class="alert">ERROR: No shelfnumber given.</div>[% END %]
117                             [% IF ( paramsloo.need_confirm ) %]
118                               <div class="alert">
119                                 The list <i>[% paramsloo.need_confirm %]</i> is not empty.
120                                 <br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]entries[% END %].
121                                 <br />Use the "Confirm" button below to confirm deletion.
122                              </div>
123                             [% END %]
124                             [% IF ( paramsloo.nopermission ) %]
125                               <div class="alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission |html%].</div>
126                             [% END %]
127                             [% IF ( paramsloo.failgetitem ) %]
128                               <div class="alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
129                             [% END %]
130                             [% IF ( paramsloo.duplicatebiblio ) %]
131                               <div class="alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div>
132                             [% END %]
133                             [% IF ( paramsloo.delete_ok ) %]
134                               <div class="alert alert-info">List [% paramsloo.delete_ok |html %] Deleted.</div>
135                             [% END %]
136                             [% IF ( paramsloo.delete_fail ) %]
137                               <div class="alert alert-info">ERROR: Database error. Delete (list number [% paramsloo.delete_fail |html %]) failed.</div>
138                             [% END %]
139                             [% IF ( paramsloo.unrecognized ) %]
140                               <div class="alert alert-info">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
141                             [% END %]
142                             [% IF ( paramsloo.modifyfailure) %]
143                               <div class="alert alert-info">ERROR: Shelf could not be renamed to [% paramsloo.modifyfailure %]. This name may not be unique for this type of list. Please check.</div>
144                             [% END %]
145                             [% IF ( paramsloo.nothingdeleted) %]
146                               <div class="alert alert-info">Warning: You could not delete any selected items from this shelf.</div>
147                             [% END %]
148                             [% IF ( paramsloo.somedeleted) %]
149                               <div class="alert alert-info">Warning: You could not delete all selected items from this shelf.</div>
150                             [% END %]
151                         [% END # / FOREACH paramsloop %]
152                     [% END # / IF paramsloop %]
153
154                     [% IF ( viewshelf ) %]<!--  Viewing a particular shelf -->
155                         <h3>
156                             [% shelfname |html %]
157                             <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-shelves.pl?rss=1&amp;viewshelf=[% shelfnumber %]" class="rss-list-link noprint">
158                                 <img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this list" title="Subscribe to this list" border="0" class="rsssearchicon"/>
159                             </a>
160                         </h3>
161
162                         [% IF ( itemsloop ) %]
163                             <div id="toolbar" class="toolbar clearfix">
164                                 <div class="list-actions">
165                                     <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a> <span class="sep">|</span>
166                                     <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber | html %]&amp;showprivateshelves=[% showprivateshelves | html %]" class="download" data-toggle="modal" data-target="#modalWin">Download list</a>
167
168                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
169                                         <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>
170                                     [% END %]
171
172                                     <a class="print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]&sort=[% sort %]&direction=[% direction |uri %]&print=1">Print list</a>
173
174                                     [% IF ( manageshelf ) %]
175                                         <span class="sep">|</span>
176                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
177                                             <input type="hidden" name="op" value="modif" />
178                                             <input type="hidden" name="display" value="viewshelf" />
179                                             <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />
180                                             <input type="submit" class="editshelf" value="Edit list" />
181                                         </form>
182
183                                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
184                                             <input type="hidden" value="1" name="shelves"/>
185                                             <input type="hidden" value="1" name="DEL-[% shelfnumber | html %]"/>
186                                             [% IF ( showprivateshelves ) %]
187                                                 <input type="hidden" name="display" value="privateshelves"/>
188                                             [% END %]
189                                             <input type="submit" class="deleteshelf" value="Delete list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
190                                         </form>
191                                         [% IF showprivateshelves && Koha.Preference('OpacAllowSharingPrivateLists') %]
192                                             <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelfnumber | html %]" class="">Share list</a>
193                                         [% END %]
194                                     [% ELSIF showprivateshelves # not manageshelf and private means shared %]
195                                         [% INCLUDE remove_share %]
196                                             <input type="hidden" name="REMSHR-[% shelfnumber | html %]" value="1" />
197                                         </form>
198                                     [% END # / IF manageshelf %]
199                                 </div>
200
201                                 <form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form" class="form-inline sort_by pull-right">
202                                     <input type="hidden" name="viewshelf" value="[% shelfnumber | html %]" />
203
204                                     <label for="sort">Sort by: </label>
205                                     <select name="sort" id="sort" class="resort" onchange="$('#sorting-form').submit()">
206                                         <option value="">Default sorting</option>
207
208                                         [% IF sort == 'author' %]
209                                             <option value="author" selected="selected">Author</option>
210                                         [% ELSE %]
211                                             <option value="author">Author</option>
212                                         [% END %]
213
214                                         [% IF sort == 'title' %]
215                                             <option value="title" selected="selected">Title</option>
216                                         [% ELSE %]
217                                             <option value="title">Title</option>
218                                         [% END %]
219
220                                         [% IF sort == 'itemcallnumber' %]
221                                             <option value="itemcallnumber" selected="selected">Call number</option>
222                                         [% ELSE %]
223                                             <option value="itemcallnumber">Call number</option>
224                                         [% END %]
225
226                                         [% IF sort == 'copyrightdate' %]
227                                             <option value="copyrightdate" selected="selected">Copyright date</option>
228                                         [% ELSE %]
229                                             <option value="copyrightdate">Copyright date</option>
230                                         [% END %]
231                                     </select>
232
233                                     <select name="direction" class="resort" onchange="$('#sorting-form').submit()">
234                                         [% IF direction == 'asc' %]
235                                             <option value="asc" selected="selected">Ascending</option>
236                                         [% ELSE %]
237                                             <option value="asc">Ascending</option>
238                                         [% END %]
239
240                                         [% IF direction == 'desc' %]
241                                             <option value="desc" selected="selected">Descending</option>
242                                         [% ELSE %]
243                                             <option value="desc">Descending</option>
244                                         [% END %]
245                                     </select>
246
247                                     <input type="submit" class="btn btn-small" id="sort-submit" value="Resort list" />
248                                 </form>
249
250                             </div> <!-- / #toolbar -->
251
252                             <div id="selections-toolbar" class="toolbar noprint">
253                                 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
254                                 <span class="links">
255                                     <span id="selections">Select titles to: </span>
256                                     [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
257                                         <span id="placehold"></span>
258                                     [% END %]
259                                     [% IF ( TagsInputEnabled && loggedinusername ) %]
260                                         <span id="addtags">
261                                           <a id="tagsel_tag" href="#" class="disabled">Tag</a>
262                                         </span>
263                                         <span id="tagsel_form" style="display:none">
264                                           <label for="tagsel_new">New tag(s), separated by a comma:</label>
265                                           <input name="tagsel_new" id="tagsel_new" maxlength="100" />
266                                           <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="tagsel_button" type="submit" value="Add" />
267                                           <a href="#" id="tagsel_cancel">Cancel</a>
268                                         </span>
269                                     [% END %]
270                                     [% IF ( loggedinusername && allowremovingitems ) %]
271                                         <span id="removeitems"></span>
272                                     [% END %]
273                                 </span> <!-- / .links -->
274                             </div> <!-- / #selections-toolbar -->
275
276                             <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
277                                 [% IF ( manageshelf ) %]
278                                     <input type="hidden" name="viewshelf" value="[% shelfnumber | html %]" />
279                                     <input type="hidden" name="modifyshelfcontents" value="1" />
280                                 [% END %]
281                                 <div class="searchresults">
282                                     <table id="listcontents" class="table">
283                                         <tbody>
284                                         [% FOREACH itemsloo IN itemsloop %]
285                                             <tr>
286                                                 <td class="select selectcol"><input type="checkbox" class="cb" name="REM-[% itemsloo.biblionumber %]" value="[% itemsloo.biblionumber %]" /></td>
287                                                 [% UNLESS ( item_level_itypes ) %]
288                                                     <td>
289                                                         [% UNLESS ( noItemTypeImages ) %]
290                                                             <img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
291                                                         [% END %]
292                                                         [% itemsloo.description %]
293                                                     </td>
294                                                 [% END %]
295                                                 <td>
296                                                     <div class="coverimages">
297                                                         <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
298                                                             [% IF ( OPACLocalCoverImages ) %]
299                                                                 <span title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
300                                                             [% END %]
301
302                                                             [% IF ( OPACAmazonCoverImages ) %]
303                                                                 [% IF ( itemsloo.normalized_isbn ) %]
304                                                                     <span title="[% SEARCH_RESULT.biblionumber %]" id="amazon-thumbnail[% loop.count %]"><img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" /></span>
305                                                                 [% ELSE %]
306                                                                     <span class="no-image">No cover image available</span>
307                                                                 [% END %]
308                                                             [% END %]
309
310                                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
311                                                                 [% IF ( using_https ) %]
312                                                                     <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" /></span>
313                                                                 [% ELSE %]
314                                                                     <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="http://www.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" /></span>
315                                                                 [% END %]
316                                                             [% END %]
317
318                                                             [% IF ( GoogleJackets ) %]
319                                                                 [% IF ( itemsloo.normalized_isbn ) %]
320                                                                     <div title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
321                                                                 [% ELSE %]
322                                                                     <span class="no-image">No cover image available</span>
323                                                                 [% END %]
324                                                             [% END %]
325
326                                                             [% IF OpenLibraryCovers %]
327                                                                 [% IF itemsloo.normalized_isbn %]
328                                                                     <span title="[% itemsloo.biblionumber %]" class="[% itemsloo.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>
329                                                                 [% ELSE %]
330                                                                     <span class="no-image">No cover image available</span>
331                                                                 [% END %]
332                                                             [% END %]
333
334                                                         </a> <!-- / .p1 -->
335                                                         [% IF ( BakerTaylorEnabled ) %]
336                                                             [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %]
337                                                             [% IF ( bt_id ) %]
338                                                                 <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
339                                                             [% ELSE %]
340                                                                 <span class="no-image">No cover image available</span>
341                                                             [% END %]
342                                                         [% END %]
343                                                     </div>
344                                                     [% IF ( itemsloo.XSLTBloc ) %]
345                                                         [% itemsloo.XSLTBloc %]
346                                                     [% ELSE %]
347
348                                                         [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
349                                                             <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
350                                                         [% ELSE %]
351                                                             [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
352                                                                 <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
353                                                             [% ELSE %]
354                                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
355                                                             [% END %]
356                                                         [% END %]
357
358                                                         [% IF ( itemsloo.title ) %]
359                                                             [% itemsloo.title |html %]
360                                                         [% ELSE %]
361                                                             No title
362                                                         [% END %]
363
364                                                         [% FOREACH subtitl IN itemsloo.subtitle %]
365                                                             [% subtitl.subfield|html %]
366                                                         [% END %]
367                                                         </a>
368
369                                                         [% IF ( itemsloo.author ) %]
370                                                             by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author %]</a>
371                                                         [% ELSE %]
372                                                             &nbsp;
373                                                         [% END %]
374
375                                                         <span class="results_summary">
376                                                             <span class="label">Publication:</span>
377                                                             [% IF ( itemsloo.place ) %]
378                                                                 [% itemsloo.place %]
379                                                             [% END %]
380                                                             [% IF ( itemsloo.publishercode ) %]
381                                                                 [% itemsloo.publishercode|html %]
382                                                             [% END %]
383                                                             [% IF ( itemsloo.publicationyear ) %]
384                                                                 [% itemsloo.publicationyear %]
385                                                             [% ELSE %]
386                                                                 [% IF ( itemsloo.copyrightdate ) %]
387                                                                     [% itemsloo.copyrightdate %]
388                                                                 [% END %]
389                                                             [% END %]
390                                                             [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
391                                                             [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
392                                                             [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') %][% END %]
393                                                         </span>
394                                                         <span class="results_summary">
395                                                             <span class="label">Holdings:</span>
396                                                             [% IF ( itemsloo.ITEM_RESULTS ) %]
397                                                                 [% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
398                                                                     [% ITEM_RESULT.homebranch %]
399                                                                     [% IF ( ITEM_RESULT.location_opac ) %]
400                                                                         , [% ITEM_RESULT.location_opac %]
401                                                                     [% END %]
402                                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
403                                                                         ([% ITEM_RESULT.itemcallnumber %])
404                                                                             [% IF ( loop.last ) %].[% ELSE %],[% END %]
405                                                                     [% END %]
406                                                                 [% END %]
407                                                             [% ELSE %]
408                                                                 This record has no items.
409                                                             [% END %]
410                                                         </span>
411                                                     [% END # / IF itemsloo.XSLTBloc %]
412
413                                                     [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
414                                                         <div class="results_summary tags">
415                                                             <span class="label">Tags:</span>
416                                                             <ul>
417                                                                 [% FOREACH TagLoo IN itemsloo.TagLoop %]
418                                                                     <li><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
419                                                                 [% END %]
420                                                             </ul>
421                                                         </div>
422                                                     [% END %]
423
424                                                     <span class="results_summary">
425
426                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
427                                                             [% UNLESS ( itemsloo.norequests ) %]
428                                                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
429                                                                     [% IF ( itemsloo.allow_onshelf_holds ) %]
430                                                                         <span class="actions"><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue--></span>
431                                                                     [% ELSE %]
432                                                                         [% IF ( itemsloo.itemsissued ) %]
433                                                                             <span class="actions"><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue--></span>
434                                                                         [% END %]
435                                                                     [% END %]
436                                                                 [% END # / IF opacuserlogin %]
437                                                             [% END # / UNLESS itemsloo.norequests %]
438                                                         [% END # / RequestOnOpac %]
439
440                                                         [% IF ( TagsInputEnabled ) %]
441                                                             [% IF ( loggedinusername ) %]
442                                                                 <span class="actions"><a class="tag_add hidden" id="tag_add[% itemsloo.biblionumber %]" href="#">Add tag</a></span>
443                                                                 <div id="tagform[% itemsloo.biblionumber %]" class="tag_results_input" style="display:none;">
444                                                                     <label for="newtag[% itemsloo.biblionumber %]">New tag(s), separated by a comma:</label>
445                                                                     <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
446                                                                     <input name="tagbutton" class="tagbutton btn btn-small" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
447                                                                     <a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber %]" href="#">(done)</a>
448                                                                 </div>
449                                                                 <div id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
450                                                                 Tag status here.
451                                                                 </div>
452                                                             [% ELSIF ( loop.first ) %]
453                                                                 <span class="tagstatus" id="login4tags">Log in to add tags.</span>
454                                                             [% END # / IF loggedinusername %]
455                                                         [% END # / IF TagsInputEnabled %]
456
457                                                         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
458                                                             <span class="actions"><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a></span>
459                                                         [% END %]
460
461                                                         [% IF ( allowremovingitems ) %]
462                                                             <span class="actions"><a class="removefromlist hidden" id="REM-[% itemsloo.biblionumber %]" href="#">Remove from this list</a></span>
463                                                         [% END %]
464
465                                                         [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
466                                                             [% IF ( itemsloo.incart ) %]
467                                                                 <span class="actions"><a class="addtocart cart[% itemsloo.biblionumber %] hidden" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">In your cart</a> <a class="cartRemove cartR[% itemsloo.biblionumber %] hidden" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a></span>
468                                                             [% ELSE %]
469                                                                 <span class="actions"><a class="addtocart cart[% itemsloo.biblionumber %] hidden" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">Add to cart</a> <a style="display:none;" class="cartRemove cartR[% itemsloo.biblionumber %] hidden" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a></span>
470                                                             [% END %]
471                                                         [% END # / IF opacbookbag %]
472                                                     </span> <!-- / .results_summary .actions -->
473
474                                                     <!-- COinS / Openurl -->
475                                                     <span class="Z3988" title="[% itemsloo.coins %]"></span>
476                                                 </td>
477                                             </tr>
478                                         [% END # / FOREACH itemsloop %]
479                                         </tbody>
480                                     </table> <!-- / #listcontents -->
481                                 </div><!-- / .searchresults -->
482
483                             [% IF ( pagination_bar ) %]
484                                 <div class="pages">[% pagination_bar %]</div>
485                             [% END %]
486
487                         [% ELSE %]
488                             <div id="toolbar" class="toolbar clearfix">
489                                 <div class="list-actions">
490                                     <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a> <span class="sep"></span>
491                                     [% IF ( manageshelf ) %]
492                                         <span class="sep">|</span>
493                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
494                                             <input type="hidden" name="op" value="modif" />
495                                             <input type="hidden" name="display" value="viewshelf" />
496                                             <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />
497                                             <input type="submit" class="editshelf" value="Edit list" />
498                                         </form>
499
500                                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
501                                             <input type="hidden" value="1" name="shelves"/>
502                                             <input type="hidden" value="1" name="DEL-[% shelfnumber | html  %]"/>
503                                             [% IF ( showprivateshelves ) %]
504                                                 <input type="hidden" name="display" value="privateshelves"/>
505                                             [% END %]
506                                             <input type="submit" class="deleteshelf" value="Delete list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
507                                         </form>
508                                     [% END # / IF manageshelf %]
509                                 </div> <!-- / .list-actions -->
510                             </div> <!-- / #toolbar -->
511
512                             <div class="alert alert-info">
513                                 This list is empty.
514                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
515                                     You can add to your lists from the results of any <a href="opac-main.pl">search</a>.
516                                 [% END %]
517                             </div>
518                         [% END # / IF itemsloop %]
519                     [% END # / IF viewshelf %]
520
521                     [% IF ( itemsloop && allowremovingitems ) %]
522                         <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />
523                         <input type="hidden" name="modifyshelfcontents" value="1" />
524                         <input type="hidden" name="viewshelf" value="[% shelfnumber | html %]" /><input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/>
525                         </form>
526                     [% ELSIF ( !itemsloop && manageshelf ) %]
527                         <form method="post" action="opac-shelves.pl">
528                         <input type="hidden" name="DEL-[% shelfnumber | html %]" value="1" />
529                         <input type="hidden" name="shelves" value="1" />
530                         <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
531                         <input type="submit" class="btn btn-danger" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
532                         </form>
533                     [% END %]
534
535                     [% IF ( edit ) %]
536                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
537                             <input type="hidden" name="op" value="modifsave" />
538                             <input type="hidden" name="display" value="[% display |html %]" />
539                             <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />
540                             <fieldset class="rows">
541                                 <legend>Editing <em>[% shelfname |html %]</em></legend>
542                                 <ol>
543                                     <li><label for="shelfname">List name: </label><input type="text" id="shelfname" name="shelfname" maxlength="255" value="[% shelfname |html %]" /></li>
544                                     <li>
545                                         <label for="sortfield" >Sort this list by: </label>
546                                         <select name="sortfield" id="sortfield">
547                                             [% IF ( sortfield == "title" ) %]
548                                                 <option value="title" selected="selected">Title</option>
549                                             [% ELSE %]
550                                                 <option value="title">Title</option>
551                                             [% END %]
552                                             [% IF ( sortfield == "author" ) %]
553                                                 <option value="author" selected="selected">Author</option>
554                                             [% ELSE %]
555                                                 <option value="author">Author</option>
556                                             [% END %]
557                                             [% IF ( sortfield == "copyrightdate" ) %]
558                                                 <option value="copyrightdate" selected="selected">Year</option>
559                                             [% ELSE %]
560                                                 <option value="copyrightdate">Year</option>
561                                             [% END %]
562                                             [% IF ( sortfield == "itemcallnumber" ) %]
563                                                 <option value="itemcallnumber" selected="selected">Call number</option>
564                                             [% ELSE %]
565                                                 <option value="itemcallnumber">Call number</option>
566                                             [% END %]
567                                         </select>
568                                     </li>
569                                     [% IF ( OpacAllowPublicListCreation || category2 ) %]
570                                         <li>
571                                             <label for="category">Category:</label>
572                                             <select name="category" id="category">
573                                                 [% IF ( category1 ) %]
574                                                         <option value="1" selected="selected">Private</option>
575                                                     [% ELSE %]
576                                                         <option value="1">Private</option>
577                                                     [% END %]
578                                                 [% IF ( category2 ) %]
579                                                     <option value="2" selected="selected">Public</option>
580                                                 [% ELSE %]
581                                                     <option value="2">Public</option>
582                                                 [% END %]
583                                             </select>
584                                             [% IF ( category2 && !OpacAllowPublicListCreation ) %]
585                                                 <span class="hint alert alert-info">The library has disabled the ability for patrons to create new public lists.  If you make your list private, you will not be able to make it public again.</span>
586                                             [% END %]
587                                         </li>
588                                         [% INCLUDE list_permissions %]
589                                     [% END %]
590                                 </ol>
591                                 [% UNLESS ( OpacAllowPublicListCreation || category2 ) %]
592                                     <input type="hidden" name="category" value="1" />
593                                 [% END %]
594                             </fieldset>
595
596                             <fieldset class="action">
597                                 <input type="submit" value="Save" class="btn" />
598                                 [% IF ( showprivateshelves ) %]
599                                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber | html %]&amp;display=privateshelves">Cancel</a>
600                                 [% ELSE %]
601                                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber | html %]">Cancel</a>
602                                 [% END %]
603                             </fieldset>
604                         </form>
605                     [% END # / IF edit %]
606
607
608                     [% UNLESS ( edit ) %]
609                         [% UNLESS ( viewshelf ) %]
610                             [% UNLESS ( shelves ) %]
611                                 <h2>Lists</h2>
612                                 <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
613                                 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
614                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
615                                         [% IF ( showprivateshelves ) %]
616                                             <li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
617                                         [% ELSE %]
618                                             <li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
619                                         [% END %]
620                                     [% END %]
621                                     [% IF ( showpublicshelves ) %]
622                                         <li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
623                                     [% ELSE %]
624                                         <li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
625                                     [% END %]
626                                 </ul>
627
628                                 [% IF ( showprivateshelves ) %]
629                                         <div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
630
631                                         [% IF ( loggedinusername ) %]
632                                             <div id="toolbar" class="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
633                                             [% IF ( showprivateshelves ) %]
634                                                 [% IF ( shelveslooppriv ) %]
635                                                     <table class="table">
636                                                         <thead>
637                                                             <tr>
638                                                                 <th>List name</th>
639                                                                 <th>Contents</th>
640                                                                 <th>Type</th>
641                                                                 <th>&nbsp;</th>
642                                                             </tr>
643                                                         </thead>
644                                                         <tbody>
645                                                             [% FOREACH shelveslooppri IN shelveslooppriv %]
646                                                                 <tr>
647                                                                     <td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
648                                                                     <td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
649                                                                     <td>
650                                                                         [% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %]
651                                                                     </td>
652                                                                     <td>
653                                                                         [% IF ( shelveslooppri.mine ) %]
654                                                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="form-inline">
655                                                                             <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf |html %]" />
656                                                                             <input type="hidden" name="display" value="privateshelves" />
657                                                                             <input type="hidden" name="op" value="modif" />
658                                                                             <input type="submit" class="editshelf" value="Edit" />
659                                                                         </form>
660                                                                         <form action="opac-shelves.pl" method="post" class="form-inline">
661                                                                             <input type="hidden" name="shelves" value="1" />
662                                                                             <input type="hidden" name="display" value="privateshelves" />
663                                                                             <input type="hidden" name="DEL-[% shelveslooppri.shelf |html %]" value="1" />
664                                                                             <input type="hidden" name="shelfoff" value="[% shelfoff |html %]" />
665                                                                             [% IF ( shelveslooppri.confirm ) %]
666                                                                                 <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm |html %]" value="1" />
667                                                                                 <input type="submit" class="btn btn-danger confirm" value="Confirm" />
668                                                                             [% ELSE %]
669                                                                                 <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
670                                                                             [% END %]
671                                                                         </form>
672                                                                             [% IF Koha.Preference('OpacAllowSharingPrivateLists') %]
673                                                                                 <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelveslooppri.shelf |html %]" class="">Share</a>
674                                                                             [% END %]
675                                                                         [% ELSE # not shelveslooppri.mine, so shared %]
676                                                                             [% INCLUDE remove_share  # if pref is off, you should still be able to remove shares %]
677                                                                             <input type="hidden" name="shelfoff" value="[% shelfoff |html %]" />
678                                                                             <input type="hidden" name="REMSHR-[% shelveslooppri.shelf |html %]" value="1" />
679                                                                             </form>
680                                                                         [% END %]&nbsp;
681                                                                     </td>
682                                                                 </tr>
683                                                             [% END # / FOREACH shelveslooppri %]
684                                                         </tbody>
685                                                     </table>
686                                                     <div class="pages">[% pagination_bar %]</div>
687                                                 [% ELSE %]
688                                                     <p>No private lists.</p>
689                                                 [% END # / IF shelveslooppriv %]
690                                             [% END # / IF showprivateshelves %]
691                                         [% ELSE %]
692                                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
693                                                 <div class="alert alert-info"><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>
694                                             [% END %]
695                                         [% END  # IF loggedinusername %]
696                                     </div><!-- / #privateshelves -->
697                                 [% END # / IF showprivateshelves %]
698                                 [% IF ( showpublicshelves ) %]
699                                     <div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
700
701                                     [% IF ( loggedinusername ) %]
702                                         <div id="toolbar" class="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a></div>
703                                     [% ELSE %]
704                                         [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
705                                             <div class="alert alert-info"><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new lists.</div>
706                                         [% END %]
707                                     [% END # / IF loggedinusername %]
708
709                                     [% IF ( shelvesloop ) %]
710                                         <table class="table">
711                                             <thead>
712                                                 <tr>
713                                                     <th>List name</th>
714                                                     <th>Contents</th>
715                                                     <th>Type</th><th>&nbsp;</th>
716                                                 </tr>
717                                             </thead>
718                                             <tbody>
719                                                 [% FOREACH shelvesloo IN shelvesloop %]
720                                                     <tr>
721                                                         <td><a class="title" href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
722                                                         <td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
723                                                         <td>
724                                                             [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
725                                                         </td>
726                                                         <td>
727                                                             [% IF ( shelvesloo.mine ) %]
728                                                                 <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="form-inline">
729                                                                     <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
730                                                                     <input type="hidden" name="op" value="modif" />
731                                                                     <input type="hidden" name="display" value="publicshelves" />
732                                                                     <input type="submit" class="editshelf" value="Edit" />
733                                                                 </form>
734                                                                 <form action="opac-shelves.pl" method="post" class="form-inline">
735                                                                     <input type="hidden" name="shelves" value="1" />
736                                                                     <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
737                                                                     [% IF ( shelvesloo.confirm ) %]
738                                                                         <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
739                                                                         <input type="submit" class="btn btn-danger confirm" value="Confirm" />
740                                                                     [% ELSE %]
741                                                                         <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
742                                                                     [% END %]
743                                                                 </form>
744                                                             [% END %]&nbsp;
745                                                         </td>
746                                                     </tr>
747                                                 [% END # / FOREACH shelvesloop %]
748                                             </tbody>
749                                         </table>
750                                         [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
751                                     [% ELSE %]
752                                         [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
753                                     [% END # / IF shelvesloop %]
754
755                                     </div><!-- / # publicshelves -->
756                                 [% END # / IF showprivateshelves %]
757                                 </div> <!-- / .ui-tabs-panel -->
758                             [% END # / UNLESS shelves %]
759                         [% END # / UNLESS viewshelf %]
760                     [% END # / UNLESS edit %]
761
762                     [% IF ( shelves ) %]
763                         <div id="addshelf">
764                             <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
765                                 <fieldset class="rows">
766                                     <legend>Create a new list</legend>
767                                     <input type="hidden" name="shelves" value="1" />
768                                     <ol>
769                                         <li>
770                                             <label class="required" for="addshelf">List name:</label>
771                                             [% IF ( already ) %]
772                                               <input id="addshelf" type="text" name="addshelf" value="[% already %]" maxlength="255" class="input-fluid" />
773                                             [% ELSE %]
774                                               <input id="addshelf" type="text" name="addshelf" maxlength="255" class="input-fluid" />
775                                             [% END %]
776                                             <input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
777                                         </li>
778                                         <li>
779                                             <label for="sortfield" >Sort this list by: </label>
780                                             <select name="sortfield" id="sortfield">
781                                               <option value="title">Title</option>
782                                               <option value="author">Author</option>
783                                               <option value="copyrightdate">Year</option>
784                                               <option value="itemcallnumber">Call number</option>
785                                             </select>
786                                         </li>
787                                         [% IF (OpacAllowPublicListCreation) %]
788                                             <li>
789                                                 <label for="category">Category:</label>
790                                                 <select name="category" id="category">
791                                                     <option value="1">Private</option>
792                                                     <option value="2">Public</option>
793                                                 </select>
794                                             </li>
795                                             [% INCLUDE list_permissions %]
796                                         [% END %]
797                                     </ol>
798                                     [% UNLESS (OpacAllowPublicListCreation) %]
799                                         <input type="hidden" name="category" value="1" />
800                                     [% END %]
801                                 </fieldset>
802                                 <fieldset class="action">
803                                     <input type="submit" onclick="Check(this.form); return false;" value="Save" class="btn" />
804                                     <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
805                                 </fieldset>
806                             </form>
807                         </div> <!-- / #addshelf -->
808                     [% END # / IF shelves %]
809
810                 </div> <!-- / #usershelves -->
811                 </div> <!-- / .span10/12 -->
812       </div> <!-- / .row-fluid -->
813     </div> <!-- / .container-fluid -->
814   </div> <!-- / .main -->
815
816 <div class="modal hide" id="modalWin" role="dialog" aria-hidden="true" tabindex="-1">
817     <div class="modal-content">
818         <div class="modal-body">
819             <div style="margin:1em;padding:1em;font-size:150%;">
820                 <img src="[% interface %]/[% theme %]/images/loading.gif" /> Loading
821             </div>
822         </div>
823     </div>
824 </div>
825
826 <!-- DEBUG -->
827     <div id="debug"></div>
828 <!-- /DEBUG -->
829
830 [% INCLUDE 'opac-bottom.inc' %]
831 [% BLOCK jsinclude %]
832 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
833 <script type="text/javascript">
834 //<![CDATA[
835 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
836 var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
837 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
838 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?");
839
840 [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
841     function holdSelections() {
842         var checkedBoxes = $("input:checkbox:checked");
843         if ($(checkedBoxes).size() == 0) {
844             alert(MSG_NO_RECORD_SELECTED);
845         } else {
846             var bibs = "";
847             $(checkedBoxes).each(function(){
848                 var name = $(this).attr("name");
849                 bib = name.substr(4);
850                 bibs += bib + "/";
851             });
852             document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
853         }
854     }
855 [% END %]
856 [% IF ( TagsInputEnabled && loggedinusername ) %]
857     function tagSelected() {
858         var checkedBoxes = $("input:checkbox:checked");
859         if ($(checkedBoxes).size()) {
860             $("#tagsel_tag").hide();
861             $(".tag_hides").hide();
862             $("#tagsel_form").show();
863         } else {
864             alert(MSG_NO_RECORD_SELECTED);
865         }
866     }
867
868     function tagCanceled() {
869         $("#tagsel_form").hide();
870         $("#tagsel_tag").show();
871         $(".tag_hides").show();
872         $("#tagsel_new").val("");
873         $(".tagstatus").empty().hide();
874     }
875
876     function tagAdded() {
877         var checkedBoxes = $("input:checkbox:checked");
878         if (!$(checkedBoxes).size()) {
879             alert(MSG_NO_RECORD_SELECTED);
880             return false;
881         }
882
883         var tag = $("#tagsel_new").val();
884         if (!tag || (tag == "")) {
885             alert(MSG_NO_TAG_SPECIFIED);
886             return false;
887         }
888
889         var bibs = [];
890         for (var i = 0; i < $(checkedBoxes).size(); i++) {
891             var box = $(checkedBoxes).get(i);
892             bibs[i] = $(box).val();
893         }
894
895         KOHA.Tags.add_multitags_button(bibs, tag);
896         return false;
897     }
898 [% END %]
899
900 function enableCheckboxActions(){
901     // Enable/disable controls if checkboxes are checked
902     var checkedBoxes = $(".checkboxed input:checkbox:checked");
903     if ($(checkedBoxes).size()) {
904       $("#selections").html(_("With selected titles: "));
905       $("#selections-toolbar .links a").removeClass("disabled");
906     } else {
907       $("#selections").html(_("Select titles to: "));
908       $("#selections-toolbar .links a").addClass("disabled");
909     }
910 }
911
912 $(function() {
913     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]$(".addtocart,.cartRemove").removeClass("hidden");[% END %]
914     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
915     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
916     $("a.print").show();
917
918     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
919         $("#placehold").html("<a href=\"#\" class=\"hold tag_hides disabled\">"+_("Place hold")+"<\/a>");
920         $("#selections-toolbar a.hold").click(function(){
921             holdSelections();
922             return false;
923         });
924     [% END %]
925
926     // If JS is enabled add paramter to download link
927     var dialoglink = $(".download").attr("href");
928     dialoglink += "&context=modal";
929     $(".download").attr("href",dialoglink);
930
931     $("#CheckAll").click(function(){
932         $(".checkboxed").checkCheckboxes();
933         enableCheckboxActions();
934         return false;
935     });
936     $("#CheckNone").click(function(){
937         $(".checkboxed").unCheckCheckboxes();
938         enableCheckboxActions();
939         return false;
940     });
941
942     $(".cb").click(function(){
943       enableCheckboxActions();
944     });
945     enableCheckboxActions();
946
947     [% IF ( TagsInputEnabled && loggedinusername ) %]
948         var tagAdd = $(".tag_add");
949         tagAdd.removeClass("hidden");
950         $("#tagsel_tag").click(function(){
951             tagSelected();
952             return false;
953         });
954         $("#tagsel_cancel").click(function(){
955             tagCanceled();
956             return false;
957         });
958         $("#tagsel_button").click(function(){
959             tagAdded();
960             return false;
961         });
962
963         tagAdd.click(function(){
964             var thisid = $(this).attr("id");
965             thisid = thisid.replace("tag_add","");
966             $(this).hide();
967             $("#tagform"+thisid).show();
968             $("#newtag"+thisid).focus();
969             $("#newtag"+thisid+"_status").empty().hide();
970             return false;
971         });
972         $(".cancel_tag_add").click(function(){
973             var thisid = $(this).attr("id");
974             thisid = thisid.replace("cancel","");
975             $("#tagform"+thisid).hide();
976             $("#tag_add"+thisid).show();
977             $("#newtag"+thisid).val("");
978             $("#newtag"+thisid+"_status").empty().hide();
979             return false;
980         });
981         $(".tagbutton").click(function(){
982           var thisid = $(this).attr("title");
983           var tag = $("#newtag"+thisid).val();
984           if (!tag || (tag == "")) {
985               alert(MSG_NO_TAG_SPECIFIED);
986               return false;
987           }
988           KOHA.Tags.add_tag_button(thisid, tag);
989           return false;
990         });
991     [% END %]
992
993     [% IF ( loggedinusername && allowremovingitems ) %]
994         var removeFromListLinks = $(".removefromlist");
995         removeFromListLinks.removeClass("hidden");
996         // "remove from list" appearing on each line of the list output
997         removeFromListLinks.on("click",function(){
998             $(".checkboxed").unCheckCheckboxes();
999             var listitem = $("input[name="+this.id+"]");
1000             listitem.prop("checked",true);
1001             $("#myform").submit();
1002         });
1003
1004         $("#myform").submit(function(){
1005             var checkedBoxes = $(".checkboxed input:checkbox:checked");
1006             var numchecked = $(checkedBoxes).size();
1007             if (numchecked) {
1008                 if( numchecked > 1 ){
1009                     return confirmDelete(MSG_REMOVE_FROM_LIST);
1010                 } else {
1011                     return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
1012                 }
1013             } else {
1014                 alert(MSG_NO_RECORD_SELECTED);
1015                 return false;
1016             }
1017         });
1018         $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Remove from list")+"</a>")
1019         .click(function(){
1020             $("#myform").submit();
1021             return false;
1022         });
1023     [% END %]
1024     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1025     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1026     [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1027     $('#sort-submit').hide();
1028
1029     [% IF print %]
1030         window.print();
1031         setTimeout('window.close()', 1);
1032     [% END %]
1033 }); // document.ready
1034
1035 function Check(f) {
1036     var _alertString="";
1037     var alertString2;
1038
1039     if(f.addshelf.value.length ==0){
1040         _alertString += _("- You must enter a list name") + "\n";
1041     }
1042
1043     if (_alertString.length==0) {
1044         f.submit();
1045     } else {
1046         alertString2 = _("Form not submitted because of the following problem(s)");
1047         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
1048         alertString2 += _alertString;
1049         alert(alertString2);
1050     }
1051 }
1052 //]]>
1053 </script>
1054 [% END %]