1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Serials › Numbering patterns</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
8 function confirmDelete() {
9 return confirm(_("Are you sure you want to delete this numbering pattern?"));
12 [% IF (new or modify) %]
13 function testPattern() {
14 var frequencyid = $("#frequency").val();
15 var firstacquidate = $("#firstacquidate").val();
18 if(frequencyid == undefined || frequencyid == "") {
19 error_msg += _("- Frequency is not defined") + "\n";
22 if(firstacquidate == undefined || firstacquidate == "") {
23 error_msg += _("- First publication date is not defined") + "\n";
28 alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
34 'custompattern': true,
37 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
38 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
39 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
40 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
41 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
43 for(i in ajaxParams) {
44 var param = ajaxParams[i];
45 var value = $("#"+param).val();
47 ajaxData[param] = value;
51 url: "/cgi-bin/koha/serials/showpredictionpattern.pl",
55 success: function(data) {
56 $("#predictionpattern").html(data);
62 function show_blocking_subs() {
63 $("#blocking_subs").show();
65 $(document).ready(function(){
66 $(".delete_pattern").on("click",function(){
67 return confirmDelete();
69 $("#show_blocking_subs").on("click",function(e){
71 $("#blocking_subs").show();
73 $("#test_pattern").on("click",function(){
81 <body id="ser_subscription_numberpatterns" class="ser">
82 [% INCLUDE 'header.inc' %]
83 [% INCLUDE 'serials-search.inc' %]
85 <div id="breadcrumbs">
86 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
87 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
88 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
91 <div id="doc3" class="yui-t2">
96 [% IF (new or modify) %]
99 <h1>New numbering pattern</h1>
100 [% IF (error_existing_numberpattern) %]
101 <div class="dialog alert">
102 <p>A pattern with this name already exists.</p>
106 <h1>Modify pattern: [% label %]</h1>
107 [% IF (error_existing_numberpattern) %]
108 <div class="dialog alert">
109 <p>Another pattern with this name already exists.</p>
115 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
117 <input type="hidden" name="op" value="savenew" />
119 <input type="hidden" name="op" value="savemod" />
120 <input type="hidden" name="id" value="[% id %]" />
122 <fieldset class="rows">
125 <label for="label">Name:</label>
126 <input type="text" id="label" name="label" value="[% label %]" />
129 <label for="description">Description:</label>
130 <input type="text" id="description" name="description" value="[% description %]" />
133 <label for="numberingmethod">Numbering formula:</label>
134 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod %]" />
137 <label for="displayorder">Display order:</label>
138 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" />
153 <td><input type="text" id="label1" name="label1" value="[% label1 %]" /></td>
154 <td><input type="text" id="label2" name="label2" value="[% label2 %]" /></td>
155 <td><input type="text" id="label3" name="label3" value="[% label3 %]" /></td>
159 <td><input type="text" id="add1" name="add1" value="[% add1 %]" /></td>
160 <td><input type="text" id="add2" name="add2" value="[% add2 %]" /></td>
161 <td><input type="text" id="add3" name="add3" value="[% add3 %]" /></td>
165 <td><input type="text" id="every1" name="every1" value="[% every1 %]" /></td>
166 <td><input type="text" id="every2" name="every2" value="[% every2 %]" /></td>
167 <td><input type="text" id="every3" name="every3" value="[% every3 %]" /></td>
171 <td><input type="text" id="setto1" name="setto1" value="[% setto1 %]" /></td>
172 <td><input type="text" id="setto2" name="setto2" value="[% setto2 %]" /></td>
173 <td><input type="text" id="setto3" name="setto3" value="[% setto3 %]" /></td>
176 <td>When more than</td>
177 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 %]" /></td>
178 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 %]" /></td>
179 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 %]" /></td>
182 [% BLOCK numbering_select %]
183 <select id="[% name %]" name="[% name %]">
184 <option value=""></option>
185 [% IF (value == "dayname") %]
186 <option selected="selected" value="dayname">Name of day</option>
188 <option value="dayname">Name of day</option>
190 [% IF (value == "dayabrv") %]
191 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
193 <option value="dayabrv">Name of day (abbreviated)</option>
195 [% IF (value == "monthname") %]
196 <option selected="selected" value="monthname">Name of month</option>
198 <option value="monthname">Name of month</option>
200 [% IF (value == "monthabrv") %]
201 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
203 <option value="monthabrv">Name of month (abbreviated)</option>
205 [% IF (value == "season") %]
206 <option selected="selected" value="season">Name of season</option>
208 <option value="season">Name of season</option>
210 [% IF (value == "seasonabrv") %]
211 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
213 <option value="seasonabrv">Name of season (abbreviated)</option>
218 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
219 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
220 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
225 <fieldset class="action">
226 <input type="submit" value="Save" />
227 <input type="reset" value="Reset" />
228 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
234 <fieldset class="rows">
235 <legend>Test prediction pattern</legend>
238 <label for="frequency">Frequency: </label>
239 <select id="frequency">
240 [% FOREACH frequency IN frequencies_loop %]
241 <option value="[% frequency.id %]">[% frequency.description %]</option>
246 <label for="firstacquidate">First issue publication date: </label>
247 <input type="text" id="firstacquidate" class="datepicker" size="10" />
250 <label for="sublength">Subscription length:</label>
251 <select id="subtype">
252 [% FOREACH subtype IN subtypes_loop %]
253 <option value="[% subtype.value %]">[% subtype.value %]</option>
256 <input type="text" id="sublength" size="3" />
259 <label for="locale">Locale: </label>
260 <select id="locale" name="locale">
261 <option value=""></option>
262 [% FOREACH locale IN locales %]
263 <option value="[% locale.language %]">[% locale.description %]</option>
266 <span class="hint">If empty, English is used</span>
281 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 %]" /></td>
282 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 %]" /></td>
283 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 %]" /></td>
286 <td>Inner counter</td>
287 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 %]" /></td>
288 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 %]" /></td>
289 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 %]" /></td>
293 <fieldset class="action">
294 <input type="button" id="test_pattern" value="Test pattern" />
296 <div id="predictionpattern"></div>
301 <h1>Numbering patterns</h1>
303 <div class="dialog alert">
305 This pattern is still used by [% subscriptions.size %]
306 subscription(s). Do you still want to delete it?
308 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
309 <ul id="blocking_subs" style="display:none">
310 [% FOREACH sub IN subscriptions %]
311 <li style="list-style-type:none">
312 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
317 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
318 <input type="hidden" name="op" value="del" />
319 <input type="hidden" name="confirm" value="1" />
320 <input type="hidden" name="id" value="[% id %]" />
321 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
323 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
324 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
329 <div id="toolbar" class="btn-toolbar">
330 <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>
333 [% IF (numberpatterns_loop.size) %]
334 <table id="numberpatternst">
339 <th>Numbering formula</th>
340 <th>Display order</th>
345 [% FOREACH numberpattern IN numberpatterns_loop %]
347 <td>[% numberpattern.label %]</td>
348 <td>[% numberpattern.description %]</td>
349 <td>[% numberpattern.numberingmethod %]</td>
350 <td>[% numberpattern.displayorder %]</td>
352 <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>
353 <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>
360 <p>There are no existing numbering patterns.</p>
366 [% INCLUDE 'serials-menu.inc' %]
369 [% INCLUDE 'intranet-bottom.inc' %]