Bug #2531 Cannot delete private shelf
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-shelves.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo;   <!-- TMPL_IF NAME="viewshelf" -->Contents of <!-- TMPL_VAR NAME="shelfname" ESCAPE="html" --><!-- TMPL_ELSE -->My Lists<!-- /TMPL_IF --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
2 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.pack.js"></script>
3 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
4 <script type="text/JavaScript" language="JavaScript">
5 //<![CDATA[
6 $.tablesorter.addParser({
7     id: 'articles', 
8     is: function(s) {return false;  }, 
9     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
10     type: 'text' 
11 });
12
13        $(function() {
14             $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">Clear All</a>");
15             $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">Select All</a>");
16             $("#listcontents").tablesorter({
17                 widgets : ['zebra'],
18                 <!-- TMPL_IF NAME="manageshelf" -->
19                 sortList: [[1,0]],
20                 headers: { 0: { sorter: false },1:{sorter: 'articles'}
21                 <!-- TMPL_ELSE -->
22                 sortList: [[0,0]],
23                 headers: { 0:{sorter:'articles'}
24                 <!-- /TMPL_IF -->
25                 }
26             }); 
27             $("#CheckAll").click(function(){
28                 $(".checkboxed").checkCheckboxes();
29                 return false;
30             });
31             $("#CheckNone").click(function(){
32                 $(".checkboxed").unCheckCheckboxes();
33                 return false;
34             });
35        });
36 //]]>
37 </script>
38 </head>
39 <body>
40     <!-- TMPL_IF EXPR="OpacNav||loggedinusername" --><div id="doc3" class="yui-t1"><!-- TMPL_ELSE --><div id="doc3" class="yui-t7"><!-- /TMPL_IF -->
41  <div id="bd">
42 <!-- TMPL_INCLUDE NAME="masthead.inc" -->
43
44   <div id="yui-main">
45    <div class="yui-b">
46 <div class="container">
47 <!-- TMPL_IF NAME="paramsloop" -->
48 <!-- TMPL_LOOP NAME="paramsloop" -->
49 <div class="yui-ge">
50     <div class="yui-u first">
51         <!-- TMPL_IF NAME="already" --><div class="dialog alert">A List named <b><!-- TMPL_VAR NAME="already" --></b> already exists!</div><!-- /TMPL_IF -->
52         <!-- TMPL_IF NAME="status" --><div class="dialog alert"><!-- TMPL_VAR NAME="string" --></div><!-- /TMPL_IF -->
53         <!-- TMPL_IF NAME="nobarcode" --><div class="dialog alert">ERROR: No barcode given.</div><!-- /TMPL_IF -->
54         <!-- TMPL_IF NAME="noshelfnumber" --><div class="dialog alert">ERROR: No shelfnumber given.</div><!-- /TMPL_IF -->
55         <!-- TMPL_IF NAME="need_confirm" -->
56         <div class="dialog alert">The list <i><!-- TMPL_VAR NAME="need_confirm" --></i> is not empty.
57             <br />It has <b><!-- TMPL_VAR NAME="count" --></b> entries.
58             <br />Use the "Confirm" button below to confirm deletion.
59         </div>
60         <!-- /TMPL_IF -->
61         <!-- TMPL_IF NAME="nopermission" -->
62         <div class="dialog alert">ERROR: You do not have adequate permission for that action on list <!-- TMPL_VAR NAME="nopermission" -->.</div>
63         <!-- /TMPL_IF -->
64         <!-- TMPL_IF NAME="failgetitem" -->
65         <div class="dialog alert">ERROR: No item found with barcode <!-- TMPL_VAR NAME="failgetitem" -->.</div>
66         <!-- /TMPL_IF -->
67         <!-- TMPL_IF NAME="duplicatebiblio" -->
68         <div class="dialog alert">A record matching barcode <b><!-- TMPL_VAR NAME="duplicatebiblio" --></b> has already been added.</div>
69         <!-- /TMPL_IF -->
70         <!-- TMPL_IF NAME="delete_ok" -->
71             <div class="dialog message">List <!-- TMPL_VAR NAME="delete_ok" --> Deleted.</div>
72         <!-- /TMPL_IF -->
73         <!-- TMPL_IF NAME="delete_fail" -->
74             <div class="dialog message">ERROR: Database error. Delete (list number <!-- TMPL_VAR NAME="delete_fail" -->) failed.</div>
75         <!-- /TMPL_IF -->
76         <!-- TMPL_IF NAME="unrecognized" -->
77             <div class="dialog message">ERROR: List number <!-- TMPL_VAR NAME="unrecognized" --> unrecognized.</div>
78         <!-- /TMPL_IF -->
79     </div>
80 </div>
81 <!-- /TMPL_LOOP -->
82 <!-- /TMPL_IF --> 
83
84     <div class="yui-g">
85     
86     
87     <!-- TMPL_IF NAME="viewshelf" -->
88     <!--  Viewing a particular shelf -->
89     <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="<!-- TMPL_VAR NAME="themelang" -->/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <em><!-- TMPL_VAR NAME="shelfname" ESCAPE="html" --></em></h3>
90         <!-- TMPL_IF NAME="itemsloop" -->
91         <!-- TMPL_IF NAME="manageshelf" --><div><span class="checkall"></span>
92         <span class="clearall"></span> | <a class="editshelf" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=<!-- TMPL_VAR NAME="shelfnumber" -->&amp;op=modif">Edit List</a> <form method="post" action="opac-shelves.pl">
93 <input type="hidden" value="1" name="shelves"/>
94 <!-- TMPL_IF NAME="showprivateshelves" -->
95 <input type="hidden" name="display" value="privateshelves" />
96 <!-- /TMPL_IF -->
97 <input type="hidden" value="1" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->"/>
98 <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(_('Are you sure you want to remove this List?'));"/></form>
99 </div><!-- /TMPL_IF -->
100     <!-- TMPL_IF NAME="manageshelf" --><form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
101         <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
102         <input type="hidden" name="modifyshelfcontents" value="1" /><!-- /TMPL_IF -->
103         <!-- TMPL_VAR name='pagination_bar'-->
104 <table id="listcontents">
105         <thead><tr>
106             <!-- TMPL_IF NAME="manageshelf" --><th>&nbsp;</th><!-- /TMPL_IF -->
107             <!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
108             <th>Title</th>
109             <th>Author</th>
110             <th>Copyright</th>
111         </tr></thead>
112             <tbody><!-- TMPL_LOOP NAME="itemsloop" -->
113                 <!-- TMPL_IF NAME="toggle" -->
114         <tr class="highlight">
115                 <!-- TMPL_ELSE -->
116         <tr>
117                 <!-- /TMPL_IF -->
118                 <!-- TMPL_IF NAME="manageshelf" -->
119             <td>
120                 <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
121             </td>
122                 <!-- /TMPL_IF -->
123             <!-- TMPL_UNLESS NAME="item-level_itypes" --><td>
124                 <img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" /><!-- TMPL_VAR NAME="description" -->
125             </td> <!-- /TMPL_UNLESS -->
126
127             <td><!-- TMPL_IF NAME="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a>
128               <!-- TMPL_ELSE -->
129               <!-- TMPL_IF NAME="BiblioDefaultViewisbd" --><a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a>
130               <!-- TMPL_ELSE --><a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a>
131               <!-- /TMPL_IF --><!-- /TMPL_IF -->
132               <!-- COinS / OpenURL --><span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn"  ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
133             </td>
134             <td><!-- TMPL_VAR NAME="author" --></td>
135             <td><!-- TMPL_VAR NAME="copyrightdate" --></td>
136         </tr>
137                 <!-- /TMPL_LOOP --></tbody><!-- /itemsloop -->
138     </table>
139             <!-- TMPL_ELSE -->
140         <div class="dialog message">This List is empty.  You can add to your lists from the results of any <a href="opac-main.pl">search</a>!</div>
141             <!-- /TMPL_IF --><!-- /itemsloop -->
142     <!-- /TMPL_IF -->
143     <!-- /viewshelf -->
144
145     <!-- TMPL_IF NAME="manageshelf" -->
146     <!-- Editing shelf -->
147         <!-- TMPL_IF NAME="itemsloop" -->
148             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
149             <input type="hidden" name="modifyshelfcontents" value="1" />
150             <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(_('Are you sure you want to remove these items from the list?'))" />
151         <!-- TMPL_ELSE -->
152 <form method="post" action="opac-shelves.pl">
153             <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->" value="1" />
154             <input type="hidden" name="shelves" value="1" />
155             <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(_('Are you sure you want to delete this List?'))" />
156         <!-- /TMPL_IF -->
157         </form>
158     <!-- /TMPL_IF -->
159
160     <!-- TMPL_IF NAME="edit" -->
161     <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="<!-- TMPL_VAR NAME="themelang" -->/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->"><em><!-- TMPL_VAR NAME="shelfname" ESCAPE="html" --></em></a> <img src="<!-- TMPL_VAR NAME="themelang" -->/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Editing</h3>
162         <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
163             <input type="hidden" name="op" value="modifsave" />
164             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
165             <fieldset class="rows">
166             <ol>
167             <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="<!-- TMPL_VAR NAME="shelfname" ESCAPE="html" -->" /></li>
168             <li><label for="sortfield" >Sort this list by: </label>
169             <select name="sortfield">
170             <!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
171             <!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
172             <!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
173             </select></li>
174             <li><label for="category">Category: </label>
175                 <select name="category" id="category">
176                       <option value="1">Private</option>
177                       <option value="2">Public</option>
178                 </select>
179             </li>
180             </ol>
181             </fieldset>
182             <fieldset class="action"><input type="submit" value="Save" class="submit" /> <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=<!-- TMPL_VAR NAME="shelfnumber" -->">Cancel</a></fieldset>
183         </form>
184     <!-- /TMPL_IF -->
185
186    <!-- TMPL_UNLESS NAME="edit" --> <!-- TMPL_UNLESS NAME="viewshelf" --> <!-- TMPL_UNLESS NAME="shelves" -->
187         <h2>Lists</h2>
188         <ul class="link-tabs">
189         <!-- TMPL_IF NAME="showprivateshelves" -->
190             <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your Lists</a></li>
191         <!-- TMPL_ELSE -->
192             <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your Lists</a></li>
193         <!-- /TMPL_IF -->
194         <!-- TMPL_IF NAME="showpublicshelves" -->
195             <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public Lists</a></li>
196         <!-- TMPL_ELSE -->
197             <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public Lists</a></li>
198         <!-- /TMPL_IF -->
199         </ul>
200         <!-- TMPL_IF NAME="showprivateshelves" -->
201         <div id="privateshelves" class="tab-container" style="display:block;">
202         <!-- TMPL_ELSE -->
203         <div id="privateshelves" class="tab-container" style="display:none;">
204         <!-- /TMPL_IF -->
205         
206         <!-- TMPL_IF NAME="loggedinusername" -->
207             <!-- TMPL_IF NAME="shelveslooppriv" -->
208             <!-- TMPL_VAR name='pagination_bar'-->
209                 <table>
210                 <tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>&nbsp;</th></tr>
211                 <!-- TMPL_LOOP NAME="shelveslooppriv" -->
212                     <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!--TMPL_ELSE--><tr><!-- /TMPL_IF -->
213         <td><a href="opac-shelves.pl?display=privateshelves&viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
214         <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
215         <td><!-- TMPL_VAR NAME="sortfield" --></td>
216         <td><!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
217             <!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
218             <!-- TMPL_IF NAME="viewcategory3" -->Open<!-- /TMPL_IF -->
219         </td>
220         <td>
221             <!-- TMPL_IF NAME="mine" -->
222                 <form action="opac-shelves.pl" method="get">
223                     <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelf" -->" />
224                     <input type="hidden" name="display" value="privateshelves" />
225                     <input type="hidden" name="op" value="modif" />
226                     <input type="submit" class="editshelf" value="Edit" />
227                 </form>
228                 <form action="opac-shelves.pl" method="post">
229                     <input type="hidden" name="shelves" value="1" />
230                     <input type="hidden" name="display" value="privateshelves" />
231                     <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" value="1" />
232                     <!-- TMPL_IF NAME="confirm" -->
233                     <input type="hidden" name="CONFIRM-<!-- TMPL_VAR NAME="confirm" -->" value="1" />
234                     <input type="submit" class="confirm" value="Confirm" />
235                     <!-- TMPL_ELSE -->
236                     <input type="submit" class="deleteshelf" onclick="return confirmDelete(_('Are you sure you want to remove this List?'));" value="Delete" />
237                     <!-- /TMPL_IF -->
238                 </form>
239             <!-- /TMPL_IF -->&nbsp;
240         </td>
241         </tr>
242                 <!-- /TMPL_LOOP -->
243             <!-- TMPL_ELSE -->
244             <tr><td colspan="4">No Private Lists.</td></tr>
245             <!-- /TMPL_IF --><!-- /shelveslooppriv -->
246         </table>
247         <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a>
248         <!-- TMPL_ELSE --><!-- /loggedinusername -->
249             <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
250         <!-- /TMPL_IF --><!-- /loggedinusername -->
251         </div><!-- /privateshelves -->
252
253         <!-- TMPL_IF NAME="showpublicshelves" -->
254         <div id="publicshelves" class="tab-container" style="display:block;">
255         <!-- TMPL_ELSE -->
256         <div id="publicshelves" class="tab-container" style="display:none;">
257         <!-- /TMPL_IF -->
258         <!-- TMPL_IF NAME="shelvesloop" -->
259         <!-- TMPL_VAR name='pagination_bar'-->
260         <table>
261         <tr><th>List Name</th><th>Contents</th><th>Type</th></tr>
262             <!-- TMPL_LOOP NAME="shelvesloop" -->
263                 <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!--TMPL_ELSE--><tr><!-- /TMPL_IF -->
264         <td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
265         <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
266         <td><!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
267             <!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
268             <!-- TMPL_IF NAME="viewcategory3" -->Open<!-- /TMPL_IF -->
269         </td>
270         </tr>
271             <!-- /TMPL_LOOP -->
272         </table>
273         <!-- TMPL_ELSE -->
274             <!-- TMPL_IF NAME="showpublicshelves" -->No Public Lists.<!-- /TMPL_IF -->
275         <!-- /TMPL_IF --><!-- /shelvesloop -->
276         </div><!-- /publicshelves -->
277     <!-- /TMPL_UNLESS --><!-- /viewshelf --><!-- /TMPL_UNLESS --><!-- /edit --><!-- /TMPL_UNLESS --><!-- /shelves -->
278
279         <!-- TMPL_IF NAME="shelves" -->
280         <div id="addshelf"><form method="post" action="/cgi-bin/koha/opac-shelves.pl">
281         <fieldset class="rows">
282         <legend>Create a New List</legend>
283             <input type="hidden" name="shelves" value="1" />
284             <ol><li><label for="addshelf">List Name:</label>
285                 <!-- TMPL_IF NAME="already" -->
286                 <input id="addshelf" type="text" name="addshelf" value="<!-- TMPL_VAR NAME="already" -->" size="60" />
287                 <!-- TMPL_ELSE -->
288                 <input id="addshelf" type="text" name="addshelf" size="60" />
289                 <!-- /TMPL_IF -->
290                 <input type="hidden" name="owner" id="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->" /></li>
291                 <li><label for="sortfield" >Sort this list by: </label>
292                 <select name="sortfield">
293                 <!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
294                 <!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
295                 <!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
296                 </select></li>
297                 <li><label for="category">Category:</label>
298                 <select name="category" id="category">
299                     <option value="1">Private</option>
300                     <option value="2">Public</option>
301                 </select></li>
302 </ol>
303         </fieldset>
304             <fieldset class="action"><input type="submit" value="Save" class="submit" /> <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a></fieldset>
305         </form>    </div>
306     <!-- /TMPL_IF --><!-- /showadd -->
307     </div></div>
308    </div>
309   </div>
310 <!-- TMPL_IF EXPR="OpacNav||loggedinusername" -->
311   <div class="yui-b">
312   <div class="container">
313     <!-- TMPL_INCLUDE NAME="navigation.inc" -->
314     <!-- TMPL_INCLUDE NAME="usermenu.inc" -->
315   </div>
316   </div><!-- /TMPL_IF -->
317  </div>
318 <!-- </div> -->
319 <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->