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