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

(-)a/Koha/Template/Plugin/Borrowers.pm (+41 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Borrowers;
2
3
# Copyright ByWater Solutions 2013
4
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use base qw( Template::Plugin );
23
24
use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
25
26
use C4::Koha;
27
28
sub IsDebarred {
29
    my ( $self, $borrower ) = @_;
30
31
    if ( $borrower->{'debarred'} && check_date( split( /-/, $borrower->{'debarred'} ) ) ) {
32
        if ( Date_to_Days(Date::Calc::Today) < Date_to_Days( split( /-/, $borrower->{'debarred'} ) ) ) {
33
            warn "TEST1";
34
            return 1;
35
        }
36
    }
37
38
    return 0;
39
}
40
41
1;
(-)a/circ/returns.pl (-1 / +2 lines)
Lines 268-274 if ($barcode) { Link Here
268
        itemtype         => $biblio->{'itemtype'},
268
        itemtype         => $biblio->{'itemtype'},
269
        ccode            => $biblio->{'ccode'},
269
        ccode            => $biblio->{'ccode'},
270
        itembiblionumber => $biblio->{'biblionumber'},    
270
        itembiblionumber => $biblio->{'biblionumber'},    
271
	additional_materials => $biblio->{'materials'}
271
	additional_materials => $biblio->{'materials'},
272
        borrower         => $borrower,
272
    );
273
    );
273
274
274
    my %input = (
275
    my %input = (
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +12 lines)
Lines 1-6 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE KohaBranchName %]
2
[% USE KohaBranchName %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Borrowers %]
4
5
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
7
<title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
Lines 102-107 $(document).ready(function () { Link Here
102
    </div>
103
    </div>
103
[% END %]
104
[% END %]
104
105
106
<!-- Patron is restricted and checkin was backdated -->
107
[% IF return_date_override && Borrowers.IsDebarred( borrower ) %]
108
    <div id="restricted_backdated" class="dialog message">
109
        <h3>
110
            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">
111
                [% borrower.firstname %] [% borrower.surname %] 
112
            </a>
113
            is retricted. Please verify this patron should still be restricted.
114
        </h3>
115
    </div>
116
[% END %]
105
117
106
[% IF ( wrongbranch ) %]
118
[% IF ( wrongbranch ) %]
107
<div class="dialog alert"><h3>Cannot check in</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
119
<div class="dialog alert"><h3>Cannot check in</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
108
- 

Return to bug 10694