Bug Fixing :
[koha.git] / koha-tmpl / opac-tmpl / prog / en / opac-shelves.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryNameTitle" --> Catalog -- <!-- TMPL_IF Name="viewshelf" -->Contents of <!-- TMPL_VAR Name="shelfname" --><!-- TMPL_ELSE -->List of Virtual Shelves<!-- /TMPL_IF --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
2 <!--TMPL_INCLUDE NAME="masthead.inc" -->
3 <!--TMPL_INCLUDE NAME="navigation.inc" -->
4
5 <!-- TMPL_INCLUDE NAME="usermenu.inc" -->
6
7 <!-- TMPL_IF Name="viewshelf" -->
8
9 <h3>Contents of <!-- TMPL_VAR Name="shelfname" --></h3>
10
11 <a class="button" href="/cgi-bin/koha/opac-shelves.pl">Back to Virtual Shelves</a>
12
13 <!-- TMPL_IF name="manageshelf" -->
14  | <a class="button" href="/cgi-bin/koha/opac-shelves.pl?op=modif&shelf=<!-- TMPL_VAR Name="shelfnumber" -->">
15  Modify this Shelf</a>
16 <!-- /TMPL_IF -->
17
18 <form action="/cgi-bin/koha/opac-shelves.pl"
19       method="POST"
20       name="mainform"
21       onsubmit="return checkForm(this);">
22     
23     <!-- TMPL_IF NAME="itemsloop" -->
24     <table>
25         <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
26         <input type="hidden" name="modifyshelfcontents" value="1" />
27             <tr>
28                 <th>
29                     <a style="color:white;" href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;">Check All</a>
30                 </th>
31                 <th>&nbsp;</th>
32                 <th>Title</th>
33                 <th>Author</th>
34                 <th>Call No.</th>
35             </tr>
36         <!-- TMPL_LOOP Name="itemsloop" -->
37             <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
38                     <td>
39                         <input type="checkbox" name="MOD-<!-- TMPL_VAR Name="itemnumber" -->" />
40                         <input type="hidden" name="ModBiblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
41                     </td>
42                     <td>
43                         <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
44                     </td>
45                     <td>
46                          <!-- TMPL_IF name="BiblioDefaultViewmarc" -->
47                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
48                                             <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
49                                         </a>
50                                     <!-- TMPL_ELSE -->
51                                         <!-- TMPL_IF name="BiblioDefaultViewisbd" -->
52                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
53                                                 <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
54                                             </a>
55                                         <!-- TMPL_ELSE -->
56                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
57                                                 <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
58                                             </a>
59                                         <!-- /TMPL_IF -->
60                                     <!-- /TMPL_IF -->
61                         </a>
62                     </td>
63                     <td><!-- TMPL_VAR Name="author" --></td>
64                     <td><!-- TMPL_VAR NAME="classification" --></td>
65         </tr>
66         <!-- /TMPL_LOOP -->
67     </table>
68     <!-- TMPL_ELSE -->
69     <b>This shelf is empty.</b>
70     <!-- TMPL_UNLESS NAME="itemsloop" -->
71         <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->" />
72         <input type="hidden" name="shelves" value="1" />
73         <input type="submit" class="icon delete"
74                value="Delete this Shelf"
75                onclick="return confirmDelete('Are you sure you want to delete this shelf?')" />
76         <!-- /TMPL_UNLESS -->
77         <!-- /TMPL_IF -->
78     <!-- TMPL_IF name="manageshelf" -->
79         <!-- TMPL_IF NAME="itemsloop" -->
80             <h2>With selected items :</h2>
81             <p>
82             <label for="check-remove">remove</label>
83             <input id="check-remove"
84                    type="checkbox"
85                    name="remove"
86                    />
87             </p>
88             <p>
89             <label for="check-addbb">Add to bookbag</label>
90             <input id="check-addbb"
91                    type="checkbox"
92                    name="addToBookBag"
93                    />
94             </p>
95             <p><input type="submit"
96                    value=" GO "
97                    />
98             </p>
99         <!-- /TMPL_IF -->
100         <!-- /TMPL_IF -->
101 </form>
102     <!-- TMPL_IF name="manageshelf" -->
103
104 <br />
105 <form action="/cgi-bin/koha/opac-shelves.pl" method="post">
106     <table>
107         <tr><th colspan="2">Add an Item to this Shelf by Barcode</th></tr>
108         <tr>
109             <td>
110                 <label for="addbarcode">Barcode:</label>
111             </td>
112             <td>
113                 <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
114                 <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
115                 <input type="hidden" name="modifyshelfcontents" value="1" />
116                 <input type="submit" value=" Add " />
117             </td>
118         </tr>
119     </table>
120 </form>
121 <!-- /TMPL_IF -->
122 <!-- TMPL_ELSE -->
123     <!-- TMPL_IF Name="shelves" -->
124         <!-- TMPL_IF Name="status1" -->
125             <p class="error"><!-- TMPL_VAR Name="string1" --></p>
126         <!-- /TMPL_IF -->
127         <!-- TMPL_LOOP Name="paramsloop" -->
128             <!-- TMPL_IF Name="status" -->
129                 <p class="error"><!-- TMPL_VAR Name="string" --></p>
130             <!-- /TMPL_IF -->
131         <!-- /TMPL_LOOP -->
132     <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
133         <input type="hidden" name="shelves" value="1">
134         <h3>Create a New a Virtual Shelf</h3>
135         <table>
136         <tr><th scope="row"><label for="addshelf">Shelf Name:</label> </th><td> <input id="addshelf" type="text" name="addshelf" size="25"></td></tr>
137         <tr><th scope="row"><label for="owner">Owner:</label> </th><td><input type="hidden" name="owner" id="owner" value="<!-- TMPL_VAR name="loggedinuser" -->"><!-- TMPL_VAR name="loggedinusername" --></td></tr>
138         <tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category">
139                                     <option value="1">Private</option>
140                                     <option value="2">Public</option>
141                                     <option value="3">Free</option>
142                                     </select></td></tr></table>
143         <ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen only by you.</li><li> A <strong>public</strong> virtual shelf can be seen by everybody, but managed only by you.</li>
144             <li> A <strong>free</strong> virtual shelf can be added to and changed by any user.</li></ul>
145                                 <p><input type="submit" value="Add New Shelf"></p>
146                     </form>
147     
148         <!-- TMPL_IF NAME="shelvesloop" -->
149         <form method="post" action="/cgi-bin/koha/opac-shelves.pl" name="mainform">
150                     <input type="hidden" name="shelves" value="1" />
151                     <h3>Delete Virtual Shelves</h3>
152                     <table>
153                         <tr><th>&nbsp;</th><th>Shelf Name</th><th>Contents</th></tr>
154                         <!-- TMPL_LOOP Name="shelvesloop" -->
155                         <!-- TMPL_IF name="canmanage" -->
156                         <tr>
157                             <td><input type="checkbox" name="DEL-<!-- TMPL_VAR Name="shelf" -->" /></td><td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a></td><td><!-- TMPL_VAR Name="shelfbookcount" --> item(s)</td></tr>
158                         <!-- /TMPL_IF -->
159                         <!-- /TMPL_LOOP -->
160                     </table>
161         <input type="submit" value="Delete Shelves" /></form>
162         <!-- /TMPL_IF -->
163         <p><form class="inline" action="opac-shelves.pl" method="get"><input type="submit" value="Back to Virtual Shelves" /></form></p>
164
165     <!-- TMPL_ELSE -->
166     <!-- TMPL_IF name="edit" -->
167         <form method="post">
168             <input type="hidden" name="op" value="modifsave">
169             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
170 <h3>Modify Virtual Shelf <!-- TMPL_VAR name="shelfname"--></h3>
171             <table>
172             <tr><td><label for="shelfname">Shelf Name: </label></td><td><input type="text" id="shelfname" name="shelfname" size="25" value="<!-- TMPL_VAR name="shelfname"-->" /></td></tr>
173             <tr><td><label for="owner">Owner: </label></td><td><input type="hidden" id="owner" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></td></tr>
174             <tr><td><label for="category">Category: </label></td><td><select id="category" name="category">
175                     <!-- TMPL_IF name="category1" -->
176                         <option value="1" selected>Private</option>
177                     <!-- TMPL_ELSE -->
178                         <option value="1">Private</option>
179                     <!-- /TMPL_IF -->
180                     <!-- TMPL_IF name="category2" -->
181                         <option value="2" selected>Public</option>
182                     <!-- TMPL_ELSE -->
183                         <option value="2">Public</option>
184                     <!-- /TMPL_IF -->
185                     <!-- TMPL_IF name="category3" -->
186                         <option value="3" selected>Free</option>
187                     <!-- TMPL_ELSE -->
188                         <option value="3">Free</option>
189                     <!-- /TMPL_IF -->
190                 </select></td></tr>
191             </table>
192             <ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen <strong>only</strong> by you.</li>
193                 <li> A <strong>public</strong> virtual shelf can be seen by <strong>everybody</strong>, but managed only by you.</li>
194                 <li>A <strong>free</strong> virtual shelf can be added to or changed by <strong>any</strong> user.</li></ul>
195             <p><input type="submit" value="Save Changes"></p>
196
197         </form>
198 <!-- /TMPL_IF -->
199 <h3>Virtual Shelves</h3>
200
201 <table>
202 <tr><th>Shelf Name</th><th>Category</th><th>Content Size</th><th>&nbsp;</th></tr>
203 <!-- TMPL_LOOP Name="shelvesloop" -->
204 <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->><td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a></td><td><!-- TMPL_IF NAME="category1" -->Private<!-- /TMPL_IF --><!-- TMPL_IF NAME="category2" -->Public<!-- /TMPL_IF --><!-- TMPL_IF NAME="category3" -->Free<!-- /TMPL_IF --></td><td><!-- TMPL_VAR Name="shelfbookcount" --> item(s)</td><td><!-- TMPL_IF name="mine" --><a href="opac-shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Modify</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
205             <!-- /TMPL_LOOP -->
206         </table>
207         <p><form action="/cgi-bin/koha/opac-shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or Remove Book Shelves" /></form></p>
208     <!-- /TMPL_IF -->
209 <!-- /TMPL_IF -->
210
211 <br clear="both" />
212
213 <script type="text/javascript" language="javascript">
214     // Set the focus the barcode input if it exists.
215     var barcodeInput;
216     if (barcodeInput = document.getElementById('addbarcode')) {
217         barcodeInput.focus();
218     }
219     /**
220      *  Function checkForm
221      *  This function check the form beform submited it.
222      *  If there are items to add to bookbag then add it there.
223      */
224     function checkForm(form){
225         if( form.addToBookBag.checked ) { // add to BookBag
226             AddCheckedToBookBag(form);
227         }
228         return true;
229     }
230
231     /**
232      *  Function AddCheckedToBookBag
233      *  This function add the checked item to bookbag.
234      */
235         function AddCheckedToBookBag(form) {
236             var inputs = form.getElementsByTagName('input');
237             for(var i=0,num=inputs.length; i < num; i++){
238                 var input = inputs[i].getAttribute('type');
239                 if (input == "checkbox") {
240                     if( inputs[i].checked ) {
241                         var itemnumber   = inputs[i].getAttribute('name');
242                         var regexp       = /MOD-/;
243                         if(itemnumber.match(regexp)){
244                             var biblionumber = inputs[i+1].value;
245                             addRecord(biblionumber,null,1); // function from basket.js
246                         }
247                     }
248                 }
249             }
250         }
251 </script>
252
253 <!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->