4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Serials › Numbering patterns</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.css("css/datatables.css") | $raw %]
10 <body id="ser_subscription_numberpatterns" class="ser">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'serials-search.inc' %]
14 <div id="breadcrumbs">
15 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
16 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
17 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
19 › New numbering pattern
20 [% ELSIF ( modify ) %]
21 › Modifying numbering pattern '[% label | html %]'
25 <div id="doc3" class="yui-t2">
30 [% IF (new or modify) %]
33 <h1>New numbering pattern</h1>
34 [% IF (error_existing_numberpattern) %]
35 <div class="dialog alert">
36 <p>A pattern with this name already exists.</p>
40 <h1>Modify pattern: [% label | html %]</h1>
41 [% IF (error_existing_numberpattern) %]
42 <div class="dialog alert">
43 <p>Another pattern with this name already exists.</p>
49 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
51 <input type="hidden" name="op" value="savenew" />
53 <input type="hidden" name="op" value="savemod" />
54 <input type="hidden" name="id" value="[% id | html %]" />
56 <fieldset class="rows">
59 <label for="label">Name:</label>
60 <input type="text" id="label" name="label" value="[% label | html %]" />
63 <label for="description">Description:</label>
64 <input type="text" id="description" name="description" value="[% description | html %]" />
67 <label for="numberingmethod">Numbering formula:</label>
68 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod | html %]" />
71 <label for="displayorder">Display order:</label>
72 <input type="text" id="displayorder" name="displayorder" value="[% displayorder | html %]" />
87 <td><input type="text" id="label1" name="label1" value="[% label1 | html %]" /></td>
88 <td><input type="text" id="label2" name="label2" value="[% label2 | html %]" /></td>
89 <td><input type="text" id="label3" name="label3" value="[% label3 | html %]" /></td>
93 <td><input type="text" id="add1" name="add1" value="[% add1 | html %]" /></td>
94 <td><input type="text" id="add2" name="add2" value="[% add2 | html %]" /></td>
95 <td><input type="text" id="add3" name="add3" value="[% add3 | html %]" /></td>
99 <td><input type="text" id="every1" name="every1" value="[% every1 | html %]" /></td>
100 <td><input type="text" id="every2" name="every2" value="[% every2 | html %]" /></td>
101 <td><input type="text" id="every3" name="every3" value="[% every3 | html %]" /></td>
105 <td><input type="text" id="setto1" name="setto1" value="[% setto1 | html %]" /></td>
106 <td><input type="text" id="setto2" name="setto2" value="[% setto2 | html %]" /></td>
107 <td><input type="text" id="setto3" name="setto3" value="[% setto3 | html %]" /></td>
110 <td>When more than</td>
111 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 | html %]" /></td>
112 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 | html %]" /></td>
113 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 | html %]" /></td>
116 [% BLOCK numbering_select %]
117 <select id="[% name | html %]" name="[% name | html %]">
118 <option value=""></option>
119 [% IF (value == "dayname") %]
120 <option selected="selected" value="dayname">Name of day</option>
122 <option value="dayname">Name of day</option>
124 [% IF (value == "dayabrv") %]
125 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
127 <option value="dayabrv">Name of day (abbreviated)</option>
129 [% IF (value == "monthname") %]
130 <option selected="selected" value="monthname">Name of month</option>
132 <option value="monthname">Name of month</option>
134 [% IF (value == "monthabrv") %]
135 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
137 <option value="monthabrv">Name of month (abbreviated)</option>
139 [% IF (value == "season") %]
140 <option selected="selected" value="season">Name of season</option>
142 <option value="season">Name of season</option>
144 [% IF (value == "seasonabrv") %]
145 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
147 <option value="seasonabrv">Name of season (abbreviated)</option>
152 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
153 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
154 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
159 <fieldset class="action">
160 <button type="submit" class="btn btn-default btn-sm">Save</button>
161 <button type="reset" class="btn btn-default btn-sm">Reset</button>
162 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
168 <fieldset class="rows">
169 <legend>Test prediction pattern</legend>
172 <label for="frequency">Frequency: </label>
173 <select id="frequency">
174 [% FOREACH frequency IN frequencies_loop %]
175 <option value="[% frequency.id | html %]">[% frequency.description | html %]</option>
180 <label for="firstacquidate">First issue publication date: </label>
181 <input type="text" id="firstacquidate" class="datepicker" size="10" />
184 <label for="sublength">Subscription length:</label>
185 <select id="subtype">
186 [% FOREACH subtype IN subtypes_loop %]
187 <option value="[% subtype.value | html %]">[% subtype.value | html %]</option>
190 <input type="text" id="sublength" size="3" />
193 <label for="locale">Locale: </label>
194 <select id="locale" name="locale">
195 <option value=""></option>
196 [% FOREACH locale IN locales %]
197 <option value="[% locale.language | html %]">[% locale.description | html %]</option>
200 <span class="hint">If empty, English is used</span>
215 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 | html %]" /></td>
216 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 | html %]" /></td>
217 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 | html %]" /></td>
220 <td>Inner counter</td>
221 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 | html %]" /></td>
222 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 | html %]" /></td>
223 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 | html %]" /></td>
227 <fieldset class="action">
228 <button type="button" id="test_pattern" class="btn btn-default btn-sm">Test pattern</button>
230 <div id="predictionpattern"></div>
235 <h1>Numbering patterns</h1>
237 <div class="dialog alert">
239 This pattern is still used by [% subscriptions.size | html %]
240 subscription(s). Do you still want to delete it?
242 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
243 <ul id="blocking_subs" style="display:none">
244 [% FOREACH sub IN subscriptions %]
245 <li style="list-style-type:none">
246 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid | html %]">[% sub.title | html %]</a>
251 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
252 <input type="hidden" name="op" value="del" />
253 <input type="hidden" name="confirm" value="1" />
254 <input type="hidden" name="id" value="[% id | html %]" />
255 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
257 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
258 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
263 <div id="toolbar" class="btn-toolbar">
264 <a class="btn btn-default btn-sm" id="newnumberpattern" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=new"><i class="fa fa-plus"></i> New numbering pattern</a>
267 [% IF (numberpatterns_loop.size) %]
268 <table id="numberpatternst">
273 <th>Numbering formula</th>
274 <th>Display order</th>
279 [% FOREACH numberpattern IN numberpatterns_loop %]
281 <td>[% numberpattern.label | html %]</td>
282 <td>[% numberpattern.description | html %]</td>
283 <td>[% numberpattern.numberingmethod | html %]</td>
284 <td>[% numberpattern.displayorder | html %]</td>
286 <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>
287 <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>
294 <p>There are no existing numbering patterns.</p>
300 [% INCLUDE 'serials-menu.inc' %]
304 [% MACRO jsinclude BLOCK %]
305 [% IF (daily_options) %]
306 [% Asset.js("js/showpredictionpattern.js") | $raw %]
308 [% INCLUDE 'calendar.inc' %]
309 [% INCLUDE 'datatables.inc' %]
310 <script type="text/javascript">
311 function confirmDelete() {
312 return confirm(_("Are you sure you want to delete this numbering pattern?"));
315 [% IF (new or modify) %]
316 function testPattern() {
317 var frequencyid = $("#frequency").val();
318 var firstacquidate = $("#firstacquidate").val();
321 if(frequencyid == undefined || frequencyid == "") {
322 error_msg += _("- Frequency is not defined") + "\n";
325 if(firstacquidate == undefined || firstacquidate == "") {
326 error_msg += _("- First publication date is not defined") + "\n";
331 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
337 'custompattern': true,
340 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
341 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
342 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
343 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
344 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
346 for(i in ajaxParams) {
347 var param = ajaxParams[i];
348 var value = $("#"+param).val();
350 ajaxData[param] = value;
354 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
358 success: function(data) {
359 $("#predictionpattern").html(data);
365 function show_blocking_subs() {
366 $("#blocking_subs").show();
368 $(document).ready(function(){
370 $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
372 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
374 "sPaginationType": "four_button"
377 $(".delete_pattern").on("click",function(){
378 return confirmDelete();
380 $("#show_blocking_subs").on("click",function(e){
382 $("#blocking_subs").show();
384 $("#test_pattern").on("click",function(){
391 [% INCLUDE 'intranet-bottom.inc' %]