@@ -, +, @@ --- circ/circulation.pl | 2 ++ .../intranet-tmpl/prog/en/includes/borrower_debarments.inc | 12 ++---------- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 3 ++- members/memberentry.pl | 5 ++++- members/moremember.pl | 5 +++++ 5 files changed, 15 insertions(+), 12 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -47,6 +47,7 @@ use Koha::AuthorisedValues; use Koha::CsvProfiles; use Koha::Patrons; use Koha::Patron::Debarments qw(GetDebarments); +use Koha::RestrictionTypes; use Koha::DateUtils; use Koha::Database; use Koha::BiblioFrameworks; @@ -632,6 +633,7 @@ $template->param( SpecifyDueDate => $duedatespec_allow, PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), + restriction_types => scalar Koha::RestrictionTypes->keyed_on_code(), todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), has_modifications => $has_modifications, override_high_holds => $override_high_holds, --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -17,18 +17,10 @@ [% FOREACH d IN debarments %] + [% dtype = d.type %] - [% SWITCH d.type %] - [% CASE 'MANUAL' %] - Manual - [% CASE 'OVERDUES' %] - Overdues - [% CASE 'SUSPENSION' %] - Suspension - [% CASE 'DISCHARGE' %] - Discharge - [% END %] + [% restriction_types.$dtype.display_text | html %] [% IF d.comment.search('OVERDUES_PROCESS') %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1159,8 +1159,9 @@ [% FOREACH d IN debarments %] + [% dtype = d.type %] - [% d.type | html %] + [% restriction_types.$dtype.display_text | html %] [% IF d.comment.search('OVERDUES_PROCESS') %] Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %] --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -39,6 +39,7 @@ use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::AuthorisedValues; use Koha::Patron::Debarments; +use Koha::RestrictionTypes; use Koha::Cities; use Koha::DateUtils; use Koha::Libraries; @@ -120,7 +121,9 @@ foreach my $id ( @delete_guarantor ) { ## Deal with debarments $template->param( - debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ) ); + debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ), + restriction_types => scalar Koha::RestrictionTypes->keyed_on_code() +); my @debarments_to_remove = $input->multi_param('remove_debarment'); foreach my $d ( @debarments_to_remove ) { DelDebarment( $d ); --- a/members/moremember.pl +++ a/members/moremember.pl @@ -37,6 +37,7 @@ use C4::Form::MessagingPreferences; use List::MoreUtils qw/uniq/; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Debarments qw(GetDebarments); +use Koha::RestrictionTypes; use Koha::Patron::Messages; use Koha::DateUtils; use Koha::CsvProfiles; @@ -88,6 +89,10 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) { $patron->$_ and $template->param(flagged => 1) and last; } +$template->param( + restriction_types => scalar Koha::RestrictionTypes->keyed_on_code() +} + if ( $patron->is_debarred ) { $template->param( debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), --