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