From 46585db2536dd339b1e5aa3eccbe0fba32f8d6d7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Apr 2024 11:01:26 +0000 Subject: [PATCH] Bug 25682: Style transfers interface to match checkin page This patch updates the transfer page to make it better match the style of the checkin page. The static dialog is converted to a modal for consistency's sake, with information displaying as similarly as possible to the checkin page. The library dropdown is now styled with Select2. To test, apply the patch and go to Circulation -> Transfers. - Test some simple transfers: Items which are not checked out, some which are checked out. - Test that the page's handling of items on hold matches current master (i.e. broken, see Bug 36686). Description of current behavior: - Logged in to Branch A. - Find a barcode for a title which has a biblio-level hold (not already in transit) to be sent to Branch B. - Submit transfer to Branch C. - Three actions are offered: 1. Transfer to Branch B 2. Cancel hold and then attempt transfer 3. Ignore and return to transfers Testing each of the three actions: 1. The page says "Item is now in transit to Branch C (not the hold's destination)" 2. The item is not in transit, and the hold has been changed to an item-level hold. 3. Works correctly. No change to the hold and no transfer initiated. - Logged in to Branch A. - Find a barcode for a title which has a biblio-level hold (not already in transit) to be sent to Branch B. - Check in the item, confirm hold and transfer. - Submit transfer to Branch C. - Two actions are offered: 1. Cancel hold and then attempt transfer 2. Ignore and return to transfers Testing each of the two actions: 1. The page says "Reserve cancelled" (sic). The original transfer to Branch B is still in place. 2. Works correctly. No change to the hold and the original transfer remains. - Logged in to Branch D. - Find a barcode for a title which has a biblio-level hold (not already in transit) to be held at Branch D. - Check in the item, confirm hold. - Log in to Branch A. - Submit a transfer with that barcode to Branch C. - Two actions are offered: 1. Cancel hold and then attempt transfer 2. Ignore and return to transfer. Testing each of the two actions: 1. The page says "Reserve cancelled" (sic). The hold has been cancelled but the item has not been transferred. 2. Works correctly. Hold remains unchanged, no transfer initiated. --- circ/branchtransfers.pl | 8 +- .../prog/css/src/staff-global.scss | 16 ++ .../prog/en/modules/circ/branchtransfers.tt | 245 +++++++++++------- 3 files changed, 169 insertions(+), 100 deletions(-) diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index b3b07ed0b1..e65029a0a2 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -167,6 +167,8 @@ my $biblionumber; ##################### my $hold; +my $patron; +my $found_biblio; if ($found){ $hold = Koha::Holds->find( { reserve_id => $found->{reserve_id} }, @@ -174,6 +176,8 @@ if ($found){ ); $itemnumber = $found->{'itemnumber'}; $borrowernumber = $found->{'borrowernumber'}; + $patron = Koha::Patrons->find($borrowernumber); + $found_biblio = Koha::Biblios->find( $found->{'biblionumber'} ); if ( $found->{'ResFound'} eq "Waiting" ) { $waiting = 1; @@ -238,7 +242,9 @@ $template->param( settransit => $settransit, trsfitemloop => \@trsfitemloop, errmsgloop => \@errmsgloop, - PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), + PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), + patron => $patron, + found_biblio => $found_biblio, ); # Checking if there is a Fast Cataloging Framework diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 28beabafc7..638356f193 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1021,6 +1021,21 @@ fieldset { } } + &.barcode_input { + label { + &.hint { + display: block; + margin-bottom: .5em; + } + } + + select { + font-size: 120%; + max-width: 50%; + padding: .5em 0; + } + } + &.brief { div { &.hint { @@ -1575,6 +1590,7 @@ i { } .form-control-group { + margin-bottom: .5rem; white-space: nowrap; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt index aef7032444..7ce124d600 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt @@ -5,6 +5,7 @@ [% USE AuthorisedValues %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] +[% PROCESS 'member-display-address-style.inc' %] [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] [% t("Transfers") | html %] › @@ -12,8 +13,29 @@ [% t("Koha") | html %] [% END %] [% INCLUDE 'doc-head-close.inc' %] +[% FILTER collapse %] + +[% END %] +[% BLOCK display_holdpatron_address %] + [% PROCESS 'display-address-style' %] +[% END %] + [% WRAPPER 'header.inc' %] [% INCLUDE 'circ-search.inc' %] @@ -40,104 +62,125 @@
[% INCLUDE 'messages.inc' %] -

Transfer items

- [% IF ( found ) %] -

Reserve found

-
- - - - - - - [% IF ( reserved ) %] - - - - - [% END # /IF reserved %] - - - - -
- [% IF ( reserved ) %] - Hold found for [% INCLUDE 'patron-title.inc' patron => hold.patron | html %] ([% borrowernumber | html %]). - [% END %] - [% IF ( waiting ) %] - Item is marked waiting at [% branchname | html %] for [% name | html %] ([% borrowernumber | html %]). - [% END %] - [% IF ( transferred ) %] - Item has been trapped to fill a hold and is in transit for [% name | html %] ([% borrowernumber | html %]). - [% END %] -
- [% IF ( reserved ) %] - Transfer item to [% Branches.GetName( hold.branchcode ) | html %]: - [% END %] - [% IF ( waiting or transferred ) %]Cancel hold and then attempt transfer: [% END %] - -
- [% INCLUDE 'csrf-token.inc' %] - [% FOREACH trsfitemloo IN trsfitemloop %] - - - - [% END %] - - - - - - [% IF ( waiting or transferred or processing ) %] - - - [% END %] + [% BLOCK transfer_hidden_fields %] + [% FOREACH trsfitemloo IN trsfitemloop %] + + + + [% END %] + [% END %] + +

Transfers

+ + +
Cancel hold and then attempt transfer: -
- [% INCLUDE 'csrf-token.inc' %] - [% FOREACH trsfitemloo IN trsfitemloop %] - - - +
+ [% INCLUDE 'biblio-title.inc' biblio=found_biblio link=1 %] + [% IF ( barcode ) %] + ([% barcode | html %]) + [% END %] + + + + +
Ignore and return to transfers: -
- - - [% FOREACH trsfitemloo IN trsfitemloop %] - - - - [% END %] - -
-
-
+ + + [% IF ( reserved ) %] +
+
+ [% INCLUDE 'csrf-token.inc' %] + [% PROCESS transfer_hidden_fields %] + + + + + + + +
+
+ [% END # /IF reserved %] + +
+
+ + + [% PROCESS transfer_hidden_fields %] + +
+
+ + + + + [% ELSE # /IF found %] [% IF ( reqmessage ) %]
-
    [% IF ( cancelled ) %] -
  • Reserve cancelled
  • +

    Hold cancelled

    [% END %] [% IF ( settransit ) %] -
  • Item is now in transit to [% Branches.GetName(tobranchcd) | html %]
  • +

    Item is now in transit to [% Branches.GetName(tobranchcd) | html %]

    [% END %] -
[% END %] @@ -178,22 +221,22 @@ [% END # /errmsgloop %]
-
+ [% INCLUDE 'csrf-token.inc' %] -
- Transfer -
    -
  1. - - -
  2. -
  3. - - -
  4. -
+
+

Transfers

+
+ + + Required +
+
+ + + +
[% FOREACH trsfitemloo IN trsfitemloop %] @@ -201,7 +244,7 @@ [% END %] - +
[% IF ( trsfitemloop ) %] @@ -255,6 +298,7 @@ [% MACRO jsinclude BLOCK %] + [% INCLUDE 'select2.inc' %] [% END %] -- 2.39.2