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

(-)a/C4/Letters.pm (-12 / +13 lines)
Lines 760-777 sub _parseletter_sth { Link Here
760
    #       broke things for the rest of us. prepare_cached is a better
760
    #       broke things for the rest of us. prepare_cached is a better
761
    #       way to cache statement handles anyway.
761
    #       way to cache statement handles anyway.
762
    my $query = 
762
    my $query = 
763
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
763
    ($table eq 'biblio'       )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
764
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
764
    ($table eq 'biblioitems'  )    ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
765
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
765
    ($table eq 'items'        )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
766
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
766
    ($table eq 'issues'       )    ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
767
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
767
    ($table eq 'old_issues'   )    ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
768
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"             :
768
    ($table eq 'reserves'     )    ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"             :
769
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                  :
769
    ($table eq 'borrowers'    )    ? "SELECT * FROM $table WHERE borrowernumber = ?"                                  :
770
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                  :
770
    ($table eq 'branches'     )    ? "SELECT * FROM $table WHERE     branchcode = ?"                                  :
771
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                  :
771
    ($table eq 'suggestions'  )    ? "SELECT * FROM $table WHERE   suggestionid = ?"                                  :
772
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                  :
772
    ($table eq 'aqbooksellers')    ? "SELECT * FROM $table WHERE             id = ?"                                  :
773
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
773
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
774
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
774
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
775
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
775
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
776
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
776
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
777
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
777
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
778
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
(-)a/Koha/ArticleRequest.pm (+223 lines)
Line 0 Link Here
1
package Koha::ArticleRequest;
2
3
# Copyright ByWater Solutions 2015
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 3 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 Carp;
23
24
use Koha::Database;
25
use Koha::Borrowers;
26
use Koha::Biblios;
27
use Koha::Items;
28
use Koha::Branches;
29
use Koha::ArticleRequest::Status;
30
use Koha::DateUtils qw(dt_from_string);
31
32
use base qw(Koha::Object);
33
34
=head1 NAME
35
36
Koha::ArticleRequest - Koha Article Request Object class
37
38
=head1 API
39
40
=head2 Class Methods
41
42
=cut
43
44
=head3 open
45
46
=cut
47
48
sub open {
49
    my ($self) = @_;
50
51
    $self->status(Koha::ArticleRequest::Status::Open);
52
    $self->notify();
53
    return $self;
54
}
55
56
=head3 process
57
58
=cut
59
60
sub process {
61
    my ($self) = @_;
62
63
    $self->status(Koha::ArticleRequest::Status::Processing);
64
    $self->store();
65
    $self->notify();
66
    return $self;
67
}
68
69
=head3 complete
70
71
=cut
72
73
sub complete {
74
    my ($self) = @_;
75
76
    $self->status(Koha::ArticleRequest::Status::Completed);
77
    $self->store();
78
    $self->notify();
79
    return $self;
80
}
81
82
=head3 cancel
83
84
=cut
85
86
sub cancel {
87
    my ( $self, $notes ) = @_;
88
89
    $self->status(Koha::ArticleRequest::Status::Canceled);
90
    $self->notes($notes) if $notes;
91
    $self->store();
92
    $self->notify();
93
    return $self;
94
}
95
96
=head3 notify
97
98
=cut
99
100
sub notify {
101
    my ($self) = @_;
102
103
    my $status = $self->status;
104
105
    if (
106
        my $letter = C4::Letters::GetPreparedLetter(
107
            module                 => 'circulation',
108
            letter_code            => "AR_$status",
109
            message_transport_type => 'email',
110
            tables                 => {
111
                article_requests => $self->id,
112
                borrowers        => $self->borrowernumber,
113
                biblio           => $self->biblionumber,
114
                biblioitems      => $self->biblionumber,
115
                items            => $self->itemnumber,
116
                branches         => $self->branchcode,
117
            },
118
        )
119
      )
120
    {
121
        C4::Letters::EnqueueLetter(
122
            {
123
                letter                 => $letter,
124
                borrowernumber         => $self->borrowernumber,
125
                message_transport_type => 'email',
126
            }
127
        ) or warn "can't enqueue letter $letter";
128
    }
129
}
130
131
=head3 biblio
132
133
Returns the Koha::Biblio object for this article request
134
135
=cut
136
137
sub biblio {
138
    my ($self) = @_;
139
140
    $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );
141
142
    return $self->{_biblio};
143
}
144
145
=head3 item
146
147
Returns the Koha::Item object for this article request
148
149
=cut
150
151
sub item {
152
    my ($self) = @_;
153
154
    $self->{_item} ||= Koha::Items->find( $self->itemnumber() );
155
156
    return $self->{_item};
157
}
158
159
=head3 borrower
160
161
Returns the Koha::Borrower object for this article request
162
163
=cut
164
165
sub borrower {
166
    my ($self) = @_;
167
168
    $self->{_borrower} ||= Koha::Borrowers->find( $self->borrowernumber() );
169
170
    return $self->{_borrower};
171
}
172
173
=head3 branch
174
175
Returns the Koha::Branch object for this article request
176
177
=cut
178
179
sub branch {
180
    my ($self) = @_;
181
182
    $self->{_branch} ||= Koha::Branches->find( $self->branchcode() );
183
184
    return $self->{_branch};
185
}
186
187
=head3 store
188
189
Override the default store behavior so that new opan requests
190
will have notifications sent.
191
192
=cut
193
194
sub store {
195
    my ($self) = @_;
196
197
    if ( $self->in_storage() ) {
198
        my $now = dt_from_string();
199
        $self->updated_on($now);
200
201
        return $self->SUPER::store();
202
    }
203
    else {
204
        $self->open();
205
        return $self->SUPER::store();
206
    }
207
}
208
209
=head3 type
210
211
=cut
212
213
sub type {
214
    return 'ArticleRequest';
215
}
216
217
=head1 AUTHOR
218
219
Kyle M Hall <kyle@bywatersolutions.com>
220
221
=cut
222
223
1;
(-)a/Koha/ArticleRequest/Status.pm (+44 lines)
Line 0 Link Here
1
package Koha::ArticleRequest::Status;
2
3
# Copyright ByWater Solutions 2015
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 3 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
sub Open {
23
    return 'OPEN';
24
}
25
26
sub Processing {
27
    return 'PROCESSING';
28
}
29
30
sub Completed {
31
    return 'COMPLETED';
32
}
33
34
sub Canceled {
35
    return 'CANCELED';
36
}
37
38
=head1 AUTHOR
39
40
Kyle M Hall <kyle@bywatersolutions.com>
41
42
=cut
43
44
1;
(-)a/Koha/ArticleRequests.pm (+103 lines)
Line 0 Link Here
1
package Koha::ArticleRequests;
2
3
# Copyright ByWater Solutions 2015
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 3 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 Carp;
23
24
use Koha::Database;
25
26
use Koha::ArticleRequest;
27
use Koha::ArticleRequest::Status;
28
29
use base qw(Koha::Objects);
30
31
=head1 NAME
32
33
Koha::ArticleRequests - Koha ArticleRequests Object class
34
35
=head1 API
36
37
=head2 Class Methods
38
39
=cut
40
41
=head3 open
42
43
=cut
44
45
sub open {
46
    my ( $self, $branchcode ) = @_;
47
    my $params = { status => Koha::ArticleRequest::Status::Open };
48
    $params->{branchcode} = $branchcode if $branchcode;
49
    return Koha::ArticleRequests->search( $params );
50
}
51
52
=head3 processing
53
54
=cut
55
56
sub processing {
57
    my ( $self, $branchcode ) = @_;
58
    my $params = { status => Koha::ArticleRequest::Status::Processing };
59
    $params->{branchcode} = $branchcode if $branchcode;
60
    return Koha::ArticleRequests->search( $params );
61
}
62
63
=head3 completed
64
65
=cut
66
67
sub completed {
68
    my ( $self, $branchcode ) = @_;
69
    my $params = { status => Koha::ArticleRequest::Status::Completed };
70
    $params->{branchcode} = $branchcode if $branchcode;
71
    return Koha::ArticleRequests->search( $params );
72
}
73
74
=head3 canceled
75
76
=cut
77
78
sub canceled {
79
    my ( $self, $branchcode ) = @_;
80
    my $params = { status => Koha::ArticleRequest::Status::Canceled };
81
    $params->{branchcode} = $branchcode if $branchcode;
82
    return Koha::ArticleRequests->search( $params );
83
}
84
85
=head3 type
86
87
=cut
88
89
sub type {
90
    return 'ArticleRequest';
91
}
92
93
sub object_class {
94
    return 'Koha::ArticleRequest';
95
}
96
97
=head1 AUTHOR
98
99
Kyle M Hall <kyle@bywatersolutions.com>
100
101
=cut
102
103
1;
(-)a/Koha/Biblio.pm (+174 lines)
Lines 27-32 use Koha::Database; Link Here
27
27
28
use base qw(Koha::Object);
28
use base qw(Koha::Object);
29
29
30
use C4::Circulation qw(GetIssuingRule);
31
use Koha::Items;
32
use Koha::ArticleRequests;
33
use Koha::ArticleRequest::Status;
34
30
=head1 NAME
35
=head1 NAME
31
36
32
Koha::Biblio - Koha Biblio Object class
37
Koha::Biblio - Koha Biblio Object class
Lines 53-58 sub subtitles { Link Here
53
    return map { $_->{subfield} } @{ GetRecordValue( 'subtitle', GetMarcBiblio( $self->id ), $self->frameworkcode ) };
58
    return map { $_->{subfield} } @{ GetRecordValue( 'subtitle', GetMarcBiblio( $self->id ), $self->frameworkcode ) };
54
}
59
}
55
60
61
=head3 can_article_request
62
63
my $bool = $biblio->can_article_request( $borrower );
64
65
Returns true if article requests can be made for this record
66
67
$borrower must be a Koha::Borrower object
68
69
=cut
70
71
sub can_article_request {
72
    my ( $self, $borrower ) = @_;
73
74
    my $rule = $self->article_request_type($borrower);
75
    return q{} if $rule eq 'item_only' && !$self->items()->count();
76
    return 1 if $rule && $rule ne 'no';
77
78
    return q{};
79
}
80
81
=head3 article_request_type
82
83
my $type = $biblio->article_request_type( $borrower );
84
85
Returns the article request type based on items, or on the record
86
itself if there are no items.
87
88
$borrower must be a Koha::Borrower object
89
90
=cut
91
92
sub article_request_type {
93
    my ( $self, $borrower ) = @_;
94
95
    my $rule = $self->article_request_type_for_items( $borrower );
96
    return $rule if $rule;
97
98
    # If the record has no items that are requestable, go by the record itemtype
99
    $rule = $self->article_request_type_for_bib($borrower);
100
    return $rule if $rule;
101
102
    return q{};
103
}
104
105
=head3 article_request_type_for_bib
106
107
my $type = $biblio->article_request_type_for_bib
108
109
Returns the article request type 'yes', 'no', 'item_only', 'bib_only', for the given record
110
111
=cut
112
113
sub article_request_type_for_bib {
114
    my ( $self, $borrower ) = @_;
115
116
    my $borrowertype = $borrower->categorycode;
117
    my $itemtype     = $self->itemtype();
118
    my $rules        = GetIssuingRule( $borrowertype, $itemtype );
119
120
    return $rules->{article_requests} || q{};
121
}
122
123
=head3 article_request_type_for_items
124
125
my $type = $biblio->article_request_type_for_items
126
127
Returns the article request type 'yes', 'no', 'item_only', 'bib_only', for the given record's items
128
129
If there is a conflict where some items are 'bib_only' and some are 'item_only', 'bib_only' will be returned.
130
131
=cut
132
133
sub article_request_type_for_items {
134
    my ( $self, $borrower ) = @_;
135
136
    my $counts;
137
    foreach my $item ( $self->items()->as_list() ) {
138
        my $rule = $item->article_request_type($borrower);
139
        return $rule if $rule eq 'bib_only';    # we don't need to go any further
140
        $counts->{$rule}++;
141
    }
142
143
    return 'item_only' if $counts->{item_only};
144
    return 'yes'       if $counts->{yes};
145
    return 'no'        if $counts->{no};
146
    return q{};
147
}
148
149
=head3 article_requests
150
151
my @requests = $biblio->article_requests
152
153
Returns the article requests associated with this Biblio
154
155
=cut
156
157
sub article_requests {
158
    my ( $self, $borrower ) = @_;
159
160
    $self->{_article_requests} ||= Koha::ArticleRequests->search( { biblionumber => $self->biblionumber() } );
161
162
    return wantarray ? $self->{_article_requests}->as_list : $self->{_article_requests};
163
}
164
165
=head3 article_requests_current
166
167
my @requests = $biblio->article_requests_current
168
169
Returns the article requests associated with this Biblio that are incomplete
170
171
=cut
172
173
sub article_requests_current {
174
    my ( $self, $borrower ) = @_;
175
176
    $self->{_article_requests_current} ||= Koha::ArticleRequests->search(
177
        {
178
            biblionumber => $self->biblionumber(),
179
            -or          => [
180
                { status => Koha::ArticleRequest::Status::Open },
181
                { status => Koha::ArticleRequest::Status::Processing }
182
            ]
183
        }
184
    );
185
186
    return wantarray ? $self->{_article_requests_current}->as_list : $self->{_article_requests_current};
187
}
188
189
=head3 article_requests_finished
190
191
my @requests = $biblio->article_requests_finished
192
193
Returns the article requests associated with this Biblio that are completed
194
195
=cut
196
197
sub article_requests_finished {
198
    my ( $self, $borrower ) = @_;
199
200
    $self->{_article_requests_finished} ||= Koha::ArticleRequests->search(
201
        {
202
            biblionumber => $self->biblionumber(),
203
            -or          => [
204
                { status => Koha::ArticleRequest::Status::Completed },
205
                { status => Koha::ArticleRequest::Status::Canceled }
206
            ]
207
        }
208
    );
209
210
    return wantarray ? $self->{_article_requests_finished}->as_list : $self->{_article_requests_finished};
211
}
212
213
=head3 items
214
215
my @items = $biblio->items();
216
my $items = $biblio->items();
217
218
Returns a list of Koha::Item objects or a Koha::Items object of
219
items associated with this bib
220
221
=cut
222
223
sub items {
224
    my ( $self ) = @_;
225
226
    $self->{_items} ||= Koha::Items->search({ biblionumber => $self->biblionumber() });
227
228
    return $self->{_items};
229
}
56
230
57
=head3 type
231
=head3 type
58
232
(-)a/Koha/Biblios.pm (-1 / +1 lines)
Lines 1-6 Link Here
1
package Koha::Biblios;
1
package Koha::Biblios;
2
2
3
# Copyright ByWater Solutions 2014
3
# Copyright ByWater Solutions 2015
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
(-)a/Koha/Borrower.pm (+70 lines)
Lines 23-28 use Carp; Link Here
23
23
24
use Koha::Database;
24
use Koha::Database;
25
25
26
use Koha::ArticleRequests;
27
use Koha::ArticleRequest::Status;
28
26
use base qw(Koha::Object);
29
use base qw(Koha::Object);
27
30
28
=head1 NAME
31
=head1 NAME
Lines 47-52 sub guarantor { Link Here
47
    return Koha::Borrowers->find( $self->guarantorid() );
50
    return Koha::Borrowers->find( $self->guarantorid() );
48
}
51
}
49
52
53
=head3 article_requests
54
55
my @requests = $borrower->article_requests();
56
my $requests = $borrower->article_requests();
57
58
Returns either a list of ArticleRequests objects,
59
or an ArtitleRequests object, depending on the
60
calling context.
61
62
=cut
63
64
sub article_requests {
65
    my ( $self ) = @_;
66
67
    $self->{_article_requests} ||= Koha::ArticleRequests->search({ borrowernumber => $self->borrowernumber() });
68
69
    return $self->{_article_requests};
70
}
71
72
=head3 article_requests_current
73
74
my @requests = $patron->article_requests_current
75
76
Returns the article requests associated with this patron that are incomplete
77
78
=cut
79
80
sub article_requests_current {
81
    my ( $self ) = @_;
82
83
    $self->{_article_requests_current} ||= Koha::ArticleRequests->search(
84
        {
85
            borrowernumber => $self->id(),
86
            -or          => [
87
                { status => Koha::ArticleRequest::Status::Open },
88
                { status => Koha::ArticleRequest::Status::Processing }
89
            ]
90
        }
91
    );
92
93
    return $self->{_article_requests_current};
94
}
95
96
=head3 article_requests_finished
97
98
my @requests = $biblio->article_requests_finished
99
100
Returns the article requests associated with this patron that are completed
101
102
=cut
103
104
sub article_requests_finished {
105
    my ( $self, $borrower ) = @_;
106
107
    $self->{_article_requests_finished} ||= Koha::ArticleRequests->search(
108
        {
109
            borrowernumber => $self->id(),
110
            -or          => [
111
                { status => Koha::ArticleRequest::Status::Completed },
112
                { status => Koha::ArticleRequest::Status::Canceled }
113
            ]
114
        }
115
    );
116
117
    return $self->{_article_requests_finished};
118
}
119
50
=head3 type
120
=head3 type
51
121
52
=cut
122
=cut
(-)a/Koha/Item.pm (-2 / +46 lines)
Lines 21-28 use Modern::Perl; Link Here
21
21
22
use Carp;
22
use Carp;
23
23
24
use Koha::Database;
24
use C4::Context;
25
25
use C4::Circulation qw(GetIssuingRule);
26
use Koha::Branches;
26
use Koha::Branches;
27
use Koha::Borrowers;
27
use Koha::Borrowers;
28
28
Lines 107-112 sub last_returned_by { Link Here
107
    }
