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 <ordernumber>' 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 <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-09-19 19:53:38 +00:00 committed by Tomas Cohen Arazi
parent 799f7968dd
commit 2b1b7c9ce8
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 6 additions and 3 deletions

View file

@ -1002,7 +1002,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 );
@ -1131,7 +1132,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 );

View file

@ -410,7 +410,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 );