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