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