Lines 389-395
Link Here
|
389 |
</td> |
389 |
</td> |
390 |
<td> |
390 |
<td> |
391 |
<span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br> |
391 |
<span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br> |
392 |
<a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort_1="[% order.sort1 | html %]" data-sort_2="[% order.sort2 | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a> |
392 |
<a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a> |
393 |
</td> |
393 |
</td> |
394 |
</tr> |
394 |
</tr> |
395 |
[% END # /FOREACH order %] |
395 |
[% END # /FOREACH order %] |
Lines 620-635
Link Here
|
620 |
$("#update_fund").data('order_id',$(this).data('order_id')); |
620 |
$("#update_fund").data('order_id',$(this).data('order_id')); |
621 |
$("#modify_budget_id").html(disabledBudgetsCopy); |
621 |
$("#modify_budget_id").html(disabledBudgetsCopy); |
622 |
$("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive'); |
622 |
$("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive'); |
623 |
$("#sort1").val(sort1); |
623 |
$("#updateFund").find('[name="sort1"]').val(sort1); |
624 |
$("#sort2").val(sort2); |
624 |
$("#updateFund").find('[name="sort2"]').val(sort2); |
625 |
$("#modify_budget_id").find('.b_inactive').remove(); |
625 |
$("#modify_budget_id").find('.b_inactive').remove(); |
626 |
$("#modify_budget_id").change(); |
626 |
$("#modify_budget_id").change(); |
627 |
$("#updateFund").modal('show'); |
627 |
$("#updateFund").modal('show'); |
628 |
}); |
628 |
}); |
629 |
$("#update_fund").on('click',function(){ |
629 |
$("#update_fund").on('click',function(){ |
630 |
var new_fund = $("#modify_budget_id").val(); |
630 |
var new_fund = $("#modify_budget_id").val(); |
631 |
var sort1 = $("#sort1").val(); |
631 |
var sort1 = $("#updateFund").find('[name="sort1"]').val(); |
632 |
var sort2 = $("#sort2").val(); |
632 |
var sort2 = $("#updateFund").find('[name="sort2"]').val(); |
633 |
var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text(); |
633 |
var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text(); |
634 |
var order_id = $(this).data('order_id'); |
634 |
var order_id = $(this).data('order_id'); |
635 |
let options = { |
635 |
let options = { |
Lines 647-652
Link Here
|
647 |
$("#updateFund").modal('hide'); |
647 |
$("#updateFund").modal('hide'); |
648 |
$('#updateFund .showallfunds').prop('checked',false); |
648 |
$('#updateFund .showallfunds').prop('checked',false); |
649 |
$('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund); |
649 |
$('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund); |
|
|
650 |
$('.modify_fund[data-order_id="'+order_id+'"]').data('sort1',sort1); |
651 |
$('.modify_fund[data-order_id="'+order_id+'"]').data('sort2',sort2); |
650 |
$('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name); |
652 |
$('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name); |
651 |
humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } ); |
653 |
humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } ); |
652 |
}) |
654 |
}) |
Lines 657-672
Link Here
|
657 |
$("#modify_budget_id").change(function(){ |
659 |
$("#modify_budget_id").change(function(){ |
658 |
var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]'); |
660 |
var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]'); |
659 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
661 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
660 |
var sort1 = $(destination_sort1).val() || ""; |
|
|
661 |
if ( destination_sort1.length < 1 ) { |
662 |
if ( destination_sort1.length < 1 ) { |
662 |
destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]'); |
663 |
destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]'); |
663 |
} |
664 |
} |
|
|
665 |
var sort1 = $(destination_sort1).val() || ""; |
664 |
var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]'); |
666 |
var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]'); |
665 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
667 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
666 |
var sort2 = $(destination_sort2).val() || ""; |
|
|
667 |
if ( destination_sort2.length < 1 ) { |
668 |
if ( destination_sort2.length < 1 ) { |
668 |
destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]'); |
669 |
destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]'); |
669 |
} |
670 |
} |
|
|
671 |
var sort2 = $(destination_sort2).val() || ""; |
670 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); |
672 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); |
671 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); |
673 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); |
672 |
}); |
674 |
}); |
673 |
- |
|
|