From 5cb9d00fc960de993a6209ff916f4ba4bce3234e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 5 Aug 2020 10:52:48 +0100 Subject: [PATCH] Bug 25261: (QA follow-up) Add confirmation to issues table The issues table allows for checkins and was not appropriately requireing confirmation for the multi-part confirmation added in this bug. --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 11 +++++++++++ svc/checkouts | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 41c3562a67..952dd84008 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -130,6 +130,15 @@ $(document).ready(function() { }, "json") }); + $(".confirm:checked:visible").each(function() { + itemnumber = $(this).val(); + id = "#checkin_" + itemnumber; + materials = $(this).data('materials'); + + $(this).replaceWith("Confirm (" + materials + "): "); + $(id).parent().parent().addClass('warn'); + }); + $(".renew:checked:visible").each(function() { var override_limit = $("#override_limit").is(':checked') ? 1 : 0; @@ -543,6 +552,8 @@ $(document).ready(function() { "mDataProp": function ( oObj ) { if ( oObj.can_renew_error == "on_reserve" ) { return "" + ON_HOLD + ""; + } else if ( oObj.materials ) { + return ""; } else { return ""; } diff --git a/svc/checkouts b/svc/checkouts index fa470b3a2a..4932f3873a 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -104,6 +104,7 @@ my $sql = ' items.damaged, items.location, items.enumchron, + items.materials, DATEDIFF( issues.issuedate, CURRENT_DATE() ) AS not_issued_today, @@ -186,6 +187,11 @@ while ( my $c = $sth->fetchrow_hashref() ) { my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); $damaged = $av->count ? $av->next->lib : ''; } + my $materials; + if ( $c->{materials} ) { + my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $c->{materials} }); + $materials = $descriptions->{lib} // $c->{materials}; + } my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); my $checkout = { DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, @@ -248,6 +254,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { lost => $lost, claims_returned => $claims_returned, damaged => $damaged, + materials => $materials, borrower => { surname => $c->{surname}, firstname => $c->{firstname}, -- 2.20.1