From e10ae45d4763594b2aa680dec70480d0ae5e0ff6 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 23 Nov 2018 14:54:27 +0100 Subject: [PATCH] Bug 21877: Show authorized value description for withdrawn in checkout During checkout the withdrawn information is displayed in a message : "Item has been withdrawn". Like in other pages and like notforloan, we should display the withdrawn authorized value description. This patch adds this display. Add so that translation does not change. Also adds class 'co-withdrawn' (like in checkin 'ci-*' classes) to ease hidding this new information via CSS. Test plan : 1) On a catalog with items.withdrawn defined with authorized values category WITHDRAWN 2) Define in WITHDRAWN an authorized values 1 with description 'dropped in trash' 3) Define in WITHDRAWN an authorized values 2 with description empty 4) Edit an item with withdrawn=1 5) Checkout this item => You see 'Item has been withdrawn (dropped in trash)' 6) Edit an item with withdrawn=2 7) Checkout this item => You see 'Item has been withdrawn' --- C4/Circulation.pm | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0999a970fd..f53c373d56 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -946,6 +946,7 @@ sub CanBookBeIssued { if ( $item->{'withdrawn'} && $item->{'withdrawn'} > 0 ) { $issuingimpossible{WTHDRAWN} = 1; + $issuingimpossible{item_withdrawn} = $item->{'withdrawn'}; } if ( $item->{'restricted'} && $item->{'restricted'} == 1 ) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 6700b0e581..7c3dfcba7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -348,7 +348,11 @@ [% END %] [% IF ( WTHDRAWN ) %] -
  • Item has been withdrawn
  • +
  • + Item has been withdrawn + [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item_withdrawn ) %] + [% IF (item_withdrawn_lib) %]([% item_withdrawn_lib | html %])[% END %] +
  • [% END %] [% IF ( RESTRICTED ) %] -- 2.17.1