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 $(document).ready(function() {
48 $("#issuesperunit").change(function() {
49 var value = $(this).val();
50 if(!isNaN(value) && value > 1) {
51 $("#unitsperissue").val(1);
54 $("#unitsperissue").change(function() {
55 var value = $(this).val();
56 if(!isNaN(value) && value > 1) {
57 $("#issuesperunit").val(1);
60 $(".delete_frequency").on("click",function(){
61 return confirmDelete();
63 $("#add_frequency_form").on("submit",function(){
66 $("#show_blocking_subs").on("click",function(e){
68 $("#blocking_subs").show();
75 <body id="ser_subscription_frequencies" class="ser">
76 [% INCLUDE 'header.inc' %]
77 [% INCLUDE 'serials-search.inc' %]
79 [% BLOCK translate_frequnit %]
82 [% CASE 'week' %] week
83 [% CASE 'month' %] month
84 [% CASE 'year' %] year
88 <div id="breadcrumbs">
89 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
90 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> ›
91 <a href="/cgi-bin/koha/serials/subscription-frequencies.pl">Frequencies</a>
94 <div id="doc3" class="yui-t2">
99 [% IF (new or modify) %]
101 <h1>New frequency</h1>
103 <h1>Edit frequency: [% description %]</h1>
105 <form action="/cgi-bin/koha/serials/subscription-frequencies.pl" id="add_frequency_form" method="post">
107 <input type="hidden" name="id" value="[% id %]" />
108 <input type="hidden" name="op" value="savemod" />
110 <input type="hidden" name="op" value="savenew" />
112 <fieldset class="rows">
115 <label class="required" for="description">Description: </label>
116 <input type="text" id="description" name="description" value="[% description | html %]" class="required" required="required" /> <span class="required">Required</span>
119 <label for="unit">Unit: </label>
120 <select id="unit" name="unit">
121 <option value="">None</option>
122 [% FOREACH unit IN units_loop %]
123 [% IF (unit.selected) %]
124 <option selected="selected" value="[% unit.val %]">
126 <option value="[% unit.val %]">
128 [% PROCESS translate_frequnit frequnit=unit.val %]
133 <li><span class="hint">Note: one of the two following fields must be equal to 1</span></li>
135 <label for="issuesperunit">Issues per unit: </label>
137 <input type="text" id="issuesperunit" name="issuesperunit" value="1" size="3" />
139 <input type="text" id="issuesperunit" name="issuesperunit" value="[% issuesperunit %]" size="3" />
143 <label for="unitsperissue">Units per issue: </label>
145 <input type="text" id="unitsperissue" name="unitsperissue" value="1" size="3" />
147 <input type="text" id="unitsperissue" name="unitsperissue" value="[% unitsperissue %]" size="3" />
151 <label for="displayorder">Display order: </label>
152 <input type="text" id="displayorder" name="displayorder" value="[% displayorder %]" size="3" />
156 <fieldset class="action">
157 <input type="submit" value="Save" />
158 <a href="/cgi-bin/koha/serials/subscription-frequencies.pl" class="cancel">Cancel</a>
163 <div id="toolbar" class="btn-toolbar">
164 <a class="btn btn-default btn-sm" id="newfrequency" href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=new"><i class="fa fa-plus"></i> New frequency</a>
169 <div class="dialog alert">
171 This frequency is still used by [% subscriptions.size %]
172 subscription(s). Do you still want to delete it?
174 <p><a href="#" id="show_blocking_subs">Show subscriptions</a></p>
175 <ul id="blocking_subs" style="display:none">
176 [% FOREACH sub IN subscriptions %]
177 <li style="list-style-type:none">
178 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid %]">[% sub.title %]</a>
183 <form action="/cgi-bin/koha/serials/subscription-frequencies.pl" method="get">
184 <input type="hidden" name="op" value="del" />
185 <input type="hidden" name="confirm" value="1" />
186 <input type="hidden" name="frequencyid" value="[% frequencyid %]" />
187 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
189 <form action="/cgi-bin/koha/serials/subscription-frequencies.pl" method="get">
190 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
195 [% IF (frequencies_loop.size) %]
196 <table id="frequenciest">
201 <th>Issues per unit</th>
202 <th>Units per issue</th>
203 <th>Display order</th>
208 [% FOREACH frequency IN frequencies_loop %]
210 <td>[% frequency.description %]</td>
211 <td>[% PROCESS translate_frequnit frequnit=frequency.unit %]</td>
212 <td>[% frequency.issuesperunit %]</td>
213 <td>[% frequency.unitsperissue %]</td>
214 <td>[% frequency.displayorder %]</td>
216 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=modify&frequencyid=[% frequency.id %]"><i class="fa fa-pencil"></i> Edit</a>
217 <a class="delete_frequency btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-frequencies.pl?op=del&frequencyid=[% frequency.id %]"><i class="fa fa-trash"></i> Delete</a>
224 <p>There is no defined frequency.</p>
231 [% INCLUDE 'serials-menu.inc' %]
234 [% INCLUDE 'intranet-bottom.inc' %]