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