Bug 10904: Limit patron update request management by branch
[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>
106     <div class="dialog alert">Number of potential barcodes read: [% LinesRead %]</div>[% END %]
107     [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
108     [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
109     [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length %] barcodes that were too long.</div>[% END %]
110     [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
111     [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data %] barcodes that contained at least one unprintable character.</div>[% END %]
112     [% FOREACH error IN errorloop %]
113         <div class="dialog alert">
114             [% error.barcode %]
115             [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
116             [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
117             [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
118             [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
119         </div>
120     [% END %]
121        [% UNLESS op %]
122     <div class="yui-g">
123     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data" onsubmit="return checkForm()">
124         <fieldset class="rows">
125             <legend>Use a barcode file</legend>
126      <ol>
127             <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li>
128             <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepickerfrom" />
129             </li>
130           </ol>
131         </fieldset>
132
133         <fieldset class="rows">
134         <legend>Select items you want to check</legend>
135         <ol><li>
136         <label for="branch">Library: </label>
137             <input type="radio" name="branch" value="homebranch"> Home library</input>
138             <input type="radio" name="branch" value="holdingbranch"> Current library</input>
139         </li><li>
140         <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
141             <option value="">All libraries</option>
142         [% FOREACH branchloo IN branchloop %]
143             [% IF ( branchloo.selected ) %]
144                 <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
145             [% ELSE %]
146                 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
147             [% END %]
148         [% END %]
149         </select>
150         </li>
151         [% IF (authorised_values) %]
152         <li>
153             <label for="locationloop">Shelving location (items.location) is: </label>
154         <select id="locationloop" name="location">
155                 <option value="">Filter location</option>
156         [% FOREACH value IN authorised_values %]
157             [% IF (value.selected) %]
158                 <option value="[% value.authorised_value %]" selected="selected">[% value.lib %]</option>
159             [% ELSE %]
160                 <option value="[% value.authorised_value %]">[% value.lib %]</option>
161             [% END %]
162         [% END %]
163         </select>        </li>
164         [% END %]
165         <li>
166             <label for="minlocation">Item callnumber between: </label>
167                 <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber)  </li>
168            <li><label for="maxlocation">...and: </label>
169                 <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" />
170         </li>
171         [% IF (statuses) %]
172     </ol>
173     </fieldset>
174             <fieldset class="rows">
175             <legend>Item statuses</legend>
176             <div id="statuses" style="display: block;">
177                   [% FOREACH status IN statuses %]
178                       [% IF (status.values) %]
179                           <fieldset style="float: left; padding: 5px; margin: 5px;text-align:right">
180                               <legend>[% status.fieldname %]</legend>
181                               <ul id="statuses-[% fieldname %]" style="display: inline;">
182                               [% FOREACH value IN status.values %]
183                                   [% IF (value.lib) %]<li>
184                                     <label for="[% value.id %]">
185                                       [% value.lib %]
186                                     </label>
187                                     <input type="checkbox" name="status-[% status.fieldname %]-[% value.authorised_value %]" id="[% value.authorised_value %]" />
188                                   </li>[% END %]
189                               [% END %]
190                               </ul>
191                           </fieldset>
192                       [% END %]
193                   [% END %]
194                 </div>
195             </fieldset>
196         <fieldset class="rows">
197           <ol>
198         [% END %]
199
200         <li><label for="datelastseen">Inventory date:</label>
201             <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepickerfrom" />
202         </li>
203         <li><label for="ignoreissued">Skip items on loan: </label>
204             [% IF (ignoreissued) %]
205             <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /></li>
206             [% ELSE %]
207             <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
208             [% END %]
209         <li>
210            <label for="CSVexport">Export to CSV file: </label>
211            <input type="checkbox" name="CSVexport" id="CSVexport" />
212         </li>
213         <li>
214             <label for="compareinv2barcd">Compare barcodes list to results: </label>
215             <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
216         </li>
217         <li>
218             <label for="dont_checkin">Do not check in items scanned during inventory: </label>
219             <input type="checkbox" name="dont_checkin" id="dont_checkin" />
220         </li>
221         </ol>
222   </fieldset>
223             <input type="hidden" name="op" value="do_it" />
224
225             <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
226     </form>
227     </div>
228     </div>
229     [% END %]
230     [% IF (op) %]
231     <form method="post" action="/cgi-bin/koha/tools/inventory.pl" class="checkboxed">
232     <input type="hidden" name="markseen" value="1" />
233     <input type="hidden" name="minlocation" value="[% minlocation %]" />
234     <input type="hidden" name="maxlocation" value="[% maxlocation %]" />
235     <input type="hidden" name="location" value="[% location %]" />
236     <input type="hidden" name="branchcode" value="[% branchcode %]" />
237     <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
238
239     [% UNLESS compareinv2barcd %]
240       <div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
241     [% END %]
242
243     <table id="inventoryt">
244     <thead>
245         <tr>
246             [% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
247             <th>Barcode</th>
248             <th>Library</th>
249             <th>Title</th>
250             <th>Status</th>
251             <th>Lost</th>
252             <th>Damaged</th>
253             <th>Withdrawn</th>
254             <th>Unseen since</th>
255             <th>Problems</th>
256         </tr>
257     </thead>
258     <tbody>
259     [% FOREACH result IN loop %]
260         <tr>
261             [% UNLESS compareinv2barcd %]
262               <td>
263                 <input type="checkbox" name="SEEN-[% result.itemnumber %]" value="1" />
264               </td>
265             [% END %]
266             <td>
267             [% result.barcode | html %]
268             </td>
269             <td>
270                 [% Branches.GetName( result.homebranch ) %]
271                 [% result.location | html %] [% IF ( result.itemcallnumber ) %][[% result.itemcallnumber | html %]][% ELSE %][% END %]
272             </td>
273             <td>
274             <p><a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% result.biblionumber %]" class="openWin">[% result.title | html %]</a></p><p>[% result.author | html %]</p>
275             </td>
276             <td>
277             [% result.notforloan | html %]
278             </td>
279             <td>
280             [% result.itemlost | html %]
281             </td>
282             <td>
283             [% result.damaged | html %]
284             </td>
285             <td>
286             [% result.withdrawn | html %]
287             </td>
288             <td>
289             [% result.datelastseen | $KohaDates | html %]
290             </td>
291             <td>
292             [% IF result.problem == 'wrongplace' %]
293                 <p>Item should not have been scanned</p>
294             [% ELSIF result.problem == 'missingitem' %]
295                 <p>Item missing</p>
296             [% ELSIF result.problem == 'changestatus' %]
297                 <p>Change item status</p>
298             [% ELSIF result.problem == 'not_scanned' %]
299                 <p>Item should have been scanned</p>
300             [% END %]
301             </td>
302         </tr>
303     [% END %]
304     </tbody>
305     </table>
306     <div class="spacer"></div>
307     [% UNLESS compareinv2barcd %]
308       <div style="padding : .3em 0"><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
309       <input type="submit" id="markseenandquit" value="Mark seen and quit" />
310       <input type="submit" value="Mark seen and continue &gt;&gt;" id="markseenandcontinuebutton" />
311       <input type="submit" value="Continue without marking &gt;&gt;" id="continuewithoutmarkingbutton" class="submit" />
312     [% END %]
313     </form>
314
315     </div>
316
317     [% END %]
318 </div>
319 <div class="yui-b">
320 [% INCLUDE 'tools-menu.inc' %]
321 </div>
322 </div>
323 [% INCLUDE 'intranet-bottom.inc' %]