From ffff283f460b7e97c547b6cb42419b8dfbc7e45e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 2 Mar 2023 00:42:28 +0000 Subject: [PATCH] Bug 31391: Interface and wording fixes This patch includes the following fixes: - Making the atomic updates executable - Preventing warns when running tests - Updating db updates - Fixing terminology - Make 'cancel selected recalls' button yellow - Fix HTML makeup of recalls request page - Show a warning when placing a recall if there is already a record-level hold by this patron - Show a link to mark a hold for conversion which selects the recall option on holds page --- ...D_CANCELLATION-RECALLED_authorised_value.pl | 4 +++- ...bug_31391_-_add_RecallsInterface_syspref.pl | 4 +++- .../prog/en/includes/holds_table.inc | 6 ++++++ .../modules/admin/preferences/circulation.pref | 18 +++++++++--------- .../prog/en/modules/recalls/request.tt | 18 ++++++++++++++---- .../prog/en/modules/reserve/request.tt | 4 ++++ recalls/request.pl | 2 ++ t/db_dependent/Holds.t | 2 ++ 8 files changed, 43 insertions(+), 15 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl b/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl old mode 100644 new mode 100755 index dc2b824905..57967eedb8 --- a/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl +++ b/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl @@ -2,11 +2,13 @@ use Modern::Perl; return { bug_number => "31391", - description => "Add new RECALLED value to HOLD_CANCELLATION authorised value category", + description => "Staff-side recalls", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; $dbh->do(q{ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','RECALLED','Hold was converted to a recall') }); + + say $out "Added RECALLED value to HOLD_CANCELLATION authorised value category"; }, }; diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl b/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl old mode 100644 new mode 100755 index 48ca6d92bc..15c301fa82 --- a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl @@ -2,11 +2,13 @@ use Modern::Perl; return { bug_number => "31391", - description => "Add new system preference RecallsInterface", + description => "Staff-side recalls", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice') }); + + say $out "Added system preference 'RecallsInterface'"; }, }; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index 5852249534..76d480bb0f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -23,6 +23,7 @@     Print hold/transfer slip +   [%- SET first_priority = 0 -%] @@ -249,6 +250,11 @@ [% ELSE %] [% END %] + + [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] + Mark for conversion to recall + [% END %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 3218cb8219..542b1baab3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -1334,6 +1334,15 @@ Circulation: 1: Use 0: "Don't use" - recalls. Make sure you configure circulation and fines rules for recalls once enabled. + - + - Recalls can be placed through + - pref: RecallsInterface + default: opac + choices: + opac: the OPAC only + staff: the staff interface only + both: both the OPAC and the staff interface + - . (Requires UseRecalls.) SIP2: - @@ -1368,12 +1377,3 @@ Circulation: 1: Enable 0: Disable - "the curbside pickup module." - - - - Recalls can be placed through - - pref: RecallsInterface - default: opac - choices: - opac: the OPAC only - staff: the staff interface only - both: both the OPAC and the staff interface - - . (Requires UseRecalls.) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt index 2fa07dff87..4ea2e8105e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt @@ -57,6 +57,12 @@ [% END %] + [% IF patron_holds_count %] +
+ Patron has placed one or more record-level holds. Convert a hold to a recall. +
+ [% END %] +
Recall details
@@ -109,7 +115,7 @@ Barcode [% UNLESS ( single_branch_mode ) %] Home library - Last location + Holding library [% END %] Collection Call number @@ -146,7 +152,7 @@ In transit from [% Branches.GetName( item.get_transfer.frombranch ) | html %] to [% Branches.GetName( item.get_transfer.tobranch ) | html %] since [% item.get_transfer.datesent | $KohaDates %] [% END %] [% IF ( item.itemlost || item.withdrawn ) %] - Unavailable (lost or missing) + Unavailable (lost or withdrawn) [% END %] [% IF ( item.notforloan ) %] Not for loan ([% item.notforloan | html %]) @@ -166,7 +172,7 @@ [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %] - Patron has already placed a reserve on this item. + Patron has already placed a hold on this item. [% END # / IF ( item.recall or hold ) %] @@ -213,6 +219,8 @@ [% END %] +
+

Existing recalls

[% IF Koha.Preference('UseRecalls') %] @@ -223,7 +231,7 @@ Select all [% INCLUDE 'recalls.inc' %]
- +
[% ELSE %] @@ -233,6 +241,8 @@
Recalls have not been enabled. Enable the UseRecalls system preference to use recalls.
[% END %] +
+ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index b1bd2882f8..753cdda629 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1761,6 +1761,10 @@ window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id); return false; }) + $(".convert-to-recall").click(function(){ + var reserve_id = $(this).attr('data-id'); + $("select[class='rank-request'][data-hold-id='"+reserve_id+"']").val('recall'); + }); [% END %] diff --git a/recalls/request.pl b/recalls/request.pl index 2ec38ccd78..5839ad76c1 100755 --- a/recalls/request.pl +++ b/recalls/request.pl @@ -122,9 +122,11 @@ if ( $borrowernumber ) { if ( !$biblio->can_be_recalled({ patron => $patron }) ) { $error = 1; } + my $patron_holds_count = Koha::Holds->search({ borrowernumber => $borrowernumber, biblionumber => $biblio->biblionumber, item_level_hold => 0 })->count; $template->param( patron => $patron, + patron_holds_count => $patron_holds_count, ); } } diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 65ae2e4221..7f1c35c93b 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -1825,6 +1825,7 @@ subtest 'ModReserve to convert a hold to a recall' => sub { surname => 'whatever surname', categorycode => $category->{categorycode}, branchcode => $branch, + email => 'name@email.com', } )->store; my $borrowernumber = $patron->borrowernumber; @@ -1835,6 +1836,7 @@ subtest 'ModReserve to convert a hold to a recall' => sub { surname => 'whatever surname', categorycode => $category->{categorycode}, branchcode => $branch, + email => 'name2@email.com', } )->store; -- 2.20.1