From 457fe88fa3e1d1c451e86465f383ff691d95d1f6 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 19 Sep 2023 19:53:38 +0000 Subject: [PATCH] Bug 34833: Make "order number" in acq modal translatable The 'order number' was not translatable when editing the estimated delivery date or notes from basket summary or when editing the estimated delivery date from late orders. To get there: 0. Make sure you have budgets and vendors set up 1. Create a basket (skip this if you already have an open basket) 1.1. Go to acquisitions 1.2. Search for a vendor 1.3. Click New > basket 1.4. Enter a name for the basket 1.5. To make the tests easier, choose to create items when : cataloging the record 1.6. Click save 2. Add an order 2.1. Click add to basket > From a new (empty) record 2.2. Fill out the form, minimally - Enter a title - Enter a quantity - Choose a fund - Enter a vendor price 2.3. Click Save 3. Next to the order line, click Edit under Estimated delivery date 4. Verify that the 'order number ' shows on top of the modal 5. Edit internal/vendor note, verify it shows there as well 6. Close basket 7. Go to late orders 8. Edit estimated delivery date, text should show there as well 9. Apply patch 10. Run translation update script 11. Verify the string now appears in po files 12. Translate it 13. Install translation 14. Verify it shows nicely translated in all 3 mentioned spots Signed-off-by: Caroline Cyr La Rose Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 2b1b7c9ce84683543267816f6e6d351fe3f891d0) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 ++++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index e1c404286a..454d37012d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -980,7 +980,8 @@ e.preventDefault(); var ordernumber = $(this).data("ordernumber"); var note_type = $(this).data("note_type"); - var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; + var order_number_text = _(" (order number %s)").format(ordernumber); + var modalTitle = $(this).attr("title") + " " + order_number_text; var note_text = $( "#" + note_type + "-note-" + ordernumber ).html(); $("#noteEditor .modal-title").text(modalTitle); $("#ordernumber").val( ordernumber ); @@ -1109,7 +1110,8 @@ $(".edit_delivery_date").on("click", function(e) { e.preventDefault(); var ordernumber = $(this).data("ordernumber"); - var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; + var order_number_text = _(" (order number %s)").format(ordernumber); + var modalTitle = $(this).attr("title") + " " + order_number_text; var delivery_date = $( "#delivery_date_" + ordernumber ).data("delivery_date"); const estimated_delivery_date = document.querySelector("#estimated_delivery_date")._flatpickr; estimated_delivery_date.setDate( delivery_date ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt index 1a502c41e7..ea20b31b73 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt @@ -405,7 +405,8 @@ $(".edit_delivery_date").on("click", function(e) { e.preventDefault(); var ordernumber = $(this).data("ordernumber"); - var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; + var order_number_text = _(" (order number %s)").format(ordernumber); + var modalTitle = $(this).attr("title") + " " + order_number_text; var delivery_date = $( "#delivery_date_" + ordernumber ).data("delivery_date"); const estimated_delivery_date = document.querySelector("#estimated_delivery_date")._flatpickr; estimated_delivery_date.setDate( delivery_date ); -- 2.39.5