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