@@ -, +, @@ description --- admin/restrictions.pl | 2 +- .../data/mysql/en/mandatory/patron_restrictions.yml | 4 ++-- .../prog/en/includes/borrower_debarments.inc | 12 +++--------- .../prog/en/includes/patron_restrictions.inc | 10 ++++++++++ .../prog/en/modules/admin/restrictions.tt | 13 +++++++------ 5 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc --- a/admin/restrictions.pl +++ a/admin/restrictions.pl @@ -67,8 +67,8 @@ if ( $op eq 'add_form') { }; } else { my $restriction = Koha::RestrictionTypes->find($code); + $restriction->display_text($display_text); unless ($restriction->is_system) { - $restriction->display_text($display_text); $restriction->can_be_added_manually($can_be_added_manually); } $restriction->store; --- a/installer/data/mysql/en/mandatory/patron_restrictions.yml +++ a/installer/data/mysql/en/mandatory/patron_restrictions.yml @@ -22,7 +22,7 @@ description: tables: - debarment_types: - translatable: [ display_text ] + translatable: [] multiline: [] rows: - code: "MANUAL" @@ -47,4 +47,4 @@ tables: display_text: "Discharge" is_system: 1 default: 0 - can_be_added_manually: 0 + can_be_added_manually: 0 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -1,5 +1,6 @@ [% USE raw %] [% USE Koha %] +[% PROCESS 'patron_restrictions.inc' %]
[% IF ( not debarments.defined || debarments.size < 1 ) %]

Patron is currently unrestricted.

@@ -21,14 +22,7 @@ [% dtype = d.type %] - [% ddisplay = restriction_types.$dtype.display_text %] - [% SWITCH ddisplay %] - [% CASE 'Manual' %]Manual - [% CASE 'Overdues' %]Overdues - [% CASE 'Suspension' %]Suspension - [% CASE 'Discharge' %]Discharge - [% CASE %][% ddisplay | html %] - [% END %] + [% PROCESS restriction_type_description restriction=restriction_types.$dtype %] [% IF d.comment.search('OVERDUES_PROCESS') %] @@ -65,7 +59,7 @@ --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc @@ -0,0 +1,10 @@ +[%- BLOCK restriction_type_description -%] + [% ddisplay = restriction.display_text %] + [% SWITCH ddisplay %] + [% CASE 'Manual' %]Manual + [% CASE 'Overdues' %]Overdues + [% CASE 'Suspension' %]Suspension + [% CASE 'Discharge' %]Discharge + [% CASE %][% ddisplay | html %] + [% END %] +[%- END -%] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt @@ -1,10 +1,11 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% PROCESS 'patron_restrictions.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% restriction.display_text | html %]'[% ELSE %]New restriction[% END %][% END %] -[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% restriction.display_text | html %]'[% END %] › Patron restrictions › Administration › Koha +<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% PROCESS restriction_type_description %]'[% ELSE %]New restriction[% END %][% END %] +[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% PROCESS restriction_type_description %]'[% END %] › Patron restrictions › Administration › Koha [% INCLUDE 'doc-head-close.inc' %] @@ -37,7 +38,7 @@ [% IF restriction %]
  • - Modify restriction '[% restriction.display_text | html %]' + Modify restriction '[% PROCESS restriction_type_description %]'
  • [% ELSE %] @@ -85,7 +86,7 @@ [% IF restriction %] -

    Modify restriction [% restriction.display_text | html %]

    +

    Modify restriction [% PROCESS restriction_type_description %]

    [% ELSE %]

    New restriction

    @@ -151,7 +152,7 @@ Confirm restriction deletion -

    Are you sure you want to delete "[% restriction.display_text | html %]"

    +

    Are you sure you want to delete "[% PROCESS restriction_type_description %]"

    @@ -191,7 +192,7 @@ [% restriction.code | html %] - [% restriction.display_text | html %] + [% PROCESS restriction_type_description %] [% IF restriction.can_be_added_manually %]Yes[% END %] --