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