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 == "monthname") %]
184 <option selected="selected" value="monthname">Name of month</option>
186 <option value="monthname">Name of month</option>
188 [% IF (value == "season") %]
189 <option selected="selected" value="season">Name of season</option>
191 <option value="season">Name of season</option>
196 <td>[% PROCESS numbering_select name="numbering1" value=numbering1 %]</td>
197 <td>[% PROCESS numbering_select name="numbering2" value=numbering2 %]</td>
198 <td>[% PROCESS numbering_select name="numbering3" value=numbering3 %]</td>
203 <fieldset class="action">
204 <input type="submit" value="Save" />
205 <input type="reset" value="Reset" />
206 <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
212 <fieldset class="rows">
213 <legend>Test prediction pattern</legend>
216 <label for="frequency">Frequency: </label>
217 <select id="frequency">
218 [% FOREACH frequency IN frequencies_loop %]
219 <option value="[% frequency.id %]">[% frequency.description %]</option>
224 <label for="firstacquidate">First issue publication date: </label>
225 <input type="text" id="firstacquidate" class="datepicker" size="10" />
228 <label for="sublength">Subscription length:</label>
229 <select id="subtype">
230 [% FOREACH subtype IN subtypes_loop %]
231 <option value="[% subtype.value %]">[% subtype.value %]</option>
234 <input type="text" id="sublength" size="3" />
237 <label for="locale">Locale: </label>
238 <select id="locale" name="locale">
239 <option value=""></option>
240 [% FOREACH locale IN locales %]
241 <option value="[% locale.language %]">[% locale.description %]</option>
244 <span class="hint">If empty, English is used</span>
259 <td><input type="text" id="lastvalue1" name="lastvalue1" value="[% lastvalue1 %]" /></td>
260 <td><input type="text" id="lastvalue2" name="lastvalue2" value="[% lastvalue2 %]" /></td>
261 <td><input type="text" id="lastvalue3" name="lastvalue3" value="[% lastvalue3 %]" /></td>
264 <td>Inner counter</td>
265 <td><input type="text" id="innerloop1" name="innerloop1" value="[% innerloop1 %]" /></td>
266 <td><input type="text" id="innerloop2" name="innerloop2" value="[% innerloop2 %]" /></td>
267 <td><input type="text" id="innerloop3" name="innerloop3" value="[% innerloop3 %]" /></td>
271 <fieldset class="action">
272 <input type="button" value="Test pattern" onclick="testPattern();" />
274 <div id="predictionpattern"></div>
279 <h1>Numbering patterns</h1>
281 <div class="dialog alert">
283 This pattern is still used by [% subscriptions.size %]
284 subscription(s). Do you still want to delete it?
286 <p><a href="#" onclick="show_blocking_subs(); return false;">Show subscriptions</a></p>
287 <ul id="blocking_subs" style="display:none">
288 [% FOREACH sub IN subscriptions %]
289 <li style="list-style-type:none">
290 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
295 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
296 <input type="hidden" name="op" value="del" />
297 <input type="hidden" name="confirm" value="1" />
298 <input type="hidden" name="id" value="[% id %]" />
299 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
301 <form action="/cgi-bin/koha/serials/subscription-numberpatterns.pl" method="get">
302 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
307 <div id="toolbar" class="btn-toolbar">
308 <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>
311 [% IF (numberpatterns_loop.size) %]
312 <table id="numberpatternst">
317 <th>Numbering formula</th>
318 <th>Display order</th>
323 [% FOREACH numberpattern IN numberpatterns_loop %]
325 <td>[% numberpattern.label %]</td>
326 <td>[% numberpattern.description %]</td>
327 <td>[% numberpattern.numberingmethod %]</td>
328 <td>[% numberpattern.displayorder %]</td>
330 <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>
331 <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>
338 <p>There are no existing numbering patterns.</p>
344 [% INCLUDE 'serials-menu.inc' %]
347 [% INCLUDE 'intranet-bottom.inc' %]