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 |
"suggestion.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.suggestion && row.suggestion.reason) { |
697 |
params["suggestionid"] = row.biblio.suggestions[0].suggestion_id; |
698 |
params["suggestionid"] = row.suggestion.suggestion_id; |
698 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
699 |
if($("#reason option[value='"+row.suggestion.reason+"']").length) { |
699 |
params['reason'] = row.biblio.suggestions[0].reason; |
700 |
params['reason'] = row.suggestion.reason; |
700 |
} else { |
701 |
} else { |
701 |
params['reason'] = 'other'; |
702 |
params['reason'] = 'other'; |
702 |
params['other_reason'] = row.biblio.suggestions[0].reason; |
703 |
params['other_reason'] = row.suggestion.reason; |
703 |
} |
704 |
} |
704 |
} |
705 |
} |
705 |
params['datereceived'] = row.date_received; |
706 |
params['datereceived'] = row.date_received; |
Lines 837-850
Link Here
|
837 |
$("#other_reason").show(); |
838 |
$("#other_reason").show(); |
838 |
$(this).hide(); |
839 |
$(this).hide(); |
839 |
} else { |
840 |
} else { |
840 |
row.biblio.suggestions[0].reason = val; |
841 |
row.suggestion.reason = val; |
841 |
} |
842 |
} |
842 |
}); |
843 |
}); |
843 |
|
844 |
|
844 |
$("#order_edit").on("change", "#select-other_reason", function() { |
845 |
$("#order_edit").on("change", "#select-other_reason", function() { |
845 |
var val = $(this).val(); |
846 |
var val = $(this).val(); |
846 |
var row = $("#order_edit").data('row'); |
847 |
var row = $("#order_edit").data('row'); |
847 |
row.biblio.suggestions[0].reason = val; |
848 |
row.suggestion.reason = val; |
848 |
}); |
849 |
}); |
849 |
|
850 |
|
850 |
$("#order_edit").on("click", "#other_reason a", function() { |
851 |
$("#order_edit").on("click", "#other_reason a", function() { |
Lines 1132-1161
Link Here
|
1132 |
o.parent().hide(); |
1133 |
o.parent().hide(); |
1133 |
} |
1134 |
} |
1134 |
}); |
1135 |
}); |
1135 |
if(row.biblio.suggestions.length) { |
1136 |
if(row.suggestion) { |
1136 |
$("#suggestion_fieldset").show(); |
1137 |
$("#suggestion_fieldset").show(); |
1137 |
if(row.biblio.suggestions[0].suggester) { |
1138 |
if(row.suggestion.suggester) { |
1138 |
$("#biblio_suggestion_suggester").parent().show(); |
1139 |
$("#biblio_suggestion_suggester").parent().show(); |
1139 |
$("#biblio_suggestion_suggester") |
1140 |
$("#biblio_suggestion_suggester") |
1140 |
.html( |
1141 |
.html( |
1141 |
[row.biblio.suggestions[0].suggester.surname, row.biblio.suggestions[0].suggester.firstname] |
1142 |
[row.suggestion.suggester.surname, row.suggestion.suggester.firstname] |
1142 |
.filter(function(name){ |
1143 |
.filter(function(name){ |
1143 |
return name |
1144 |
return name |
1144 |
}) |
1145 |
}) |
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>)' |
1146 |
.join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.suggestion.suggestion_id+'&op=show">'+SUGGESTION.format(row.suggestion.suggestion_id)+'</a>)' |
1146 |
); |
1147 |
); |
1147 |
} else { |
1148 |
} else { |
1148 |
$("#biblio_suggestion_suggester").parent().hide(); |
1149 |
$("#biblio_suggestion_suggester").parent().hide(); |
1149 |
} |
1150 |
} |
1150 |
if(row.biblio.suggestions[0].reason) { |
1151 |
if(row.suggestion.reason) { |
1151 |
$("#suggestion_reason").show(); |
1152 |
$("#suggestion_reason").show(); |
1152 |
if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) { |
1153 |
if($("#reason option[value='"+row.suggestion.reason+"']").length) { |
1153 |
$("#other_reason a").click(); |
1154 |
$("#other_reason a").click(); |
1154 |
$("#reason").val(row.biblio.suggestions[0].reason); |
1155 |
$("#reason").val(row.suggestion.reason); |
1155 |
$("#select-other_reason").val(null); |
1156 |
$("#select-other_reason").val(null); |
1156 |
} else { |
1157 |
} else { |
1157 |
$("#reason").val("other").change(); |
1158 |
$("#reason").val("other").change(); |
1158 |
$("#select-other_reason").val(row.biblio.suggestions[0].reason); |
1159 |
$("#select-other_reason").val(row.suggestion.reason); |
1159 |
} |
1160 |
} |
1160 |
|
1161 |
|
1161 |
} else { |
1162 |
} else { |