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