Bug 26102: Prevent XSS when To.json is used: subscription-add.tt
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-add.tt
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE Koha %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% IF ( modify ) %][% bibliotitle | html %] &rsaquo; Modify subscription[% ELSE %]New subscription[% END %] &rsaquo; Serials &rsaquo; Koha</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 <style>
12 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
13 #mana_comment_errortext { font-weight: bold; font-family: monospace;}
14 /* Prevents Bootstrap menus from being hidden inside modal */
15 #mana_search_result .modal { overflow: visible; }
16 #mana_search_result .modal-body { overflow-y: visible; }
17 fieldset.rows table { clear: none; margin: 0; }
18 </style>
19 </head>
20
21 <body id="ser_subscription-add" class="ser">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'serials-search.inc' %]
24
25 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
26     <ol>
27         <li>
28             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
29         </li>
30
31         [% IF blocking_error %]
32             <li>
33                 <a href="#" aria-current="page">
34                     Serials
35                 </a>
36             </li>
37         [% ELSE %]
38             <li>
39                 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
40             </li>
41             [% IF ( modify ) %]
42                 <li>
43                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | uri %]"><em>[% bibliotitle | html %]</em></a>
44                 </li>
45                 <li>
46                     <a href="#" aria-current="page">
47                         Modify subscription
48                     </a>
49                 </li>
50             [% ELSE %]
51                 <li>
52                     <a href="#" aria-current="page">
53                         New subscription
54                     </a>
55                 </li>
56             [% END %]
57         [% END %]
58     </ol>
59 </nav>
60
61 [% INCLUDE 'blocking_errors.inc' %]
62
63 <div class="main container-fluid">
64     <div class="row">
65         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
66             <h1>[% IF ( modify ) %] Modify subscription for <em>[% bibliotitle | html %]</em>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
67         </div>
68     </div>
69     <form method="post" id="subscription_add_form" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated">
70                 <div class="row" id="page_1">
71                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
72                         [% IF ( modify ) %]
73                             <input type="hidden" name="op" value="modsubscription" />
74                             <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
75                         [% ELSE %]
76                                 <input type="hidden" name="op" value="addsubscription" />
77                         [% END %]
78                         <input type="hidden" name="user" value="[% logged_in_user.userid | html %]" />
79                         <input type="hidden" name="irreg_check" value="0" />
80                         <fieldset id="subscription_add_information" class="rows">
81                             <legend>Subscription details</legend>
82                             <ol>
83                                 [% IF ( subscriptionid ) %]
84                                     <li><span class="label">Subscription number: </span> [% subscriptionid | html %]</li>
85                                 [% END %]
86                                 <li>
87                                     <label for="aqbooksellerid">Vendor: </label>
88                                     <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>
89                                 </li>
90                                 <li>
91                                     <label for="biblionumber" class="required">Record:</label>
92                                     <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum | html %]" size="8" />
93                                     (<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>
94                                     <span id="error_bib_not_exist"></span>
95                                     <div class="hint">Subscriptions must be associated with a bibliographic record</div>
96                                     <div class="inputnote"> <a href="#" id="record_search"><i class="fa fa-search"></i> Search for record</a>
97                                         [% IF ( CAN_user_editcatalogue ) %]
98                                             [% IF ( modify ) %]
99                                             | <a href="#" id="biblio_add_edit" data-biblionumber="[% bibnum | html %]"><i class="fa fa-pencil"></i> Edit record</a>
100                                             [% ELSE %]
101                                             | <a href="#" id="biblio_add_edit"><i class="fa fa-plus"></i> Create record</a>
102                                             [% END %]
103                                         [% END %]
104                                     </div>
105                                 </li>
106                                 <li class="radio">
107                                     [% IF ( serialsadditems ) %]
108                                         <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>
109                                         <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>
110                                     [% ELSE %]
111                                         <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>
112                                         <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>
113                                     [% END %]
114                                 </li>
115                                 <li class="radio">
116                                   <p>When there is an irregular issue:</p>
117                                   [% IF (skip_serialseq) %]
118                                     <p>
119                                       <input type="radio" id="skip_serialseq_yes" name="skip_serialseq" value="1" checked="checked" />
120                                       <label for="skip_serialseq_yes">Skip issue number</label>
121                                     </p>
122                                     <p>
123                                       <input type="radio" id="skip_serialseq_no" name="skip_serialseq" value="0" />
124                                       <label for="skip_serialseq_no">Keep issue number</label>
125                                     </p>
126                                   [% ELSE %]
127                                     <p>
128                                       <input type="radio" id="skip_serialseq_yes" name="skip_serialseq" value="1" />
129                                       <label for="skip_serialseq_yes">Skip issue number</label>
130                                     </p>
131                                     <p>
132                                       <input type="radio" id="skip_serialseq_no" name="skip_serialseq" value="0" checked="checked" />
133                                       <label for="skip_serialseq_no">Keep issue number</label>
134                                     </p>
135                                   [% END %]
136                                 </li>
137                                 <li>
138                                     <label for="manualhistory">Manual history:</label>
139                                     [% IF (manualhistory) %]
140                                         <input type="checkbox" id="manualhistory" name="manualhist" checked="checked" />
141                                     [% ELSE %]
142                                         <input type="checkbox" id="manualhistory" name="manualhist" />
143                                     [% END %]
144                                 </li>
145                                 <li>
146                                     <label for="callnumber">Call number:</label>
147                                     <input type="text" name="callnumber" id="callnumber" value="[% callnumber | html %]" size="20" />
148                                 </li>
149                                 <li>
150                                     <label for="branchcode">Library:</label>
151                                     <select name="branchcode" id="branchcode">
152                                         [% UNLESS ( Independentbranches ) %]
153                                             <option value="">None</option>
154                                         [% END %]
155                                         [% IF CAN_user_serials_superserials %]
156                                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %]
157                                         [% ELSE %]
158                                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
159                                         [% END %]
160                                     </select>
161                                 </li>
162                                 <li>
163                                     <label for="notes">Public note:</label>
164                                     <textarea name="notes" id="notes" cols="30" rows="2">[% notes | html %]</textarea>
165                                 </li>
166                                 <li>
167                                     <label for="internalnotes">Nonpublic note:</label>
168                                     <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes | html %]</textarea>
169                                 </li>
170                                 <li>
171                                     [% IF ( letterloop ) %]
172                                         <label for="letter">Patron notification: </label>
173                                         <select name="letter" id="letter">
174                                             <option value="">None</option>
175                                             [% FOREACH letterloo IN letterloop %]
176                                                 [% IF ( letterloo.selected ) %]
177                                                     <option value="[% letterloo.value | html %]" selected="selected">[% letterloo.lettername | html %]</option>
178                                                 [% ELSE %]
179                                                     <option value="[% letterloo.value | html %]">[% letterloo.lettername | html %]</option>
180                                                 [% END %]
181                                             [% END %]
182                                         </select>
183                                         <div class="hint">Selecting a notice will allow patrons to subscribe to notifications when a new issue is received.</div>
184                                     [% ELSE %]
185                                         <span class="label">Patron notification: </span>
186                                         <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>
187                                     [% END %]
188                                 </li>
189                                 <li>
190                                     <label for="location">Location:</label>
191                                     <select name="location" id="location">
192                                         <option value="">None</option>
193                                         [% FOREACH locations_loo IN locations_loop %]
194                                             [% IF locations_loo.authorised_value == location %]
195                                                 <option value="[% locations_loo.authorised_value | html %]" selected="selected">[% locations_loo.lib | html %]</option>
196                                             [% ELSE %]
197                                                 <option value="[% locations_loo.authorised_value | html %]">[% locations_loo.lib | html %]</option>
198                                             [% END %]
199                                         [% END %]
200                                     </select>
201                                 </li>
202                                 <li>
203                                     <label for="itemtype">Item type:</label>
204                                     <select name="itemtype" id="itemtype">
205                                         <option value=""></option>
206                                         [% FOREACH type IN typeloop %]
207                                             [% IF ( type.selected ) %]
208                                                 <option value="[% type.code | html %]" selected="selected">[% type.value | html %]</option>
209                                             [% ELSE %]
210                                                 <option value="[% type.code | html %]">[% type.value | html %]</option>
211                                             [% END %]
212                                         [% END %]
213                                     </select>
214                                 </li>
215                                 [%IF makePreviousSerialAvailable %]
216                                 <li>
217                                     <label for="previousitemtype">item type for older issues:</label>
218                                     <select name="previousitemtype" id="previousitemtype">
219                                             <option value=""></option>
220                                         [% FOREACH previous IN previoustypeloop %]
221                                             [% IF ( previous.selected ) %]
222                                                 <option value="[% previous.code | html %]" selected="selected">[% previous.value | html %]</option>
223                                             [% ELSE %]
224                                                 <option value="[% previous.code | html %]">[% previous.value | html %]</option>
225                                             [% END %]
226                                         [% END %]
227                                     </select>
228                                 </li>
229                                 [% END %]
230                                     <li>
231                                     <label for="graceperiod">Grace period:</label>
232                                     <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod | html %]" size="5"/> day(s)
233                                 </li>
234                                 <li>
235                                      <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
236                                      <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" size="4"/>
237                                  </li>
238                                  <li>
239                                     <label class="widelabel" for="opacdisplaycount">Number of issues to display to the public: </label>
240                                     <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount | html %]" size="4"/>
241                                 </li>
242                             </ol>
243                         </fieldset>
244                         <fieldset class="action">
245                             <button type="button" id="subscription_add_next" style="float:right;">Next <i class="fa fa-long-arrow-right"></i></button>
246                         </fieldset>
247                     </div> <!-- /.col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 -->
248                 </div> <!-- /.row#page_1 -->
249                 <div class="row" id="page_2">
250                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
251                 [% IF ( Koha.Preference('Mana') == 1) && !mana_url %]
252                     <fieldset>
253                         <p><center>The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference
254                         <a href=/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=request+to+mana+webservice>here</a></center></p>
255                     </fieldset>
256                 [% END %]
257                         <div hidden id="mana_search" class="dialog message">
258                         </div>
259                         <div id="subscription_form_planning">
260                             <fieldset class="rows">
261                                 <legend>Serials planning</legend>
262                                 <ol>
263                                     <li>
264                                         <label for="acqui_date" class="required">First issue publication date:</label>
265                                         [% UNLESS (more_than_one_serial) %]
266                                           <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="flatpickr required" required="required" />
267                                         [% ELSE %]
268                                           [% firstacquidate | $KohaDates %]
269                                           <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
270                                         [% END %]
271                                         <span class="required">Required</span>
272                                     </li>
273                                     [% IF (more_than_one_serial) %]
274                                       <li>
275                                         <label for="nextacquidate">Next issue publication date:</label>
276                                         <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="flatpickr" />
277                                       </li>
278                                     [% END %]
279                                     <li>
280                                         <label for="frequency" class="required">Frequency:</label>
281                                         <select name="frequency" id="frequency" class="required" required="required">
282                                             <option value="">-- please choose --</option>
283                                             [% FOREACH frequency IN frequencies %]
284                                                 [% IF (frequency.selected) %]
285                                                     <option value="[% frequency.id | html %]" selected="selected">
286                                                 [% ELSE %]
287                                                     <option value="[% frequency.id | html %]">
288                                                 [% END %]
289                                                     [% frequency.label | html %]
290                                                 </option>
291                                             [% END %]
292                                         </select>
293                                     </li>
294                                     <li>
295                                         <label for="subtype">Subscription length:</label>
296                                         <select name="subtype" id="subtype">
297                                             [% FOREACH st IN subtypes %]
298                                                 [% SWITCH st %]
299                                                     [% CASE 'numberlength' %]
300                                                         [% IF st == subtype %]
301                                                             <option value="issues" selected="selected">
302                                                         [% ELSE %]
303                                                             <option value="issues">
304                                                         [% END %]
305                                                         issues
306                                                     [% CASE 'weeklength' %]
307                                                         [% IF st == subtype %]
308                                                             <option value="weeks" selected="selected">
309                                                         [% ELSE %]
310                                                             <option value="weeks">
311                                                         [% END %]
312                                                         weeks
313                                                     [% CASE 'monthlength' %]
314                                                         [% IF st == subtype %]
315                                                             <option value="months" selected="selected">
316                                                         [% ELSE %]
317                                                             <option value="months">
318                                                         [% END %]
319                                                         months
320                                                     [% CASE %][% st | html %]
321                                                 [% END %]
322                                                 </option>
323                                             [% END %]
324                                         </select>
325                                         <input type="text" name="sublength" id="sublength" value="[% sublength | html %]" size="3" /> (enter amount in numerals)
326                                         <input type="hidden" name="issuelengthcount">
327                                     </li>
328                                     <li>
329                                         <label for="from" class="required"> Subscription start date:</label>
330                                         <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="flatpickr required" data-date_to="to" required="required" />
331                                     </li>
332                                     <li>
333                                         <label for="to">Subscription end date:</label>
334                                         <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="flatpickr" />
335                                     </li>
336                                     <li>
337                                         <label for="numberpattern" class="required">Numbering pattern:</label>
338                                         <select name="numbering_pattern" id="numberpattern" class="required" required="required">
339                                             <option value="">-- please choose --</option>
340                                             [% FOREACH numberpattern IN numberpatterns %]
341                                                 [% IF (numberpattern.selected) %]
342                                                     <option value="[% numberpattern.id | html %]" selected="selected">
343                                                 [% ELSE %]
344                                                     <option value="[% numberpattern.id | html %]">
345                                                 [% END %]
346                                                     [% numberpattern.label | html %]
347                                                 </option>
348                                             [% END %]
349                                         </select>
350                                         <span class="required">Required</span>
351                                     </li>
352                                     <li>
353                                         <label for="locale">Locale:</label>
354                                         <select id="locale" name="locale">
355                                             <option value=""></option>
356                                             [% FOREACH l IN locales %]
357                                                 [% IF l.language == locale %]
358                                                     <option value="[% l.language | html %]" selected="selected">[% l.description | html %]</option>
359                                                 [% ELSE %]
360                                                     <option value="[% l.language | html %]">[% l.description | html %]</option>
361                                                 [% END %]
362                                             [% END %]
363                                         </select>
364                                         <div class="hint">If empty, English is used</div>
365                                     </li>
366                                     <li id="more_options">
367                                         <span class="label">&nbsp;</span>
368                                         <table id="moreoptionst">
369                                             <thead>
370                                                 <tr>
371                                                     <th>&nbsp;</th>
372                                                     <th id="headerX">&nbsp;</th>
373                                                     <th id="headerY">&nbsp;</th>
374                                                     <th id="headerZ">&nbsp;</th>
375                                                 </tr>
376                                             </thead>
377                                             <tbody>
378                                                 <tr>
379                                                     <th scope="row">
380                                                       [% IF (more_than_one_serial) %]
381                                                         Last value:
382                                                       [% ELSE %]
383                                                         Begins with:
384                                                       [% END %]
385                                                     </th>
386                                                     <td id="beginsX"><input type="text" id="lastvaluetemp1" name="lastvaluetemp1" value="[% lastvalue1 | html %]" /></td>
387                                                     <td id="beginsY"><input type="text" id="lastvaluetemp2" name="lastvaluetemp2" value="[% lastvalue2 | html %]" /></td>
388                                                     <td id="beginsZ"><input type="text" id="lastvaluetemp3" name="lastvaluetemp3" value="[% lastvalue3 | html %]" /></td>
389                                                 </tr>
390                                                 <tr>
391                                                     <th scope="row">Inner counter:</th>
392                                                     <td id="innerX"><input type="text" id="innerlooptemp1" name="innerlooptemp1" value="[% innerloop1 | html %]" /></td>
393                                                     <td id="innerY"><input type="text" id="innerlooptemp2" name="innerlooptemp2" value="[% innerloop2 | html %]" /></td>
394                                                     <td id="innerZ"><input type="text" id="innerlooptemp3" name="innerlooptemp3" value="[% innerloop3 | html %]" /></td>
395                                                 </tr>
396                                             </tbody>
397                                         </table>
398                                     </li>
399                                     <li>
400                                         <span class="label">&nbsp;</span>
401                                         <a href="#" class="toggle_advanced_pattern show_advanced_pattern"><i class="fa fa-plus-square"></i> Show advanced pattern</a>
402                                         <a href="#" style="display:none;" class="toggle_advanced_pattern hide_advanced_pattern"><i class="fa fa-minus-square"></i> Hide advanced pattern</a>
403                                     </li>
404                                 </ol>
405
406                                     <div id="advancedpredictionpattern" style="display:none">
407                                         <ol>
408                                       <li>
409                                         <label for="patternname" class="required">Pattern name:</label>
410                                         <input id="patternname" name="patternname" type="text" readonly="readonly" class="required" required="required" />
411                                         <span class="required">Required</span>
412                                       </li>
413                                       <li>
414                                         <label for="numberingmethod">Numbering formula:</label>
415                                         <input readonly="readonly" type="text" name="numberingmethod" id="numberingmethod" size="50" value="[% numberingmethod | html %]" />
416                                       </li>
417                                       <li>
418                                         <span class="label">Advanced prediction pattern: </span>
419                                         <table id="advancedpredictionpatternt">
420                                             <thead>
421                                                 <tr>
422                                                     <th>&nbsp;</th>
423                                                     <th>X</th>
424                                                     <th>Y</th>
425                                                     <th>Z</th>
426                                                 </tr>
427                                             </thead>
428                                             <tbody>
429                                                 <tr>
430                                                     <th scope="row">Label: </th>
431                                                     <td><input type="text" readonly="readonly" id="label1" name="label1" /></td>
432                                                     <td><input type="text" readonly="readonly" id="label2" name="label2" /></td>
433                                                     <td><input type="text" readonly="readonly" id="label3" name="label3" /></td>
434                                                 </tr>
435                                                 <tr>
436                                                     <th scope="row">Begins with: </th>
437                                                     <td><input type="text" readonly="readonly" id="lastvalue1" name="lastvalue1" /></td>
438                                                     <td><input type="text" readonly="readonly" id="lastvalue2" name="lastvalue2" /></td>
439                                                     <td><input type="text" readonly="readonly" id="lastvalue3" name="lastvalue3" /></td>
440                                                 </tr>
441                                                 <tr>
442                                                     <th scope="row">Add: </th>
443                                                     <td><input type="text" readonly="readonly" id="add1" name="add1" /></td>
444                                                     <td><input type="text" readonly="readonly" id="add2" name="add2" /></td>
445                                                     <td><input type="text" readonly="readonly" id="add3" name="add3" /></td>
446                                                 </tr>
447                                                 <tr>
448                                                     <th scope="row">Every: </th>
449                                                     <td><input type="text" readonly="readonly" id="every1" name="every1" /></td>
450                                                     <td><input type="text" readonly="readonly" id="every2" name="every2" /></td>
451                                                     <td><input type="text" readonly="readonly" id="every3" name="every3" /></td>
452                                                 </tr>
453                                                 <tr>
454                                                     <th scope="row">Set back to: </th>
455                                                     <td><input type="text" readonly="readonly" id="setto1" name="setto1" /></td>
456                                                     <td><input type="text" readonly="readonly" id="setto2" name="setto2" /></td>
457                                                     <td><input type="text" readonly="readonly" id="setto3" name="setto3" /></td>
458                                                 </tr>
459                                                 <tr>
460                                                     <th scope="row">When more than: </th>
461                                                     <td><input type="text" readonly="readonly" id="whenmorethan1" name="whenmorethan1" /></td>
462                                                     <td><input type="text" readonly="readonly" id="whenmorethan2" name="whenmorethan2" /></td>
463                                                     <td><input type="text" readonly="readonly" id="whenmorethan3" name="whenmorethan3" /></td>
464                                                 </tr>
465                                                 <tr>
466                                                     <th scope="row">Inner counter: </th>
467                                                     <td><input type="text" readonly="readonly" id="innerloop1" name="innerloop1" /></td>
468                                                     <td><input type="text" readonly="readonly" id="innerloop2" name="innerloop2" /></td>
469                                                     <td><input type="text" readonly="readonly" id="innerloop3" name="innerloop3" /></td>
470                                                 </tr>
471                                                 <tr>
472                                                     [% BLOCK numbering_select %]
473                                                         <select disabled="disabled" id="[% name | html %]" name="[% name | html %]">
474                                                             <option value=""></option>
475                                                             <option value="dayname">Name of day</option>
476                                                             <option value="dayabrv">Name of day (abbreviated)</option>
477                                                             <option value="monthname">Name of month</option>
478                                                             <option value="monthabrv">Name of month (abbreviated)</option>
479                                                             <option value="season">Name of season</option>
480                                                             <option value="seasonabrv">Name of season (abbreviated)</option>
481                                                         </select>
482                                                     [% END %]
483                                                     <th scope="row">Formatting:</th>
484                                                     <td>[% PROCESS numbering_select name="numbering1" %]</td>
485                                                     <td>[% PROCESS numbering_select name="numbering2" %]</td>
486                                                     <td>[% PROCESS numbering_select name="numbering3" %]</td>
487                                                 </tr>
488                                             </tbody>
489                                         </table>
490                                     </li>
491                                     <li>
492                                         <span class="label">&nbsp;</span>
493                                         <a href="#" id="modifyadvancedpatternbutton"><i class="fa fa-pencil"></i> Modify pattern</a>
494                                         <button type="button" class="btn btn-default btn-xs" id="saveadvancedpatternbutton" style="display:none"><i class="fa fa-save"></i> Save as new pattern</button>
495                                         <a class="cancel" href="#" id="restoreadvancedpatternbutton" style="display:none">Cancel modifications</a>
496                                     </li>
497                                     </ol>
498                                 </div> <!-- /#advancedpredictionpattern -->
499                                 <fieldset class="action">
500                                     <button type="button" id="testpatternbutton" class="btn btn-default btn-sm"><i class="fa fa-play"></i> Test prediction pattern</button>
501                                 </fieldset>
502                             </fieldset>
503
504                             [% IF additional_fields %]
505                                 <div id="subscription_additional_fields">
506                                     [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values %]
507                                 </div>
508                             [% END %]
509
510                             <input type="hidden" id="mana_id"  name="mana_id" value=""/>
511                             <input type="hidden" id="sndescription"  name="sndescription" value=""/>
512                             <input type="hidden" id="sfdescription"  name="sfdescription" value=""/>
513                             <input type="hidden" id="unit"  name="unit" value=""/>
514                             <input type="hidden" id="unitsperissue"  name="unitsperissue" value=""/>
515                             <input type="hidden" id="issuesperunit"  name="issuesperunit" value=""/>
516                             <fieldset class="action">
517                                 <button type="button" id="subscription_add_previous" style="float:left"><i class="fa fa-long-arrow-left"></i> Previous</button>
518                                 <input id="save-subscription" type="submit" value="Save subscription" style="float:right;" accesskey="w"/>
519                             </fieldset>
520                         </div>
521                     </div>
522                     <div class="col-md-6">
523                         <fieldset id="displayexample"></fieldset>
524                     </div>
525                 </div> <!-- /.row#page_2 -->
526             </form>
527         </div>
528
529         <!-- Mana Search Result Modal -->
530         <div class="modal" id="mana_search_result" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label">
531             <div class="modal-dialog modal-lg" role="document">
532                 <div class="modal-content">
533                     <div class="modal-header">
534                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
535                         <h4 class="modal-title" id="mana_search_result_label">Modal title</h4>
536                     </div>
537                     <div class="modal-body">
538                     </div>
539                     <div class="modal-footer">
540                         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
541                     </div>
542                 </div>
543              </div>
544          </div>
545
546 [% MACRO jsinclude BLOCK %]
547     [% INCLUDE 'calendar.inc' %]
548     [% INCLUDE 'datatables.inc' %]
549     [% Asset.js("js/mana.js") | $raw %]
550     <script>
551         var subscriptionid = "[% subscriptionid | html %]";
552         var irregularity = "[% irregularity | html %]";
553         var more_than_one_serial = "[% more_than_one_serial | html %]";
554         var tags = [];
555         var interface = "[% interface | html %]";
556         var theme = "[% theme | html %]";
557         [% FOREACH field IN dont_export_field_loop %]
558             tags.push("[% field.fieldid | html %]");
559         [% END %]
560         [%- IF (Koha.Preference('Mana') == 1 && mana_url) -%]
561             var mana_enabled = 1;
562         [%- ELSE -%]
563             var mana_enabled = 0;
564         [%- END -%]
565         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");
566         var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
567         var MSG_BIBLIO_NOT_EXIST = _("Bibliographic record does not exist!");
568         var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
569         var MSG_TEST_PREDICTION = _("Please click on 'Test prediction pattern' before saving subscription.");
570         var MSG_REQUIRED_PUB_DATE = _("You must choose a first publication date");
571         var MSG_SAVE_PREDICTION_PATTERN = _("You have modified the advanced prediction pattern. Please save your work or cancel modifications.");
572         var MSG_PATTERN_IRREG = _("Warning! Present pattern has planned irregularities. Click on 'Test prediction pattern' to check if it's still valid");
573         var MSG_PATTERN_NAME = _("Please enter a name for this pattern");
574         var MSG_PATTERN_NAME_EXISTS = _("This pattern name already exists. Do you want to modify it?");
575         var MSG_OVERWRITE_PATTERNS = _("Warning: This will modify the pattern for all subscriptions that are using it.");
576         var MSG_PATTERN_CREATE_FAILED = _("Something went wrong. Unable to create a new numbering pattern.");
577         var MSG_PATTERN_TEST_FAILED = _("Cannot test prediction pattern for the following reason(s): %s");
578         var MSG_FREQUENCY_UNDEFINED = _("Frequency is not defined");
579         var MSG_PUB_DATE_UNDEFINED = _("First publication date is not defined");
580         var MSG_NEXT_ISSUE_UNDEFINED = _("Next issue publication date is not defined");
581         var MSG_MANA_SEARCHING = _("Searching for subscription in Mana Knowledge Base");
582         var MSG_MANA_RESULTS = _("Results from Mana Knowledge Base");
583         var MSG_MANA_SUBSCRIPTION_FOUND = _("Subscription found on Mana Knowledge Base:");
584         var MSG_MANA_SHOW_DETAILS = _("Show Mana results");
585         var MSG_MANA_NO_SUBSCRIPTION_FOUND = _("No subscription found on Mana Knowledge Base");
586         var MSG_MANA_SHARE_PATTERN = _("Please feel free to share your pattern with all others librarians once you are done");
587
588         var BOOKSELLER_IDS = [% To.json( bookseller_ids ) || '[]' | html %];
589     </script>
590     [% Asset.js("js/subscription-add.js") | $raw %]
591     [% Asset.js("js/showpredictionpattern.js") | $raw %]
592 [% END %]
593
594 [% INCLUDE 'intranet-bottom.inc' %]