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();
74 <body id="ser_subscription_numberpatterns" class="ser">
75 [% INCLUDE 'header.inc' %]
76 [% INCLUDE 'serials-search.inc' %]
78 <div id="breadcrumbs">
79 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
80 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
81 <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
84 <div id="doc3" class="yui-t2">
89 [% IF (new or modify) %]
92 <h1>New numbering pattern</h1>
93 [% IF (error_existing_numberpattern) %]
94 <div class="dialog alert">
95 <p>A pattern with this name already exists.</p>
99 <h1>Modify pattern: [% label %]</h1>
100 [% IF (error_existing_numberpattern) %]
101 <div class="dialog alert">
102 <p>Another pattern with this name already exists.</p>
108 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="post">
110 <input type="hidden" name="op" value="savenew" />
112 <input type="hidden" name="op" value="savemod" />
113 <input type="hidden" name="id" value="[% id %]" />
115 <fieldset class="rows">
118 <label for="label">Name:</label>
119 <input type="text" id="label" name="label" value="[% label %]" />
122 <label for="description">Description:</label>
123 <input type="text" id="description" name="description" value="[% description %]" />
126 <label for="numberingmethod">Numbering formula:</label>
127 <input type="text" id="numberingmethod" name="numberingmethod" value="[% numberingmethod %]" />
130 <label for="displayorder">Display order:</label>
131 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" />
146 <td><input type="text" id="label1" name="label1" value="[% label1 %]" /></td>
147 <td><input type="text" id="label2" name="label2" value="[% label2 %]" /></td>
148 <td><input type="text" id="label3" name="label3" value="[% label3 %]" /></td>
152 <td><input type="text" id="add1" name="add1" value="[% add1 %]" /></td>
153 <td><input type="text" id="add2" name="add2" value="[% add2 %]" /></td>
154 <td><input type="text" id="add3" name="add3" value="[% add3 %]" /></td>
158 <td><input type="text" id="every1" name="every1" value="[% every1 %]" /></td>
159 <td><input type="text" id="every2" name="every2" value="[% every2 %]" /></td>
160 <td><input type="text" id="every3" name="every3" value="[% every3 %]" /></td>
164 <td><input type="text" id="setto1" name="setto1" value="[% setto1 %]" /></td>
165 <td><input type="text" id="setto2" name="setto2" value="[% setto2 %]" /></td>
166 <td><input type="text" id="setto3" name="setto3" value="[% setto3 %]" /></td>
169 <td>When more than</td>
170 <td><input type="text" id="whenmorethan1" name="whenmorethan1" value="[% whenmorethan1 %]" /></td>
171 <td><input type="text" id="whenmorethan2" name="whenmorethan2" value="[% whenmorethan2 %]" /></td>
172 <td><input type="text" id="whenmorethan3" name="whenmorethan3" value="[% whenmorethan3 %]" /></td>
175 [% BLOCK numbering_select %]
176 <select id="[% name %]" name="[% name %]">
177 <option value=""></option>
178 [% IF (value == "dayname") %]
179 <option selected="selected" value="dayname">Name of day</option>
181 <option value="dayname">Name of day</option>
183 [% IF (value == "dayabrv") %]
184 <option selected="selected" value="dayabrv">Name of day (abbreviated)</option>
186 <option value="dayabrv">Name of day (abbreviated)</option>
188 [% IF (value == "monthname") %]
189 <option selected="selected" value="monthname">Name of month</option>
191 <option value="monthname">Name of month</option>
193 [% IF (value == "monthabrv") %]
194 <option selected="selected" value="monthabrv">Name of month (abbreviated)</option>
196 <option value="monthabrv">Name of month (abbreviated)</option>
198 [% IF (value == "season") %]
199 <option selected="selected" value="season">Name of season</option>
201 <option value="season">Name of season</option>
203 [% IF (value == "seasonabrv") %]
204 <option selected="selected" value="seasonabrv">Name of season (abbreviated)</option>
206 <option value="seasonabrv">Name of season (abbreviated)</option>
211 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
212 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
213 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
218 <fieldset class="action">
219 <input type="submit" value="Save" />
220 <input type="reset" value="Reset" />
221 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
227 <fieldset class="rows">
228 <legend>Test prediction pattern</legend>
231 <label for="frequency">Frequency: </label>
232 <select id="frequency">
233 [% FOREACH frequency IN frequencies_loop %]
234 <option value="[% frequency.id %]">[% frequency.description %]</option>
239 <label for="firstacquidate">First issue publication date: </label>
240 <input type="text" id="firstacquidate" class="datepicker" size="10" />
243 <label for="sublength">Subscription length:</label>
244 <select id="subtype">
245 [% FOREACH subtype IN subtypes_loop %]
246 <option value="[% subtype.value %]">[% subtype.value %]</option>
249 <input type="text" id="sublength" size="3" />
252 <label for="locale">Locale: </label>
253 <select id="locale" name="locale">
254 <option value=""></option>
255 [% FOREACH locale IN locales %]
256 <option value="[% locale.language %]">[% locale.description %]</option>
259 <span class="hint">If empty, English is used</span>
274 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 %]" /></td>
275 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 %]" /></td>
276 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 %]" /></td>
279 <td>Inner counter</td>
280 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 %]" /></td>
281 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 %]" /></td>
282 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 %]" /></td>
286 <fieldset class="action">
287 <input type="button" value="Test pattern" onclick="testPattern();" />
289 <div id="predictionpattern"></div>
294 <h1>Numbering patterns</h1>
296 <div class="dialog alert">
298 This pattern is still used by [% subscriptions.size %]
299 subscription(s). Do you still want to delete it?
301 <p><a href="#" onclick="show_blocking_subs(); return false;">Show subscriptions</a></p>
302 <ul id="blocking_subs" style="display:none">
303 [% FOREACH sub IN subscriptions %]
304 <li style="list-style-type:none">
305 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
310 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
311 <input type="hidden" name="op" value="del" />
312 <input type="hidden" name="confirm" value="1" />
313 <input type="hidden" name="id" value="[% id %]" />
314 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
316 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
317 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
322 <div id="toolbar" class="btn-toolbar">
323 <a class="btn btn-small" id="newnumberpattern" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=new"><i class="fa fa-plus"></i> New numbering pattern</a>
326 [% IF (numberpatterns_loop.size) %]
327 <table id="numberpatternst">
332 <th>Numbering formula</th>
333 <th>Display order</th>
338 [% FOREACH numberpattern IN numberpatterns_loop %]
340 <td>[% numberpattern.label %]</td>
341 <td>[% numberpattern.description %]</td>
342 <td>[% numberpattern.numberingmethod %]</td>
343 <td>[% numberpattern.displayorder %]</td>
345 <a class="btn btn-mini" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=modify&id=[% numberpattern.id %]"><i class="fa fa-pencil"></i> Edit</a>
346 <a class="delete_pattern btn btn-mini" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=del&id=[% numberpattern.id %]"><i class="fa fa-trash"></i> Delete</a>
353 <p>There are no existing numbering patterns.</p>
359 [% INCLUDE 'serials-menu.inc' %]
362 [% INCLUDE 'intranet-bottom.inc' %]