1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Serials › Frequencies</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
6 function confirmDelete() {
7 return confirm(_("Are you sure you want to delete this subscription frequency?"));
10 function check_form() {
11 var description = $("#description").val();
12 var unit = $("#unit").val();
13 var issuesperunit = $("#issuesperunit").val();
14 var unitsperissue = $("#unitsperissue").val();
15 var alert_msg = _("Some fields are not valid:") + "\n";
18 if(description.length == 0) {
19 alert_msg += "\t - " + _("Description is required");
23 if(isNaN(issuesperunit) || issuesperunit == 0) {
24 alert_msg += "\n\t - " + _("Issues per unit is required")
25 + " " + _("(must be a number greater than 0)");
28 if(isNaN(unitsperissue) || unitsperissue == 0) {
29 alert_msg += "\n\t - " + _("Units per issue is required")
30 + " " + _("(must be a number greater than 0)");
33 if(issuesperunit > 1 && unitsperissue > 1) {
34 alert_msg += "\n\t - " + _("One of 'issues per unit' and 'units per issue' must be equal to 1");
47 function show_blocking_subs() {
48 $("#blocking_subs").show();
51 $(document).ready(function() {
52 $("#issuesperunit").change(function() {
53 var value = $(this).val();
54 if(!isNaN(value) && value > 1) {
55 $("#unitsperissue").val(1);
58 $("#unitsperissue").change(function() {
59 var value = $(this).val();
60 if(!isNaN(value) && value > 1) {
61 $("#issuesperunit").val(1);
64 $(".delete_frequency").on("click",function(){
65 return confirmDelete();
72 <body id="ser_subscription_frequencies" class="ser">
73 [% INCLUDE 'header.inc' %]
74 [% INCLUDE 'serials-search.inc' %]
76 [% BLOCK translate_frequnit %]
79 [% CASE 'week' %] week
80 [% CASE 'month' %] month
81 [% CASE 'year' %] year
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-frequencies.pl">Frequencies</a>
91 <div id="doc3" class="yui-t2">
96 [% IF (new or modify) %]
98 <h1>New frequency</h1>
100 <h1>Modify frequency: [% description %]</h1>
102 <form action="/cgi-bin/koha/serials/subscription-frequencies.pl" method="post" onsubmit="return check_form();">
104 <input type="hidden" name="id" value="[% id %]" />
105 <input type="hidden" name="op" value="savemod" />
107 <input type="hidden" name="op" value="savenew" />
109 <fieldset class="rows">
112 <label class="required" for="description">Description: </label>
113 <input type="text" id="description" name="description" value="[% description %]" class="required" required="required" /> <span class="required">Required</span>
116 <label for="unit">Unit: </label>
117 <select id="unit" name="unit">
118 <option value="">None</option>
119 [% FOREACH unit IN units_loop %]
120 [% IF (unit.selected) %]
121 <option selected="selected" value="[% unit.val %]">
123 <option value="[% unit.val %]">
125 [% PROCESS translate_frequnit frequnit=unit.val %]
130 <li><span class="hint">Note: one of the two following fields must be equal to 1</span></li>
132 <label for="issuesperunit">Issues per unit: </label>
134 <input type="text" id="issuesperunit" name="issuesperunit" value="1" size="3" />
136 <input type="text" id="issuesperunit" name="issuesperunit" value="[% issuesperunit %]" size="3" />
140 <label for="unitsperissue">Units per issue: </label>
142 <input type="text" id="unitsperissue" name="unitsperissue" value="1" size="3" />
144 <input type="text" id="unitsperissue" name="unitsperissue" value="[% unitsperissue %]" size="3" />
148 <label for="displayorder">Display order: </label>
149 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" size="3" />
153 <fieldset class="action">
154 <input type="submit" value="Save" />
155 <a href="/cgi-bin/koha/serials/subscription-frequencies.pl" class="cancel">Cancel</a>
160 <div id="toolbar" class="btn-toolbar">
161 <a class="btn btn-small" id="newfrequency" href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=new"><i class="fa fa-plus"></i> New frequency</a>
168 This frequency is still used by [% subscriptions.size %]
169 subscription(s). Do you still want to delete it?
171 <p><a href="#" onclick="show_blocking_subs(); return false;">Show subscriptions</a></p>
172 <ul id="blocking_subs" style="display:none">
173 [% FOREACH sub IN subscriptions %]
174 <li style="list-style-type:none">
175 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
180 <form action="" method="get">
181 <input type="hidden" name="op" value="del" />
182 <input type="hidden" name="confirm" value="1" />
183 <input type="hidden" name="frequencyid" value="[% frequencyid %]" />
184 <input type="submit" class="approve" value="Yes, delete" />
186 <form action="" method="get">
187 <input type="submit" class="deny" value="No, don't delete" />
192 [% IF (frequencies_loop.size) %]
193 <table id="frequenciest">
198 <th>Issues per unit</th>
199 <th>Units per issue</th>
200 <th>Display order</th>
205 [% FOREACH frequency IN frequencies_loop %]
207 <td>[% frequency.description %]</td>
208 <td>[% PROCESS translate_frequnit frequnit=frequency.unit %]</td>
209 <td>[% frequency.issuesperunit %]</td>
210 <td>[% frequency.unitsperissue %]</td>
211 <td>[% frequency.displayorder %]</td>
213 <a href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=modify&frequencyid=[% frequency.id %]">Modify</a> |
214 <a class="delete_frequency" href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=del&frequencyid=[% frequency.id %]">Delete</a>
221 <p>There is no defined frequency.</p>
228 [% INCLUDE 'serials-menu.inc' %]
231 [% INCLUDE 'intranet-bottom.inc' %]