Lines 428-433
Link Here
|
428 |
[% INCLUDE 'datatables.inc' %] |
428 |
[% INCLUDE 'datatables.inc' %] |
429 |
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] |
429 |
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] |
430 |
[% Asset.js("js/acq.js") | $raw %] |
430 |
[% Asset.js("js/acq.js") | $raw %] |
|
|
431 |
[% Asset.js("js/funds_sorts.js") | $raw %] |
431 |
<script type="text/JavaScript"> |
432 |
<script type="text/JavaScript"> |
432 |
$(document).ready(function() { |
433 |
$(document).ready(function() { |
433 |
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, { |
434 |
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, { |
Lines 440-509
Link Here
|
440 |
"aaSorting": [] |
441 |
"aaSorting": [] |
441 |
} ) ); |
442 |
} ) ); |
442 |
|
443 |
|
443 |
// keep copy of the inactive budgets |
|
|
444 |
disabledBudgetsCopy = $("select[name='all_budget_id']").html(); |
445 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
446 |
$("select[name='budget_id'] .b_inactive").remove(); |
447 |
|
448 |
$("#showallbudgets").click(function() { |
449 |
if ($(this).is(":checked")) { |
450 |
$("select[name='budget_id']").html(disabledBudgetsCopy) |
451 |
} |
452 |
else { |
453 |
$("select[name='budget_id'] .b_inactive").remove(); |
454 |
} |
455 |
}); |
456 |
|
457 |
$("#all_showallbudgets").click(function() { |
458 |
if ($(this).is(":checked")) { |
459 |
$("select[name='all_budget_id']").html(disabledBudgetsCopy); |
460 |
} |
461 |
else { |
462 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
463 |
} |
464 |
}); |
465 |
|
466 |
$("select[name='budget_id']").change(function(){ |
467 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
468 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
469 |
var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); |
470 |
var sort1 = $(destination_sort1).val() || ""; |
471 |
if ( destination_sort1.length < 1 ) { |
472 |
destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); |
473 |
} |
474 |
var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); |
475 |
var sort2 = $(destination_sort2).val() || ""; |
476 |
if ( destination_sort2.length < 1 ) { |
477 |
destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); |
478 |
} |
479 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); |
480 |
|
481 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); |
482 |
} ); |
483 |
|
484 |
$("select[name='budget_id']").change(); |
485 |
|
486 |
$("select[name='all_budget_id']").change(function(){ |
487 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
488 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
489 |
var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]'); |
490 |
if ( destination_sort1.length < 1 ) { |
491 |
destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]'); |
492 |
} |
493 |
var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]'); |
494 |
if ( destination_sort2.length < 1 ) { |
495 |
destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]'); |
496 |
} |
497 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 ); |
498 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 ); |
499 |
$(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1'); |
500 |
$(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1'); |
501 |
$(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2'); |
502 |
$(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); |
503 |
} ); |
504 |
|
505 |
$("select[name='all_budget_id']").change(); |
506 |
|
507 |
$("#records_to_import fieldset.rows div").hide(); |
444 |
$("#records_to_import fieldset.rows div").hide(); |
508 |
$('input:checkbox[name="import_record_id"]').change(function(){ |
445 |
$('input:checkbox[name="import_record_id"]').change(function(){ |
509 |
var container = $(this).parents("fieldset"); |
446 |
var container = $(this).parents("fieldset"); |