From 3ce8a035a5331d94f284dc01757c7eb3304cbb86 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Fri, 9 Aug 2024 11:57:53 +0000
Subject: [PATCH] Bug 37177: "item" should be "record" in list page

This patch rewords areas of the lists and cart templates so that the
term "record" is preferred over "item" when referring to a bibliographic
record.

To test, apply the patch and go to Lists in the staff interface.

- If necessary, create a new list.
- From the list contents view, click "Add records" in the toolbar.
  - Submit some valid barcodes and biblionumbers
  - After adding biblionumbers you should see the message "The record
    ( [number] ) has been added to the list"
  - After adding barcodes you should see the message "The record for
    this item ( [barcode] ) has been added to the list"
- Click "Add records" again
  - Submit some of the same barcodes and biblionumbers
    - You should see these messages:
      - "The record for this item ( [barcode] ) has not
         been added to the list. Please verify it is not already in the
         list."
      - "The record ( [number] ) has not been added to the
        list. Please verify it is not already in the list.
- Check the checkbox for one or more titles on your list and click
  "Remove selected"
  - You should see the message, "The record has been removed from the
    list."
- Perform a catalog search and from the results screen, select one or
  more results and add them to the cart.
  - Open the Cart and confirm that the controls at the top of the table
    of titles reads "Selected records: ..."

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
---
 .../en/includes/virtualshelves-toolbar.inc    |  2 +-
 .../prog/en/modules/basket/basket.tt          |  2 +-
 .../prog/en/modules/virtualshelves/shelves.tt | 10 +++----
 koha-tmpl/intranet-tmpl/prog/js/basket.js     | 28 +++++++++----------
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
index 2ce1ccd503..08d831158b 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
@@ -4,7 +4,7 @@
     [% IF ( can_add_biblios ) %]
         <div class="btn-group">
             <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addToList">
