Bugzilla – Attachment 184386 Details for
Bug 40333
When EDIFACT is enabled, one should be able view the corresponding EDIFACT INVOICE message on the Koha Invoice page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40333: Tidy commit
Bug-40333-Tidy-commit.patch (text/plain), 14.07 KB, created by
Martin Renvoize (ashimema)
on 2025-07-18 14:23:21 UTC
(
hide
)
Description:
Bug 40333: Tidy commit
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-07-18 14:23:21 UTC
Size:
14.07 KB
patch
obsolete
>From c1345111a1e14188cd8732b29acd2749675013d7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 10 Jul 2025 14:24:15 +0100 >Subject: [PATCH] Bug 40333: Tidy commit > >The commit hook was deliverately disabled for the previous commit and >this commit added distinctly to ensure clarity between the functional >code change and the massive tidy that the hook created. > >In that last commit we remove the last remaining TT variable from the ><script> block in that template and as such we unlock the JS tidying on >that block.. nice, except it hides the functional change in the mass >commit of whitespace, quoting and newline changes. > >Sponsored-by: Open Fifth <https://openfith.co.uk> >Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> >--- > .../prog/en/modules/acqui/edifactmsgs.tt | 220 +++++++++--------- > 1 file changed, 111 insertions(+), 109 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt >index 3e8bc28d4a5..eb2ae3a82f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt >@@ -45,124 +45,126 @@ > [% INCLUDE 'datatables.inc' %] > [% Asset.js("js/modals/edifact-modal.js") | $raw %] > <script> >- $(document).ready(function() { >- let edi_msgs_table_url = '/api/v1/acquisitions/edifiles?'; >+ $(document).ready(function () { >+ let edi_msgs_table_url = "/api/v1/acquisitions/edifiles?"; > >- var edi_msgs_table = $("#edi_msgs").kohaTable({ >- "ajax": { >- "url": edi_msgs_table_url >- }, >- "embed": [ >- "vendor", >- "basket", >- "errors" >- ], >- "order": [[ 1, "desc" ]], >- "columns": [ >- { >- "data": "type", >- "title": _("Type"), >- "searchable": true, >- "orderable": true >- }, >- { >- "data": "transfer_date", >- "title": _("Transferred"), >- "searchable": true, >- "orderable": true, >- "render": function(data, type, row, meta) { >- return $date(row.transfer_date); >- } >+ var edi_msgs_table = $("#edi_msgs").kohaTable( >+ { >+ ajax: { >+ url: edi_msgs_table_url, > }, >- { >- "data": "status", >- "title": _("Status"), >- "searchable": true, >- "orderable": true, >- "render": function(daya, type, row, meta) { >- let rendered = ''; >- if ( row.errors.length > 0 ) { >- let errorsList = '<ul>'; >- row.errors.forEach(error => { >- if (error.details) { >- errorsList += '<li>' >- errorsList += error.details >- if (error.section) { >- errorsList += '</br><pre>' + error.section + '</pre>'; >+ embed: ["vendor", "basket", "errors"], >+ order: [[1, "desc"]], >+ columns: [ >+ { >+ data: "type", >+ title: _("Type"), >+ searchable: true, >+ orderable: true, >+ }, >+ { >+ data: "transfer_date", >+ title: _("Transferred"), >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return $date(row.transfer_date); >+ }, >+ }, >+ { >+ data: "status", >+ title: _("Status"), >+ searchable: true, >+ orderable: true, >+ render: function (daya, type, row, meta) { >+ let rendered = ""; >+ if (row.errors.length > 0) { >+ let errorsList = "<ul>"; >+ row.errors.forEach(error => { >+ if (error.details) { >+ errorsList += "<li>"; >+ errorsList += "<strong>" + error.details + "</strong>"; >+ if (error.section) { >+ errorsList += "<br/><pre>" + error.section + "</pre>"; >+ } >+ errorsList += "</li>"; > } >- errorsList += '</li>'; >+ }); >+ errorsList += "</ul>"; >+ rendered = row.status + ' (<a href="#" data-bs-toggle="modal" data-bs-target="#EDI_errors_modal" data-bs-errors="' + errorsList + '" data-bs-filename="' + row.filename + '">' + _("with errors") + "</a>)"; >+ } else { >+ rendered = row.status; >+ } >+ return rendered; >+ }, >+ }, >+ { >+ data: "vendor.name", >+ title: _("Vendor"), >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ let link; >+ if (row.vendor) { >+ link = '<a href="/cgi-bin/koha/acquisition/vendors/' + row.vendor_id + '">' + row.vendor.name + "</a>"; >+ } else { >+ link = '<a href="/cgi-bin/koha/acquisition/vendors/' + row.vendor_id + '">' + row.vendor_id + "</a>"; >+ } >+ return link; >+ }, >+ }, >+ { >+ data: "basket_id:type", >+ title: _("Details"), >+ searchable: false, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ let rendered = ""; >+ if (row.type == "QUOTE" || row.type == "ORDERS") { >+ if (row.basket_id) { >+ rendered = '<a href="/cgi-bin/koha/acqui/basket.pl?basketno=' + row.basket_id + '">' + _("Basket") + ": " + row.basket_id + "</a>"; > } >- }); >- errorsList += '</ul>'; >- rendered = row.status + ' (<a href="#" data-bs-toggle="modal" data-bs-target="#EDI_errors_modal" data-bs-errors="'+ errorsList + '" data-bs-filename="' + row.filename + '">' + _("with errors") + '</a>)'; >- } else { >- rendered = row.status; >- } >- return rendered; >- } >- }, >- { >- "data": "vendor.name", >- "title": _("Vendor"), >- "searchable": true, >- "orderable": true, >- "render": function(data, type, row, meta) { >- let link; >- if ( row.vendor ) { >- link = '<a href="/cgi-bin/koha/acquisition/vendors/'+row.vendor_id+'">'+row.vendor.name+'</a>'; >- } else { >- link = '<a href="/cgi-bin/koha/acquisition/vendors/'+row.vendor_id+'">'+row.vendor_id+'</a>'; >- } >- return link; >- } >- }, >- { >- "data": "basket_id:type", >- "title": _("Details"), >- "searchable": false, >- "orderable": true, >- "render": function(data, type, row, meta) { >- let rendered = ''; >- if ( row.type == 'QUOTE' || row.type == 'ORDERS' ) { >- if ( row.basket_id ) { >- rendered = '<a href="/cgi-bin/koha/acqui/basket.pl?basketno='+row.basket_id+'">'+_("Basket")+': '+row.basket_id+'</a>'; >+ } else { >+ rendered = '<a href="/cgi-bin/koha/acqui/invoices.pl?message_id=' + row.id + '&op=do_search">' + _("Invoices") + "</a>"; > } >- } else { >- rendered = '<a href="/cgi-bin/koha/acqui/invoices.pl?message_id='+row.id+'&op=do_search">'+_("Invoices")+'</a>'; >- } >- return rendered; >- } >- }, >- { >- "data": "filename", >- "title": _("Filename"), >- "searchable": true, >- "orderable": true >- }, >- { >- "title": _("Actions"), >- "className": "actions", >- "searchable": false, >- "orderable": false, >- "render": function(data, type, row, meta) { >- var result = '<a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id='+encodeURIComponent(row.id)+'"><i class="fa fa-search"></i> '+_("View message")+'</a> '; >- result += '<form action="/cgi-bin/koha/acqui/edifactmsgs.pl" method="post"><input type="hidden" name="message_id" value="'+encodeURIComponent(row.id)+'" />'; >- result += '<input type="hidden" name="csrf_token" value="' + $('meta[name="csrf-token"]').attr('content').trim() + '" />'; >- result += '<input type="hidden" name="op" value="cud-delete" /><button type="submit" class="btn btn-default btn-xs delete_msg"><i class="fa fa-trash-can"></i> '+_("Delete")+'</button> '; >- if ( row.status == 'new' ) { >- result += '<a class="btn btn-default btn-xs import_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=import&message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-cog"></i> '+_("Import")+'</a> '; >- } >- return result; >- } >- } >- ] >- }, 0, 0); >+ return rendered; >+ }, >+ }, >+ { >+ data: "filename", >+ title: _("Filename"), >+ searchable: true, >+ orderable: true, >+ }, >+ { >+ title: _("Actions"), >+ className: "actions", >+ searchable: false, >+ orderable: false, >+ render: function (data, type, row, meta) { >+ var result = >+ '<a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id=' + encodeURIComponent(row.id) + '"><i class="fa fa-search"></i> ' + _("View message") + "</a> "; >+ result += '<form action="/cgi-bin/koha/acqui/edifactmsgs.pl" method="post"><input type="hidden" name="message_id" value="' + encodeURIComponent(row.id) + '" />'; >+ result += '<input type="hidden" name="csrf_token" value="' + $('meta[name="csrf-token"]').attr("content").trim() + '" />'; >+ result += '<input type="hidden" name="op" value="cud-delete" /><button type="submit" class="btn btn-default btn-xs delete_msg"><i class="fa fa-trash-can"></i> ' + _("Delete") + "</button> "; >+ if (row.status == "new") { >+ result += >+ '<a class="btn btn-default btn-xs import_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=import&message_id=' + encodeURIComponent(row.id) + '"><i class="fa fa-cog"></i> ' + _("Import") + "</a> "; >+ } >+ return result; >+ }, >+ }, >+ ], >+ }, >+ 0, >+ 0 >+ ); > >- $("body").on("click", ".delete_msg" ,function(){ >+ $("body").on("click", ".delete_msg", function () { > return confirm(_("Are you sure you want to delete this message?")); > }); > }); > </script> > [% END %] > >-[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >+[% INCLUDE 'intranet-bottom.inc' %] >-- >2.50.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40333
:
183902
|
183903
|
183941
|
183942
|
184385
| 184386 |
184387