Lines 119-131
Link Here
|
119 |
<div class="col-sm-10 col-sm-push-2"> |
119 |
<div class="col-sm-10 col-sm-push-2"> |
120 |
<main> |
120 |
<main> |
121 |
|
121 |
|
122 |
[% UNLESS close_form OR closed%] |
122 |
[% UNLESS close_form OR closed OR duplicate_form %] |
123 |
[% INCLUDE 'budgets-admin-toolbar.inc' %] |
123 |
[% INCLUDE 'budgets-admin-toolbar.inc' %] |
124 |
[% END %] |
124 |
[% END %] |
125 |
|
125 |
|
126 |
[% IF ( duplicate_form ) %] |
126 |
[% IF ( duplicate_form ) %] |
127 |
<h3>Duplicate budget</h3> |
127 |
<h3>Duplicate budget</h3> |
128 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> |
128 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post"> |
129 |
<fieldset class="rows"> |
129 |
<fieldset class="rows"> |
130 |
<input type="hidden" name="op" value="duplicate_budget" /> |
130 |
<input type="hidden" name="op" value="duplicate_budget" /> |
131 |
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" /> |
131 |
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" /> |
Lines 135-152
Link Here
|
135 |
<li> |
135 |
<li> |
136 |
<label class="required" for="from">Start date: </label> |
136 |
<label class="required" for="from">Start date: </label> |
137 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
137 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
138 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
138 |
<span class="required">Required</span> |
|
|
139 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
139 |
</li> |
140 |
</li> |
140 |
<li> |
141 |
<li> |
141 |
|
142 |
|
142 |
<label class="required" for="to">End date: </label> |
143 |
<label class="required" for="to">End date: </label> |
143 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
144 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
144 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
145 |
<span class="required">Required</span> |
|
|
146 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
145 |
</li> |
147 |
</li> |
146 |
|
148 |
|
147 |
<li> |
149 |
<li> |
148 |
<label class="required" for="budget_period_description">Description</label> |
150 |
<label class="required" for="budget_period_description">Description</label> |
149 |
<input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description | html %]" /> |
151 |
<input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description | html %]" /> |
|
|
152 |
<span class="required">Required</span> |
150 |
</li> |
153 |
</li> |
151 |
|
154 |
|
152 |
<li> |
155 |
<li> |
Lines 175-181
Link Here
|
175 |
</fieldset> |
178 |
</fieldset> |
176 |
|
179 |
|
177 |
<fieldset class="action"> |
180 |
<fieldset class="action"> |
178 |
<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 | html %]">Cancel</a> |
181 |
<input type="submit" value="Save" /> |
|
|
182 |
<a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | html %]">Cancel</a> |
179 |
</fieldset> |
183 |
</fieldset> |
180 |
|
184 |
|
181 |
</form> |
185 |
</form> |
Lines 190-196
Link Here
|
190 |
[% ELSE %] |
194 |
[% ELSE %] |
191 |
<h3>Add budget</h3> |
195 |
<h3>Add budget</h3> |
192 |
[% END %] |
196 |
[% END %] |
193 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post"> |
197 |
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post"> |
194 |
<fieldset class="rows"> |
198 |
<fieldset class="rows"> |
195 |
<!-- ################################################################################# --> |
199 |
<!-- ################################################################################# --> |
196 |
<!-- display information about the budget period that must be added or modified --> |
200 |
<!-- display information about the budget period that must be added or modified --> |
Lines 201-213
Link Here
|
201 |
<li> |
205 |
<li> |
202 |
<label class="required" for="from">Start date: </label> |
206 |
<label class="required" for="from">Start date: </label> |
203 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
207 |
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" /> |
204 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
208 |
<span class="required">Required</span> |
|
|
209 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
205 |
</li> |
210 |
</li> |
206 |
<li> |
211 |
<li> |
207 |
|
212 |
|
208 |
<label class="required" for="to">End date: </label> |
213 |
<label class="required" for="to">End date: </label> |
209 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
214 |
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" /> |
210 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
215 |
<span class="required">Required</span> |
|
|
216 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
211 |
</li> |
217 |
</li> |
212 |
|
218 |
|
213 |
<li> |
219 |
<li> |
Lines 216-221
Link Here
|
216 |
<label class="required" for="budget_period_description">Description: </label> |
222 |
<label class="required" for="budget_period_description">Description: </label> |
217 |
<input type="text" id="budget_period_description" name="budget_period_description" |
223 |
<input type="text" id="budget_period_description" name="budget_period_description" |
218 |
size="48" maxlength="80" value="[% budget_period_description | html %]" /> |
224 |
size="48" maxlength="80" value="[% budget_period_description | html %]" /> |
|
|
225 |
<span class="required">Required</span> |
219 |
</li> |
226 |
</li> |
220 |
|
227 |
|
221 |
<li> |
228 |
<li> |
Lines 245-252
Link Here
|
245 |
<fieldset class="action"> |
252 |
<fieldset class="action"> |
246 |
<!-- "save changes" button --> |
253 |
<!-- "save changes" button --> |
247 |
<!-- ###################################### --> |
254 |
<!-- ###################################### --> |
248 |
<input type="button" value="Save" onclick="Check(this.form)" /> |
255 |
<input type="submit" value="Save" /> |
249 |
<!-- <input type="submit" value="Save Changes" /> --> |
|
|
250 |
[% IF ( budget_period_id ) %] |
256 |
[% IF ( budget_period_id ) %] |
251 |
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | html %]" class="cancel">Cancel</a> |
257 |
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | html %]" class="cancel">Cancel</a> |
252 |
[% ELSE %] |
258 |
[% ELSE %] |
Lines 504-573
Link Here
|
504 |
[% END %] |
510 |
[% END %] |
505 |
[% Asset.js("js/acq.js") | $raw %] |
511 |
[% Asset.js("js/acq.js") | $raw %] |
506 |
<script> |
512 |
<script> |
507 |
// ################################################################################# |
|
|
508 |
// Javascript |
509 |
// ################################################################################# |
510 |
function CheckDuplicateForm(f){ |
511 |
var ok=1; |
512 |
var _alertString=""; |
513 |
var alertString=""; |
514 |
if(!(isNotNull(f.budget_period_startdate,1))){ |
515 |
_alertString += "\n- " + _("Start date missing"); |
516 |
} |
517 |
if (!(isNotNull(f.budget_period_enddate,1))){ |
518 |
_alertString += "\n- " + _("End date missing"); |
519 |
} |
520 |
if( f.budget_period_startdate > f.budget_period_enddate ) { |
521 |
_alertString += "\n- " + _("Start date must be before end date"); |
522 |
} |
523 |
if (!(isNotNull(f.budget_period_description,1))){ |
524 |
_alertString += "\n- " + _("Budget description missing"); |
525 |
} |
526 |
|
527 |
if(_alertString.length==0){ |
528 |
f.submit(); |
529 |
} else { |
530 |
alertString += _("Form not submitted because of the following problem(s)"); |
531 |
alertString += "\n-----------------------------------------\n"; |
532 |
alertString += _alertString; |
533 |
alert(alertString); |
534 |
} |
535 |
} |
536 |
function Check(f) { |
537 |
var ok=1; |
538 |
var _alertString=""; |
539 |
var alertString2; |
540 |
|
541 |
if (!(isNotNull(f.budget_period_startdate,1))) { |
542 |
_alertString += "\n- " + _("Start date missing"); |
543 |
} |
544 |
|
545 |
if (!(isNotNull(f.budget_period_enddate,1))) { |
546 |
_alertString += "\n- " + _("End date missing"); |
547 |
} |
548 |
|
549 |
if ( f.budget_period_startdate > f.budget_period_enddate ) { |
550 |
_alertString += "\n- " + _("Start date must be before end date"); |
551 |
} |
552 |
|
553 |
if (!(isNotNull(f.budget_period_description,1))) { |
554 |
_alertString += "\n- " + _("Description missing"); |
555 |
} |
556 |
|
557 |
if (!(isNum(f.budget_period_total))) { |
558 |
_alertString += "\n- " + _("Amount must be a valid number, or empty"); |
559 |
} |
560 |
|
561 |
if (_alertString.length==0) { |
562 |
f.submit(); |
563 |
} else { |
564 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
565 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
566 |
alertString2 += _alertString; |
567 |
alert(alertString2); |
568 |
} |
569 |
} |
570 |
|
571 |
$(document).ready(function() { |
513 |
$(document).ready(function() { |
572 |
var tabs = $('#budgetsTabs').tabs(); |
514 |
var tabs = $('#budgetsTabs').tabs(); |
573 |
[% IF ( tab ) %] |
515 |
[% IF ( tab ) %] |
Lines 633-638
Link Here
|
633 |
"sPaginationType": "full_numbers" |
575 |
"sPaginationType": "full_numbers" |
634 |
})); |
576 |
})); |
635 |
[% END %] |
577 |
[% END %] |
|
|
578 |
$("#add_modify_budget").validate({ |
579 |
rules: { |
580 |
budget_period_startdate: "required", |
581 |
budget_period_enddate: { |
582 |
required: true, |
583 |
date_on_or_after: "#from" |
584 |
}, |
585 |
budget_period_description: "required", |
586 |
budget_period_total: { |
587 |
number: true |
588 |
} |
589 |
}, |
590 |
messages: { |
591 |
budget_period_enddate: { |
592 |
date_on_or_after: _("Budget end date must be on or after budget start date") |
593 |
} |
594 |
} |
595 |
}); |
636 |
}); |
596 |
}); |
637 |
</script> |
597 |
</script> |
638 |
[% END %] |
598 |
[% END %] |