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

(-)a/circ/circulation.pl (-4 / +4 lines)
Lines 261-268 if ($findborrower) { Link Here
261
}
261
}
262
262
263
# get the borrower information.....
263
# get the borrower information.....
264
if ($borrowernumber) {
264
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
265
    $patron = Koha::Patrons->find( $borrowernumber );
265
if ($patron) {
266
    my $overdues = $patron->get_overdues;
266
    my $overdues = $patron->get_overdues;
267
    my $issues = $patron->checkouts;
267
    my $issues = $patron->checkouts;
268
    my $balance = $patron->account->balance;
268
    my $balance = $patron->account->balance;
Lines 442-449 if (@$barcodes) { Link Here
442
##################################################################################
442
##################################################################################
443
# BUILD HTML
443
# BUILD HTML
444
# show all reserves of this borrower, and the position of the reservation ....
444
# show all reserves of this borrower, and the position of the reservation ....
445
if ($borrowernumber) {
445
if ($patron) {
446
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } );
446
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
447
    my $waiting_holds = $holds->waiting;
447
    my $waiting_holds = $holds->waiting;
448
    $template->param(
448
    $template->param(
449
        holds_count  => $holds->count(),
449
        holds_count  => $holds->count(),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt (-6 / +2 lines)
Lines 3-13 Link Here
3
[% USE Branches %]
3
[% USE Branches %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo;
5
<title>Koha &rsaquo; Patrons &rsaquo;
6
[% IF ( unknowuser ) %]
6
Statistics for [% INCLUDE 'patron-title.inc' %]
7
    Patron does not exist
8
[% ELSE %]
9
    Statistics for [% INCLUDE 'patron-title.inc' %]
10
[% END %]
11
</title>
7
</title>
12
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
13
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
Lines 30-36 Link Here
30
<div id="breadcrumbs">
26
<div id="breadcrumbs">
31
         <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27
         <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32
&rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
28
&rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
33
&rsaquo; [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Statistics for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
29
&rsaquo; Statistics for [% firstname %] [% surname %] ([% cardnumber %])
34
</div>
30
</div>
35
31
36
<div id="doc3" class="yui-t1">
32
<div id="doc3" class="yui-t1">
(-)a/members/boraccount.pl (+4 lines)
Lines 54-59 my $action = $input->param('action') || ''; Link Here
54
54
55
#get patron details
55
#get patron details
56
my $patron = Koha::Patrons->find( $borrowernumber );
56
my $patron = Koha::Patrons->find( $borrowernumber );
57
unless ( $patron ) {
58
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
59
    exit;
60
}
57
61
58
if ( $action eq 'reverse' ) {
62
if ( $action eq 'reverse' ) {
59
  ReversePayment( $input->param('accountlines_id') );
63
  ReversePayment( $input->param('accountlines_id') );
(-)a/members/deletemem.pl (+4 lines)
Lines 75-80 my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, Link Here
75
my $countissues = scalar(@$issues);
75
my $countissues = scalar(@$issues);
76
76
77
my $patron = Koha::Patrons->find( $member );
77
my $patron = Koha::Patrons->find( $member );
78
unless ( $patron ) {
79
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
80
    exit;
81
}
78
my $flags = C4::Members::patronflags( $patron->unblessed );
82
my $flags = C4::Members::patronflags( $patron->unblessed );
79
my $userenv = C4::Context->userenv;
83
my $userenv = C4::Context->userenv;
80
84
(-)a/members/discharge.pl (-71 / +72 lines)
Lines 58-142 unless ( C4::Context->preference('useDischarge') ) { Link Here
58
   exit;
58
   exit;
59
}
59
}
60
60
61
if ( $input->param('borrowernumber') ) {
61
$borrowernumber = $input->param('borrowernumber');
62
    $borrowernumber = $input->param('borrowernumber');
63
62
64
    # Getting member data
63
my $patron = Koha::Patrons->find( $borrowernumber );
65
    my $patron = Koha::Patrons->find( $borrowernumber );
64
unless ( $patron ) {
65
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
66
    exit;
67
}
66
68
67
    my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({
69
my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({
68
        borrowernumber => $borrowernumber
70
    borrowernumber => $borrowernumber
69
    });
71
});
70
72
71
    my $holds = $patron->holds;
73
my $holds = $patron->holds;
72
    my $has_reserves = $holds->count;
74
my $has_reserves = $holds->count;
73
75
74
    # Generating discharge if needed
76
# Generating discharge if needed
75
    if ( $input->param('discharge') and $can_be_discharged ) {
77
if ( $input->param('discharge') and $can_be_discharged ) {
76
        my $is_discharged = Koha::Patron::Discharge::is_discharged({
78
    my $is_discharged = Koha::Patron::Discharge::is_discharged({
77
            borrowernumber => $borrowernumber,
79
        borrowernumber => $borrowernumber,
80
    });
81
    unless ($is_discharged) {
82
        Koha::Patron::Discharge::discharge({
83
            borrowernumber => $borrowernumber
78
        });
84
        });
79
        unless ($is_discharged) {
80
            Koha::Patron::Discharge::discharge({
81
                borrowernumber => $borrowernumber
82
            });
83
        }
84
        eval {
85
            my $pdf_path = Koha::Patron::Discharge::generate_as_pdf(
86
                { borrowernumber => $borrowernumber, branchcode => $patron->branchcode } );
87
88
            binmode(STDOUT);
89
            print $input->header(
90
                -type       => 'application/pdf',
91
                -charset    => 'utf-8',
92
                -attachment => "discharge_$borrowernumber.pdf",
93
            );
94
            open my $fh, '<', $pdf_path;
95
            my @lines = <$fh>;
96
            close $fh;
97
            print @lines;
98
            exit;
99
        };
100
        if ( $@ ) {
101
            carp $@;
102
            $template->param( messages => [ {type => 'error', code => 'unable_to_generate_pdf'} ] );
103
        }
104
    }
85
    }
86
    eval {
87
        my $pdf_path = Koha::Patron::Discharge::generate_as_pdf(
88
            { borrowernumber => $borrowernumber, branchcode => $patron->branchcode } );
89
90
        binmode(STDOUT);
91
        print $input->header(
92
            -type       => 'application/pdf',
93
            -charset    => 'utf-8',
94
            -attachment => "discharge_$borrowernumber.pdf",
95
        );
96
        open my $fh, '<', $pdf_path;
97
        my @lines = <$fh>;
98
        close $fh;
99
        print @lines;
100
        exit;
101
    };
102
    if ( $@ ) {
103
        carp $@;
104
        $template->param( messages => [ {type => 'error', code => 'unable_to_generate_pdf'} ] );
105
    }
106
}
105
107
106
    # Already generated discharges
108
# Already generated discharges
107
    my $validated_discharges = Koha::Patron::Discharge::get_validated({
109
my $validated_discharges = Koha::Patron::Discharge::get_validated({
108
        borrowernumber => $borrowernumber,
110
    borrowernumber => $borrowernumber,
109
    });
111
});
110
112
111
    $template->param( picture => 1 ) if $patron->image;
113
$template->param( picture => 1 ) if $patron->image;
112
114
113
    $template->param(
115
$template->param(
114
        # FIXME The patron object should be passed to the template
116
    # FIXME The patron object should be passed to the template
115
        borrowernumber    => $borrowernumber,
117
    borrowernumber    => $borrowernumber,
116
        title             => $patron->title,
118
    title             => $patron->title,
117
        initials          => $patron->initials,
119
    initials          => $patron->initials,
118
        surname           => $patron->surname,
120
    surname           => $patron->surname,
119
        borrowernumber    => $borrowernumber,
121
    borrowernumber    => $borrowernumber,
120
        firstname         => $patron->firstname,
122
    firstname         => $patron->firstname,
121
        cardnumber        => $patron->cardnumber,
123
    cardnumber        => $patron->cardnumber,
122
        categorycode      => $patron->categorycode,
124
    categorycode      => $patron->categorycode,
123
        category_type     => $patron->category->category_type,
125
    category_type     => $patron->category->category_type,
124
        categoryname      => $patron->category->description,
126
    categoryname      => $patron->category->description,
125
        address           => $patron->address,
127
    address           => $patron->address,
126
        streetnumber      => $patron->streetnumber,
128
    streetnumber      => $patron->streetnumber,
127
        streettype        => $patron->streettype,
129
    streettype        => $patron->streettype,
128
        address2          => $patron->address2,
130
    address2          => $patron->address2,
129
        city              => $patron->city,
131
    city              => $patron->city,
130
        zipcode           => $patron->zipcode,
132
    zipcode           => $patron->zipcode,
131
        country           => $patron->country,
133
    country           => $patron->country,
132
        phone             => $patron->phone,
134
    phone             => $patron->phone,
133
        email             => $patron->email,
135
    email             => $patron->email,
134
        branchcode        => $patron->branchcode,
136
    branchcode        => $patron->branchcode,
135
        has_reserves      => $has_reserves,
137
    has_reserves      => $has_reserves,
136
        can_be_discharged => $can_be_discharged,
138
    can_be_discharged => $can_be_discharged,
137
        validated_discharges => $validated_discharges,
139
    validated_discharges => $validated_discharges,
138
    );
140
);
139
}
140
141
141
$template->param( dischargeview => 1, );
142
$template->param( dischargeview => 1, );
142
143
(-)a/members/files.pl (+5 lines)
Lines 64-69 if ( $op eq 'download' ) { Link Here
64
}
64
}
65
else {
65
else {
66
    my $patron = Koha::Patrons->find( $borrowernumber );
66
    my $patron = Koha::Patrons->find( $borrowernumber );
67
    unless ( $patron ) {
68
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
69
        exit;
70
    }
71
67
    my $patron_category = $patron->category;
72
    my $patron_category = $patron->category;
68
    $template->param(%{ $patron->unblessed});
73
    $template->param(%{ $patron->unblessed});
69
74
(-)a/members/mancredit.pl (+4 lines)
Lines 43-48 my $flagsrequired = { borrowers => 1, updatecharges => 1 }; Link Here
43
my $borrowernumber=$input->param('borrowernumber');
43
my $borrowernumber=$input->param('borrowernumber');
44
44
45
my $patron = Koha::Patrons->find( $borrowernumber );
45
my $patron = Koha::Patrons->find( $borrowernumber );
46
unless ( $patron ) {
47
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
48
    exit;
49
}
46
my $add=$input->param('add');
50
my $add=$input->param('add');
47
51
48
if ($add){
52
if ($add){
(-)a/members/maninvoice.pl (+5 lines)
Lines 43-48 my $flagsrequired = { borrowers => 1 }; Link Here
43
my $borrowernumber=$input->param('borrowernumber');
43
my $borrowernumber=$input->param('borrowernumber');
44
44
45
my $patron = Koha::Patrons->find( $borrowernumber );
45
my $patron = Koha::Patrons->find( $borrowernumber );
46
unless ( $patron ) {
47
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
48
    exit;
49
}
50
46
my $add=$input->param('add');
51
my $add=$input->param('add');
47
if ($add){
52
if ($add){
48
    if ( checkauth( $input, 0, $flagsrequired, 'intranet' ) ) {
53
    if ( checkauth( $input, 0, $flagsrequired, 'intranet' ) ) {
(-)a/members/member-flags.pl (+5 lines)
Lines 27-32 my $input = new CGI; Link Here
27
my $flagsrequired = { permissions => 1 };
27
my $flagsrequired = { permissions => 1 };
28
my $member=$input->param('member');
28
my $member=$input->param('member');
29
my $patron = Koha::Patrons->find( $member );
29
my $patron = Koha::Patrons->find( $member );
30
unless ( $patron ) {
31
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
32
    exit;
33
}
34
30
my $category_type = $patron->category->category_type;
35
my $category_type = $patron->category->category_type;
31
my $bor = $patron->unblessed;
36
my $bor = $patron->unblessed;
32
if( $category_type eq 'S' )  {
37
if( $category_type eq 'S' )  {
(-)a/members/member-password.pl (+5 lines)
Lines 49-54 my $newpassword2 = $input->param('newpassword2'); Link Here
49
my @errors;
49
my @errors;
50
50
51
my $patron = Koha::Patrons->find( $member );
51
my $patron = Koha::Patrons->find( $member );
52
unless ( $patron ) {
53
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
54
    exit;
55
}
56
52
my $category_type = $patron->category->category_type;
57
my $category_type = $patron->category->category_type;
53
my $bor = $patron->unblessed;
58
my $bor = $patron->unblessed;
54
59
(-)a/members/member.pl (+4 lines)
Lines 53-58 if ( $quicksearch and $searchmember ) { Link Here
53
        $branchcode = $userenv->{'branch'};
53
        $branchcode = $userenv->{'branch'};
54
    }
54
    }
55
    my $patron = Koha::Patrons->find( { cardnumber => $searchmember } );
55
    my $patron = Koha::Patrons->find( { cardnumber => $searchmember } );
56
    unless ( $patron ) {
57
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
58
        exit;
59
    }
56
    if( ( $branchcode and $patron->branchcode eq $branchcode ) or ( not $branchcode and $patron ) ){
60
    if( ( $branchcode and $patron->branchcode eq $branchcode ) or ( not $branchcode and $patron ) ){
57
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=" . $patron->borrowernumber);
61
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=" . $patron->borrowernumber);
58
        exit;
62
        exit;
(-)a/members/memberentry.pl (+5 lines)
Lines 155-160 $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); Link Here
155
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
155
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
156
if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) {
156
if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) {
157
    my $patron = Koha::Patrons->find( $borrowernumber );
157
    my $patron = Koha::Patrons->find( $borrowernumber );
158
    unless ( $patron ) {
159
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
160
        exit;
161
    }
162
158
    $borrower_data = $patron->unblessed;
163
    $borrower_data = $patron->unblessed;
159
    $borrower_data->{category_type} = $patron->category->category_type;
164
    $borrower_data->{category_type} = $patron->category->category_type;
160
}
165
}
(-)a/members/notices.pl (+4 lines)
Lines 34-39 my $input=new CGI; Link Here
34
34
35
my $borrowernumber = $input->param('borrowernumber');
35
my $borrowernumber = $input->param('borrowernumber');
36
my $patron = Koha::Patrons->find( $borrowernumber );
36
my $patron = Koha::Patrons->find( $borrowernumber );
37
unless ( $patron ) {
38
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
39
    exit;
40
}
37
my $borrower = $patron->unblessed;
41
my $borrower = $patron->unblessed;
38
42
39
my ($template, $loggedinuser, $cookie)
43
my ($template, $loggedinuser, $cookie)
(-)a/members/pay.pl (+4 lines)
Lines 68-73 if ( !$borrowernumber ) { Link Here
68
68
69
# get borrower details
69
# get borrower details
70
my $patron = Koha::Patrons->find( $borrowernumber );
70
my $patron = Koha::Patrons->find( $borrowernumber );
71
unless ( $patron ) {
72
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
73
    exit;
74
}
71
my $category = $patron->category;
75
my $category = $patron->category;
72
our $borrower = $patron->unblessed;
76
our $borrower = $patron->unblessed;
73
$borrower->{description} = $category->description;
77
$borrower->{description} = $category->description;
(-)a/members/paycollect.pl (+4 lines)
Lines 50-55 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
50
# get borrower details
50
# get borrower details
51
my $borrowernumber = $input->param('borrowernumber');
51
my $borrowernumber = $input->param('borrowernumber');
52
my $patron         = Koha::Patrons->find( $borrowernumber );
52
my $patron         = Koha::Patrons->find( $borrowernumber );
53
unless ( $patron ) {
54
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
55
    exit;
56
}
53
my $borrower       = $patron->unblessed;
57
my $borrower       = $patron->unblessed;
54
my $category       = $patron->category;
58
my $category       = $patron->category;
55
$borrower->{description} = $category->description;
59
$borrower->{description} = $category->description;
(-)a/members/printfeercpt.pl (+4 lines)
Lines 51-56 my $action = $input->param('action') || ''; Link Here
51
my $accountlines_id = $input->param('accountlines_id');
51
my $accountlines_id = $input->param('accountlines_id');
52
52
53
my $patron = Koha::Patrons->find( $borrowernumber );
53
my $patron = Koha::Patrons->find( $borrowernumber );
54
unless ( $patron ) {
55
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
56
    exit;
57
}
54
my $category = $patron->category;
58
my $category = $patron->category;
55
my $data = $patron->unblessed;
59
my $data = $patron->unblessed;
56
$data->{description} = $category->description;
60
$data->{description} = $category->description;
(-)a/members/printinvoice.pl (+4 lines)
Lines 50-55 my $action = $input->param('action') || ''; Link Here
50
my $accountlines_id = $input->param('accountlines_id');
50
my $accountlines_id = $input->param('accountlines_id');
51
51
52
my $patron = Koha::Patrons->find( $borrowernumber );
52
my $patron = Koha::Patrons->find( $borrowernumber );
53
unless ( $patron ) {
54
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
55
    exit;
56
}
53
my $category = $patron->category;
57
my $category = $patron->category;
54
my $data = $patron->unblessed;
58
my $data = $patron->unblessed;
55
$data->{description} = $category->description;
59
$data->{description} = $category->description;
(-)a/members/purchase-suggestions.pl (-1 / +4 lines)
Lines 42-49 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
42
42
43
my $borrowernumber = $input->param('borrowernumber');
43
my $borrowernumber = $input->param('borrowernumber');
44
44
45
# Set informations for the patron
46
my $patron = Koha::Patrons->find( $borrowernumber );
45
my $patron = Koha::Patrons->find( $borrowernumber );
46
unless ( $patron ) {
47
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
48
    exit;
49
}
47
my $category = $patron->category;
50
my $category = $patron->category;
48
my $data = $patron->unblessed;
51
my $data = $patron->unblessed;
49
$data->{description} = $category->description;
52
$data->{description} = $category->description;
(-)a/members/readingrec.pl (-3 / +7 lines)
Lines 55-69 my $patron; Link Here
55
if ($input->param('cardnumber')) {
55
if ($input->param('cardnumber')) {
56
    $cardnumber = $input->param('cardnumber');
56
    $cardnumber = $input->param('cardnumber');
57
    $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
57
    $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
58
    $data = $patron->unblessed;
59
    $borrowernumber = $data->{'borrowernumber'}; # we must define this as it is used to retrieve other data about the patron
60
}
58
}
61
if ($input->param('borrowernumber')) {
59
if ($input->param('borrowernumber')) {
62
    $borrowernumber = $input->param('borrowernumber');
60
    $borrowernumber = $input->param('borrowernumber');
63
    $patron = Koha::Patrons->find( $borrowernumber );
61
    $patron = Koha::Patrons->find( $borrowernumber );
64
    $data = $patron->unblessed;
65
}
62
}
66
63
64
unless ( $patron ) {
65
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
66
    exit;
67
}
68
$data = $patron->unblessed;
69
$borrowernumber = $patron->borrowernumber;
70
67
my $order = 'date_due desc';
71
my $order = 'date_due desc';
68
my $limit = 0;
72
my $limit = 0;
69
my $issues = ();
73
my $issues = ();
(-)a/members/routing-lists.pl (-28 / +29 lines)
Lines 48-84 my $borrowernumber = $query->param('borrowernumber'); Link Here
48
48
49
my $branch = C4::Context->userenv->{'branch'};
49
my $branch = C4::Context->userenv->{'branch'};
50
50
51
# get the borrower information.....
51
my $patron = Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
52
my ( $patron, $patron_info );
52
unless ( $patron ) {
53
if ($borrowernumber) {
53
    print $query->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
54
    $patron = Koha::Patrons->find( $borrowernumber );
54
    exit;
55
    my $category = $patron->category;
55
}
56
    $patron_info = $patron->unblessed;
57
    $patron_info->{description} = $category->description;
58
    $patron_info->{category_type} = $category->category_type;
59
60
  my $count;
61
  my @borrowerSubscriptions;
62
  ($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber );
63
  my @subscripLoop;
64
65
    foreach my $num_res (@borrowerSubscriptions) {
66
        my %getSubscrip;
67
        $getSubscrip{subscriptionid}	= $num_res->{'subscriptionid'};
68
        $getSubscrip{title}			= $num_res->{'title'};
69
        $getSubscrip{borrowernumber}		= $num_res->{'borrowernumber'};
70
        push( @subscripLoop, \%getSubscrip );
71
    }
72
73
    $template->param(
74
        countSubscrip => scalar @subscripLoop,
75
        subscripLoop  => \@subscripLoop,
76
        routinglistview => 1
77
    );
78
56
79
    $template->param( adultborrower => 1 ) if ( $patron_info->{category_type} =~ /^(A|I)$/ );
57
my $category = $patron->category;
58
my $patron_info = $patron->unblessed;
59
$patron_info->{description} = $category->description;
60
$patron_info->{category_type} = $category->category_type;
61
62
my $count;
63
my @borrowerSubscriptions;
64
($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber );
65
my @subscripLoop;
66
67
foreach my $num_res (@borrowerSubscriptions) {
68
    my %getSubscrip;
69
    $getSubscrip{subscriptionid}	= $num_res->{'subscriptionid'};
70
    $getSubscrip{title}			= $num_res->{'title'};
71
    $getSubscrip{borrowernumber}		= $num_res->{'borrowernumber'};
72
    push( @subscripLoop, \%getSubscrip );
80
}
73
}
81
74
75
$template->param(
76
    countSubscrip => scalar @subscripLoop,
77
    subscripLoop  => \@subscripLoop,
78
    routinglistview => 1
79
);
80
81
$template->param( adultborrower => 1 ) if ( $patron_info->{category_type} =~ /^(A|I)$/ );
82
82
##################################################################################
83
##################################################################################
83
84
84
$template->param(%$patron_info);
85
$template->param(%$patron_info);
(-)a/members/statistics.pl (-2 / +1 lines)
Lines 50-57 my $borrowernumber = $input->param('borrowernumber'); Link Here
50
# Set informations for the patron
50
# Set informations for the patron
51
my $patron = Koha::Patrons->find( $borrowernumber );
51
my $patron = Koha::Patrons->find( $borrowernumber );
52
unless ( $patron ) {
52
unless ( $patron ) {
53
    $template->param (unknowuser => 1);
53
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
54
    output_html_with_http_headers $input, $cookie, $template->output;
55
    exit;
54
    exit;
56
}
55
}
57
56
(-)a/members/summary-print.pl (+4 lines)
Lines 44-49 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
44
);
44
);
45
45
46
my $patron = Koha::Patrons->find( $borrowernumber );
46
my $patron = Koha::Patrons->find( $borrowernumber );
47
unless ( $patron ) {
48
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
49
    exit;
50
}
47
my $category = $patron->category;
51
my $category = $patron->category;
48
my $data = $patron->unblessed;
52
my $data = $patron->unblessed;
49
$data->{description} = $category->description;
53
$data->{description} = $category->description;
(-)a/members/update-child.pl (+4 lines)
Lines 73-78 if ( $op eq 'multi' ) { Link Here
73
73
74
elsif ( $op eq 'update' ) {
74
elsif ( $op eq 'update' ) {
75
    my $patron = Koha::Patrons->find( $borrowernumber );
75
    my $patron = Koha::Patrons->find( $borrowernumber );
76
    unless ( $patron ) {
77
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
78
        exit;
79
    }
76
    my $member = $patron->unblessed;
80
    my $member = $patron->unblessed;
77
    $member->{'guarantorid'}  = 0;
81
    $member->{'guarantorid'}  = 0;
78
    $member->{'categorycode'} = $catcode;
82
    $member->{'categorycode'} = $catcode;
(-)a/tools/viewlog.pl (-1 / +4 lines)
Lines 74-79 if ( $src eq 'circ' ) { Link Here
74
    use C4::Members::Attributes qw(GetBorrowerAttributes);
74
    use C4::Members::Attributes qw(GetBorrowerAttributes);
75
    my $borrowernumber = $object;
75
    my $borrowernumber = $object;
76
    my $patron = Koha::Patrons->find( $borrowernumber );
76
    my $patron = Koha::Patrons->find( $borrowernumber );
77
    unless ( $patron ) {
78
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
79
        exit;
80
    }
77
    $template->param( picture => 1 ) if $patron->image;
81
    $template->param( picture => 1 ) if $patron->image;
78
    my $data = $patron->unblessed;
82
    my $data = $patron->unblessed;
79
83
80
- 

Return to bug 19080