Bug 20351: Shortcut serials scripts if a blocking error appeared
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-add.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Serials &rsaquo; [% IF ( modify ) %][% bibliotitle | html %] &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style type="text/css">
10 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
11 .yui-u li p label.widelabel {
12     width: 300px;  /* not enough for IE7 apparently */
13 }
14 </style>
15 </head>
16
17 <body id="ser_subscription-add" class="ser">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'serials-search.inc' %]
20
21 <div id="breadcrumbs">
22     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23     &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
24     [% UNLESS blocking_error %]
25         &rsaquo; [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | uri %]"><i>[% bibliotitle | html %]</i></a> &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]
26     [% END %]
27 </div>
28 [% INCLUDE 'blocking_errors.inc' %]
29
30 <div class="main container-fluid">
31     <div class="row">
32
33             <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle | html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
34             <form method="post" id="subscription_add_form" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated">
35                 [% IF ( modify ) %]
36                     <input type="hidden" name="op" value="modsubscription" />
37                     <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
38                 [% ELSE %]
39                         <input type="hidden" name="op" value="addsubscription" />
40                 [% END %]
41                 <input type="hidden" name="user" value="[% logged_in_user.userid | html %]" />
42                 <input type="hidden" name="irreg_check" value="0" />
43
44                 <div id="page_1">
45                     <div class="col-md-6">
46                         <fieldset id="subscription_add_information" class="rows">
47                             <legend>Subscription details</legend>
48                             <ol>
49                                 [% IF ( subscriptionid ) %]
50                                     <li><span class="label">Subscription #</span> [% subscriptionid | html %]</li>
51                                 [% END %]
52                                 <li>
53                                     <label for="aqbooksellerid">Vendor: </label>
54                                     <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="[% aqbooksellerid | html %]" size="8" /> (<input type="text" name="aqbooksellername" id="aqbooksellername" value="[% aqbooksellername | html %]" disabled="disabled" readonly="readonly" />) <a href="#" id="vendor_search"><i class="fa fa-search"></i> Search for a vendor</a>
55                                 </li>
56                                 <li>
57                                     <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Record:</label>
58                                     <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum | html %]" size="8" />
59                                     (<input type="text" name="title" value="[% bibliotitle | html %]" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span>
60                                     <div class="inputnote"> <a href="#" id="record_search"><i class="fa fa-search"></i> Search for record</a>
61                                         [% IF ( CAN_user_editcatalogue ) %]
62                                             [% IF ( modify ) %]
63                                             | <a href="#" id="biblio_add_edit" data-biblionumber="[% bibnum | html %]"><i class="fa fa-pencil"></i> Edit record</a>
64                                             [% ELSE %]
65                                             | <a href="#" id="biblio_add_edit"><i class="fa fa-plus"></i> Create record</a>
66                                             [% END %]
67                                         [% END %]
68                                     </div>
69                                 </li>
70                                 <li class="radio">
71                                     [% IF ( serialsadditems ) %]
72                                         <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
73                                         <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
74                                     [% ELSE %]
75                                         <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
76                                         <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
77                                     [% END %]
78                                 </li>
79                                 <li class="radio">
80                                   <p>When there is an irregular issue:</p>
81                                   [% IF (skip_serialseq) %]
82                                     <p>
83                                       <input type="radio" id="skip_serialseq_yes" name="skip_serialseq" value="1" checked="checked" />
84                                       <label for="skip_serialseq_yes">Skip issue number</label>
85                                     </p>
86                                     <p>
87                                       <input type="radio" id="skip_serialseq_no" name="skip_serialseq" value="0" />
88                                       <label for="skip_serialseq_no">Keep issue number</label>
89                                     </p>
90                                   [% ELSE %]
91                                     <p>
92                                       <input type="radio" id="skip_serialseq_yes" name="skip_serialseq" value="1" />
93                                       <label for="skip_serialseq_yes">Skip issue number</label>
94                                     </p>
95                                     <p>
96                                       <input type="radio" id="skip_serialseq_no" name="skip_serialseq" value="0" checked="checked" />
97                                       <label for="skip_serialseq_no">Keep issue number</label>
98                                     </p>
99                                   [% END %]
100                                 </li>
101                                 <li>
102                                     <label for="manualhistory">Manual history:</label>
103                                     [% IF (manualhistory) %]
104                                         <input type="checkbox" id="manualhistory" name="manualhist" checked="checked" />
105                                     [% ELSE %]
106                                         <input type="checkbox" id="manualhistory" name="manualhist" />
107                                     [% END %]
108                                 </li>
109                                 <li>
110                                     <label for="callnumber">Call number:</label>
111                                     <input type="text" name="callnumber" id="callnumber" value="[% callnumber | html %]" size="20" />
112                                 </li>
113                                 <li>
114                                     <label for="branchcode">Library:</label>
115                                     <select name="branchcode" id="branchcode" style="width: 20em;">
116                                         [% UNLESS ( Independentbranches ) %]
117                                             <option value="">None</option>
118                                         [% END %]
119                                         [% IF CAN_user_serials_superserials %]
120                                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %]
121                                         [% ELSE %]
122                                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
123                                         [% END %]
124                                     </select> (select a library)
125                                 </li>
126                                 <li>
127                                     <label for="notes">Public note:</label>
128                                     <textarea name="notes" id="notes" cols="30" rows="2">[% notes | html %]</textarea>
129                                 </li>
130                                 <li>
131                                     <label for="internalnotes">Nonpublic note:</label>
132                                     <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes | html %]</textarea>
133                                 </li>
134                                 <li>
135                                     [% IF ( letterloop ) %]
136                                         <label for="letter">Patron notification: </label>
137                                         <select name="letter" id="letter">
138                                             <option value="">None</option>
139                                             [% FOREACH letterloo IN letterloop %]
140                                                 [% IF ( letterloo.selected ) %]
141                                                     <option value="[% letterloo.value | html %]" selected="selected">[% letterloo.lettername | html %]</option>
142                                                 [% ELSE %]
143                                                     <option value="[% letterloo.value | html %]">[% letterloo.lettername | html %]</option>
144                                                 [% END %]
145                                             [% END %]
146                                         </select>
147                                         <div class="hint">Selecting a notice will allow patrons to subscribe to notifications when a new issue is received.</div>
148                                     [% ELSE %]
149                                         <span class="label">Patron notification: </span>
150                                         <div class="hint">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div>
151                                     [% END %]
152                                 </li>
153                                 <li>
154                                     <label for="location">Location:</label>
155                                     <select name="location" id="location">
156                                         <option value="">None</option>
157                                         [% FOREACH locations_loo IN locations_loop %]
158                                             [% IF locations_loo.authorised_value == location %]
159                                                 <option value="[% locations_loo.authorised_value | html %]" selected="selected">[% locations_loo.lib | html %]</option>
160                                             [% ELSE %]
161                                                 <option value="[% locations_loo.authorised_value | html %]">[% locations_loo.lib | html %]</option>
162                                             [% END %]
163                                         [% END %]
164                                     </select>
165                                 </li>
166                                 <li>
167                                     <label for="itemtype">Item type:</label>
168                                     <select name="itemtype" id="itemtype">
169                                         <option value=""></option>
170                                         [% FOREACH type IN typeloop %]
171                                             [% IF ( type.selected ) %]
172                                                 <option value="[% type.code | html %]" selected="selected">[% type.value | html %]</option>
173                                             [% ELSE %]
174                                                 <option value="[% type.code | html %]">[% type.value | html %]</option>
175                                             [% END %]
176                                         [% END %]
177                                     </select>
178                                 </li>
179                                 [%IF makePreviousSerialAvailable %]
180                                 <li>
181                                     <label for="previousitemtype">item type for older issues:</label>
182                                     <select name="previousitemtype" id="previousitemtype">
183                                             <option value=""></option>
184                                         [% FOREACH previous IN previoustypeloop %]
185                                             [% IF ( previous.selected ) %]
186                                                 <option value="[% previous.code | html %]" selected="selected">[% previous.value | html %]</option>
187                                             [% ELSE %]
188                                                 <option value="[% previous.code | html %]">[% previous.value | html %]</option>
189                                             [% END %]
190                                         [% END %]
191                                     </select>
192                                 </li>
193                                 [% END %]
194                                     <li>
195                                     <label for="graceperiod">Grace period:</label>
196                                     <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod | html %]" size="5"/> day(s)
197                                 </li>
198                                 <li>
199                                      <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
200                                      <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" size="4"/>
201                                  </li>
202                                  <li>
203                                     <label class="widelabel" for="opacdisplaycount">Number of issues to display to the public: </label>
204                                     <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount | html %]" size="4"/>
205                                 </li>
206                             </ol>
207                         </fieldset>
208                         <fieldset class="action">
209                             <input type="button" value="Next &gt;&gt;" id="subscription_add_next" style="float:right;" />
210                         </fieldset>
211                     </div>
212                 </div>
213
214                 <div id="page_2">
215                     <div class="col-md-6">
216                         <div id="subscription_form_planning">
217                             <fieldset class="rows">
218                                 <legend>Serials planning</legend>
219                                 <ol>
220                                     <li>
221                                         <label for="firstacquidate" class="required">First issue publication date:</label>
222                                         [% UNLESS (more_than_one_serial) %]
223                                           <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="datepicker required" required="required" />
224                                         [% ELSE %]
225                                           [% firstacquidate | $KohaDates %]
226                                           <input type="hidden" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
227                                         [% END %]
228                                     </li>
229                                     [% IF (more_than_one_serial) %]
230                                       <li>
231                                         <label for="nextacquidate">Next issue publication date:</label>
232                                         <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="datepicker" />
233                                       </li>
234                                     [% END %]
235                                     <li>
236                                         <label for="frequency" class="required">Frequency:</label>
237                                         <select name="frequency" size="1" id="frequency" class="required" required="required">
238                                             <option value="">-- please choose --</option>
239                                             [% FOREACH frequency IN frequencies %]
240                                                 [% IF (frequency.selected) %]
241                                                     <option value="[% frequency.id | html %]" selected="selected">
242                                                 [% ELSE %]
243                                                     <option value="[% frequency.id | html %]">
244                                                 [% END %]
245                                                     [% frequency.label | html %]
246                                                 </option>
247                                             [% END %]
248                                         </select>
249                                     </li>
250                                     <li>
251                                         <label for="subtype">Subscription length:</label>
252                                         <select name="subtype" id="subtype">
253                                             [% FOREACH st IN subtypes %]
254                                                 [% SWITCH st %]
255                                                     [% CASE 'numberlength' %]
256                                                         [% IF st == subtype %]
257                                                             <option value="issues" selected="selected">
258                                                         [% ELSE %]
259                                                             <option value="issues">
260                                                         [% END %]
261                                                         issues
262                                                     [% CASE 'weeklength' %]
263                                                         [% IF st == subtype %]
264                                                             <option value="weeks" selected="selected">
265                                                         [% ELSE %]
266                                                             <option value="weeks">
267                                                         [% END %]
268                                                         weeks
269                                                     [% CASE 'monthlength' %]
270                                                         [% IF st == subtype %]
271                                                             <option value="months" selected="selected">
272                                                         [% ELSE %]
273                                                             <option value="months">
274                                                         [% END %]
275                                                         months
276                                                     [% CASE %][% st | html %]
277                                                 [% END %]
278                                                 </option>
279                                             [% END %]
280                                         </select>
281                                         <input type="text" name="sublength" id="sublength" value="[% sublength | html %]" size="3" /> (enter amount in numerals)
282                                         <input type="hidden" name="issuelengthcount">
283                                     </li>
284                                     <li>
285                                         <label for="startdate" class="required"> Subscription start date:</label>
286                                         <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="datepickerfrom required" required="required" />
287                                     </li>
288                                     <li>
289                                         <label for="enddate">Subscription end date:</label>
290                                         <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="datepickerto" />
291                                     </li>
292                                     <li>
293                                         <label for="numberpattern" class="required">Numbering pattern:</label>
294                                         <select name="numbering_pattern" size="1" id="numberpattern" class="required" required="required">
295                                             <option value="">-- please choose --</option>
296                                             [% FOREACH numberpattern IN numberpatterns %]
297                                                 [% IF (numberpattern.selected) %]
298                                                     <option value="[% numberpattern.id | html %]" selected="selected">
299                                                 [% ELSE %]
300                                                     <option value="[% numberpattern.id | html %]">
301                                                 [% END %]
302                                                     [% numberpattern.label | html %]
303                                                 </option>
304                                             [% END %]
305                                         </select>
306                                     </li>
307                                     <li>
308                                         <label for="locale">Locale:</label>
309                                         <select id="locale" name="locale">
310                                             <option value=""></option>
311                                             [% FOREACH l IN locales %]
312                                                 [% IF l.language == locale %]
313                                                     <option value="[% l.language | html %]" selected="selected">[% l.description | html %]</option>
314                                                 [% ELSE %]
315                                                     <option value="[% l.language | html %]">[% l.description | html %]</option>
316                                                 [% END %]
317                                             [% END %]
318                                         </select>
319                                         <span class="hint">If empty, English is used</span>
320                                     </li>
321                                     <li id="more_options">
322                                         <table id="moreoptionst">
323                                             <thead>
324                                                 <tr>
325                                                     <th>&nbsp;</th>
326                                                     <th id="headerX">&nbsp;</th>
327                                                     <th id="headerY">&nbsp;</th>
328                                                     <th id="headerZ">&nbsp;</th>
329                                                 </tr>
330                                             </thead>
331                                             <tbody>
332                                                 <tr>
333                                                     <td>
334                                                       [% IF (more_than_one_serial) %]
335                                                         Last value
336                                                       [% ELSE %]
337                                                         Begins with
338                                                       [% END %]
339                                                     </td>
340                                                     <td id="beginsX"><input type="text" id="lastvaluetemp1" name="lastvaluetemp1" value="[% lastvalue1 | html %]" /></td>
341                                                     <td id="beginsY"><input type="text" id="lastvaluetemp2" name="lastvaluetemp2" value="[% lastvalue2 | html %]" /></td>
342                                                     <td id="beginsZ"><input type="text" id="lastvaluetemp3" name="lastvaluetemp3" value="[% lastvalue3 | html %]" /></td>
343                                                 </tr>
344                                                 <tr>
345                                                     <td>Inner counter</td>
346                                                     <td id="innerX"><input type="text" id="innerlooptemp1" name="innerlooptemp1" value="[% innerloop1 | html %]" /></td>
347                                                     <td id="innerY"><input type="text" id="innerlooptemp2" name="innerlooptemp2" value="[% innerloop2 | html %]" /></td>
348                                                     <td id="innerZ"><input type="text" id="innerlooptemp3" name="innerlooptemp3" value="[% innerloop3 | html %]" /></td>
349                                                 </tr>
350                                             </tbody>
351                                         </table>
352                                     </li>
353                                     <li>
354                                         <a href="#" class="toggle_advanced_pattern show_advanced_pattern"><i class="fa fa-plus-square"></i> Show advanced pattern</a>
355                                         <a href="#" style="display:none;" class="toggle_advanced_pattern hide_advanced_pattern"><i class="fa fa-minus-square"></i> Hide advanced pattern</a>
356                                     </li>
357                                     <div id="advancedpredictionpattern" style="display:none">
358                                       <li>
359                                         <label for="patternname" class="required">Pattern name:</label>
360                                         <input id="patternname" name="patternname" type="text" readonly="readonly" class="required" required="required" />
361                                       </li>
362                                       <li>
363                                         <label for="numberingmethod">Numbering formula:</label>
364                                         <input readonly="readonly" type="text" name="numberingmethod" id="numberingmethod" size="50" value="[% numberingmethod | html %]" />
365                                       </li>
366                                         <table id="advancedpredictionpatternt">
367                                             <thead>
368                                                 <tr>
369                                                     <th colspan="4">Advanced prediction pattern</th>
370                                                 </tr>
371                                                 <tr>
372                                                     <th>&nbsp;</th>
373                                                     <th>X</th>
374                                                     <th>Y</th>
375                                                     <th>Z</th>
376                                                 </tr>
377                                             </thead>
378                                             <tbody>
379                                                 <tr>
380                                                     <td>Label</td>
381                                                     <td><input type="text" readonly="readonly" id="label1" name="label1" /></td>
382                                                     <td><input type="text" readonly="readonly" id="label2" name="label2" /></td>
383                                                     <td><input type="text" readonly="readonly" id="label3" name="label3" /></td>
384                                                 </tr>
385                                                 <tr>
386                                                     <td>Begins with</td>
387                                                     <td><input type="text" readonly="readonly" id="lastvalue1" name="lastvalue1" /></td>
388                                                     <td><input type="text" readonly="readonly" id="lastvalue2" name="lastvalue2" /></td>
389                                                     <td><input type="text" readonly="readonly" id="lastvalue3" name="lastvalue3" /></td>
390                                                 </tr>
391                                                 <tr>
392                                                     <td>Add</td>
393                                                     <td><input type="text" readonly="readonly" id="add1" name="add1" /></td>
394                                                     <td><input type="text" readonly="readonly" id="add2" name="add2" /></td>
395                                                     <td><input type="text" readonly="readonly" id="add3" name="add3" /></td>
396                                                 </tr>
397                                                 <tr>
398                                                     <td>Every</td>
399                                                     <td><input type="text" readonly="readonly" id="every1" name="every1" /></td>
400                                                     <td><input type="text" readonly="readonly" id="every2" name="every2" /></td>
401                                                     <td><input type="text" readonly="readonly" id="every3" name="every3" /></td>
402                                                 </tr>
403                                                 <tr>
404                                                     <td>Set back to</td>
405                                                     <td><input type="text" readonly="readonly" id="setto1" name="setto1" /></td>
406                                                     <td><input type="text" readonly="readonly" id="setto2" name="setto2" /></td>
407                                                     <td><input type="text" readonly="readonly" id="setto3" name="setto3" /></td>
408                                                 </tr>
409                                                 <tr>
410                                                     <td>When more than</td>
411                                                     <td><input type="text" readonly="readonly" id="whenmorethan1" name="whenmorethan1" /></td>
412                                                     <td><input type="text" readonly="readonly" id="whenmorethan2" name="whenmorethan2" /></td>
413                                                     <td><input type="text" readonly="readonly" id="whenmorethan3" name="whenmorethan3" /></td>
414                                                 </tr>
415                                                 <tr>
416                                                     <td>Inner counter</td>
417                                                     <td><input type="text" readonly="readonly" id="innerloop1" name="innerloop1" /></td>
418                                                     <td><input type="text" readonly="readonly" id="innerloop2" name="innerloop2" /></td>
419                                                     <td><input type="text" readonly="readonly" id="innerloop3" name="innerloop3" /></td>
420                                                 </tr>
421                                                 <tr>
422                                                     [% BLOCK numbering_select %]
423                                                         <select disabled="disabled" id="[% name | html %]" name="[% name | html %]">
424                                                             <option value=""></option>
425                                                             <option value="dayname">Name of day</option>
426                                                             <option value="dayabrv">Name of day (abbreviated)</option>
427                                                             <option value="monthname">Name of month</option>
428                                                             <option value="monthabrv">Name of month (abbreviated)</option>
429                                                             <option value="season">Name of season</option>
430                                                             <option value="seasonabrv">Name of season (abbreviated)</option>
431                                                         </select>
432                                                     [% END %]
433                                                     <td>Formatting</td>
434                                                     <td>[% PROCESS numbering_select name="numbering1" %]</td>
435                                                     <td>[% PROCESS numbering_select name="numbering2" %]</td>
436                                                     <td>[% PROCESS numbering_select name="numbering3" %]</td>
437                                                 </tr>
438                                             </tbody>
439                                         </table>
440                                         <input id="modifyadvancedpatternbutton" type="button" value="Modify pattern" />
441                                         <input id="restoreadvancedpatternbutton" type="button" value="Cancel modifications" style="display:none" />
442                                         <input id="saveadvancedpatternbutton" type="button" value="Save as new pattern" style="display:none" />
443                                     </div>
444                                 </ol>
445                             </fieldset>
446
447                             [% IF additional_fields_for_subscription %]
448                               <div id="subscription_additional_fields">
449                                 <fieldset class="rows">
450                                   <legend>Additional fields</legend>
451                                   <ol>
452                                     [% FOR field IN additional_fields_for_subscription %]
453                                       <li>
454                                         <label for="additional_field_[% field.id | html %]"> [% field.name | html %]: </label>
455                                         [% IF field.authorised_value_choices %]
456                                           <select name="additional_field_[% field.id | html %]" id="additional_field_[% field.id | html %]">
457                                             [% FOREACH av IN field.authorised_value_choices %]
458                                               [% IF av.authorised_value == additional_fields.${field.name} %]
459                                                 <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
460                                               [% ELSE %]
461                                                 <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
462                                               [% END %]
463                                             [% END %]
464                                           </select> (Authorised values for [% field.authorised_value_category | html %])
465                                         [% ELSE %]
466                                           [% IF field.marcfield %]
467                                             <input type="text" value="[% additional_fields.${field.name} | html %]" id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]" readonly="readonly" />
468                                             This value will be filled with the [% field.marcfield | html %] subfield of the selected biblio.
469                                           [% ELSE %]
470                                             <input type="text" value="[% additional_fields.${field.name} | html %]" id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]" />
471                                           [% END %]
472                                         [% END %]
473                                       </li>
474                                     [% END %]
475                                   </ol>
476                                 </fieldset>
477                               </div>
478                             [% END %]
479
480                             <fieldset class="action">
481                                 <input type="button" id="subscription_add_previous" value="&lt;&lt; Previous" style="float:left;"/>
482                                 <input id="testpatternbutton" type="button" value="Test prediction pattern" />
483                                 <input type="submit" value="Save subscription" style="float:right;" accesskey="w" />
484                             </fieldset>
485                         </div>
486                     </div>
487                     <div class="col-md-6">
488                         <li id="displayexample"></li>
489                     </div>
490                 </div>
491             </form>
492         </div>
493
494 [% MACRO jsinclude BLOCK %]
495     [% INCLUDE 'calendar.inc' %]
496     <script type="text/javascript">
497         var subscriptionid = "[% subscriptionid | html %]";
498         var irregularity = "[% irregularity | html %]";
499         var more_than_one_serial = "[% more_than_one_serial | html %]";
500         var tags = [];
501         [% FOREACH field IN dont_export_field_loop %]
502             tags.push("[% field.fieldid | html %]");
503         [% END %]
504         var MSG_LINK_TO_VENDOR = _("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor");
505         var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
506         var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
507         var MSG_TEST_PREDICTION = _("Please click on 'Test prediction pattern' before saving subscription.");
508         var MSG_REQUIRED_PUB_DATE = _("You must choose a first publication date");
509         var MSG = _("You have modified the advanced prediction pattern. Please save your work or cancel modifications.");
510         var MSG_PATTERN_IRREG = _("Warning! Present pattern has planned irregularities. Click on 'Test prediction pattern' to check if it's still valid")
511         var MSG_PATTERN_NAME = _("Please enter a name for this pattern");
512         var MSG_PATTERN_NAME_EXISTS = _("This pattern name already exists. Do you want to modify it?");
513         var MSG_OVERWRITE_PATTERNS = _("Warning: it will modify the pattern for all subscriptions that are using it.");
514         var MSG_PATTERN_CREATE_FAILED = _("Something went wrong. Unable to create a new numbering pattern.");
515         var MSG_PATTERN_TEST_FAILED = _("Cannot test prediction pattern for the following reason(s): %s");
516         var MSG_FREQUENCY_UNDEFINED = _("Frequency is not defined");
517         var MSG_PUB_DATE_UNDEFINED = _("First publication date is not defined");
518         var MSG_NEXT_ISSUE_UNDEFINED = _("Next issue publication date is not defined");
519     </script>
520     [% Asset.js("js/subscription-add.js") | $raw %]
521     [% Asset.js("js/showpredictionpattern.js") | $raw %]
522 [% END %]
523
524 [% INCLUDE 'intranet-bottom.inc' %]