From 0361e7e09d3f4aa6c2ea2052c5f6c408e30e2951 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 13 Jul 2019 14:23:19 +0200 Subject: [PATCH] Bug 22021: Improve item status display when placing holds in staff This patch is a bit of a clean-up to bring the item status display more in line with the display on the detail page: - show descrpition of authorised value for not for loan instead of hardcoded text - Show description of authorised value for lost instead of hardcoded text This is also a translatability fix, as the text came from the .pl - Show description of authorised value damaged instead of hardcoded text - Make sequence of status match display on details page: lost - damaged - not for loan To test: - On a record with multiple items - Add different status to the items damaged, lost, not for loan - Make sure you have items with one status and multiple status at the same time - Look at how the status display on the detail page - Place a hold, compare display - Apply patch - Repeat Signed-off-by: Owen Leonard --- .../prog/en/modules/reserve/request.tt | 71 +++++++++++----------- reserve/request.pl | 12 ---- 2 files changed, 36 insertions(+), 47 deletions(-) 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 f11f0cffff8..5a96a1f3b5b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -396,46 +396,47 @@ [% END %] - [% IF ( itemloo.onloan ) %] - Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] - [% ELSE %] - - [% IF ( itemloo.transfertwhen ) %] - In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], - to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] + [% IF ( itemloo.onloan ) %] + Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] + [% ELSE %] + + [% IF ( itemloo.transfertwhen ) %] + In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], + to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] + [% END %] + [% END %] - - [% END %] - [% IF ( itemloo.message ) %] - Unavailable (lost or missing) - [% END %] - [% IF ( itemloo.notforloan ) %] - Not for loan ([% itemloo.notforloanvalue | html %]) - [% END %] + [% IF ( itemloo.reservedate ) %] + [% IF ( itemloo.nocancel ) %] + Can't be cancelled when item is in transit + [% ELSE %] + [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] + [% IF ( itemloo.canreservefromotherbranches ) %]for [% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %][% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] + since + [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate | html %][% END %][% END %]. Cancel hold + [% END %] + [% ELSE %] + Not on hold + [% END %] - [% IF ( itemloo.reservedate ) %] - [% IF ( itemloo.nocancel ) %] - Can't be cancelled when item is in transit - [% ELSE %] - [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] - [% IF ( itemloo.canreservefromotherbranches ) %]for [% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %][% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] - since - [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate | html %][% END %][% END %]. Cancel hold + [% IF itemloo.item_level_holds == "N" %] +
Item level hold not allowed from OPAC + [% ELSIF itemloo.item_level_holds == "F" %] +
Item level hold forced from OPAC + [% END %] - [% END %] - [% ELSE %] - Not on hold - [% END %] + [% IF ( itemloo.itemlost ) %] + [% AuthorisedValues.GetByCode( 'LOST', itemloo.itemlost ) | html %] + [% END %] - [% IF itemloo.item_level_holds == "N" %] -
Item level hold not allowed from OPAC - [% ELSIF itemloo.item_level_holds == "F" %] -
Item level hold forced from OPAC - [% END %] - [% IF ( itemloo.damaged ) %] -
Damaged - [% END %] + [% IF ( itemloo.damaged ) %] + [% AuthorisedValues.GetByCode( 'DAMAGED', itemloo.damaged ) | html %] + [% END %] + + [% IF ( itemloo.notforloan ) %] + Not for loan ([% AuthorisedValues.GetByCode( 'NOT_LOAN', itemloo.notforloan ) | html %]) + [% END %] [% END %] diff --git a/reserve/request.pl b/reserve/request.pl index c709cec7e54..89368086cc5 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -346,10 +346,6 @@ foreach my $biblionumber (@biblionumbers) { } }; - my $frameworkcode = GetFrameworkCode( $biblionumber ); - my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); - my $notforloan_label_of = { map { $_->authorised_value => $_->lib } @notforloan_avs }; - my @bibitemloop; my @available_itemtypes; @@ -436,18 +432,10 @@ foreach my $biblionumber (@biblionumbers) { # Management of the notforloan document if ( $item->{notforloan} ) { $item->{backgroundcolor} = 'other'; - $item->{notforloanvalue} = - $notforloan_label_of->{ $item->{notforloan} }; } # Management of lost or long overdue items if ( $item->{itemlost} ) { - - # FIXME localized strings should never be in Perl code - $item->{message} = - $item->{itemlost} == 1 ? "(lost)" - : $item->{itemlost} == 2 ? "(long overdue)" - : ""; $item->{backgroundcolor} = 'other'; if ($logged_in_patron->category->hidelostitems && !$showallitems) { $item->{hide} = 1; -- 2.11.0