107
    }
108
}
108
}
109
109
110
=head3 can_article_request
111
112
my $bool = $item->can_article_request( $borrower )
113
114
Returns true if item can be specifically requested
115
116
$borrower must be a Koha::Borrower object
117
118
=cut
119
120
sub can_article_request {
121
    my ( $self, $borrower ) = @_;
122
123
    my $rule = $self->article_request_type($borrower);
124
125
    return 1 if $rule && $rule ne 'no' && $rule ne 'bib_only';
126
    return q{};
127
}
128
129
=head3 article_request_type
130
131
my $type = $item->article_request_type( $borrower )
132
133
returns 'yes', 'no', 'bib_only', or 'item_only'
134
135
$borrower must be a Koha::Borrower object
136
137
=cut
138
139
sub article_request_type {
140
    my ( $self, $borrower ) = @_;
141
142
    my $branch_control = C4::Context->preference('HomeOrHoldingBranch');
143
    my $branchcode =
144
        $branch_control eq 'homebranch'    ? $self->homebranch
145
      : $branch_control eq 'holdingbranch' ? $self->holdingbranch
146
      :                                      undef;
147
    my $borrowertype = $borrower->categorycode;
148
    my $itemtype = $self->effective_itemtype();
149
    my $rules = GetIssuingRule( $borrowertype, $itemtype, $branchcode );
150
151
    return $rules->{article_requests} || q{};
152
}
153
110
=head3 type
154
=head3 type
111
155
112
=cut
156
=cut
(-)a/Koha/Template/Plugin/Biblio.pm (-1 / +11 lines)
Lines 23-28 use Template::Plugin; Link Here
23
use base qw( Template::Plugin );
23
use base qw( Template::Plugin );
24
24
25
use Koha::Holds;
25
use Koha::Holds;
26
use Koha::Biblios;
27
use Koha::Borrowers;
26
28
27
sub HoldsCount {
29
sub HoldsCount {
28
    my ( $self, $biblionumber ) = @_;
30
    my ( $self, $biblionumber ) = @_;
Lines 32-35 sub HoldsCount { Link Here
32
    return $holds->count();
34
    return $holds->count();
33
}
35
}
34
36
37
sub CanArticleRequest {
38
    my ( $self, $biblionumber, $borrowernumber ) = @_;
39
40
    my $biblio = Koha::Biblios->find( $biblionumber );
41
    my $borrower = Koha::Borrowers->find( $borrowernumber );
42
43
    return $biblio ? $biblio->can_article_request( $borrower ) : 0;
44
}
45
35
1;
46
1;
36
- 

Return to bug 14610