Lines 544-553
Link Here
|
544 |
}, |
544 |
}, |
545 |
"embed": [ |
545 |
"embed": [ |
546 |
"basket", |
546 |
"basket", |
547 |
"biblio.suggestions.suggester", |
547 |
"biblio", |
548 |
"fund.budget", |
548 |
"fund.budget", |
549 |
"items+strings", |
549 |
"items+strings", |
550 |
"creator" |
550 |
"creator", |
|
|
551 |
"suggestion.suggester", |
551 |
], |
552 |
], |
552 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
553 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
553 |
"columns": [ |
554 |
"columns": [ |
Lines 676-688
Link Here
|
676 |
params['ordernumber'] = row.order_id; |
677 |
params['ordernumber'] = row.order_id; |
677 |
params['booksellerid'] = row.basket.vendor_id; |
678 |
params['booksellerid'] = row.basket.vendor_id; |
678 |
|
679 |
|
679 |
if(row.biblio.suggestions.length && row.biblio.suggestions[0].reason) { |
680 |
if(row.suggestion && row.suggestion.reason) { |
680 |
params["suggestionid"] = row.biblio.suggestions[0].suggestion_id; |
681 |
params["suggestionid"] = row.suggestion.suggestion_id; |
681 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
682 |
if($("#reason option[value='"+row.suggestion.reason+"']").length) { |
682 |
params['reason'] = row.biblio.suggestions[0].reason; |
683 |
params['reason'] = row.suggestion.reason; |
683 |
} else { |
684 |
} else { |
684 |
params['reason'] = 'other'; |
685 |
params['reason'] = 'other'; |
685 |
params['other_reason'] = row.biblio.suggestions[0].reason; |
686 |
params['other_reason'] = row.suggestion.reason; |
686 |
} |
687 |
} |
687 |
} |
688 |
} |
688 |
params['datereceived'] = row.date_received; |
689 |
params['datereceived'] = row.date_received; |
Lines 820-833
Link Here
|
820 |
$("#other_reason").show(); |
821 |
$("#other_reason").show(); |
821 |
$(this).hide(); |
822 |
$(this).hide(); |
822 |
} else { |
823 |
} else { |
823 |
row.biblio.suggestions[0].reason = val; |
824 |
row.suggestion.reason = val; |
824 |
} |
825 |
} |
825 |
}); |
826 |
}); |
826 |
|
827 |
|
827 |
$("#order_edit").on("change", "#select-other_reason", function() { |
828 |
$("#order_edit").on("change", "#select-other_reason", function() { |
828 |
var val = $(this).val(); |
829 |
var val = $(this).val(); |
829 |
var row = $("#order_edit").data('row'); |
830 |
var row = $("#order_edit").data('row'); |
830 |
row.biblio.suggestions[0].reason = val; |
831 |
row.suggestion.reason = val; |
831 |
}); |
832 |
}); |
832 |
|
833 |
|
833 |
$("#order_edit").on("click", "#other_reason a", function() { |
834 |
$("#order_edit").on("click", "#other_reason a", function() { |
Lines 1105-1134
Link Here
|
1105 |
o.parent().hide(); |
1106 |
o.parent().hide(); |
1106 |
} |
1107 |
} |
1107 |
}); |
1108 |
}); |
1108 |
if(row.biblio.suggestions.length) { |
1109 |
if(row.suggestion) { |
1109 |
$("#suggestion_fieldset").show(); |
1110 |
$("#suggestion_fieldset").show(); |
1110 |
if(row.biblio.suggestions[0].suggester) { |
1111 |
if(row.suggestion.suggester) { |
1111 |
$("#biblio_suggestion_suggester").parent().show(); |
1112 |
$("#biblio_suggestion_suggester").parent().show(); |
1112 |
$("#biblio_suggestion_suggester") |
1113 |
$("#biblio_suggestion_suggester") |
1113 |
.html( |
1114 |
.html( |
1114 |
[row.biblio.suggestions[0].suggester.surname, row.biblio.suggestions[0].suggester.firstname] |
1115 |
[row.suggestion.suggester.surname, row.suggestion.suggester.firstname] |
1115 |
.filter(function(name){ |
1116 |
.filter(function(name){ |
1116 |
return name |
1117 |
return name |
1117 |
}) |
1118 |
}) |
1118 |
.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>)' |
1119 |
.join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.suggestion.suggestion_id+'&op=show">'+SUGGESTION.format(row.suggestion.suggestion_id)+'</a>)' |
1119 |
); |
1120 |
); |
1120 |
} else { |
1121 |
} else { |
1121 |
$("#biblio_suggestion_suggester").parent().hide(); |
1122 |
$("#biblio_suggestion_suggester").parent().hide(); |
1122 |
} |
1123 |
} |
1123 |
if(row.biblio.suggestions[0].reason) { |
1124 |
if(row.suggestion.reason) { |
1124 |
$("#suggestion_reason").show(); |
1125 |
$("#suggestion_reason").show(); |
1125 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
1126 |
if($("#reason option[value='"+row.suggestion.reason+"']").length) { |
1126 |
$("#other_reason a").click(); |
1127 |
$("#other_reason a").click(); |
1127 |
$("#reason").val(row.biblio.suggestions[0].reason); |
1128 |
$("#reason").val(row.suggestion.reason); |
1128 |
$("#select-other_reason").val(null); |
1129 |
$("#select-other_reason").val(null); |
1129 |
} else { |
1130 |
} else { |
1130 |
$("#reason").val("other").change(); |
1131 |
$("#reason").val("other").change(); |
1131 |
$("#select-other_reason").val(row.biblio.suggestions[0].reason); |
1132 |
$("#select-other_reason").val(row.suggestion.reason); |
1132 |
} |
1133 |
} |
1133 |
|
1134 |
|
1134 |
} else { |
1135 |
} else { |