Bug 12564: Fixing capitalisation buttons in inventory tool
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / inventory.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Inventory</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 [% INCLUDE 'calendar.inc' %]
9 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
10 <script type="text/javascript">
11 //<![CDATA[
12 function checkForm() {
13     if ( $('#uploadbarcodes').val() ) {
14         if ( !(
15             $('#branchloop').val()   ||
16             $('#locationloop').val() ||
17             $('#minlocation').val()  ||
18             $('#maxlocation').val()  ||
19             $('#statuses input:checked').length
20         ) ) {
21             return confirm(
22                 _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
23                 _("For large catalogs this can result in unexpected behavior") + "\n\n" +
24                 _("Are you sure you want to do this?")
25             );
26         }
27     }
28
29     return true;
30 }
31
32 $(document).ready(function(){
33         inventorydt = $('#inventoryt').dataTable($.extend(true, {}, dataTablesDefaults, {
34             'sPaginationType': 'full_numbers',
35             [% IF compareinv2barcd %]
36                 "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 1 ] } ],
37             [% ELSE %]
38                 "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ],
39             [% END %]
40             'fnDrawCallback': function() {
41                 //bind the click handler script to the newly created elements held in the table
42                 $('.openWin').bind('click',function(e){
43                     e.preventDefault();
44                     openWindow(this.href,'marcview',800,600);
45                 });
46             }
47         } ));
48
49
50         $("#continuewithoutmarkingbutton").click(function(){
51             inventorydt.fnPageChange( 'next' );
52             return false;
53         });
54
55         $("#markseenandcontinuebutton").click(function(){
56             var param = '';
57             $("input:checked").each(function() {
58                 param += "|" + $(this).attr('name');
59             });
60             $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
61             inventorydt.fnPageChange( 'next' );
62             return false;
63         });
64
65         $("#markseenandquit").click(function(){
66             var param = '';
67             $("input:checked").each(function() {
68                 param += "|" + $(this).attr('name');
69             });
70             $.ajax({
71               type: 'POST',
72               url: '/cgi-bin/koha/tools/ajax-inventory.pl',
73               data: { seen: param},
74               async: false
75             });
76             document.location.href = '/cgi-bin/koha/tools/inventory.pl';
77             return false;
78         });
79
80
81     $(".checkall").click(function(){
82             $(".checkboxed").checkCheckboxes();
83             return false;
84         });
85     $(".clearall").click(function(){
86             $(".checkboxed").unCheckCheckboxes();
87             return false;
88         });
89 });
90 //]]>
91 </script>
92 </head>
93 <body id="tools_inventory" class="tools">
94 [% INCLUDE 'header.inc' %]
95 [% INCLUDE 'cat-search.inc' %]
96
97 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF (loop) %]<a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a> &rsaquo; Results[% ELSE %]Inventory[% END %]</div>
98
99 <div id="doc3" class="yui-t2">
100
101    <div id="bd">
102     <div id="yui-main">
103     <div class="yui-b">
104     <h1>Inventory/Stocktaking</h1>
105     [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
106     [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
107     [% FOREACH error IN errorloop %]
108         <div class="dialog alert">
109             [% error.barcode %]
110             [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
111             [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
112             [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
113             [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
114         </div>
115     [% END %]
116        [% UNLESS op %]
117     <div class="yui-g">
118     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data" onsubmit="return checkForm()">
119         <fieldset class="rows">
120             <legend>Use a barcode file</legend>
121      <ol>
122             <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li>
123             <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepickerfrom" />
124             </li>
125           </ol>
126         </fieldset>
127
128         <fieldset class="rows">
129         <legend>Select items you want to check</legend>
130         <ol><li>
131         <label for="branch">Library: </label>
132             <input type="radio" name="branch" value="homebranch"> Home library</input>
133             <input type="radio" name="branch" value="holdingbranch"> Current library</input>
134         </li><li>
135         <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
136             <option value="">All libraries</option>
137         [% FOREACH branchloo IN branchloop %]
138             [% IF ( branchloo.selected ) %]
139                 <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
140             [% ELSE %]
141                 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
142             [% END %]
143         [% END %]
144         </select>
145         </li>
146         [% IF (authorised_values) %]
147         <li>
148             <label for="locationloop">Shelving location (items.location) is: </label>
149         <select id="locationloop" name="location">
150                 <option value="">Filter location</option>
151         [% FOREACH value IN authorised_values %]
152             [% IF (value.selected) %]
153                 <option value="[% value.authorised_value %]" selected="selected">[% value.lib %]</option>
154             [% ELSE %]
155                 <option value="[% value.authorised_value %]">[% value.lib %]</option>
156             [% END %]
157         [% END %]
158         </select>        </li>
159         [% END %]
160         <li>
161             <label for="minlocation">Item callnumber between: </label>
162                 <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber)  </li>
163            <li><label for="maxlocation">...and: </label>
164                 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" />
165         </li>
166         [% IF (statuses) %]
167     </ol>
168     </fieldset>
169             <fieldset class="rows">
170             <legend>Item statuses</legend>
171             <div id="statuses" style="display: block;">
172                   [% FOREACH status IN statuses %]
173                       [% IF (status.values) %]
174                           <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
175                               <legend>[% status.fieldname %]</legend>
176                               <ul id="statuses-[% fieldname %]" style="display: inline;">
177                               [% FOREACH value IN status.values %]
178                                   [% IF (value.lib) %]<li>
179                                     <label for="[% value.id %]">
180                                       [% value.lib %]
181                                     </label>
182                                     <input type="checkbox" name="status-[% status.fieldname %]-[% value.authorised_value %]" id="[% value.authorised_value %]" />
183                                   </li>[% END %]
184                               [% END %]
185                               </ul>
186                           </fieldset>
187                       [% END %]
188                   [% END %]
189                 </div>
190             </fieldset>
191         <fieldset class="rows">
192           <ol>
193         [% END %]
194
195         <li><label for="datelastseen">Inventory date:</label>
196             <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepickerfrom" />
197         </li>
198         <li><label for="ignoreissued">Skip items on loan: </label>
199             [% IF (ignoreissued) %]
200             <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /></li>
201             [% ELSE %]
202             <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
203             [% END %]
204         <li>
205            <label for="CSVexport">Export to CSV file: </label>
206            <input type="checkbox" name="CSVexport" id="CSVexport" />
207         </li>
208         <li>
209             <label for="compareinv2barcd">Compare barcodes list to results: </label>
210             <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
211         </li>
212         </ol>
213   </fieldset>
214             <input type="hidden" name="op" value="do_it" />
215
216             <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
217     </form>
218     </div>
219     </div>
220     [% END %]
221     [% IF (op) %]
222     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" class="checkboxed">
223     <input type="hidden" name="markseen" value="1" />
224     <input type="hidden" name="minlocation" value="[% minlocation %]" />
225     <input type="hidden" name="maxlocation" value="[% maxlocation %]" />
226     <input type="hidden" name="location" value="[% location %]" />
227     <input type="hidden" name="branchcode" value="[% branchcode %]" />
228     <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
229
230     [% UNLESS compareinv2barcd %]
231       <div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
232     [% END %]
233
234     <table id="inventoryt">
235     <thead>
236         <tr>
237             [% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
238             <th>Barcode</th>
239             <th>Library</th>
240             <th>Title</th>
241             <th>Status</th>
242             <th>Lost</th>
243             <th>Damaged</th>
244             <th>Unseen since</th>
245             <th>Problems</th>
246         </tr>
247     </thead>
248     <tbody>
249     [% FOREACH result IN loop %]
250         <tr>
251             [% UNLESS compareinv2barcd %]
252               <td>
253                 <input type="checkbox" name="SEEN-[% result.itemnumber %]" value="1" />
254               </td>
255             [% END %]
256             <td>
257             [% result.barcode | html %]
258             </td>
259             <td>
260                 [% Branches.GetName( result.homebranch ) %]
261                 [% result.location | html %] [% IF ( result.itemcallnumber ) %][[% result.itemcallnumber | html %]][% ELSE %][% END %]
262             </td>
263             <td>
264             <p><a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% result.biblionumber %]" class="openWin">[% result.title | html %]</a></p><p>[% result.author | html %]</p>
265             </td>
266             <td>
267             [% result.notforloan | html %]
268             </td>
269             <td>
270             [% result.itemlost | html %]
271             </td>
272             <td>
273             [% result.damaged | html %]
274             </td>
275             <td>
276             [% result.datelastseen | $KohaDates | html %]
277             </td>
278             <td>
279             [% IF result.problem == 'wrongplace' %]
280                 <p>Item should not have been scanned</p>
281             [% ELSIF result.problem == 'missingitem' %]
282                 <p>Item missing</p>
283             [% ELSIF result.problem == 'changestatus' %]
284                 <p>Change item status</p>
285             [% ELSIF result.problem == 'not_scanned' %]
286                 <p>Item should have been scanned</p>
287             [% END %]
288             </td>
289         </tr>
290     [% END %]
291     </tbody>
292     </table>
293     <div class="spacer"></div>
294     [% UNLESS compareinv2barcd %]
295       <div style="padding : .3em 0"><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
296       <input type="submit" id="markseenandquit" value="Mark seen and quit" />
297       <input type="submit" value="Mark seen and continue &gt;&gt;" id="markseenandcontinuebutton" />
298       <input type="submit" value="Continue without marking &gt;&gt;" id="continuewithoutmarkingbutton" class="submit" />
299     [% END %]
300     </form>
301
302     </div>
303
304     [% END %]
305 </div>
306 <div class="yui-b">
307 [% INCLUDE 'tools-menu.inc' %]
308 </div>
309 </div>
310 [% INCLUDE 'intranet-bottom.inc' %]