@@ -, +, @@ page for a user. works as expected --- circ/circulation.pl | 6 +- .../en/includes/patron-restrictions-tab.inc | 81 +++++++++++++++++++ .../prog/en/includes/restriction-types.inc | 10 +++ .../prog/en/modules/circ/circulation.tt | 4 +- 4 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/restriction-types.inc --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -44,7 +44,6 @@ use CGI::Session; use Koha::AuthorisedValues; use Koha::CsvProfiles; use Koha::Patrons; -use Koha::Patron::Debarments qw( GetDebarments ); use Koha::DateUtils qw( dt_from_string ); use Koha::Patron::Restriction::Types; use Koha::Plugins; @@ -625,10 +624,9 @@ my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $template->param( debt_confirmed => $debt_confirmed, SpecifyDueDate => $duedatespec_allow, - PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), - debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), + PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), todaysdate => dt_from_string()->set(hour => 23)->set(minute => 59), - restriction_types => scalar Koha::Patron::Restriction::Types->keyed_on_code(), + restriction_types => scalar Koha::Patron::Restriction::Types->search(), has_modifications => $has_modifications, override_high_holds => $override_high_holds, nopermission => scalar $query->param('nopermission'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc @@ -0,0 +1,81 @@ +[% USE raw %] +[% USE Koha %] +[% PROCESS 'restriction-types.inc' %] +
+ [% IF ( patron.restrictions.count == 0 ) %] +

Patron is currently unrestricted.

+ [% ELSE %] + + + + + + + + [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] + + [% END %] + + + + [% FOREACH restriction IN patron.restrictions %] + + + + + + [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] + + [% END %] + + [% END %] + +
TypeCommentExpirationCreated 
+ [% PROCESS restriction_type_description restriction_type=restriction.type %] + + [% IF restriction.comment.search('OVERDUES_PROCESS') %] + Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %] + [% ELSE %] + [% restriction.comment | $raw %] + [% END %] + [% IF restriction.expiration %] [% restriction.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %][% restriction.created | $KohaDates %] + + Remove + +
+ [% END %] + [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] +

Add manual restriction

+
+ + +
+ Add manual restriction +
    + [% IF Koha.Preference('PatronRestrictionTypes') %] +
  1. + + +
  2. + [% END %] +
  3. +
  4. + + +
  5. +
+
Cancel
+
+
+ [% END %] +
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/restriction-types.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/restriction-types.inc @@ -0,0 +1,10 @@ +[%- BLOCK restriction_type_description -%] + [%- ddisplay = restriction_type.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/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -869,7 +869,7 @@ [% END %]
  • - Restrictions ([% debarments.size || 0 | html %]) + Restrictions ([% patron.restrictions.count || 0 | html %])
  • [% SET enrollments = patron.get_club_enrollments %] @@ -895,7 +895,7 @@ [% END %] - [% INCLUDE borrower_debarments.inc %] + [% INCLUDE "patron-restrictions-tab.inc" %]
    [% IF ( holds_count ) %] --