|
Lines 355-360
Link Here
|
| 355 |
margin-bottom: 20px; |
355 |
margin-bottom: 20px; |
| 356 |
} |
356 |
} |
| 357 |
</style> |
357 |
</style> |
|
|
358 |
<script> |
| 359 |
addPrefs({ |
| 360 |
marcflavour: "[% Koha.Preference('marcflavour') | html %]", |
| 361 |
}); |
| 362 |
|
| 363 |
let summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note"; |
| 364 |
if (prefs.marcflavour == 'UNIMARC'){ |
| 365 |
summary_fields += ":biblio.ean"; |
| 366 |
} |
| 367 |
const vendor_id = [% booksellerid | html %]; |
| 368 |
const invoice_id = [% invoiceid | html %]; |
| 369 |
|
| 370 |
let table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'parcel', 'pending_orders', 'json' ) | $raw %]; |
| 371 |
const interface = "[% interface | html %]"; |
| 372 |
const theme = "[% theme | html %]"; |
| 373 |
const i18n = { |
| 374 |
order: "[%tp("noun", "Order") | html %]", |
| 375 |
}; |
| 376 |
</script> |
| 377 |
|
| 358 |
<script> |
378 |
<script> |
| 359 |
dt_overwrite_html_sorting_localeCompare(); |
379 |
dt_overwrite_html_sorting_localeCompare(); |
| 360 |
var PENDING_MULTI_SELECTION = _("Receive selected (%s)"); |
380 |
var PENDING_MULTI_SELECTION = _("Receive selected (%s)"); |
|
Lines 443-451
Link Here
|
| 443 |
} |
463 |
} |
| 444 |
}, |
464 |
}, |
| 445 |
{ |
465 |
{ |
| 446 |
[% SET summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note" %] |
466 |
data: summary_fields, |
| 447 |
[% IF Koha.Preference('marcflavour')=='UNIMARC' %][% SET summary_fields = summary_fields _ ":biblio.ean" %][% END %] |
|
|
| 448 |
data: "[% summary_fields | html %]", |
| 449 |
render: function(data, type, row, meta) { |
467 |
render: function(data, type, row, meta) { |
| 450 |
var result = ''; |
468 |
var result = ''; |
| 451 |
if ( row && row.biblio_id != null ) { |
469 |
if ( row && row.biblio_id != null ) { |
|
Lines 454-463
Link Here
|
| 454 |
result += _(" by ") + escape_str(row.biblio.author); |
472 |
result += _(" by ") + escape_str(row.biblio.author); |
| 455 |
if ( row.biblio.isbn != null ) |
473 |
if ( row.biblio.isbn != null ) |
| 456 |
result += " – " + escape_str(row.biblio.isbn); |
474 |
result += " – " + escape_str(row.biblio.isbn); |
| 457 |
[% IF Koha.Preference('marcflavour')=='UNIMARC' %] |
475 |
if (prefs.marcflavour == 'UNIMARC' && row.biblio.ean != null ) { |
| 458 |
if ( row.biblio.ean != null ) |
|
|
| 459 |
result += " – EAN:" + escape_str(row.biblio.ean); |
476 |
result += " – EAN:" + escape_str(row.biblio.ean); |
| 460 |
[% END %] |
477 |
} |
| 461 |
if ( row.biblio.publisher != null ) { |
478 |
if ( row.biblio.publisher != null ) { |
| 462 |
result += "<br/>" + _("Publisher: ") + escape_str(row.biblio.publisher); |
479 |
result += "<br/>" + _("Publisher: ") + escape_str(row.biblio.publisher); |
| 463 |
if ( row.biblio.publication_year != null ) { |
480 |
if ( row.biblio.publication_year != null ) { |
|
Lines 497-508
Link Here
|
| 497 |
+ _("Internal note: ") |
514 |
+ _("Internal note: ") |
| 498 |
+ '</strong>' + escape_str(internal_note) |
515 |
+ '</strong>' + escape_str(internal_note) |
| 499 |
+ ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
516 |
+ ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
| 500 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
517 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id' |
| 501 |
+ '&type=internal">' + _("Change internal note") + '</a>]</p>'; |
518 |
+ '&type=internal">' + _("Change internal note") + '</a>]</p>'; |
| 502 |
} |
519 |
} |
| 503 |
else { |
520 |
else { |
| 504 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
521 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
| 505 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
522 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id |
| 506 |
+ '&type=internal">' + _("Add internal note") + '</a>]'; |
523 |
+ '&type=internal">' + _("Add internal note") + '</a>]'; |
| 507 |
} |
524 |
} |
| 508 |
|
525 |
|
|
Lines 514-520
Link Here
|
| 514 |
} |
531 |
} |
| 515 |
else { |
532 |
else { |
| 516 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
533 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
| 517 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
534 |
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id |
| 518 |
+ '&type=vendor">' + _("Add vendor note") + '</a>]'; |
535 |
+ '&type=vendor">' + _("Add vendor note") + '</a>]'; |
| 519 |
} |
536 |
} |
| 520 |
|
537 |
|
|
Lines 531-537
Link Here
|
| 531 |
result += '<button type="button" class="btn btn-default btn-xs dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false"><span class="visually-hidden">Toggle dropdown</span></button>'; |
548 |
result += '<button type="button" class="btn btn-default btn-xs dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false"><span class="visually-hidden">Toggle dropdown</span></button>'; |
| 532 |
|
549 |
|
| 533 |
result += '<ul class="dropdown-menu" aria-labelledby="view' + row.order_id + '">'; |
550 |
result += '<ul class="dropdown-menu" aria-labelledby="view' + row.order_id + '">'; |
| 534 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '">[% tp("noun", "Order") | html %]</a></li>'; |
551 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '">' + i18n.order + '</a></li>'; |
| 535 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + encodeURIComponent(row.biblio_id) + '">' + _("MARC") + '</a></li>'; |
552 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + encodeURIComponent(row.biblio_id) + '">' + _("MARC") + '</a></li>'; |
| 536 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + encodeURIComponent(row.biblio_id) + '">' + _("Card") + '</a></li>'; |
553 |
result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + encodeURIComponent(row.biblio_id) + '">' + _("Card") + '</a></li>'; |
| 537 |
result += '</ul>'; |
554 |
result += '</ul>'; |
|
Lines 576-582
Link Here
|
| 576 |
data: "", |
593 |
data: "", |
| 577 |
render: function(data, type, row, meta) { |
594 |
render: function(data, type, row, meta) { |
| 578 |
return '<a href="orderreceive.pl?multiple_orders=' |
595 |
return '<a href="orderreceive.pl?multiple_orders=' |
| 579 |
+ encodeURIComponent(row.order_id) + '&invoiceid=[% invoiceid | uri %]' + '">' |
596 |
+ encodeURIComponent(row.order_id) + '&invoiceid=' + invoice_id + '">' |
| 580 |
+ _("Receive") + '</a><br/>' |
597 |
+ _("Receive") + '</a><br/>' |
| 581 |
+ '<a href="#" onclick="transfer_order_popup(' + escape_str(row.order_id) + '); return false;">' |
598 |
+ '<a href="#" onclick="transfer_order_popup(' + escape_str(row.order_id) + '); return false;">' |
| 582 |
+ _("Transfer") + '</a>'; |
599 |
+ _("Transfer") + '</a>'; |
|
Lines 598-604
Link Here
|
| 598 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
615 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
| 599 |
+ encodeURIComponent(row.order_id) |
616 |
+ encodeURIComponent(row.order_id) |
| 600 |
+ '&biblionumber=' + encodeURIComponent(row.biblio_id) |
617 |
+ '&biblionumber=' + encodeURIComponent(row.biblio_id) |
| 601 |
+ '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">' |
618 |
+ '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=' + invoice_id |
| 602 |
+ _("Cancel order") + '</a><br/>'; |
619 |
+ _("Cancel order") + '</a><br/>'; |
| 603 |
} |
620 |
} |
| 604 |
|
621 |
|
|
Lines 654-660
Link Here
|
| 654 |
$('#select_multiple').click(function () { |
671 |
$('#select_multiple').click(function () { |
| 655 |
var ids = Object.keys(selected_rows); |
672 |
var ids = Object.keys(selected_rows); |
| 656 |
if (!ids.length) return; |
673 |
if (!ids.length) return; |
| 657 |
location.href = 'orderreceive.pl?multiple_orders=' + ids.join(',') + '&invoiceid=[% invoiceid | uri %]'; |
674 |
location.href = 'orderreceive.pl?multiple_orders=' + ids.join(',') + '&invoiceid=' + invoiceid |
| 658 |
}).html(PENDING_MULTI_SELECTION.format('0')) |
675 |
}).html(PENDING_MULTI_SELECTION.format('0')) |
| 659 |
options.order = [[1, 'asc']]; |
676 |
options.order = [[1, 'asc']]; |
| 660 |
options.columns.unshift({ |
677 |
options.columns.unshift({ |
|
Lines 665-673
Link Here
|
| 665 |
orderable: false |
682 |
orderable: false |
| 666 |
}); |
683 |
}); |
| 667 |
|
684 |
|
| 668 |
let table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'parcel', 'pending_orders', 'json' ) | $raw %]; |
685 |
var pending_orders_table = $("#pending_orders").kohaTable(options, table_settings, 1, { "basket.vendor_id": vendor_id }); |
| 669 |
|
|
|
| 670 |
var pending_orders_table = $("#pending_orders").kohaTable(options, table_settings, 1, { "basket.vendor_id": [% booksellerid | html %] }); |
| 671 |
|
686 |
|
| 672 |
var api = pending_orders_table.api(); |
687 |
var api = pending_orders_table.api(); |
| 673 |
api.on('draw', function () { |
688 |
api.on('draw', function () { |
|
Lines 690-696
Link Here
|
| 690 |
|
705 |
|
| 691 |
$("#dataPreview").on("hidden.bs.modal", function(){ |
706 |
$("#dataPreview").on("hidden.bs.modal", function(){ |
| 692 |
$("#dataPreviewLabel").html(""); |
707 |
$("#dataPreviewLabel").html(""); |
| 693 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
708 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
| 694 |
}); |
709 |
}); |
| 695 |
|
710 |
|
| 696 |
$("body").on("click", ".previewData", function(e){ |
711 |
$("body").on("click", ".previewData", function(e){ |
| 697 |
- |
|
|