fix the private shelf deletion in opac
[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 <input type="hidden" value="1" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->"/>
95 <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(_('Are you sure you want to remove this List?'));"/></form>
96 </div><!-- /TMPL_IF -->
97     <!-- TMPL_IF NAME="manageshelf" --><form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
98         <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
99         <input type="hidden" name="modifyshelfcontents" value="1" /><!-- /TMPL_IF -->
100                 <!-- TMPL_VAR name='pagination_bar'-->
101 <table id="listcontents">
102         <thead><tr>
103             <!-- TMPL_IF NAME="manageshelf" --><th>&nbsp;</th><!-- /TMPL_IF -->
104             <!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
105             <th>Title</th>
106             <th>Author</th>
107             <th>Copyright</th>
108         </tr></thead>
109             <tbody><!-- TMPL_LOOP NAME="itemsloop" -->
110                 <!-- TMPL_IF NAME="toggle" -->
111         <tr class="highlight">
112                 <!-- TMPL_ELSE -->
113         <tr>
114                 <!-- /TMPL_IF -->
115                 <!-- TMPL_IF NAME="manageshelf" -->
116             <td>
117                 <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
118             </td>
119                 <!-- /TMPL_IF -->
120             <!-- TMPL_UNLESS NAME="item-level_itypes" --><td>
121                 <img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" /><!-- TMPL_VAR NAME="description" -->
122             </td> <!-- /TMPL_UNLESS -->
123
124             <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>
125               <!-- TMPL_ELSE -->
126               <!-- 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>
127               <!-- 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>
128               <!-- /TMPL_IF --><!-- /TMPL_IF -->
129               <!-- 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>
130             </td>
131             <td><!-- TMPL_VAR NAME="author" --></td>
132             <td><!-- TMPL_VAR NAME="copyrightdate" --></td>
133         </tr>
134                 <!-- /TMPL_LOOP --></tbody><!-- /itemsloop -->
135     </table>
136             <!-- TMPL_ELSE -->
137         <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>
138             <!-- /TMPL_IF --><!-- /itemsloop -->
139     <!-- /TMPL_IF -->
140         <!-- /viewshelf -->
141
142         <!-- TMPL_IF NAME="manageshelf" -->
143         <!-- Editing shelf -->
144         <!-- TMPL_IF NAME="itemsloop" -->
145                 <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
146                 <input type="hidden" name="modifyshelfcontents" value="1" />
147                 <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?'))" />
148         <!-- TMPL_ELSE -->
149 <form method="post" action="opac-shelves.pl">
150                         <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->" value="1" />
151                         <input type="hidden" name="shelves" value="1" />
152                         <input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(_('Are you sure you want to delete this List?'))" />
153         <!-- /TMPL_IF -->
154                 </form>
155     <!-- /TMPL_IF -->
156
157     <!-- TMPL_IF NAME="edit" -->
158         <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>
159         <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
160             <input type="hidden" name="op" value="modifsave" />
161             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
162             <fieldset class="rows">
163             <ol>
164             <li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="<!-- TMPL_VAR NAME="shelfname" ESCAPE="html" -->" /></li>
165             <li><label for="sortfield" >Sort this list by: </label>
166             <select name="sortfield">
167             <!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
168             <!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
169             <!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
170             </select></li>
171                         <li><label for="category">Category: </label>
172                                 <select name="category" id="category">
173                                           <option value="1">Private</option>
174                                           <option value="2">Public</option>
175                                 </select>
176                         </li>
177             </ol>
178             </fieldset>
179             <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>
180         </form>
181     <!-- /TMPL_IF -->
182
183    <!-- TMPL_UNLESS NAME="edit" --> <!-- TMPL_UNLESS NAME="viewshelf" --> <!-- TMPL_UNLESS NAME="shelves" -->
184         <h2>Lists</h2>
185         <ul class="link-tabs">
186         <!-- TMPL_IF NAME="showprivateshelves" -->
187             <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your Lists</a></li>
188         <!-- TMPL_ELSE -->
189             <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your Lists</a></li>
190         <!-- /TMPL_IF -->
191         <!-- TMPL_IF NAME="showpublicshelves" -->
192             <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public Lists</a></li>
193         <!-- TMPL_ELSE -->
194             <li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public Lists</a></li>
195         <!-- /TMPL_IF -->
196         </ul>
197         <!-- TMPL_IF NAME="showprivateshelves" -->
198                 <div id="privateshelves" class="tab-container" style="display:block;">
199                 <!-- TMPL_ELSE -->
200                 <div id="privateshelves" class="tab-container" style="display:none;">
201                 <!-- /TMPL_IF -->
202         
203                 <!-- TMPL_IF NAME="loggedinusername" -->
204             <!-- TMPL_IF NAME="shelveslooppriv" -->
205                         <!-- TMPL_VAR name='pagination_bar'-->
206                         <table>
207                         <tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>&nbsp;</th></tr>
208                 <!-- TMPL_LOOP NAME="shelveslooppriv" -->
209                     <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!--TMPL_ELSE--><tr><!-- /TMPL_IF -->
210         <td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
211         <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
212         <td><!-- TMPL_VAR NAME="sortfield" --></td>
213         <td><!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
214                         <!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
215                         <!-- TMPL_IF NAME="viewcategory3" -->Open<!-- /TMPL_IF -->
216                 </td>
217         <td>
218             <!-- TMPL_IF NAME="mine" -->
219                                 <form action="opac-shelves.pl" method="get">
220                                         <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR NAME="shelf" -->" />
221                                         <input type="hidden" name="op" value="modif" />
222                                         <input type="submit" class="editshelf" value="Edit" />
223                                 </form>
224                                 <form action="opac-shelves.pl" method="post">
225                                         <input type="hidden" name="shelves" value="1" />
226                                         <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" value="1" />
227                                         <input type="hidden" name="display" value="privateshelves" />
228                                         <!-- TMPL_IF NAME="confirm" -->
229                                         <input type="hidden" name="CONFIRM-<!-- TMPL_VAR NAME="confirm" -->" value="1" />
230                                         <input type="submit" class="confirm" value="Confirm" />
231                                         <!-- TMPL_ELSE -->
232                                         <input type="submit" class="deleteshelf" onclick="return confirmDelete(_('Are you sure you want to remove this List?'));" value="Delete" />
233                                         <!-- /TMPL_IF -->
234                                 </form>
235                         <!-- /TMPL_IF -->&nbsp;
236                 </td>
237                 </tr>
238                 <!-- /TMPL_LOOP -->
239             <!-- TMPL_ELSE -->
240             <tr><td colspan="4">No Private Lists.</td></tr>
241             <!-- /TMPL_IF --><!-- /shelveslooppriv -->
242         </table>
243                 <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a>
244         <!-- TMPL_ELSE --><!-- /loggedinusername -->
245                 <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
246         <!-- /TMPL_IF --><!-- /loggedinusername -->
247                 </div><!-- /privateshelves -->
248
249         <!-- TMPL_IF NAME="showpublicshelves" -->
250                 <div id="publicshelves" class="tab-container" style="display:block;">
251                 <!-- TMPL_ELSE -->
252                 <div id="publicshelves" class="tab-container" style="display:none;">
253                 <!-- /TMPL_IF -->
254         <!-- TMPL_IF NAME="shelvesloop" -->
255                 <!-- TMPL_VAR name='pagination_bar'-->
256         <table>
257         <tr><th>List Name</th><th>Contents</th><th>Type</th></tr>
258             <!-- TMPL_LOOP NAME="shelvesloop" -->
259                 <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!--TMPL_ELSE--><tr><!-- /TMPL_IF -->
260                 <td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
261                 <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
262         <td><!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
263                         <!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
264                         <!-- TMPL_IF NAME="viewcategory3" -->Open<!-- /TMPL_IF -->
265                 </td>
266                 </tr>
267             <!-- /TMPL_LOOP -->
268         </table>
269         <!-- TMPL_ELSE -->
270                 <!-- TMPL_IF NAME="showpublicshelves" -->No Public Lists.<!-- /TMPL_IF -->
271         <!-- /TMPL_IF --><!-- /shelvesloop -->
272         </div><!-- /publicshelves -->
273     <!-- /TMPL_UNLESS --><!-- /viewshelf --><!-- /TMPL_UNLESS --><!-- /edit --><!-- /TMPL_UNLESS --><!-- /shelves -->
274
275         <!-- TMPL_IF NAME="shelves" -->
276         <div id="addshelf"><form method="post" action="/cgi-bin/koha/opac-shelves.pl">
277                 <fieldset class="rows">
278                 <legend>Create a New List</legend>
279             <input type="hidden" name="shelves" value="1" />
280             <ol><li><label for="addshelf">List Name:</label>
281                                 <!-- TMPL_IF NAME="already" -->
282                                 <input id="addshelf" type="text" name="addshelf" value="<!-- TMPL_VAR NAME="already" -->" size="60" />
283                                 <!-- TMPL_ELSE -->
284                                 <input id="addshelf" type="text" name="addshelf" size="60" />
285                                 <!-- /TMPL_IF -->
286                                 <input type="hidden" name="owner" id="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->" /></li>
287                                 <li><label for="sortfield" >Sort this list by: </label>
288                                 <select name="sortfield">
289                                 <!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
290                                 <!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
291                                 <!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
292                                 </select></li>
293                         <li><label for="category">Category:</label>
294                     <select name="category" id="category">
295                         <option value="1">Private</option>
296                         <option value="2">Public</option>
297                     </select></li>
298 </ol>
299                 </fieldset>
300             <fieldset class="action"><input type="submit" value="Save" class="submit" /> <a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a></fieldset>
301         </form>    </div>
302         <!-- /TMPL_IF --><!-- /showadd -->
303     </div></div>
304    </div>
305   </div>
306 <!-- TMPL_IF EXPR="OpacNav||loggedinusername" -->
307   <div class="yui-b">
308   <div class="container">
309         <!-- TMPL_INCLUDE NAME="navigation.inc" -->
310         <!-- TMPL_INCLUDE NAME="usermenu.inc" -->
311   </div>
312   </div><!-- /TMPL_IF -->
313  </div>
314 <!-- </div> -->
315 <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->