Bug 19289: Extend size of inputs to 50
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / neworderempty.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="acq_neworderempty" class="acq">
10
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'acquisitions-search.inc' %]
13
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</div>
15
16 <div id="doc3" class="yui-t2">
17
18 <div id="bd">
19     <div id="yui-main">
20     <div class="yui-b">
21
22 <h2>
23     [% IF ( ordernumber ) %]
24         Modify order line
25     [% ELSE %]
26         New order
27     [% END %]
28 </h2>
29
30 <div class="error" style="display:none"></div>
31
32 [% IF ( basketno ) %]
33     <div id="acqui_basket_summary"  class="yui-g">
34     <fieldset class="rows">
35         <legend>Basket details</legend>
36         <ol>
37         [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
38         [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
39         [% IF ( basketcontractno ) %]
40             <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
41             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
42         [% END %]
43         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
44         [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
45         [% IF ( closedate ) %]
46         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
47         <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
48         [% IF ( basketgroups ) %]
49             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
50                 [% FOREACH basketgroup IN basketgroups %]
51                     [% IF ( basketgroup.default ) %]
52                     <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
53                     [% ELSE %]
54                     <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
55                     [% END %]
56                 [% END %]
57                 </select>
58                 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
59                 <input type="hidden" value="mod_basket" name="op" />
60                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
61             </li>
62             <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
63         [% END %]
64         </form>
65         [% END %]
66         </ol>
67     </fieldset>
68     </div>
69 [% END %]
70
71 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" class="validated" id="Aform" onsubmit="return Check(this);" >
72
73     <fieldset class="rows">
74         <legend>Patrons</legend>
75         <ol>
76             <li>
77                 <span class="label">To notify on receiving:</span>
78                 <div style="float:left">
79                     <ul id="users_names" style="padding-left:0">
80                       [% FOREACH user IN users %]
81                         <li id="user_[% user.borrowernumber %]">
82                             [% user.firstname %] [% user.surname %]
83                             [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
84                         </li>
85                       [% END %]
86                     </ul>
87                     <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
88                     <input type="hidden" id="op" name="op" value="mod_users" />
89                     <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
90                 </div>
91             </li>
92         </ol>
93     </fieldset>
94
95 <fieldset class="rows">
96         <legend>
97             Catalog details
98             [% IF ( biblionumber ) %]
99                 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
100             [% END %]
101         </legend>
102         [% UNLESS ( existing ) %]
103         <input type="hidden" name="existing" value="no" />
104         [% END %]
105         <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
106         <input type="hidden" name="basketno" value="[% basketno %]" />
107         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
108         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
109         <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
110         <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
111         <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
112         <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
113
114         [% FOREACH c IN currencies %]
115             <input type="hidden" id="currency_rate_[% c.currency %]"  name="[% c.currency %]" value="[% c.rate %]" />
116         [% END %]
117
118         [% IF NOT Koha.Preference('UseACQFrameworkForBiblioRecords') OR NoACQframework %]
119             <ol><li>
120                 [% IF ( biblionumber ) %]
121                 <span class="label">Title</span>
122                     <input type="hidden" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
123                 [% ELSE %]
124                 <label for="entertitle">Title: </label>
125                     <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" class="focus" required="required" />
126                     <span class="required">Required</span>
127                 [% END %]
128             </li>
129             <li>
130                 [% IF ( biblionumber ) %]
131                 <span class="label">Author: </span>
132                     <input type="hidden" name="author" id="author" value="[% author %]" />[% author %]
133                 [% ELSE %]
134                 <label for="author">Author: </label>
135                     <input type="text" size="50" name="author" id="author" value="[% author %]" />
136                 [% END %]
137             </li>
138             <li>
139                 [% IF ( biblionumber ) %]
140                 <span class="label">Publisher: </span>
141                     <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
142                 [% ELSE %]
143                 <label for="publishercode"> Publisher: </label>
144                     <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
145                 [% END %]
146             </li>
147             <li>
148                 [% IF ( biblionumber ) %]
149                 <span class="label">Edition: </span>
150                     <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
151
152                 [% ELSE %]
153                 <label for="editionstatement">Edition: </label>
154                     <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
155                 [% END %]
156             </li>
157             <li>
158                 [% IF ( biblionumber ) %]
159                 <span class="label">Publication year: </span>
160                     <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
161                 [% ELSE %]
162                 <label for="publicationyear">Publication year: </label>
163                     <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
164                 [% END %]
165             </li>
166             <li>
167                 [% IF ( biblionumber ) %]
168                 <span class="label">ISBN: </span>
169                     <input type="hidden" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
170                 [% ELSE %]
171                 <label for="ISBN">ISBN: </label>
172                     <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
173                 [% END %]
174             </li>
175             [% IF (UNIMARC) %]
176             <li>
177                 [% IF ( biblionumber ) %]
178                 <span class="label">EAN: </span>
179                     <input type="hidden" name="ean" id="EAN" value="[% ean %]" />[% ean %]
180                 [% ELSE %]
181                 <label for="EAN">EAN: </label>
182                     <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
183                 [% END %]
184             </li>
185             [% END %]
186             <li>
187                 [% IF ( biblionumber ) %]
188                 <span class="label">Series: </span>
189                     <input type="hidden" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
190                 [% ELSE %]
191                 <label for="series">Series: </label>
192                     <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
193                 [% END %]
194             </li>
195                 [% UNLESS ( biblionumber ) %]
196                 [% IF ( itemtypeloop ) %]
197                 <li>
198                     <span class="label">Item type:</span>
199                     <select name="itemtype" style="width:12em;">
200                     [% FOREACH itemtype IN itemtypeloop %]
201                         <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
202                     [% END %]
203                     </select>
204                 </li>
205                 [% END %]
206                 [% END %]
207             </ol>
208         [% ELSE %]
209             <input type="hidden" name="use_ACQ_framework" value="1" />
210             [% IF biblionumber %]
211                 <ol>
212                     [% FOREACH field IN catalog_details %]
213                         <li>
214                             <div class="subfield_line">
215                                 <label>[% field.lib %] ([% field.tag %][% field.subfield %])</label>
216                                 [% field.value %]
217                             </div>
218                         </li>
219                     [% END %]
220                 </ol>
221             [% ELSE %]
222                 <ol>
223                     [% FOREACH field IN catalog_details %]
224                         <li>
225                             <div class="subfield_line">
226                                 [% PROCESS display_subfield field=field %]
227                             </div>
228                         </li>
229                     [% END %]
230                 </ol>
231             [% END %]
232         [% END %]
233     </fieldset>
234
235     [% IF ( suggestionid ) %]
236         <fieldset class="rows">
237         <legend>Suggestion</legend>
238         <ol>
239           <li>
240             <span class="label">Suggested by: </span>
241             [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
242           </li>
243         </ol>
244         </fieldset>
245     [% END %]
246
247     [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
248       [% IF (AcqCreateItemOrdering) %]
249
250       <div id="items_list" style="display:none">
251           <p><b>Items list</b></p>
252           <div style="width:100%;overflow:auto;">
253               <table>
254                   <thead>
255                       <tr>
256                           <th>&nbsp;</th>
257                           <th>&nbsp;</th>
258                           <th>Barcode</th>
259                           <th>Home library</th>
260                           <th>Holding library</th>
261                           <th>Not for loan</th>
262                           <th>Restricted</th>
263                           <th>Location</th>
264                           <th>Call number</th>
265                           <th>Copy number</th>
266                           <th>Inventory number</th>
267                           <th>Collection code</th>
268                           <th>Item type</th>
269                           <th>Materials</th>
270                           <th>Notes</th>
271                       </tr>
272                   </thead>
273                   <tbody>
274                   </tbody>
275               </table>
276           </div>
277       </div>
278
279       <fieldset class="rows" id="itemfieldset">
280           <legend>Item</legend>
281           [% IF ( NoACQframework ) %]
282               <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
283           [% END %]
284
285           [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
286               <div class="dialog message">The autoBarcode system preference is set to [% Koha.Preference('autoBarcode') %] and items with blank barcodes will have barcodes generated upon save to database</div>
287           [% END %]
288
289           <div id="outeritemblock"></div>
290
291       </fieldset>
292       [% END %][%# UNLESS subscriptionid %]
293     [% END %][%# IF (AcqCreateItemOrdering) %]
294     <fieldset class="rows">
295         <legend>Accounting details</legend>
296         <ol>
297             <li>
298                 [% IF ( close ) %]
299                     <span class="label required">Quantity: </span>
300                     <input type="hidden" name="quantity" value="[% quantity %]" />[% quantity %]
301                 [% ELSE %]
302                     <label class="required" for="quantity">Quantity: </label>
303                     [% IF (AcqCreateItemOrdering) %]
304                         [% IF subscriptionid || basket.is_standing %]
305                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
306                         [% ELSE %]
307                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
308                         [% END %]
309                     [% ELSE %]
310                         [% IF subscriptionid || basket.is_standing %]
311                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
312                         [% ELSE %]
313                             <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
314                         [% END %]
315                     [% END %]
316                     <span class="required">Required</span>
317                 [% END %]
318                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
319                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
320             </li>
321             <li>
322                 [% IF ( close ) %]
323             <span class="label required">Fund: </span>
324                     <input type="hidden" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
325                 [% ELSE %]
326                 <label class="required" for="budget_id">Fund: </label>
327                 [% active_count = 0 %]
328                 [% IF !ordernumber %]
329                     [% FOREACH budget_loo IN budget_loop %]
330                         [% active_count= active_count + budget_loo.b_active %]
331                     [% END %]
332                 [% END %]
333                 <select id="budget_id" size="1" name="budget_id">
334                     <option value="">Select a fund</option>
335                 [% FOREACH budget_loo IN budget_loop %]
336                     [% IF ( budget_loo.b_sel ) %]
337                         [% active_count = 0 #select no other fund %]
338                         <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
339                                 style="padding-left:[% budget_loo.b_level %]em;"
340                         >
341                     [% ELSIF active_count==1 && budget_loo.b_active %]
342                         <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
343                                 style="padding-left:[% budget_loo.b_level %]em;"
344                         >
345                     [% ELSE %]
346                         [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
347                         <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
348                                 style="padding-left:[% budget_loo.b_level %]em;"
349                         >
350                     [% END %]
351                     [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
352                     </option>
353                 [% END %]
354                 </select>
355                 <span class="required">Required</span>
356                 <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
357                 <input type="checkbox" id="showallbudgets" />
358                 [% END %]
359             </li>
360                 <li>
361                 [% IF ( close ) %]
362                         <span class="label">Currency: </span>
363             <input type="hidden" name="currency" id="currency" value="[% currency %]" />[% currency %]
364                 [% ELSE %]
365                         <label for="currency">Currency:</label>
366             <select name="currency" id="currency" onchange="updateCosts();">
367                 [% FOREACH c IN currencies %]
368                     [% IF ordernumber and c.currency == currency or not ordernumber and c.currency == vendor_currency %]
369                         <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
370                     [% ELSIF not c.archived %]
371                         <option value="[% c.currency %]">[% c.currency %]</option>
372                     [% END %]
373                 [% END %]
374             </select>
375                 [% END %]
376                 </li>
377             <li>
378                 [% IF ( close ) %]
379                     <span class="label">Vendor price: </span>
380                     <input type="hidden" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %] [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
381                 [% ELSE %]
382                 <label for="listprice">Vendor price: </label>
383                     <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
384                 [% END %]
385             </li>
386             [% UNLESS ( close ) %]
387             <li>
388                     <label for="uncertainprice">Uncertain price: </label>
389                     [% IF ( uncertainprice ) %]
390                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
391                     [% ELSE %]
392                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
393                 [% END %]
394             </li>
395             [% END %]
396             [% IF ( gst_values ) %]
397                 <li>
398                     [% IF ( close ) %]
399                         <span class="label">Tax rate: </span>
400                         <input type="hidden" name="tax_rate" id="tax_rate" value="[% tax_rate %]" />[% tax_rate %]%
401                     [% ELSE %]
402                         <label for="tax_rate">Tax rate: </label>
403                         <select name="tax_rate" id="tax_rate" onchange="updateCosts();">
404                         [% FOREACH gst IN gst_values %]
405                           [% IF ( gst.option == tax_rate ) %]
406                             <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option>
407                           [% ELSE %]
408                             <option value="[% gst.option %]">[% gst.option * 100 %]%</option>
409                           [% END %]
410                         [% END %]
411                         </select>
412                     [% END %]
413                 [% ELSE %]
414                     <input type="hidden" name="tax_rate" value="0" />
415                 </li>
416             [% END %]
417             <li>
418                 <label for="discount">Discount: </label>
419                 [% IF ( close ) %]
420                     [% IF ( orderdiscount ) %]
421                         <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
422                     [% ELSE %]
423                         <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
424                     [% END %]
425                 [% ELSE %]
426                     [% IF ( orderdiscount ) %]
427                         <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
428                     [% ELSE %]
429                         <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
430                     [% END %]
431                 [% END %]
432             </li>
433             <li>
434                 [% IF ( close ) %]
435                     <span class="label">Replacement cost: </span>
436                     <input type="hidden" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]  (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
437                 [% ELSE %]
438                     <label for="rrp">Replacement cost: </label>
439                     <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
440                 [% END %]
441             </li>
442             <li>
443                 <label for="ecost">Budgeted cost: </label>
444                 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
445             </li>
446             <li>
447                 <label for="total">Total: </label>
448                 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" /> (budgeted cost * quantity)
449             </li>
450             <li>
451                 [% IF ( close ) %]
452                     <label for="unitprice">Actual cost: </label>
453                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
454                 [% ELSE %]
455                     <label for="unitprice">Actual cost: </label>
456                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
457                 [% END %]
458             </li>
459             <li>
460                 <label for="order_internalnote">Internal note: </label>
461                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea>
462             </li>
463             <li>
464                 <label for="order_vendornote">Vendor note: </label>
465                 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea>
466             </li>
467             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
468                 <label for="sort1">Statistic 1: </label>
469                 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
470             <li>
471                 <label for="sort2">Statistic 2: </label>
472                 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
473             </li>
474         </ol>
475     </fieldset>
476     <fieldset class="action">
477         <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
478         <input type="submit" value="Save" />
479         [% IF (suggestionid) %]
480             <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
481         [% ELSE %]
482             [% IF subscriptionid %]
483                 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
484             [% ELSE %]
485                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
486             [% END %]
487         [% END %]
488     </fieldset>
489 </form>
490
491 <div id="procModal" data-backdrop="static" class="modal fade" aria-labelledby="procModal" aria-hidden="true">
492     <div class="modal-dialog">
493     <div class="modal-content">
494     <div class="modal-body">
495     <h3>Processing multiple items</h3>
496     </div>
497     </div>
498     </div>
499 </div>
500
501 <div id="multiCountModal" class="modal fade" aria-labelledby="multiCountModal" aria-hidden="true">
502     <div class="modal-dialog">
503     <div class="modal-content">
504     <h3>Invalid number of copies</h3>
505     <p>Please enter a <b>number</b>, greater than or equal to 1</p>
506     </div>
507     </div>
508 </div>
509
510 </div>
511 </div>
512 <div class="yui-b">
513 [% INCLUDE 'acquisitions-menu.inc' %]
514 </div>
515 </div>
516
517 [% MACRO jsinclude BLOCK %]
518     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
519     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
520     [% INCLUDE 'additem.js.inc' %]
521     <script type="text/javascript" src="[% interface %]/[% theme %]/js/additem_[% KOHA_VERSION %].js"></script>
522     <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging_[% KOHA_VERSION %].js"></script>
523     <script type="text/javascript" src="[% interface %]/[% theme %]/js/prevent_submit_[% KOHA_VERSION %].js"></script>
524     <script type="text/javascript">
525         actTotal = "";
526
527         function Check(ff) {
528             [% IF (AcqCreateItemOrdering) %]
529                 // Remove last itemblock if it is not in items_list
530                 var lastitemblock = $("#outeritemblock > div:last");
531                 var tobedeleted = true;
532                 var listitems = $("#items_list tr");
533                 $(listitems).each(function(){
534                     if($(this).attr('idblock') == $(lastitemblock).attr('id')){
535                         tobedeleted = false;
536                     }
537                 });
538                 if(tobedeleted){
539                     $(lastitemblock).remove();
540                 }
541             [% END %]
542
543             var ok=0;
544             var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
545
546             _alertString +="-------------------------------------------------------------------\n\n";
547
548             if(isNull(ff.budget_id,1)){
549                 ok=1;
550                 _alertString += "\n- "+ _("You must select a fund");
551             }
552
553             if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
554                 ok=1;
555                             _alertString += "\n- " + _("Quantity must be greater than '0'");
556             }
557
558             if (!(isNum(ff.listprice,0))){
559                 ok=1;
560                             _alertString += "\n- " + _("Vendor price must be a number");
561             }
562
563             if (!(isNum(ff.total,0))){
564                 ok=1;
565                             _alertString += "\n- " + _("Total must be a number");
566             }
567
568             if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
569                 ok=1;
570                 _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
571             }
572
573             if ( ff.field_value ) {
574                 var empty_item_mandatory = CheckMandatorySubfields(ff);
575                 if (empty_item_mandatory > 0) {
576                     ok = 1;
577                     _alertString +=
578                         "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
579                 }
580
581             }
582
583             if (ok) {
584                 alert(_alertString);
585                 [% IF (AcqCreateItemOrdering) %]
586                     if(tobedeleted) {
587                         $(lastitemblock).appendTo('#outeritemblock');
588                     }
589                 [% END %]
590                 return false;
591             }
592
593             [% IF (AcqCreateItemOrdering) %]
594                 if(check_additem('[% UniqueItemFields %]') == false) {
595                     alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
596                     if(tobedeleted) {
597                         $(lastitemblock).appendTo('#outeritemblock');
598                     }
599                     return false;
600                 }
601             [% END %]
602         }
603
604         $(document).ready(function(){
605             [% IF AcqCreateItemOrdering and not basket.is_standing %]
606                 cloneItemBlock(0, '[% UniqueItemFields %]');
607             [% END %]
608
609             [% IF ( suggestionid ) %]updateCosts();[% END %]
610             $("#quantity").change(function() {
611                 updateCosts();
612             });
613
614             //We apply the fonction only for modify option
615             [% IF ( quantityrec ) %]
616                 [% IF ( acqcreate ) %]
617                     $('#quantity').blur(function(){
618                         // if user decreases the quantity
619                         if($(this).val() < [% quantityrec %]){
620                             alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
621                             return true;
622                         } else {
623                             // if user increases the quantity
624                             alert(_("You can't add a new item, please create a new order line"));
625                             // and we replace the original value
626                             $(this).val([% quantityrec %])
627                             updateCosts(); // blur is invoked after change which updated values
628                             return false;
629                         }
630                     });
631                 [% END %]
632             [% END %]
633
634             //keep a copy of all budgets before removing the inactives
635             disabledBudgetsCopy = $('#budget_id').html();
636             $('#budget_id .b_inactive').remove();
637
638             $('#showallbudgets').click(function() {
639                 if ($(this).is(":checked")) {
640                     $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
641                 }
642                 else {
643                     $('#budget_id .b_inactive').remove();
644                 }
645             });
646
647             $("#budget_id").change(function(){
648                 var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
649                 var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
650                 var sort1 = $(destination_sort1).val() || "";
651                 if ( destination_sort1.length < 1 ) {
652                     destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
653                 }
654                 var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
655                 var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
656                 var sort2 = $(destination_sort2).val() || "";
657                 if ( destination_sort2.length < 1 ) {
658                     destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
659                 }
660                 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
661                 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
662             });
663             $("#budget_id").change();
664         });
665
666         function UserSearchPopup(f) {
667             window.open(
668                 "/cgi-bin/koha/acqui/add_user_search.pl",
669                 'UserSearchPopup',
670                 'width=740, height=450, scrollbars=yes, toolbar=no,'
671              );
672         }
673
674         function add_user(borrowernumber, borrowername) {
675             var ids = $("#users_ids").val();
676             if(ids.length > 0) {
677                 ids = ids.split(':');
678             } else {
679                 ids = new Array;
680             }
681         if (ids.indexOf(borrowernumber.toString()) < 0) {
682                 ids.push(borrowernumber);
683                 $("#users_ids").val(ids.join(':'));
684                 var li = '<li id="user_'+borrowernumber+'">'+borrowername
685                     + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
686                     + _("Delete user") + '</a>]</li>';
687                 $("#users_names").append(li);
688                 return 0;
689             }
690             return -1;
691         }
692
693         function del_user(borrowernumber) {
694             $("#user_"+borrowernumber).remove();
695             var ids = $("#users_ids").val().split(':');
696             ids.splice(ids.indexOf(borrowernumber.toString()), 1);
697             $("#users_ids").val(ids.join(':'));
698         }
699     </script>
700 [% END %]
701
702 [% INCLUDE 'intranet-bottom.inc' %]
703
704 [% BLOCK display_subfield %]
705     <label>[% field.lib %] ([% field.tag %][% field.subfield %])</label>
706     [% IF field.authorised_value %]
707         [% SWITCH field.authorised_value %]
708         [% CASE 'branches' %]
709             [% IF field.mandatory %]
710             <select name="bib_field_value" required="required">
711             [% ELSE %]
712             <select name="bib_field_value">
713             [% END %]
714                 <option value=""></option>
715                 [% PROCESS options_for_libraries libraries => Branches.all( selected => "FIXME" ) %]
716             </select>
717         [% CASE 'itemtypes' %]
718             [% IF field.mandatory %]
719             <select name="bib_field_value" required="required">
720             [% ELSE %]
721             <select name="bib_field_value">
722             [% END %]
723                 <option value=""></option>
724                 [% PROCESS options_for_itemtypes itemtypes => ItemTypes.Get(), selected_itemtype => "FIXME" %]
725             </select>
726         [% CASE 'cn_source' %]
727         [% CASE %]
728             [% PROCESS 'av-build-dropbox.inc' name="bib_field_value", category=field.authorised_value, default="FIXME" %]
729         [% END %]
730     [% ELSE %]
731         [% IF field.mandatory %]
732         <input type="text" name="bib_field_value" value="[% field.value %]" required="required" size="50" />
733         [% ELSE %]
734         <input type="text" name="bib_field_value" value="[% field.value %]" size="50" />
735         [% END %]
736
737     [% END %]
738     <input type="hidden" name="bib_kohafield" value="[% field.kohafield %]" />
739     <input type="hidden" name="bib_tag" value="[% field.tag %]" />
740     <input type="hidden" name="bib_subfield" value="[% field.subfield %]" />
741     [% IF field.mandatory %] <span class="required">Required</span>[% END %]
742 [% END %]