-                <i class="fa fa-plus"></i> Add items
+                <i class="fa fa-plus"></i> Add records
             </button>
         </div>
     [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
index efd48a74d9..5660c30ef3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
@@ -7,7 +7,7 @@
 [% BLOCK controls %]
     <p class="cart-controls">
         <a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a> <a id="CheckNone" href="#"><i class="fa fa-times"></i> Clear all</a>
-        | <strong>Selected items:</strong>
+        | <strong>Selected records:</strong>
         <a href="#" id="remove_from_cart">Remove</a>
 
         [% IF ( loggedinusername ) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
index 4a0d749579..cf59687db9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ -151,7 +151,7 @@
                         <span>An error occurred when deleting this list.</span>
                     [% CASE 'error_on_add_biblio' %]
                         [% IF m.item_barcode %]
-                            <span>The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
+                            <span>The record for this item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list.</span>
                         [% ELSE %]
                             <span>The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list.</span>
                         [% END %]
@@ -163,12 +163,12 @@
                         <span>List deleted.</span>
                     [% CASE 'success_on_add_biblio' %]
                         [% IF m.item_barcode %]
-                            <span>The item ([% m.item_barcode | html %]) has been added to the list.</span>
+                            <span>The record for this item ([% m.item_barcode | html %]) has been added to the list.</span>
                         [% ELSE %]
                             <span>The record ([% m.bibnum | html %]) has been added to the list.</span>
                         [% END %]
                     [% CASE 'success_on_remove_biblios' %]
-                        <span>The item has been removed from the list.</span>
+                        <span>The record has been removed from the list.</span>
                     [% CASE 'does_not_exist' %]
                         <span>This list does not exist.</span>
                     [% CASE 'item_does_not_exist' %]
@@ -572,7 +572,7 @@
                 <div class="modal-content">
                     <div class="modal-header">
                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-                        <h4 class="modal-title" id="addToListLabel">Add items</h4>
+                        <h4 class="modal-title" id="addToListLabel">Add records</h4>
                     </div>
                     <div class="modal-body">
                         <fieldset class="brief">
@@ -624,7 +624,7 @@
     [% END %]
     <script>
         var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
-        var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
+        var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these records from the list?");
         var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
 
         [% IF op == 'list' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/js/basket.js b/koha-tmpl/intranet-tmpl/prog/js/basket.js
index 5a0a21ad84..4de6731936 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/basket.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/basket.js
@@ -116,7 +116,7 @@ function addRecord(val, selection,NoMsgAlert) {
                 return 0;
             }
             if (! NoMsgAlert ) {
-                showCartUpdate( __("This item is already in your cart") );
+                showCartUpdate( __("This record is already in your cart") );
             }
         }
         else {
@@ -133,7 +133,7 @@ function addRecord(val, selection,NoMsgAlert) {
             return 1;
         }
         if (! NoMsgAlert ) {
-            showCartUpdate( __("This item has been added to your cart") );
+            showCartUpdate( __("This record has been added to your cart") );
             updateLink(val,"add");
         }
     }
@@ -205,20 +205,20 @@ function addSelRecords(valSel) {
     var msg = "";
     if (nbAdd) {
         if (i > nbAdd) {
-            msg = __("%s item(s) added to your cart").format(nbAdd);
+            msg = __("%s record(s) added to your cart").format(nbAdd);
             msg += "<br/>";
             msg += __("%s already in your cart").format((i-nbAdd));
         }
         else {
-            msg = __("%s item(s) added to your cart").format(nbAdd);
+            msg = __("%s record(s) added to your cart").format(nbAdd);
         }
     }
     else {
         if (i < 1) {
-            msg = __("No item was selected");
+            msg = __("No record was selected");
         }
         else {
-            msg = __("No item was added to your cart (already in your cart)!");
+            msg = __("No record was added to your cart (already in your cart)!");
         }
     }
     showCartUpdate(msg);
@@ -257,7 +257,7 @@ function delSingleRecord(biblionumber){
     writeCookie( nameCookie, valCookie );
     updateBasket( arrayRecords.length-1 );
     updateLink(biblionumber,"del");
-    showCartUpdate(__("The item has been removed from your cart"));
+    showCartUpdate(__("The record has been removed from your cart"));
 }
 
 function delSelRecords() {
@@ -308,7 +308,7 @@ function delSelRecords() {
         document.location = CGIBIN + "basket/basket.pl?" + strCookie;
     }
     else {
-        alert(__("No item was selected"));
+        alert(__("No record was selected"));
     }
 }
 
@@ -355,7 +355,7 @@ function delBasket(context,rep) {
 function quit() {
     if (document.myform.records.value) {
         var rep = false;
-        rep = confirm(__("Are you sure you want to remove the selected items?"));
+        rep = confirm(__("Are you sure you want to remove the selected records?"));
         if (rep) {
             delSelRecords();
         }
@@ -409,10 +409,10 @@ function showLess() {
 function updateBasket(updated_value,target) {
     if(target){
         target.$('#basketcount').html(" <span>("+updated_value+")</span>");
-        target.$('#cartDetails').html(__("Items in your cart: %s").format(updated_value));
+        target.$('#cartDetails').html(__("Records in your cart: %s").format(updated_value));
     } else {
         $('#basketcount').html(" <span>("+updated_value+")</span>");
-        $('#cartDetails').html(__("Items in your cart: %s").format(updated_value));
+        $('#cartDetails').html(__("Records in your cart: %s").format(updated_value));
     }
 }
 
@@ -426,7 +426,7 @@ function addSelToShelf() {
     if(items){
         document.location = "/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber="+items;
     } else {
-        alert(__("No item was selected"));
+        alert(__("No record was selected"));
     }
 }
 
@@ -441,7 +441,7 @@ function vShelfAdd(biblist) {
                 bibs.push("biblionumber=" +  biblist[i].value);
             }
         }
-        if (bibs.length === 0) { showListsUpdate(__("No item was selected")); }
+        if (bibs.length === 0) { showListsUpdate(__("No record was selected")); }
         return bibs.join("&");
     } else {
         var bibnums = getContextBiblioNumbers();
@@ -451,7 +451,7 @@ function vShelfAdd(biblist) {
             }
             return bibs.join("&");
         } else {
-            showListsUpdate(__("No item was selected"));
+            showListsUpdate(__("No record was selected"));
         }
     }
 }
-- 
2.39.2