new virtual shelves changes, keyed by biblionumber
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / virtualshelves / shelves.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Virtual Shelves</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
5 <!-- TMPL_INCLUDE NAME="menus.inc" -->
6 <!-- TMPL_INCLUDE NAME="menu-virtualshelves.inc" -->
7
8 <!-- TMPL_IF NAME="viewshelf" -->
9 <div id="action">
10     <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl">Back to virtual Shelves</a>
11     <!-- TMPL_IF name="manageshelf" -->
12     <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">
13         Edit this shelf</a>
14     <!-- /TMPL_IF -->
15 </div>
16
17 <h3>Contents of <!-- TMPL_VAR NAME="shelfname" --></h3>
18
19 <form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post" name="mainform">
20     <!-- TMPL_IF NAME="itemsloop" -->
21     <table>
22         <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
23         <input type="hidden" name="modifyshelfcontents" value="1" />
24             <tr>
25                 <th>
26                     <a href="javascript:CheckAll();">
27                         <small>(Un)Check All</small>
28                     </a>
29                 </th>
30                 <th>&nbsp;</th>
31                 <th>Title</th>
32                 <th>Author</th>
33                 <th>Call No.</th>
34             </tr>
35         <!-- TMPL_LOOP NAME="itemsloop" -->
36             <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
37                     <td>
38                         <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
39                     </td>
40                     <td>
41                         <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
42                     </td>
43                     <td>
44                 <!-- TMPL_IF name="BiblioDefaultViewmarc" -->
45                             <a class="title" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
46                                 <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
47                             </a>
48                         <!-- TMPL_ELSE -->
49                             <!-- TMPL_IF name="BiblioDefaultViewisbd" -->
50                                 <a class="title" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
51                                     <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
52                                 </a>
53                             <!-- TMPL_ELSE -->
54                                 <a class="title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
55                                     <!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
56                                 </a>
57                             <!-- /TMPL_IF -->
58                         <!-- /TMPL_IF -->
59                     </td>
60                     <td><!-- TMPL_VAR NAME="author" --></td>
61                     <td><!-- TMPL_VAR NAME="classification" --></td>
62         </tr>
63         <!-- /TMPL_LOOP -->
64     </table>
65     <!-- TMPL_ELSE -->
66     <br />
67     <b>This shelf is empty.</b>
68     <!-- TMPL_UNLESS NAME="itemsloop" -->
69         <input type="hidden" name="DEL-<!-- TMPL_VAR NAME="shelfnumber" -->" />
70         <input type="hidden" name="shelves" value="1" />
71         <input type="submit" class="icon delete"
72                value="Delete this shelf"
73                onclick="return confirmDelete('Are you sure you want to delete this shelf?')" />
74         <!-- /TMPL_UNLESS -->
75         <!-- /TMPL_IF -->
76     <!-- TMPL_IF name="manageshelf" -->
77         <!-- TMPL_IF NAME="itemsloop" -->
78             <b>With selected items :</b>
79             <input type="submit"
80                    value="Remove"
81                    class="icon delete"
82                    onclick="return confirmDelete('Are you sure you want to remove these items from the shelf?')"
83                    style="display:inline;"
84                    />
85         <!-- /TMPL_IF -->
86         <!-- /TMPL_IF -->
87 </form>
88     <!-- TMPL_IF name="manageshelf" -->
89     
90 <br />
91 <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
92     <table>
93         <tr><th colspan="2">Add an item to this shelf by barcode</th></tr>
94         <tr>
95             <td>
96                 <label for="addbarcode">Barcode:</label>
97             </td>
98             <td>
99                 <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
100                 <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
101                 <input type="hidden" name="modifyshelfcontents" value="1" />
102                 <input type="submit" value="Save" />
103             </td>
104         </tr>
105     </table>
106 </form>
107 <!-- /TMPL_IF -->
108 <!-- TMPL_ELSE -->
109     <!-- TMPL_IF NAME="shelves" -->
110         <!-- TMPL_IF NAME="status1" -->
111             <p class="error"><!-- TMPL_VAR NAME="string1" --></p>
112         <!-- /TMPL_IF -->
113         <!-- TMPL_LOOP NAME="paramsloop" -->
114             <!-- TMPL_IF NAME="status" -->
115                 <p class="error"><!-- TMPL_VAR NAME="string" --></p>
116             <!-- /TMPL_IF -->
117         <!-- /TMPL_LOOP -->
118     <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl">
119         <input type="hidden" name="shelves" value="1">
120         <h3>Create a new virtual shelf</h3>
121         <table>
122         <tr><th scope="row"><label for="addshelf">Shelf name:</label> </th><td> <input id="addshelf" type="text" name="addshelf" size="25"></td></tr>
123         <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>
124         <tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category">
125                                     <option value="1">Private</option>
126                                     <option value="2">Public</option>
127                                                                         <option value="3">Free</option>
128                                     </select></td></tr></table>
129         <ul>
130             <li>A <b>private</b> virtual shelf is managed by you and can be seen only by you.</li>
131             <li> A <b>public</b> virtual shelf can be seen by everybody, but managed only by you.</li>
132                         <li> An <b>open</b> virtual shelf can be seen and managed by everybody.</li>
133         </ul>
134                                 <p><input type="submit" value="Add a new shelf"></p>
135                     </form>
136         
137         <!-- TMPL_IF NAME="numberCanManage" -->
138         <!-- TMPL_IF NAME="shelvesloop" -->
139         <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" name="mainform">
140                     <input type="hidden" name="shelves" value="1" />
141                     <h3>Delete virtual shelves</h3>
142                     <table>
143                         <tr><th>&nbsp;</th><th>Shelf name</th><th>Contents</th></tr>
144                         <!-- TMPL_LOOP NAME="shelvesloop" -->
145                         <!-- TMPL_IF name="canmanage" -->
146                         <tr>
147                             <td>
148                                 <input type="checkbox" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" />
149                             </td>
150                             <td>
151                                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a>
152                             </td>
153                             <td>
154                                 <!-- TMPL_VAR NAME="shelfvirtualcount" --> item(s)
155                             </td>
156                         </tr>
157                         <!-- /TMPL_IF -->
158                         <!-- /TMPL_LOOP -->
159                     </table>
160         <input type="submit" value="Delete shelves" /></form>
161         <!-- /TMPL_IF -->
162         <!-- /TMPL_IF -->
163         <br />
164         <p><form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
165
166     <!-- TMPL_ELSE -->
167     <!-- TMPL_IF name="edit" -->
168         <form method="post">
169             <input type="hidden" name="op" value="modifsave">
170             <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
171 <h3>Edit virtual shelf '<!-- TMPL_VAR name="shelfname"-->'</h3>
172             <table>
173             <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>
174             <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>
175             <tr><td><label for="category">Category: </label></td><td><select id="category" name="category">
176                     <!-- TMPL_IF name="category1" -->
177                         <option value="1" selected>Private</option>
178                     <!-- TMPL_ELSE -->
179                         <option value="1">Private</option>
180                     <!-- /TMPL_IF -->
181                     <!-- TMPL_IF name="category2" -->
182                         <option value="2" selected>Public</option>
183                     <!-- TMPL_ELSE -->
184                         <option value="2">Public</option>
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 <b>free</b> virtual shelf can be seen and managed by everybody.</li>
195             </ul>
196             <p><input type="submit" value="Save changes"></p>
197
198         </form>
199 <!-- /TMPL_IF -->
200 <!-- /TMPL_IF -->
201 <h3>Virtual shelves</h3>
202
203 <table>
204 <tr><th>Shelf name</th><th>Category</th><th>Items</th><th>&nbsp;</th></tr>
205
206 <!-- TMPL_LOOP NAME="shelvesloop" -->
207 <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
208 <td><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a></td>
209 <td>
210 <!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
211 <!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
212 <!-- TMPL_IF NAME="viewcategory3" -->Free<!-- /TMPL_IF -->
213 </td>
214 <td><!-- TMPL_VAR NAME="shelfvirtualcount" --> </td>
215 <td><!-- TMPL_IF name="mine" --><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Edit</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
216
217 <!-- /TMPL_LOOP -->
218 </table>
219         <p><form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or remove virtual shelves" /></form></p>
220     <!-- /TMPL_IF -->
221
222
223 <br clear="both" />
224
225 <script type="text/javascript">
226         function confirmDelete(s){
227                 if (window.confirm(s))
228                         return true;
229                 return false;
230         }
231         /**
232          * this function checks all checkbox 
233          * or uncheck all if there are already checked.
234          */
235         function CheckAll(){
236                 var checkboxes = document.getElementsByTagName('input');
237                 var nbCheckbox = checkboxes.length;
238                 var check = areAllChecked();
239                 check = !check;
240                 for(var i=0;i<nbCheckbox;i++){
241                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
242                                 checkboxes[i].checked = check;
243                         }
244                 }
245         }
246         /**
247          * this function return true if all checkbox are checked
248          */
249         function areAllChecked(){
250                 var checkboxes = document.getElementsByTagName('input');
251                 var nbCheckbox = checkboxes.length;
252                 for(var i=0;i<nbCheckbox;i++){
253                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
254                                 if(checkboxes[i].checked == 0){
255                                         return false;
256                                 }
257                         }
258                 }
259                 return true;
260         }
261         
262 </script>
263
264 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->