From d56f9f201704fb6dff92439b518ec6df345da050 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 8 Feb 2024 13:57:30 +0000 Subject: [PATCH] Bug 36035: Wrong text colour in addorderiso2709.pl This patch updates the "Order staged MARC records" page so that the class which is added upon selection is more unique to avoid a collision with some default DataTables styles. These classes are used in JavaScript selectors, not for visual style. The patch also adds some custom CSS variables to global.scss to override the defaults for the DataTables "selected" style, in case this issue crops up again. To test, apply the patch and rebuild the staff interface CSS. Follow the test plan from the bug report: 1) In system preferences, click Search and then select the Acquisitions option from the left hand menu 2) Paste the following into MarcFieldsToOrder price: 975$p quantity: 975$q budget_code: 975$h 3) Paste the following into MarcItemFieldsToOrder homebranch: 949$a holdingbranch: 949$b itype: 949$y nonpublic_note: 949$x public_note: 949$z loc: 949$c ccode: 949$8 notforloan: 949$7 uri: 949$u copyno: 949$t price: 949$g replacementprice: 949$v itemcallnumber: 949$o quantity: 949$k budget_code: 949$l 4) Save the sysprefs 5) Navigate to acquisitions and go into a basket 6) Click "Add to basket" and select "From a new file" 7) Download the file attached to this bug 8) Import the file and when the job is complete click "Add staged files to basket" 9) Click the checkbox next to the record to display the items. - The expanded form should look correct. 10) Add one or more items to the order and confirm that submitting the form works correctly. To test the new default "selected" DataTables style, view a page with a DataTable, e.g. Administration -> Libraries. - Right-click on one of the table rows and choose "Inspect" - Click the table row element, e.g. '' - Double-click the class name and replace it with "selected." - The row you inspected should now have a pale green background and text colors should remain the same. Signed-off-by: Matt Blenkinsop Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer (cherry picked from commit 27a651388dacc6faedef2c7463cfb580f0a79bbe) Signed-off-by: Fridolin Somers --- .../intranet-tmpl/prog/css/src/_tables.scss | 6 ++++++ .../intranet-tmpl/prog/js/addorderiso2709.js | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss index 77e844ef7c..1bee4edc2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss @@ -1,3 +1,9 @@ +:root { + --dt-row-selected: 231, 255, 218; + --dt-row-selected-text: 0, 0, 0; + --dt-row-selected-link: 0, 97, 0; +} + table { border-collapse: collapse; diff --git a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js index 1fa4e7bb99..bbfed0e236 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js +++ b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js @@ -22,19 +22,19 @@ $(document).ready(function() { $('input:checkbox[name="import_record_id"]').change(function(){ var container = $(this).parents("tr"); if ( $(this).is(':checked') ) { - $(container).addClass("selected"); - $(container).removeClass("unselected"); + $(container).addClass("order-selected"); + $(container).removeClass("order-unselected"); $(container).find(".order_details").toggle(true); } else { - $(container).addClass("unselected"); - $(container).removeClass("selected"); + $(container).addClass("order-unselected"); + $(container).removeClass("order-selected"); $(container).find(".order_details").toggle(false); } } ); $("input:checkbox").prop("checked", false); - $("div.biblio.unselected select").prop('disabled', false); - $("div.biblio.unselected input").prop('disabled', false); + $("div.biblio.order-unselected select").prop('disabled', false); + $("div.biblio.order-unselected input").prop('disabled', false); $("#checkAll").click(function(e){ e.preventDefault(); @@ -99,7 +99,7 @@ $(document).ready(function() { }); function disableUnchecked(){ - $("fieldset.biblio.unselected").each(function(){ + $("fieldset.biblio.order-unselected").each(function(){ $(this).remove(); }); return 1; @@ -110,7 +110,7 @@ function checkOrderBudgets(){ var all_budget_id = $("#all_budget_id"); // If we don't have an overarching default set we need to check each selected order if ( !all_budget_id.val() ) { - $("fieldset.biblio.rows.selected").each(function(){ + $("fieldset.biblio.rows.order-selected").each(function(){ var default_order_fund = $(this).find("[name='budget_id']"); // For each order we see if budget is set for order if( !default_order_fund.val() ){ -- 2.20.1