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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
26 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
29 <a href="#" aria-current="page">
33 [% ELSIF ( modify ) %]
35 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
38 <a href="#" aria-current="page">
39 Modifying numbering pattern '[% label | html %]'
44 <a href="#" aria-current="page">
53 <div class="main container-fluid">
55 <div class="col-sm-10 col-sm-push-2">
58 [% IF (new or modify) %]
60 <h1>New numbering pattern</h1>
61 [% IF (error_existing_numberpattern) %]
62 <div class="dialog alert">
63 <p>A pattern with this name already exists.</p>
67 <h1>Modify pattern: [% label | html %]</h1>
68 [% IF (error_existing_numberpattern) %]
69 <div class="dialog alert">
70 <p>Another pattern with this name already exists.</p>
75 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
77 <input type="hidden" name="op" value="savenew" />
79 <input type="hidden" name="op" value="savemod" />
80 <input type="hidden" name="id" value="[% id | html %]" />
82 <fieldset class="rows">
85 <label for="label">Name:</label>
86 <input type="text" id="label" name="label" value="[% label | html %]" />
89 <label for="description">Description:</label>
90 <input type="text" id="description" name="description" value="[% description | html %]" size="50" />
93 <label for="numberingmethod">Numbering formula:</label>
94 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod | html %]" />
97 <label for="displayorder">Display order:</label>
98 <input type="text" id="displayorder" name="displayorder" value="[% displayorder | html %]" />
113 <td><input type="text" id="label1" name="label1" value="[% label1 | html %]" /></td>
114 <td><input type="text" id="label2" name="label2" value="[% label2 | html %]" /></td>
115 <td><input type="text" id="label3" name="label3" value="[% label3 | html %]" /></td>
119 <td><input type="text" id="add1" name="add1" value="[% add1 | html %]" /></td>
120 <td><input type="text" id="add2" name="add2" value="[% add2 | html %]" /></td>
121 <td><input type="text" id="add3" name="add3" value="[% add3 | html %]" /></td>
125 <td><input type="text" id="every1" name="every1" value="[% every1 | html %]" /></td>
126 <td><input type="text" id="every2" name="every2" value="[% every2 | html %]" /></td>
127 <td><input type="text" id="every3" name="every3" value="[% every3 | html %]" /></td>
131 <td><input type="text" id="setto1" name="setto1" value="[% setto1 | html %]" /></td>
132 <td><input type="text" id="setto2" name="setto2" value="[% setto2 | html %]" /></td>
133 <td><input type="text" id="setto3" name="setto3" value="[% setto3 | html %]" /></td>
136 <td>When more than</td>
137 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 | html %]" /></td>
138 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 | html %]" /></td>
139 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 | html %]" /></td>
142 [% BLOCK numbering_select %]
143 <select id="[% name | html %]" name="[% name | html %]">
144 <option value=""></option>
145 [% IF (value == "dayname") %]
146 <option selected="selected" value="dayname">Name of day</option>
148 <option value="dayname">Name of day</option>
150 [% IF (value == "dayabrv") %]
151 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
153 <option value="dayabrv">Name of day (abbreviated)</option>
155 [% IF (value == "monthname") %]
156 <option selected="selected" value="monthname">Name of month</option>
158 <option value="monthname">Name of month</option>
160 [% IF (value == "monthabrv") %]
161 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
163 <option value="monthabrv">Name of month (abbreviated)</option>
165 [% IF (value == "season") %]
166 <option selected="selected" value="season">Name of season</option>
168 <option value="season">Name of season</option>
170 [% IF (value == "seasonabrv") %]
171 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
173 <option value="seasonabrv">Name of season (abbreviated)</option>
178 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
179 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
180 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
185 <fieldset class="action">
186 <button type="submit" class="btn btn-default">Save</button>
187 <button type="reset" class="btn btn-default">Reset</button>
188 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
193 <fieldset class="rows">
194 <legend>Test prediction pattern</legend>
197 <label for="frequency">Frequency: </label>
198 <select id="frequency">
199 [% FOREACH frequency IN frequencies_loop %]
200 <option value="[% frequency.id | html %]">[% frequency.description | html %]</option>
205 <label for="firstacquidate">First issue publication date: </label>
206 <input type="text" id="firstacquidate" class="flatpickr" size="10" />
209 <label for="sublength">Subscription length:</label>
210 <select id="subtype">
211 <option value="issues">issues</option>
212 <option value="weeks">weeks</option>
213 <option value="months">months</option>
215 <input type="text" id="sublength" size="3" />
218 <label for="locale">Locale: </label>
219 <select id="locale" name="locale">
220 <option value=""></option>
221 [% FOREACH locale IN locales %]
222 <option value="[% locale.language | html %]">[% locale.description | html %]</option>
225 <span class="hint">If empty, English is used</span>
240 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 | html %]" /></td>
241 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 | html %]" /></td>
242 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 | html %]" /></td>
245 <td>Inner counter</td>
246 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 | html %]" /></td>
247 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 | html %]" /></td>
248 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 | html %]" /></td>
252 <fieldset class="action">
253 <button type="button" id="test_pattern" class="btn btn-default">Test pattern</button>
255 <div id="predictionpattern"></div>
260 <h1>Numbering patterns</h1>
262 <div class="dialog alert">
264 This pattern is still used by [% subscriptions.size | html %]
265 subscription(s). Do you still want to delete it?
267 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
268 <ul id="blocking_subs" style="display:none">
269 [% FOREACH sub IN subscriptions %]
270 <li style="list-style-type:none">
271 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid | uri %]">[% sub.title | html %]</a>
276 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
277 <input type="hidden" name="op" value="del" />
278 <input type="hidden" name="confirm" value="1" />
279 <input type="hidden" name="id" value="[% id | html %]" />
280 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
282 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
283 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
288 <div id="toolbar" class="btn-toolbar">
289 <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>
292 [% IF (numberpatterns_loop.size) %]
293 <table id="numberpatternst">
298 <th>Numbering formula</th>
299 <th>Display order</th>
300 <th class="noExport">Actions</th>
304 [% FOREACH numberpattern IN numberpatterns_loop %]
306 <td>[% numberpattern.label | html %]</td>
307 <td>[% numberpattern.description | html %]</td>
308 <td>[% numberpattern.numberingmethod | html %]</td>
309 <td>[% numberpattern.displayorder | html %]</td>
311 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=modify&id=[% numberpattern.id | html %]"><i class="fa fa-pencil"></i> Edit</a>
312 <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"></i> Delete</a>
319 <p>There are no existing numbering patterns.</p>
324 </div> <!-- /.col-sm-10.col-sm-push-2 -->
326 <div class="col-sm-2 col-sm-pull-10">
328 [% INCLUDE 'serials-menu.inc' %]
330 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
331 </div> <!-- /.row -->
333 [% MACRO jsinclude BLOCK %]
334 [% IF (daily_options) %]
335 [% Asset.js("js/showpredictionpattern.js") | $raw %]
337 [% INCLUDE 'calendar.inc' %]
338 [% INCLUDE 'datatables.inc' %]
340 function confirmDelete() {
341 return confirm(_("Are you sure you want to delete this numbering pattern?"));
344 [% IF (new or modify) %]
345 function testPattern() {
346 var frequencyid = $("#frequency").val();
347 var firstacquidate = $("#firstacquidate").val();
350 if(frequencyid == undefined || frequencyid == "") {
351 error_msg += _("- Frequency is not defined") + "\n";
354 if(firstacquidate == undefined || firstacquidate == "") {
355 error_msg += _("- First publication date is not defined") + "\n";
360 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
366 'custompattern': true,
369 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
370 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
371 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
372 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
373 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
375 for(i in ajaxParams) {
376 var param = ajaxParams[i];
377 var value = $("#"+param).val();
379 ajaxData[param] = value;
383 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
387 success: function(data) {
388 $("#predictionpattern").html(data);
394 function show_blocking_subs() {
395 $("#blocking_subs").show();
397 $(document).ready(function(){
399 $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
401 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
403 "sPaginationType": "full"
406 $(".delete_pattern").on("click",function(){
407 return confirmDelete();
409 $("#show_blocking_subs").on("click",function(e){
411 $("#blocking_subs").show();
413 $("#test_pattern").on("click",function(){
420 [% INCLUDE 'intranet-bottom.inc' %]