From 798976240936b5021f036311d2cdb5ae8a8701e4 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 16 Oct 2020 18:08:44 +0000 Subject: [PATCH] Bug 26719: Replace MSG_NO_RECORD_SELECTED with translatable string This patch cleans up some loose ends left by Bug 25351, replacing instances where the undefined variable MSG_NO_RECORD_SELECTED is used. To test, apply the patch and perform a catalog search in the OPAC. - On the search results page, without checking any checkboxes, use the "Select titles to..." menu to try to add to cart and add to a list. In each case you should get a "No item was selected" message. - View a list which contains one or more titles. Click the "Remove from list" link. You should get a "No item was selected" link. Other instances have been corrected even though they will only be triggered if something has broken. For instance, toolbar items in the cart window which are disabled shouldn't register the click that might trigger the error. And selecting an item for an item-level hold shouldn't ever give a warning because at least one radio button should always be selected. Signed-off-by: David Nind --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index e81d2b0cd5..40fab7cae7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -335,7 +335,7 @@ $("#tag_hides").hide(); $("#tagsel_form").show(); } else { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); } } @@ -350,7 +350,7 @@ function tagAdded() { var checkedBoxes = $("input:checkbox:checked"); if (!$(checkedBoxes).size()) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); return false; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 1b9dd3bdee..87559d81bd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -631,7 +631,7 @@ [% END %] if ($(".confirmjs:checked").size() == 0) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); return false; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 7843add315..b8d86ee9a7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -652,7 +652,7 @@ if (checkedCount > 0) { holdBiblioNums(checkedBiblioNums); } else { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); } } @@ -667,7 +667,7 @@ function tagSelected() { var checkedBoxes = $(".searchresults :checkbox:checked"); if ($(checkedBoxes).size() == 0) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); } else { $("#tagsel_tag").hide(); $(".resort").hide(); @@ -686,7 +686,7 @@ function tagAdded() { var checkedBoxes = $(".searchresults :checkbox:checked"); if ($(checkedBoxes).size() == 0) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); return false; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index bf42a7072f..7b15ae60bf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -813,7 +813,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); function holdSelections() { var checkedBoxes = $("input:checkbox:checked"); if ($(checkedBoxes).size() == 0) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); } else { var bibs = ""; $(checkedBoxes).each(function(){ @@ -831,7 +831,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); $(".tag_hides").hide(); $("#tagsel_form").show(); } else { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); } } @@ -846,7 +846,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); function tagAdded() { var checkedBoxes = $("input:checkbox:checked"); if (!$(checkedBoxes).size()) { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); return false; } @@ -970,7 +970,7 @@ $(function() { return confirmDelete(MSG_REMOVE_ONE_FROM_LIST); } } else { - alert(MSG_NO_RECORD_SELECTED); + alert( __("No item was selected") ); return false; } }); -- 2.11.0