3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Serials › Numbering patterns</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% Asset.css("css/datatables.css") %]
9 <body id="ser_subscription_numberpatterns" class="ser">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'serials-search.inc' %]
13 <div id="breadcrumbs">
14 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
15 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
16 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
18 › New numbering pattern
19 [% ELSIF ( modify ) %]
20 › Modifying numbering pattern '[% label %]'
24 <div id="doc3" class="yui-t2">
29 [% IF (new or modify) %]
32 <h1>New numbering pattern</h1>
33 [% IF (error_existing_numberpattern) %]
34 <div class="dialog alert">
35 <p>A pattern with this name already exists.</p>
39 <h1>Modify pattern: [% label %]</h1>
40 [% IF (error_existing_numberpattern) %]
41 <div class="dialog alert">
42 <p>Another pattern with this name already exists.</p>
48 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
50 <input type="hidden" name="op" value="savenew" />
52 <input type="hidden" name="op" value="savemod" />
53 <input type="hidden" name="id" value="[% id %]" />
55 <fieldset class="rows">
58 <label for="label">Name:</label>
59 <input type="text" id="label" name="label" value="[% label %]" />
62 <label for="description">Description:</label>
63 <input type="text" id="description" name="description" value="[% description %]" />
66 <label for="numberingmethod">Numbering formula:</label>
67 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod %]" />
70 <label for="displayorder">Display order:</label>
71 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" />
86 <td><input type="text" id="label1" name="label1" value="[% label1 %]" /></td>
87 <td><input type="text" id="label2" name="label2" value="[% label2 %]" /></td>
88 <td><input type="text" id="label3" name="label3" value="[% label3 %]" /></td>
92 <td><input type="text" id="add1" name="add1" value="[% add1 %]" /></td>
93 <td><input type="text" id="add2" name="add2" value="[% add2 %]" /></td>
94 <td><input type="text" id="add3" name="add3" value="[% add3 %]" /></td>
98 <td><input type="text" id="every1" name="every1" value="[% every1 %]" /></td>
99 <td><input type="text" id="every2" name="every2" value="[% every2 %]" /></td>
100 <td><input type="text" id="every3" name="every3" value="[% every3 %]" /></td>
104 <td><input type="text" id="setto1" name="setto1" value="[% setto1 %]" /></td>
105 <td><input type="text" id="setto2" name="setto2" value="[% setto2 %]" /></td>
106 <td><input type="text" id="setto3" name="setto3" value="[% setto3 %]" /></td>
109 <td>When more than</td>
110 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 %]" /></td>
111 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 %]" /></td>
112 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 %]" /></td>
115 [% BLOCK numbering_select %]
116 <select id="[% name %]" name="[% name %]">
117 <option value=""></option>
118 [% IF (value == "dayname") %]
119 <option selected="selected" value="dayname">Name of day</option>
121 <option value="dayname">Name of day</option>
123 [% IF (value == "dayabrv") %]
124 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
126 <option value="dayabrv">Name of day (abbreviated)</option>
128 [% IF (value == "monthname") %]
129 <option selected="selected" value="monthname">Name of month</option>
131 <option value="monthname">Name of month</option>
133 [% IF (value == "monthabrv") %]
134 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
136 <option value="monthabrv">Name of month (abbreviated)</option>
138 [% IF (value == "season") %]
139 <option selected="selected" value="season">Name of season</option>
141 <option value="season">Name of season</option>
143 [% IF (value == "seasonabrv") %]
144 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
146 <option value="seasonabrv">Name of season (abbreviated)</option>
151 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
152 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
153 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
158 <fieldset class="action">
159 <button type="submit" class="btn btn-default btn-sm">Save</button>
160 <button type="reset" class="btn btn-default btn-sm">Reset</button>
161 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
167 <fieldset class="rows">
168 <legend>Test prediction pattern</legend>
171 <label for="frequency">Frequency: </label>
172 <select id="frequency">
173 [% FOREACH frequency IN frequencies_loop %]
174 <option value="[% frequency.id %]">[% frequency.description %]</option>
179 <label for="firstacquidate">First issue publication date: </label>
180 <input type="text" id="firstacquidate" class="datepicker" size="10" />
183 <label for="sublength">Subscription length:</label>
184 <select id="subtype">
185 [% FOREACH subtype IN subtypes_loop %]
186 <option value="[% subtype.value %]">[% subtype.value %]</option>
189 <input type="text" id="sublength" size="3" />
192 <label for="locale">Locale: </label>
193 <select id="locale" name="locale">
194 <option value=""></option>
195 [% FOREACH locale IN locales %]
196 <option value="[% locale.language %]">[% locale.description %]</option>
199 <span class="hint">If empty, English is used</span>
214 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 %]" /></td>
215 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 %]" /></td>
216 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 %]" /></td>
219 <td>Inner counter</td>
220 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 %]" /></td>
221 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 %]" /></td>
222 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 %]" /></td>
226 <fieldset class="action">
227 <button type="button" id="test_pattern" class="btn btn-default btn-sm">Test pattern</button>
229 <div id="predictionpattern"></div>
234 <h1>Numbering patterns</h1>
236 <div class="dialog alert">
238 This pattern is still used by [% subscriptions.size %]
239 subscription(s). Do you still want to delete it?
241 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
242 <ul id="blocking_subs" style="display:none">
243 [% FOREACH sub IN subscriptions %]
244 <li style="list-style-type:none">
245 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
250 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
251 <input type="hidden" name="op" value="del" />
252 <input type="hidden" name="confirm" value="1" />
253 <input type="hidden" name="id" value="[% id %]" />
254 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
256 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
257 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
262 <div id="toolbar" class="btn-toolbar">
263 <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>
266 [% IF (numberpatterns_loop.size) %]
267 <table id="numberpatternst">
272 <th>Numbering formula</th>
273 <th>Display order</th>
278 [% FOREACH numberpattern IN numberpatterns_loop %]
280 <td>[% numberpattern.label %]</td>
281 <td>[% numberpattern.description %]</td>
282 <td>[% numberpattern.numberingmethod %]</td>
283 <td>[% numberpattern.displayorder %]</td>
285 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=modify&id=[% numberpattern.id %]"><i class="fa fa-pencil"></i> Edit</a>
286 <a class="delete_pattern btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=del&id=[% numberpattern.id %]"><i class="fa fa-trash"></i> Delete</a>
293 <p>There are no existing numbering patterns.</p>
299 [% INCLUDE 'serials-menu.inc' %]
303 [% MACRO jsinclude BLOCK %]
304 [% IF (daily_options) %]
305 [% Asset.js("js/showpredictionpattern.js") %]
307 [% INCLUDE 'calendar.inc' %]
308 [% INCLUDE 'datatables.inc' %]
309 <script type="text/javascript">
310 function confirmDelete() {
311 return confirm(_("Are you sure you want to delete this numbering pattern?"));
314 [% IF (new or modify) %]
315 function testPattern() {
316 var frequencyid = $("#frequency").val();
317 var firstacquidate = $("#firstacquidate").val();
320 if(frequencyid == undefined || frequencyid == "") {
321 error_msg += _("- Frequency is not defined") + "\n";
324 if(firstacquidate == undefined || firstacquidate == "") {
325 error_msg += _("- First publication date is not defined") + "\n";
330 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
336 'custompattern': true,
339 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
340 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
341 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
342 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
343 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
345 for(i in ajaxParams) {
346 var param = ajaxParams[i];
347 var value = $("#"+param).val();
349 ajaxData[param] = value;
353 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
357 success: function(data) {
358 $("#predictionpattern").html(data);
364 function show_blocking_subs() {
365 $("#blocking_subs").show();
367 $(document).ready(function(){
369 $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
371 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
373 "sPaginationType": "four_button"
376 $(".delete_pattern").on("click",function(){
377 return confirmDelete();
379 $("#show_blocking_subs").on("click",function(e){
381 $("#blocking_subs").show();
383 $("#test_pattern").on("click",function(){
390 [% INCLUDE 'intranet-bottom.inc' %]