4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Numbering patterns › Serials › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="ser_subscription_numberpatterns" class="ser">
10 [% WRAPPER 'header.inc' %]
11 [% INCLUDE 'serials-search.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 [% WRAPPER breadcrumbs %]
16 [% WRAPPER breadcrumb_item %]
17 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
19 [% IF ( new || modify ) %]
20 [% WRAPPER breadcrumb_item %]
21 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
25 [% WRAPPER breadcrumb_item bc_active= 1 %]
26 <span>New numbering pattern</span>
28 [% ELSIF ( modify ) %]
29 [% WRAPPER breadcrumb_item bc_active= 1 %]
30 <span>Modifying numbering pattern '[% label | html %]'</span>
33 [% WRAPPER breadcrumb_item bc_active= 1 %]
34 <span>Numbering patterns</span>
37 [% END #/ WRAPPER breadcrumbs %]
38 [% END #/ WRAPPER sub-header.inc %]
40 <div class="main container-fluid">
42 <div class="col-sm-10 col-sm-push-2">
45 [% IF (new or modify) %]
47 <h1>New numbering pattern</h1>
48 [% IF (error_existing_numberpattern) %]
49 <div class="dialog alert">
50 <p>A pattern with this name already exists.</p>
54 <h1>Modify pattern: [% label | html %]</h1>
55 [% IF (error_existing_numberpattern) %]
56 <div class="dialog alert">
57 <p>Another pattern with this name already exists.</p>
62 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
64 <input type="hidden" name="op" value="savenew" />
66 <input type="hidden" name="op" value="savemod" />
67 <input type="hidden" name="id" value="[% id | html %]" />
69 <fieldset class="rows">
72 <label for="label">Name:</label>
73 <input type="text" id="label" name="label" value="[% label | html %]" />
76 <label for="description">Description:</label>
77 <input type="text" id="description" name="description" value="[% description | html %]" size="50" />
80 <label for="numberingmethod">Numbering formula:</label>
81 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod | html %]" />
84 <label for="displayorder">Display order:</label>
85 <input type="text" id="displayorder" name="displayorder" value="[% displayorder | html %]" />
100 <td><input type="text" id="label1" name="label1" value="[% label1 | html %]" /></td>
101 <td><input type="text" id="label2" name="label2" value="[% label2 | html %]" /></td>
102 <td><input type="text" id="label3" name="label3" value="[% label3 | html %]" /></td>
106 <td><input type="text" id="add1" name="add1" value="[% add1 | html %]" /></td>
107 <td><input type="text" id="add2" name="add2" value="[% add2 | html %]" /></td>
108 <td><input type="text" id="add3" name="add3" value="[% add3 | html %]" /></td>
112 <td><input type="text" id="every1" name="every1" value="[% every1 | html %]" /></td>
113 <td><input type="text" id="every2" name="every2" value="[% every2 | html %]" /></td>
114 <td><input type="text" id="every3" name="every3" value="[% every3 | html %]" /></td>
118 <td><input type="text" id="setto1" name="setto1" value="[% setto1 | html %]" /></td>
119 <td><input type="text" id="setto2" name="setto2" value="[% setto2 | html %]" /></td>
120 <td><input type="text" id="setto3" name="setto3" value="[% setto3 | html %]" /></td>
123 <td>When more than</td>
124 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 | html %]" /></td>
125 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 | html %]" /></td>
126 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 | html %]" /></td>
129 [% BLOCK numbering_select %]
130 <select id="[% name | html %]" name="[% name | html %]">
131 <option value=""></option>
132 [% IF (value == "dayname") %]
133 <option selected="selected" value="dayname">Name of day</option>
135 <option value="dayname">Name of day</option>
137 [% IF (value == "dayabrv") %]
138 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
140 <option value="dayabrv">Name of day (abbreviated)</option>
142 [% IF (value == "monthname") %]
143 <option selected="selected" value="monthname">Name of month</option>
145 <option value="monthname">Name of month</option>
147 [% IF (value == "monthabrv") %]
148 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
150 <option value="monthabrv">Name of month (abbreviated)</option>
152 [% IF (value == "season") %]
153 <option selected="selected" value="season">Name of season</option>
155 <option value="season">Name of season</option>
157 [% IF (value == "seasonabrv") %]
158 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
160 <option value="seasonabrv">Name of season (abbreviated)</option>
165 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
166 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
167 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
172 <fieldset class="action">
173 <button type="submit" class="btn btn-primary">Save</button>
174 <button type="reset" class="btn btn-default">Reset</button>
175 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
180 <fieldset class="rows">
181 <legend>Test prediction pattern</legend>
184 <label for="frequency">Frequency: </label>
185 <select id="frequency">
186 [% FOREACH frequency IN frequencies_loop %]
187 <option value="[% frequency.id | html %]">[% frequency.description | html %]</option>
192 <label for="firstacquidate">First issue publication date: </label>
193 <input type="text" id="firstacquidate" class="flatpickr" size="10" />
196 <label for="sublength">Subscription length:</label>
197 <select id="subtype">
198 <option value="issues">issues</option>
199 <option value="weeks">weeks</option>
200 <option value="months">months</option>
202 <input type="text" id="sublength" size="3" />
205 <label for="locale">Locale: </label>
206 <select id="locale" name="locale">
207 <option value=""></option>
208 [% FOREACH locale IN locales %]
209 <option value="[% locale.language | html %]">[% locale.description | html %]</option>
212 <span class="hint">If empty, English is used</span>
227 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 | html %]" /></td>
228 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 | html %]" /></td>
229 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 | html %]" /></td>
232 <td>Inner counter</td>
233 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 | html %]" /></td>
234 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 | html %]" /></td>
235 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 | html %]" /></td>
239 <div id="predictionpattern"></div>
241 <fieldset class="action">
242 <button type="button" id="test_pattern" class="btn btn-default">Test pattern</button>
247 <h1>Numbering patterns</h1>
249 <div class="dialog alert">
251 This pattern is still used by [% subscriptions.size | html %]
252 subscription(s). Do you still want to delete it?
254 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
255 <ul id="blocking_subs" style="display:none">
256 [% FOREACH sub IN subscriptions %]
257 <li style="list-style-type:none">
258 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid | uri %]">[% sub.title | html %]</a>
263 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
264 <input type="hidden" name="op" value="del" />
265 <input type="hidden" name="confirm" value="1" />
266 <input type="hidden" name="id" value="[% id | html %]" />
267 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
269 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
270 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
275 <div id="toolbar" class="btn-toolbar">
276 <a class="btn btn-default" id="newnumberpattern" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=new"><i class="fa fa-plus"></i> New numbering pattern</a>
279 [% IF (numberpatterns_loop.size) %]
280 <table id="numberpatternst">
285 <th>Numbering formula</th>
286 <th>Display order</th>
287 <th class="noExport">Actions</th>
291 [% FOREACH numberpattern IN numberpatterns_loop %]
293 <td>[% numberpattern.label | html %]</td>
294 <td>[% numberpattern.description | html %]</td>
295 <td>[% numberpattern.numberingmethod | html %]</td>
296 <td>[% numberpattern.displayorder | html %]</td>
298 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=modify&id=[% numberpattern.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
299 <a class="delete_pattern btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=del&id=[% numberpattern.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
306 <p>There are no existing numbering patterns.</p>
311 </div> <!-- /.col-sm-10.col-sm-push-2 -->
313 <div class="col-sm-2 col-sm-pull-10">
315 [% INCLUDE 'serials-menu.inc' %]
317 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
318 </div> <!-- /.row -->
320 [% MACRO jsinclude BLOCK %]
321 [% IF (daily_options) %]
322 [% Asset.js("js/showpredictionpattern.js") | $raw %]
324 [% INCLUDE 'calendar.inc' %]
325 [% INCLUDE 'datatables.inc' %]
327 function confirmDelete() {
328 return confirm(_("Are you sure you want to delete this numbering pattern?"));
331 [% IF (new or modify) %]
332 function testPattern() {
333 var frequencyid = $("#frequency").val();
334 var firstacquidate = $("#firstacquidate").val();
337 if(frequencyid == undefined || frequencyid == "") {
338 error_msg += _("- Frequency is not defined") + "\n";
341 if(firstacquidate == undefined || firstacquidate == "") {
342 error_msg += _("- First publication date is not defined") + "\n";
347 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
353 'custompattern': true,
356 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
357 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
358 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
359 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
360 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
362 for(i in ajaxParams) {
363 var param = ajaxParams[i];
364 var value = $("#"+param).val();
366 ajaxData[param] = value;
370 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
374 success: function(data) {
375 $("#predictionpattern").html(data);
381 function show_blocking_subs() {
382 $("#blocking_subs").show();
384 $(document).ready(function(){
386 $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
388 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
390 "sPaginationType": "full"
393 $(".delete_pattern").on("click",function(){
394 return confirmDelete();
396 $("#show_blocking_subs").on("click",function(e){
398 $("#blocking_subs").show();
400 $("#test_pattern").on("click",function(){
407 [% INCLUDE 'intranet-bottom.inc' %]