Bug 10661: format mandatory item fields the same on all forms
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / addorderiso2709.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; Order staged MARC records
4 [% IF ( batch_details ) %]
5  &rsaquo; Batch [% import_batch_id %]
6 [% ELSE %]
7  &rsaquo; Batch list
8 [% END %]
9 </title>
10 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% INCLUDE 'datatables.inc' %]
13 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
14 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
15 <script type="text/JavaScript">
16 //<![CDATA[
17     [% IF (dateformat == 'metric') %]
18         dt_add_type_uk_date();
19     [% END %]
20     $(document).ready(function() {
21         var srlt = $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
22             "aoColumns": [
23                 null,null,null,{ "sType": "title-string" },null,null
24             ],
25             "aoColumnDefs": [
26                 { "aTargets": [ 5 ], "bSortable": false, "bSearchable": false },
27             ],
28             "sPaginationType": "four_button",
29             "aaSorting": []
30         } ) );
31
32         $("form#Aform").submit(function() {
33             var total_errors = CheckMandatorySubfields(this);
34             if (total_errors > 0) {
35                 var alertString  = _("Form not submitted because of the following problem(s)");
36                 alertString += "\n------------------------------------------------------------------------------------\n";
37                 alertString += "\n- "+ total_errors + _(" mandatory fields empty (highlighted)");
38                 alert(alertString);
39                 return false;
40             }
41             return true;
42         });
43     });
44 //]]>
45 </script>
46 </head>
47 <body id="acq_addorderiso2709" class="acq">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'acquisitions-search.inc' %]
50 <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 %]">[% booksellername %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo;  Add orders from iso2709 file</div>
51 <div id="doc3" class="yui-t2">
52    <div id="bd">
53        <div id="yui-main">
54            <div class="yui-b">
55              [% IF ( batch_details ) %]
56                   <h1>Add orders from [% comments %]
57                     ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
58                   </h1>
59                <div>
60                    <form action="[% scriptname %]" method="post" name="import_biblios">
61                      <table>
62                      <tr>
63                          <th>Citation</th>
64                          <th>Match?</th>
65                          <th>Order</th>
66                        </tr>
67                        [% FOREACH biblio_lis IN biblio_list %]
68                          <tr>
69                              <td>
70                                 [% biblio_lis.citation %]
71
72                              </td>
73                              <td>[% biblio_lis.overlay_status %]</td>
74                              <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]&amp;breedingid=[% biblio_lis.import_record_id %]&amp;import_batch_id=[% biblio_lis.import_batch_id %]&amp;biblionumber=[% biblio_lis.match_biblionumber %]">Add order</a></td>
75                          </tr>
76      [% IF ( biblio_lis.match_biblionumber ) %]
77     <tr>
78       <td class="highlight" colspan="3">&nbsp;&nbsp;&nbsp;Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.match_biblionumber %]">[% biblio_lis.match_citation %]</a></td>
79     </tr>
80     [% END %]
81                       [% END %]
82                      </table>
83                    </form>
84                </div>
85               [% IF ( pages ) %]
86                 <div class="pages">
87                 Page 
88                   [% FOREACH page IN pages %]
89                     [% IF ( page.current_page ) %]
90                       <span class="current">[% page.page_number %]</span>
91                     [% ELSE %]
92                       <a class="nav" href="[% page.script_name %]?import_batch_id=[% page.import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
93                     [% END %]
94                   [% END %]
95               [% END %]
96              [% ELSE %]
97                <div>
98                 <h1>Choose the file to add to the basket</h1>
99                    <table id="files">
100                      <thead>
101                      <tr>
102                        <th>File name</th>
103                        <th>Comments</th>
104                        <th>Status</th>
105                        <th>Staged</th>
106                        <th># Bibs</th>
107                        <th>&nbsp;</th>
108                      </tr>
109                      </thead>
110                      <tbody>
111                      [% FOREACH batch_lis IN batch_list %]
112                      <tr>
113                         <td>[% batch_lis.file_name %]</td>
114                        <td>[% batch_lis.comments %]</td>
115                        <td>[% batch_lis.import_status %]</td>
116                        <td><span title="[% batch_lis.staged_date %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td>
117                        <td>[% batch_lis.num_biblios %]</td>
118                        <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
119                      </tr>
120                      [% END %]
121                      </tbody>
122                    </table>
123                </div>
124              [% END %]
125            </div>
126         [% IF ( import_batch_id ) %]
127             <div class="yui-b">
128             <h2>Import all</h2>
129             <p>Import all the lines in the basket with the following parameters:</p>
130             <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
131                     <input type="hidden" name="op" value="import_records"/>
132                     <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
133                     <input type="hidden" name="basketno" value="[% basketno %]" />
134                     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
135                     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
136
137                     [% FOREACH loop_currencie IN loop_currencies %]
138                         <input type="hidden" name="[% loop_currencie.currency %]" value="[% loop_currencie.rate %]" />
139                     [% END %]
140
141                 [% IF ( items ) %]
142                 <fieldset class="rows">
143                     <legend>Item</legend>
144                     [% IF ( NoACQframework ) %]
145                         <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
146                     [% END %]
147
148                     [% FOREACH item IN items %]
149                     <div id="outeritemblock">
150                     <div id="itemblock">
151                         <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
152                             <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
153                                 [% IF (iteminformatio.mandatory) %]
154                                     <label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
155                                 [% ELSE %]
156                                     <label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
157                                 [% END %]
158                                 [% iteminformatio.marc_value %]
159                                 <input type="hidden" name="itemid" value="1" />
160                                 <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
161                                 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
162                                 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
163                                 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
164                                 [% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
165                             </div></li>
166                         [% END %]
167                         </ol>
168                     </div><!-- /iteminformation -->
169                     </div>
170
171                     [% END %] <!-- /items -->
172                 </fieldset>
173                 [% END %] <!-- items -->
174                 <fieldset class="rows">
175                     <legend>Accounting details</legend>
176                     <ol>
177                         <li>
178                             <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
179                             <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
180                         </li>
181                         <li>
182                             [% IF ( close ) %]
183                         <span class="label">Budget: </span>
184                                 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
185                             [% ELSE %]
186                             <li>
187                             <label for="currency">Currency:</label>
188                             <select name="currency" id="currency">
189                             [% FOREACH loop_currencie IN loop_currencies %]
190                                     [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
191                             </select>
192                             </li>
193                             <li>
194                             <label for="budget_id">Budget: </label>
195                             <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
196                             [% FOREACH budget_loo IN budget_loop %]
197                                 [% IF ( budget_loo.b_sel ) %]
198                                     <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
199                                 [% ELSE %]
200                                     <option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
201                                 [% END %]
202                             [% END %]
203                             </select>
204                             </li>
205                             [% END %]
206                         </li>
207                         <li>
208                             <label for="notes">Notes: </label>
209                             <textarea id="notes" cols="30" rows="3" name="notes"></textarea>
210                         </li>
211                         <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
212                             <label for="sort1">Planning value1: </label>
213                             <span id="sort1_zone">
214                             [% IF CGIsort1 %]
215                                 <select id="sort1" size="1" name="sort1">
216                                 [% FOREACH sort_opt IN CGIsort1 %]
217                                     [% IF sort_opt.default %]
218                                         <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
219                                     [% ELSE %]
220                                         <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
221                                     [% END %]
222                                 [% END %]
223                                 </select>
224                             [% ELSE %]
225                                 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
226                             [% END %]
227                             </span>
228                         </li>
229                         <li>
230                             <label for="sort2">Planning value2: </label>
231                             <span id="sort2_zone">
232                             [% IF CGIsort2 %]
233                                 <select id="sort2" size="1" name="sort1">
234                                 [% FOREACH sort_opt IN CGIsort2 %]
235                                     [% IF sort_opt.default %]
236                                         <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
237                                     [% ELSE %]
238                                         <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
239                                     [% END %]
240                                 [% END %]
241                                 </select>
242                             [% ELSE %]
243                                  <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
244                             [% END %]
245                             </span>
246                         </li>
247                         <li>
248                             
249                         </li>
250             </ol>
251                 </fieldset>
252                 <fieldset class="action">
253                     <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
254                 </fieldset>
255             </form>
256             </div>
257         [% END %]
258        </div>
259    </div>
260 </div>
261 </body>
262 </html>