Lines 37-111
Link Here
|
37 |
[% END %] |
37 |
[% END %] |
38 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> |
38 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> |
39 |
<script type="text/javascript"> |
39 |
<script type="text/javascript"> |
40 |
// ################################################################################# |
|
|
41 |
// Javascript |
42 |
// ################################################################################# |
43 |
function CheckDuplicateForm(f){ |
44 |
var ok=1; |
45 |
var _alertString=""; |
46 |
var alertString=""; |
47 |
if(!(isNotNull(f.budget_period_startdate,1))){ |
48 |
_alertString += "\n- " + _("Start date missing"); |
49 |
} |
50 |
if (!(isNotNull(f.budget_period_enddate,1))){ |
51 |
_alertString += "\n- " + _("End date missing"); |
52 |
} |
53 |
if( f.budget_period_startdate > f.budget_period_enddate ) { |
54 |
_alertString += "\n- " + _("Start date must be before end date"); |
55 |
} |
56 |
if (!(isNotNull(f.budget_period_description,1))){ |
57 |
_alertString += "\n- " + _("Budget description missing"); |
58 |
} |
59 |
|
60 |
if(_alertString.length==0){ |
61 |
f.submit(); |
62 |
} else { |
63 |
alertString += _("Form not submitted because of the following problem(s)"); |
64 |
alertString += "\n-----------------------------------------\n"; |
65 |
alertString += _alertString; |
66 |
alert(alertString); |
67 |
} |
68 |
} |
69 |
function Check(f) { |
70 |
var ok=1; |
71 |
var _alertString=""; |
72 |
var alertString2; |
73 |
|
74 |
if (!(isNotNull(f.budget_period_startdate,1))) { |
75 |
_alertString += "\n- " + _("Start date missing"); |
76 |
} |
77 |
|
78 |
if (!(isNotNull(f.budget_period_enddate,1))) { |
79 |
_alertString += "\n- " + _("End date missing"); |
80 |
} |
81 |
|
82 |
if ( f.budget_period_startdate > f.budget_period_enddate ) { |
83 |
_alertString += "\n- " + _("Start date must be before end date"); |
84 |
} |
85 |
|
86 |
if (!(isNotNull(f.budget_period_description,1))) { |
87 |
_alertString += "\n- " + _("Description missing"); |
88 |
} |
89 |
|
90 |
if (!(isNum(f.budget_period_total))) { |
91 |
_alertString += "\n- " + _("Amount must be a valid number, or empty"); |
92 |
} |
93 |
|
94 |
/* |
95 |
checkBudgetTotal(f) { |
96 |
} |
97 |
*/ |
98 |
|
99 |
if (_alertString.length==0) { |
100 |
f.submit(); |
101 |
} else { |
102 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
103 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
104 |
alertString2 += _alertString; |
105 |
alert(alertString2); |
106 |
} |
107 |
} |
108 |
|
109 |
$(document).ready(function() { |
40 |
$(document).ready(function() { |
110 |
var tabs = $('#budgetsTabs').tabs(); |
41 |
var tabs = $('#budgetsTabs').tabs(); |
111 |
[% IF ( tab ) %] |
42 |
[% IF ( tab ) %] |
Lines 171-176
Link Here
|
171 |
"sPaginationType": "full_numbers" |
102 |
"sPaginationType": "full_numbers" |
172 |
})); |
103 |
})); |
173 |
[% END %] |
104 |
[% END %] |
|
|
105 |
$("#add_modify_budget").validate({ |
106 |
rules: { |
107 |
budget_period_startdate: "required", |
108 |
budget_period_enddate: { |
109 |
required: true, |
110 |
is_date_after: "#from" |
111 |
}, |
112 |
budget_period_description: "required", |
113 |
budget_period_total: { |
114 |
number: true |
115 |
} |
116 |
}, |
117 |
messages: { |
118 |
budget_period_enddate: { |
119 |
is_date_after: _("Budget end date must be after budget start date") |
120 |
} |
121 |
} |
122 |
}); |
174 |
}); |
123 |
}); |
175 |
</script> |
124 |
</script> |
176 |
|
125 |
|
Lines 252-264
Link Here
|
252 |
<div id="yui-main"> |
201 |
<div id="yui-main"> |
253 |
<div class="yui-b"> |
202 |
<div class="yui-b"> |
254 |
|
203 |
|
255 |
[% UNLESS close_form OR closed%] |
204 |
[% UNLESS close_form OR closed OR duplicate_form %] |
256 |
[% INCLUDE 'budgets-admin-toolbar.inc' %] |
205 |
[% INCLUDE 'budgets-admin-toolbar.inc' %] |
257 |
[% END %] |
206 |
[% END %] |
258 |
|
207 |
|
259 |
[% IF ( duplicate_form ) %] |
208 |
[% IF ( duplicate_form ) %] |
260 |
<h3>Duplicate budget</h3> |
209 |
<h3>Duplicate budget</h3> |
261 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> |
210 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post"> |
262 |
<fieldset class="rows"> |
211 |
<fieldset class="rows"> |
263 |
<input type="hidden" name="op" value="duplicate_budget" /> |
212 |
<input type="hidden" name="op" value="duplicate_budget" /> |
264 |
<input type="hidden" name="budget_period_id" value="[% budget_period_id %]" /> |
213 |
<input type="hidden" name="budget_period_id" value="[% budget_period_id %]" /> |
Lines 268-285
Link Here
|
268 |
<li> |
217 |
<li> |
269 |
<label class="required" for="from">Start date: </label> |
218 |
<label class="required" for="from">Start date: </label> |
270 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
219 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
271 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
220 |
<span class="required">Required</span> |
|
|
221 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
272 |
</li> |
222 |
</li> |
273 |
<li> |
223 |
<li> |
274 |
|
224 |
|
275 |
<label class="required" for="to">End date: </label> |
225 |
<label class="required" for="to">End date: </label> |
276 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
226 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
277 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
227 |
<span class="required">Required</span> |
|
|
228 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
278 |
</li> |
229 |
</li> |
279 |
|
230 |
|
280 |
<li> |
231 |
<li> |
281 |
<label class="required" for="budget_period_description">Description</label> |
232 |
<label class="required" for="budget_period_description">Description</label> |
282 |
<input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" /> |
233 |
<input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" /> |
|
|
234 |
<span class="required">Required</span> |
283 |
</li> |
235 |
</li> |
284 |
|
236 |
|
285 |
<li> |
237 |
<li> |
Lines 308-314
Link Here
|
308 |
</fieldset> |
260 |
</fieldset> |
309 |
|
261 |
|
310 |
<fieldset class="action"> |
262 |
<fieldset class="action"> |
311 |
<input type="button" value="Save Changes" onclick="CheckDuplicateForm(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Cancel</a> |
263 |
<input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Cancel</a> |
312 |
</fieldset> |
264 |
</fieldset> |
313 |
|
265 |
|
314 |
</form> |
266 |
</form> |
Lines 323-329
Link Here
|
323 |
[% ELSE %] |
275 |
[% ELSE %] |
324 |
<h3>Add budget</h3> |
276 |
<h3>Add budget</h3> |
325 |
[% END %] |
277 |
[% END %] |
326 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> |
278 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post"> |
327 |
<fieldset class="rows"> |
279 |
<fieldset class="rows"> |
328 |
<!-- ################################################################################# --> |
280 |
<!-- ################################################################################# --> |
329 |
<!-- display information about the budget period that must be added or modified --> |
281 |
<!-- display information about the budget period that must be added or modified --> |
Lines 334-346
Link Here
|
334 |
<li> |
286 |
<li> |
335 |
<label class="required" for="from">Start date: </label> |
287 |
<label class="required" for="from">Start date: </label> |
336 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
288 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
337 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
289 |
<span class="required">Required</span> |
|
|
290 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
338 |
</li> |
291 |
</li> |
339 |
<li> |
292 |
<li> |
340 |
|
293 |
|
341 |
<label class="required" for="to">End date: </label> |
294 |
<label class="required" for="to">End date: </label> |
342 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
295 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
343 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
296 |
<span class="required">Required</span> |
|
|
297 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
344 |
</li> |
298 |
</li> |
345 |
|
299 |
|
346 |
<li> |
300 |
<li> |
Lines 349-354
Link Here
|
349 |
<label class="required" for="budget_period_description">Description: </label> |
303 |
<label class="required" for="budget_period_description">Description: </label> |
350 |
<input type="text" id="budget_period_description" name="budget_period_description" |
304 |
<input type="text" id="budget_period_description" name="budget_period_description" |
351 |
size="48" maxlength="80" value="[% budget_period_description %]" /> |
305 |
size="48" maxlength="80" value="[% budget_period_description %]" /> |
|
|
306 |
<span class="required">Required</span> |
352 |
</li> |
307 |
</li> |
353 |
|
308 |
|
354 |
<li> |
309 |
<li> |
Lines 378-385
Link Here
|
378 |
<fieldset class="action"> |
333 |
<fieldset class="action"> |
379 |
<!-- "save changes" button --> |
334 |
<!-- "save changes" button --> |
380 |
<!-- ###################################### --> |
335 |
<!-- ###################################### --> |
381 |
<input type="button" value="Save" onclick="Check(this.form)" /> |
336 |
<input type="submit" value="Save" /> |
382 |
<!-- <input type="submit" value="Save Changes" /> --> |
|
|
383 |
[% IF ( budget_period_id ) %] |
337 |
[% IF ( budget_period_id ) %] |
384 |
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a> |
338 |
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a> |
385 |
[% ELSE %] |
339 |
[% ELSE %] |