1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Serials › Numbering patterns</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript">
10 function confirmDelete() {
11 return confirm(_("Are you sure you want to delete this numbering pattern?"));
14 [% IF (new or modify) %]
15 function testPattern() {
16 var frequencyid = $("#frequency").val();
17 var firstacquidate = $("#firstacquidate").val();
20 if(frequencyid == undefined || frequencyid == "") {
21 error_msg += _("- Frequency is not defined") + "\n";
24 if(firstacquidate == undefined || firstacquidate == "") {
25 error_msg += _("- First publication date is not defined") + "\n";
30 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
36 'custompattern': true,
39 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
40 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
41 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
42 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
43 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
45 for(i in ajaxParams) {
46 var param = ajaxParams[i];
47 var value = $("#"+param).val();
49 ajaxData[param] = value;
53 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
57 success: function(data) {
58 $("#predictionpattern").html(data);
64 function show_blocking_subs() {
65 $("#blocking_subs").show();
67 $(document).ready(function(){
69 $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
71 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
73 "sPaginationType": "four_button"
76 $(".delete_pattern").on("click",function(){
77 return confirmDelete();
79 $("#show_blocking_subs").on("click",function(e){
81 $("#blocking_subs").show();
83 $("#test_pattern").on("click",function(){
91 <body id="ser_subscription_numberpatterns" class="ser">
92 [% INCLUDE 'header.inc' %]
93 [% INCLUDE 'serials-search.inc' %]
95 <div id="breadcrumbs">
96 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
97 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
98 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
100 › New numbering pattern
101 [% ELSIF ( modify ) %]
102 › Modifying numbering pattern '[% label %]'
106 <div id="doc3" class="yui-t2">
111 [% IF (new or modify) %]
114 <h1>New numbering pattern</h1>
115 [% IF (error_existing_numberpattern) %]
116 <div class="dialog alert">
117 <p>A pattern with this name already exists.</p>
121 <h1>Modify pattern: [% label %]</h1>
122 [% IF (error_existing_numberpattern) %]
123 <div class="dialog alert">
124 <p>Another pattern with this name already exists.</p>
130 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
132 <input type="hidden" name="op" value="savenew" />
134 <input type="hidden" name="op" value="savemod" />
135 <input type="hidden" name="id" value="[% id %]" />
137 <fieldset class="rows">
140 <label for="label">Name:</label>
141 <input type="text" id="label" name="label" value="[% label %]" />
144 <label for="description">Description:</label>
145 <input type="text" id="description" name="description" value="[% description %]" />
148 <label for="numberingmethod">Numbering formula:</label>
149 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod %]" />
152 <label for="displayorder">Display order:</label>
153 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" />
168 <td><input type="text" id="label1" name="label1" value="[% label1 %]" /></td>
169 <td><input type="text" id="label2" name="label2" value="[% label2 %]" /></td>
170 <td><input type="text" id="label3" name="label3" value="[% label3 %]" /></td>
174 <td><input type="text" id="add1" name="add1" value="[% add1 %]" /></td>
175 <td><input type="text" id="add2" name="add2" value="[% add2 %]" /></td>
176 <td><input type="text" id="add3" name="add3" value="[% add3 %]" /></td>
180 <td><input type="text" id="every1" name="every1" value="[% every1 %]" /></td>
181 <td><input type="text" id="every2" name="every2" value="[% every2 %]" /></td>
182 <td><input type="text" id="every3" name="every3" value="[% every3 %]" /></td>
186 <td><input type="text" id="setto1" name="setto1" value="[% setto1 %]" /></td>
187 <td><input type="text" id="setto2" name="setto2" value="[% setto2 %]" /></td>
188 <td><input type="text" id="setto3" name="setto3" value="[% setto3 %]" /></td>
191 <td>When more than</td>
192 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 %]" /></td>
193 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 %]" /></td>
194 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 %]" /></td>
197 [% BLOCK numbering_select %]
198 <select id="[% name %]" name="[% name %]">
199 <option value=""></option>
200 [% IF (value == "dayname") %]
201 <option selected="selected" value="dayname">Name of day</option>
203 <option value="dayname">Name of day</option>
205 [% IF (value == "dayabrv") %]
206 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
208 <option value="dayabrv">Name of day (abbreviated)</option>
210 [% IF (value == "monthname") %]
211 <option selected="selected" value="monthname">Name of month</option>
213 <option value="monthname">Name of month</option>
215 [% IF (value == "monthabrv") %]
216 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
218 <option value="monthabrv">Name of month (abbreviated)</option>
220 [% IF (value == "season") %]
221 <option selected="selected" value="season">Name of season</option>
223 <option value="season">Name of season</option>
225 [% IF (value == "seasonabrv") %]
226 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
228 <option value="seasonabrv">Name of season (abbreviated)</option>
233 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
234 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
235 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
240 <fieldset class="action">
241 <button type="submit" class="btn btn-default btn-sm">Save</button>
242 <button type="reset" class="btn btn-default btn-sm">Reset</button>
243 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
249 <fieldset class="rows">
250 <legend>Test prediction pattern</legend>
253 <label for="frequency">Frequency: </label>
254 <select id="frequency">
255 [% FOREACH frequency IN frequencies_loop %]
256 <option value="[% frequency.id %]">[% frequency.description %]</option>
261 <label for="firstacquidate">First issue publication date: </label>
262 <input type="text" id="firstacquidate" class="datepicker" size="10" />
265 <label for="sublength">Subscription length:</label>
266 <select id="subtype">
267 [% FOREACH subtype IN subtypes_loop %]
268 <option value="[% subtype.value %]">[% subtype.value %]</option>
271 <input type="text" id="sublength" size="3" />
274 <label for="locale">Locale: </label>
275 <select id="locale" name="locale">
276 <option value=""></option>
277 [% FOREACH locale IN locales %]
278 <option value="[% locale.language %]">[% locale.description %]</option>
281 <span class="hint">If empty, English is used</span>
296 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 %]" /></td>
297 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 %]" /></td>
298 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 %]" /></td>
301 <td>Inner counter</td>
302 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 %]" /></td>
303 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 %]" /></td>
304 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 %]" /></td>
308 <fieldset class="action">
309 <button type="button" id="test_pattern" class="btn btn-default btn-sm">Test pattern</button>
311 <div id="predictionpattern"></div>
316 <h1>Numbering patterns</h1>
318 <div class="dialog alert">
320 This pattern is still used by [% subscriptions.size %]
321 subscription(s). Do you still want to delete it?
323 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
324 <ul id="blocking_subs" style="display:none">
325 [% FOREACH sub IN subscriptions %]
326 <li style="list-style-type:none">
327 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
332 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
333 <input type="hidden" name="op" value="del" />
334 <input type="hidden" name="confirm" value="1" />
335 <input type="hidden" name="id" value="[% id %]" />
336 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
338 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
339 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
344 <div id="toolbar" class="btn-toolbar">
345 <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>
348 [% IF (numberpatterns_loop.size) %]
349 <table id="numberpatternst">
354 <th>Numbering formula</th>
355 <th>Display order</th>
360 [% FOREACH numberpattern IN numberpatterns_loop %]
362 <td>[% numberpattern.label %]</td>
363 <td>[% numberpattern.description %]</td>
364 <td>[% numberpattern.numberingmethod %]</td>
365 <td>[% numberpattern.displayorder %]</td>
367 <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>
368 <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>
375 <p>There are no existing numbering patterns.</p>
381 [% INCLUDE 'serials-menu.inc' %]
384 [% INCLUDE 'intranet-bottom.inc' %]