diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
index 02c697f806..37a7598eb9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
@@ -453,7 +453,7 @@
let item_search_selections = JSON.parse( localStorage.getItem("item_search_selections") ) || [];
if( item_search_selections.length > 0 ){
showItemSelections( item_search_selections.length );
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
var itemnumber = $(this).val();
if( item_search_selections.indexOf( itemnumber ) >= 0 ){
$(this).prop("checked", true );
@@ -540,7 +540,7 @@
+ ' ' + _("Clear") + ''
+ ' '
+ ' '
- + '
'
+ + ' '
+ ' ' + tr + ''
+ ' '
+ '
'
@@ -650,7 +650,7 @@
};
var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'itemsearch', 'results', 'json' ) | $raw %];
- KohaTable('results' , {
+ KohaTable('item_search' , {
"bKohaColumnsUseNames": true,
"destroy": true,
"serverSide": true,
@@ -703,7 +703,7 @@
fixedHeader: false // There is a bug on this view
}, table_settings, true, null, filters_options );
- $('#results').on('draw.dt', function (e, settings) {
+ $('#item_search').on('draw.dt', function (e, settings) {
prepSelections();
$('[data-bs-toggle="tooltip"]').tooltip();
});
@@ -751,7 +751,7 @@
$("body").on("click", "#select_all", function(e) {
e.preventDefault();
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
if( $(this).prop("checked") == false ){
$(this).prop( "checked", true ).change();
}
@@ -760,7 +760,7 @@
$("body").on("click", "#clear_all", function(e) {
e.preventDefault();
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
if( $(this).prop("checked") == true ){
$(this).prop( "checked", false ).change();
}
@@ -769,12 +769,12 @@
$("body").on("click", "#clear-row-selection", function(e){
e.preventDefault();
- $("#results input[type='checkbox']").prop("checked" ,false ).change();
+ $("#item_search input[type='checkbox']").prop("checked" ,false ).change();
localStorage.removeItem("item_search_selections");
showItemSelections( 0 );
});
- $("body").on('change', '#results input[type="checkbox"]', function() {
+ $("body").on('change', '#item_search input[type="checkbox"]', function() {
let item_search_selections = JSON.parse( localStorage.getItem("item_search_selections") ) || [];
var itemnumber = $(this).val();
if( $(this).prop("checked") ){
@@ -844,7 +844,7 @@
batch_mod_form.submit();
});
- $("body").on('click','#results tbody td',function(e){
+ $("body").on('click','#item_search tbody td',function(e){
var checkbox = $(this).find("input[type=checkbox]");
if (e.target.type != "checkbox") {
checkbox.prop('checked', !checkbox.prop("checked"));
diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js
index 693e9cad54..6a5b35932a 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js
@@ -913,10 +913,15 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) {
return this._id !== "" && this._str !== "";
})
.each(function () {
- let optionValue =
- table_dt.settings()[0].ajax !== null
- ? `^${this._id}$`
- : this._id;
+ let optionValue = this._id;
+
+ if (
+ table_dt.settings()[0].ajax !== null &&
+ table_node.attr("id") !== "item_search"
+ ) {
+ optionValue = `^${this._id}$`;
+ }
+
let o = $(
``
);