Bugzilla – Attachment 191299 Details for
Bug 41563
Tidy kohaTable block - acqui
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41563: Tidy kohaTable - acqui/parcel.tt
Bug-41563-Tidy-kohaTable---acquiparceltt.patch (text/plain), 9.51 KB, created by
Owen Leonard
on 2026-01-12 16:55:50 UTC
(
hide
)
Description:
Bug 41563: Tidy kohaTable - acqui/parcel.tt
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-01-12 16:55:50 UTC
Size:
9.51 KB
patch
obsolete
>From f2eb5f5e5e60155f9427fd1d9f33285eebc21601 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Jan 2026 16:48:33 +0100 >Subject: [PATCH] Bug 41563: Tidy kohaTable - acqui/parcel.tt > >See bug 41324 comment 6 >1. Variable serialization >2. Use of permissions and sysprefs > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/acqui/parcel.tt | 49 ++++++++++++------- > 1 file changed, 32 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 1970eebf1e4..66ed33c9726 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -355,6 +355,26 @@ > margin-bottom: 20px; > } > </style> >+ <script> >+ addPrefs({ >+ marcflavour: "[% Koha.Preference('marcflavour') | html %]", >+ }); >+ >+ let summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note"; >+ if (prefs.marcflavour == 'UNIMARC'){ >+ summary_fields += ":biblio.ean"; >+ } >+ const vendor_id = [% booksellerid | html %]; >+ const invoice_id = [% invoiceid | html %]; >+ >+ let table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'parcel', 'pending_orders', 'json' ) | $raw %]; >+ const interface = "[% interface | html %]"; >+ const theme = "[% theme | html %]"; >+ const i18n = { >+ order: "[%tp("noun", "Order") | html %]", >+ }; >+ </script> >+ > <script> > dt_overwrite_html_sorting_localeCompare(); > var PENDING_MULTI_SELECTION = _("Receive selected (%s)"); >@@ -443,9 +463,7 @@ > } > }, > { >- [% SET summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note" %] >- [% IF Koha.Preference('marcflavour')=='UNIMARC' %][% SET summary_fields = summary_fields _ ":biblio.ean" %][% END %] >- data: "[% summary_fields | html %]", >+ data: summary_fields, > render: function(data, type, row, meta) { > var result = ''; > if ( row && row.biblio_id != null ) { >@@ -454,10 +472,9 @@ > result += _(" by ") + escape_str(row.biblio.author); > if ( row.biblio.isbn != null ) > result += " – " + escape_str(row.biblio.isbn); >- [% IF Koha.Preference('marcflavour')=='UNIMARC' %] >- if ( row.biblio.ean != null ) >+ if (prefs.marcflavour == 'UNIMARC' && row.biblio.ean != null ) { > result += " – EAN:" + escape_str(row.biblio.ean); >- [% END %] >+ } > if ( row.biblio.publisher != null ) { > result += "<br/>" + _("Publisher: ") + escape_str(row.biblio.publisher); > if ( row.biblio.publication_year != null ) { >@@ -497,12 +514,12 @@ > + _("Internal note: ") > + '</strong>' + escape_str(internal_note) > + ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' >- + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' >+ + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id' > + '&type=internal">' + _("Change internal note") + '</a>]</p>'; > } > else { > result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' >- + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' >+ + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id > + '&type=internal">' + _("Add internal note") + '</a>]'; > } > >@@ -514,7 +531,7 @@ > } > else { > result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' >- + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' >+ + encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=' + invoice_id > + '&type=vendor">' + _("Add vendor note") + '</a>]'; > } > >@@ -531,7 +548,7 @@ > 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>'; > > result += '<ul class="dropdown-menu" aria-labelledby="view' + row.order_id + '">'; >- 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>'; >+ result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '">' + i18n.order + '</a></li>'; > result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + encodeURIComponent(row.biblio_id) + '">' + _("MARC") + '</a></li>'; > result += '<li><a class="dropdown-item previewData" href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + encodeURIComponent(row.biblio_id) + '">' + _("Card") + '</a></li>'; > result += '</ul>'; >@@ -576,7 +593,7 @@ > data: "", > render: function(data, type, row, meta) { > return '<a href="orderreceive.pl?multiple_orders=' >- + encodeURIComponent(row.order_id) + '&invoiceid=[% invoiceid | uri %]' + '">' >+ + encodeURIComponent(row.order_id) + '&invoiceid=' + invoice_id + '">' > + _("Receive") + '</a><br/>' > + '<a href="#" onclick="transfer_order_popup(' + escape_str(row.order_id) + '); return false;">' > + _("Transfer") + '</a>'; >@@ -598,7 +615,7 @@ > result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' > + encodeURIComponent(row.order_id) > + '&biblionumber=' + encodeURIComponent(row.biblio_id) >- + '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">' >+ + '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=' + invoice_id > + _("Cancel order") + '</a><br/>'; > } > >@@ -654,7 +671,7 @@ > $('#select_multiple').click(function () { > var ids = Object.keys(selected_rows); > if (!ids.length) return; >- location.href = 'orderreceive.pl?multiple_orders=' + ids.join(',') + '&invoiceid=[% invoiceid | uri %]'; >+ location.href = 'orderreceive.pl?multiple_orders=' + ids.join(',') + '&invoiceid=' + invoiceid > }).html(PENDING_MULTI_SELECTION.format('0')) > options.order = [[1, 'asc']]; > options.columns.unshift({ >@@ -665,9 +682,7 @@ > orderable: false > }); > >- let table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'parcel', 'pending_orders', 'json' ) | $raw %]; >- >- var pending_orders_table = $("#pending_orders").kohaTable(options, table_settings, 1, { "basket.vendor_id": [% booksellerid | html %] }); >+ var pending_orders_table = $("#pending_orders").kohaTable(options, table_settings, 1, { "basket.vendor_id": vendor_id }); > > var api = pending_orders_table.api(); > api.on('draw', function () { >@@ -690,7 +705,7 @@ > > $("#dataPreview").on("hidden.bs.modal", function(){ > $("#dataPreviewLabel").html(""); >- $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"" + interface + "/" + theme + "/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); > > $("body").on("click", ".previewData", function(e){ >-- >2.39.5
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 41563
:
191069
|
191070
|
191071
|
191072
|
191073
|
191074
|
191075
|
191076
|
191077
|
191078
|
191079
|
191080
|
191290
|
191291
|
191292
|
191293
|
191294
|
191295
|
191296
|
191297
|
191298
| 191299 |
191300
|
191301
|
191302
|
191303