Lines 288-320
Link Here
|
288 |
<label class="required" for="bookfund">Fund: </label> |
288 |
<label class="required" for="bookfund">Fund: </label> |
289 |
[% active_count = 0 %] |
289 |
[% active_count = 0 %] |
290 |
[% IF !ordernumber %] |
290 |
[% IF !ordernumber %] |
291 |
[% FOREACH budget_loo IN budget_loop %] |
291 |
[% FOREACH budget_period IN budget_loops.keys %] |
292 |
[% active_count= active_count + budget_loo.b_active %] |
292 |
[% FOREACH fund IN budget_loops.$budget_period.funds %] |
|
|
293 |
[% active_count= active_count + fund.b_active %] |
294 |
[% END %] |
293 |
[% END %] |
295 |
[% END %] |
294 |
[% END %] |
296 |
[% END %] |
295 |
<select class="select2" id="bookfund" name="bookfund"> |
297 |
<select class="select2" id="bookfund" name="bookfund"> |
296 |
[% FOREACH budget_loo IN budget_loop %] |
298 |
[% FOREACH budget_period_id IN budget_loops.keys %] |
297 |
[% level_indent_cnt = 0 %] |
299 |
[% SET budget_period = budget_loops.$budget_period_id %] |
298 |
[% level_indent = "" %] |
300 |
[% IF budget_period.active %] |
299 |
[% WHILE level_indent_cnt < budget_loo.b_level %] |
301 |
<optgroup label="[% budget_period.description %]"> |
300 |
[% level_indent = level_indent _ " -- " %] |
302 |
[% ELSE %] |
301 |
[% level_indent_cnt = level_indent_cnt +1 %] |
303 |
<optgroup class="inactive_budget" label="[% budget_period.description %] (Inactive)"> |
302 |
[% END %] |
304 |
[% END %] |
|
|
305 |
[% FOREACH budget_loo IN budget_period.funds %] |
306 |
[% level_indent_cnt = 0 %] |
307 |
[% level_indent = "" %] |
308 |
[% WHILE level_indent_cnt < budget_loo.b_level %] |
309 |
[% level_indent = level_indent _ " -- " %] |
310 |
[% level_indent_cnt = level_indent_cnt +1 %] |
311 |
[% END %] |
303 |
|
312 |
|
304 |
[% IF ( budget_loo.b_sel ) %] |
313 |
[% IF ( budget_loo.b_sel ) %] |
305 |
[% active_count = 0 #select no other fund %] |
314 |
[% active_count = 0 #select no other fund %] |
306 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" |
315 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
307 |
> |
316 |
[% ELSIF active_count==1 && budget_loo.b_active %] |
308 |
[% ELSIF active_count==1 && budget_loo.b_active %] |
317 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
309 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" |
318 |
[% ELSE %] |
310 |
> |
319 |
[% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %] |
311 |
[% ELSE %] |
320 |
<option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
312 |
[% bdgclass=budget_loo.b_active? "": "b_inactive" | html %] |
321 |
[% END %] |
313 |
<option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" |
322 |
[% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] |
314 |
> |
323 |
</option> |
315 |
[% END %] |
324 |
[% END %] |
316 |
[% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] |
325 |
</optgroup> |
317 |
</option> |
|
|
318 |
[% END %] |
326 |
[% END %] |
319 |
</select> |
327 |
</select> |
320 |
<span class="required">Required</span> |
328 |
<span class="required">Required</span> |
Lines 552-565
Link Here
|
552 |
|
560 |
|
553 |
//keep a copy of all budgets before removing the inactives |
561 |
//keep a copy of all budgets before removing the inactives |
554 |
disabledBudgetsCopy = $('#bookfund').html(); |
562 |
disabledBudgetsCopy = $('#bookfund').html(); |
555 |
$('#bookfund .b_inactive').remove(); |
563 |
$('#bookfund .inactive_budget').remove(); |
556 |
|
564 |
|
557 |
$('#showallbudgets').click(function() { |
565 |
$('#showallbudgets').click(function() { |
558 |
if ($(this).is(":checked")) { |
566 |
if ($(this).is(":checked")) { |
559 |
$('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds |
567 |
$('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds |
560 |
} |
568 |
} |
561 |
else { |
569 |
else { |
562 |
$('#bookfund .b_inactive').remove(); |
570 |
$('#bookfund .inactive_budget').remove(); |
563 |
} |
571 |
} |
564 |
}); |
572 |
}); |
565 |
|
573 |
|
566 |
- |
|
|