|
Lines 553-559
Link Here
|
| 553 |
$(document).ready(function(){ |
553 |
$(document).ready(function(){ |
| 554 |
// keep a copy for re-rendering |
554 |
// keep a copy for re-rendering |
| 555 |
var $funds_tree = $('#bookfund').html(); |
555 |
var $funds_tree = $('#bookfund').html(); |
| 556 |
var base_query = { "order_id": {"in": [[% multiple_orders | html %]]}}; |
556 |
var base_query = { "me.order_id": {"in": [[% multiple_orders | html %]]}}; |
| 557 |
var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; |
557 |
var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; |
| 558 |
var options = { |
558 |
var options = { |
| 559 |
"ajax": { |
559 |
"ajax": { |
|
Lines 561-570
Link Here
|
| 561 |
}, |
561 |
}, |
| 562 |
"embed": [ |
562 |
"embed": [ |
| 563 |
"basket", |
563 |
"basket", |
| 564 |
"biblio.suggestions.suggester", |
564 |
"biblio", |
| 565 |
"fund.budget", |
565 |
"fund.budget", |
| 566 |
"items+strings", |
566 |
"items+strings", |
| 567 |
"creator" |
567 |
"creator", |
|
|
568 |
"suggestions.suggester", |
| 568 |
], |
569 |
], |
| 569 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
570 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
| 570 |
"columns": [ |
571 |
"columns": [ |
|
Lines 693-705
Link Here
|
| 693 |
params['ordernumber'] = row.order_id; |
694 |
params['ordernumber'] = row.order_id; |
| 694 |
params['booksellerid'] = row.basket.vendor_id; |
695 |
params['booksellerid'] = row.basket.vendor_id; |
| 695 |
|
696 |
|
| 696 |
if(row.biblio.suggestions.length && row.biblio.suggestions[0].reason) { |
697 |
if(row.suggestions && row.suggestions[0].reason) { |
| 697 |
params["suggestionid"] = row.biblio.suggestions[0].suggestion_id; |
698 |
|
| 698 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
699 |
params["suggestionid"] = row.suggestions[0].suggestion_id; |
| 699 |
params['reason'] = row.biblio.suggestions[0].reason; |
700 |
if($("#reason option[value='"+row.suggestions[0].reason+"']").length) { |
|
|
701 |
params['reason'] = row.suggestions[0].reason; |
| 700 |
} else { |
702 |
} else { |
| 701 |
params['reason'] = 'other'; |
703 |
params['reason'] = 'other'; |
| 702 |
params['other_reason'] = row.biblio.suggestions[0].reason; |
704 |
params['other_reason'] = row.suggestions[0].reason; |
| 703 |
} |
705 |
} |
| 704 |
} |
706 |
} |
| 705 |
params['datereceived'] = row.date_received; |
707 |
params['datereceived'] = row.date_received; |
|
Lines 837-850
Link Here
|
| 837 |
$("#other_reason").show(); |
839 |
$("#other_reason").show(); |
| 838 |
$(this).hide(); |
840 |
$(this).hide(); |
| 839 |
} else { |
841 |
} else { |
| 840 |
row.biblio.suggestions[0].reason = val; |
842 |
row.suggestions[0].reason = val; |
| 841 |
} |
843 |
} |
| 842 |
}); |
844 |
}); |
| 843 |
|
845 |
|
| 844 |
$("#order_edit").on("change", "#select-other_reason", function() { |
846 |
$("#order_edit").on("change", "#select-other_reason", function() { |
| 845 |
var val = $(this).val(); |
847 |
var val = $(this).val(); |
| 846 |
var row = $("#order_edit").data('row'); |
848 |
var row = $("#order_edit").data('row'); |
| 847 |
row.biblio.suggestions[0].reason = val; |
849 |
row.suggestions[0].reason = val; |
| 848 |
}); |
850 |
}); |
| 849 |
|
851 |
|
| 850 |
$("#order_edit").on("click", "#other_reason a", function() { |
852 |
$("#order_edit").on("click", "#other_reason a", function() { |
|
Lines 1132-1161
Link Here
|
| 1132 |
o.parent().hide(); |
1134 |
o.parent().hide(); |
| 1133 |
} |
1135 |
} |
| 1134 |
}); |
1136 |
}); |
| 1135 |
if(row.biblio.suggestions.length) { |
1137 |
if(row.suggestions) { |
| 1136 |
$("#suggestion_fieldset").show(); |
1138 |
$("#suggestion_fieldset").show(); |
| 1137 |
if(row.biblio.suggestions[0].suggester) { |
1139 |
if(row.suggestions[0].suggester) { |
| 1138 |
$("#biblio_suggestion_suggester").parent().show(); |
1140 |
$("#biblio_suggestion_suggester").parent().show(); |
| 1139 |
$("#biblio_suggestion_suggester") |
1141 |
$("#biblio_suggestion_suggester") |
| 1140 |
.html( |
1142 |
.html( |
| 1141 |
[row.biblio.suggestions[0].suggester.surname, row.biblio.suggestions[0].suggester.firstname] |
1143 |
[row.suggestions[0].suggester.surname, row.suggestions[0].suggester.firstname] |
| 1142 |
.filter(function(name){ |
1144 |
.filter(function(name){ |
| 1143 |
return name |
1145 |
return name |
| 1144 |
}) |
1146 |
}) |
| 1145 |
.join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestion_id+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestion_id)+'</a>)' |
1147 |
.join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.suggestions[0].suggestion_id+'&op=show">'+SUGGESTION.format(row.suggestions[0].suggestion_id)+'</a>)' |
| 1146 |
); |
1148 |
); |
| 1147 |
} else { |
1149 |
} else { |
| 1148 |
$("#biblio_suggestion_suggester").parent().hide(); |
1150 |
$("#biblio_suggestion_suggester").parent().hide(); |
| 1149 |
} |
1151 |
} |
| 1150 |
if(row.biblio.suggestions[0].reason) { |
1152 |
if(row.suggestions[0].reason) { |
| 1151 |
$("#suggestion_reason").show(); |
1153 |
$("#suggestion_reason").show(); |
| 1152 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
1154 |
if($("#reason option[value='"+row.suggestions[0].reason+"']").length) { |
| 1153 |
$("#other_reason a").click(); |
1155 |
$("#other_reason a").click(); |
| 1154 |
$("#reason").val(row.biblio.suggestions[0].reason); |
1156 |
$("#reason").val(row.suggestions[0].reason); |
| 1155 |
$("#select-other_reason").val(null); |
1157 |
$("#select-other_reason").val(null); |
| 1156 |
} else { |
1158 |
} else { |
| 1157 |
$("#reason").val("other").change(); |
1159 |
$("#reason").val("other").change(); |
| 1158 |
$("#select-other_reason").val(row.biblio.suggestions[0].reason); |
1160 |
$("#select-other_reason").val(row.suggestions[0].reason); |
| 1159 |
} |
1161 |
} |
| 1160 |
|
1162 |
|
| 1161 |
} else { |
1163 |
} else { |