View | Details | Raw Unified | Return to bug 31095
Collapse All | Expand All

(-)a/circ/circulation.pl (-4 / +2 lines)
Lines 44-50 use CGI::Session; Link Here
44
use Koha::AuthorisedValues;
44
use Koha::AuthorisedValues;
45
use Koha::CsvProfiles;
45
use Koha::CsvProfiles;
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::Patron::Debarments qw( GetDebarments );
48
use Koha::DateUtils qw( dt_from_string );
47
use Koha::DateUtils qw( dt_from_string );
49
use Koha::Patron::Restriction::Types;
48
use Koha::Patron::Restriction::Types;
50
use Koha::Plugins;
49
use Koha::Plugins;
Lines 625-634 my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => Link Here
625
$template->param(
624
$template->param(
626
    debt_confirmed            => $debt_confirmed,
625
    debt_confirmed            => $debt_confirmed,
627
    SpecifyDueDate            => $duedatespec_allow,
626
    SpecifyDueDate            => $duedatespec_allow,
628
    PatronAutoComplete      => C4::Context->preference("PatronAutoComplete"),
627
    PatronAutoComplete        => C4::Context->preference("PatronAutoComplete"),
629
    debarments                => scalar GetDebarments({ borrowernumber => $borrowernumber }),
630
    todaysdate                => dt_from_string()->set(hour => 23)->set(minute => 59),
628
    todaysdate                => dt_from_string()->set(hour => 23)->set(minute => 59),
631
    restriction_types         => scalar Koha::Patron::Restriction::Types->keyed_on_code(),
629
    restriction_types         => scalar Koha::Patron::Restriction::Types->search(),
632
    has_modifications         => $has_modifications,
630
    has_modifications         => $has_modifications,
633
    override_high_holds       => $override_high_holds,
631
    override_high_holds       => $override_high_holds,
634
    nopermission              => scalar $query->param('nopermission'),
632
    nopermission              => scalar $query->param('nopermission'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc (+81 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Koha %]
3
[% PROCESS 'restriction-types.inc' %]
4
<div id="reldebarments">
5
    [% IF ( patron.restrictions.count == 0 ) %]
6
        <p>Patron is currently unrestricted.</p>
7
    [% ELSE %]
8
        <table>
9
            <thead>
10
                <tr>
11
                     <th>Type</th>
12
                     <th>Comment</th>
13
                     <th>Expiration</th>
14
                     <th>Created</th>
15
                     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
16
                         <th>&nbsp;</th>
17
                     [% END %]
18
                </tr>
19
            </thead>
20
            <tbody>
21
                [% FOREACH restriction IN patron.restrictions %]
22
                    <tr>
23
                        <td>
24
                            [% PROCESS restriction_type_description restriction_type=restriction.type %]
25
                        </td>
26
                        <td>
27
                            [% IF restriction.comment.search('OVERDUES_PROCESS') %]
28
                                <span>Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %]</span>
29
                            [% ELSE %]
30
                                [% restriction.comment | $raw %]
31
                            [% END %]
32
                        </td>
33
                        <td>[% IF restriction.expiration %] [% restriction.expiration | $KohaDates %] [% ELSE %] <em>Indefinite</em> [% END %]</td>
34
                        <td>[% restriction.created | $KohaDates %]</td>
35
                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
36
                            <td>
37
                                <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;borrower_debarment_id=[% restriction.borrower_debarment_id | html %]&amp;action=del">
38
                                    <i class="fa fa-trash"></i> Remove
39
                                </a>
40
                            </td>
41
                        [% END %]
42
                    </tr>
43
                [% END %]
44
            </tbody>
45
        </table>
46
    [% END %]
47
    [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
48
        <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
49
        <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
50
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
51
            <input type="hidden" name="action" value="add" />
52
            <fieldset class="rows" id="manual_restriction_form">
53
                <legend>Add manual restriction</legend>
54
                <ol>
55
                    [% IF Koha.Preference('PatronRestrictionTypes') %]
56
                    <li>
57
                        <label for="debarred_type">Type:</label>
58
                        <select name="debarred_type">
59
                            [% FOREACH restriction_type IN restriction_types %]
60
                                [% IF !restriction_type.is_system %]
61
                                   [% IF restriction_type.is_default %]
62
                                   <option value="[% code | html %]" selected>[% PROCESS restriction_type_description %]</option>
63
                                   [% ELSE %]
64
                                   <option value="[% code | html %]">[% PROCESS restriction_type_description %]</option>
65
                                   [% END %]
66
                                [% END %]
67
                            [% END %]
68
                        </select>
69
                    </li>
70
                    [% END %]
71
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
72
                    <li>
73
                        <label for="rexpiration">Expiration:</label>
74
                        <input name="expiration" id="rexpiration" size="20" value="" class="flatpickr" data-flatpickr-futuredate="true" type="text" />
75
                    </li>
76
                </ol>
77
            <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
78
            </fieldset>
79
        </form>
80
    [% END %]
81
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/restriction-types.inc (+10 lines)
Line 0 Link Here
1
[%- BLOCK restriction_type_description -%]
2
    [%- ddisplay = restriction_type.display_text -%]
3
    [%- SWITCH ddisplay -%]
4
        [%- CASE 'Manual' -%]<span>Manual</span>
5
        [%- CASE 'Overdues' -%]<span>Overdues</span>
6
        [%- CASE 'Suspension' -%]<span>Suspension</span>
7
        [%- CASE 'Discharge' -%]<span>Discharge</span>
8
        [%- CASE -%]<span>[% ddisplay | html %]</span>
9
    [%- END -%]
10
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-3 / +2 lines)
Lines 869-875 Link Here
869
                        [% END %]
869
                        [% END %]
870
870
871
                        <li>
871
                        <li>
872
                            <a id="debarments-tab-link" href="#reldebarments">Restrictions ([% debarments.size || 0 | html %])</a>
872
                            <a id="debarments-tab-link" href="#reldebarments">Restrictions ([% patron.restrictions.count || 0 | html %])</a>
873
                        </li>
873
                        </li>
874
874
875
                        [% SET enrollments = patron.get_club_enrollments %]
875
                        [% SET enrollments = patron.get_club_enrollments %]
Lines 895-901 Link Here
895
                        </div> <!-- /#clubs-tab -->
895
                        </div> <!-- /#clubs-tab -->
896
                    [% END %]
896
                    [% END %]
897
897
898
                    [% INCLUDE borrower_debarments.inc %]
898
                    [% INCLUDE "patron-restrictions-tab.inc" %]
899
899
900
                    <div id="reserves">
900
                    <div id="reserves">
901
                        [% IF ( holds_count ) %]
901
                        [% IF ( holds_count ) %]
902
- 

Return to bug 31095