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

(-)a/Koha/CurbsidePickup.pm (+104 lines)
Line 0 Link Here
1
package Koha::CurbsidePickup;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
use Koha::Patron;
27
use Koha::Library;
28
use Koha::CurbsidePickupIssues;
29
30
=head1 NAME
31
32
Koha::CurbsidePickup - Koha Curbside Pickup Object class
33
34
=head1 API
35
36
=head2 Class methods
37
38
=head3 checkouts
39
40
Return the checkouts linked to this pickup
41
42
=cut
43
44
sub checkouts {
45
    my ( $self ) = @_;
46
47
    my @pi = Koha::CurbsidePickupIssues->search({ curbside_pickup_id => $self->id })->as_list;
48
49
    my @checkouts = map { $_->checkout } @pi;
50
    @checkouts = grep { defined $_ } @checkouts;
51
52
    return @checkouts;
53
}
54
55
=head3 patron
56
57
Return the patron linked to this pickup
58
59
=cut
60
61
sub patron {
62
    my ( $self ) = @_;
63
    my $rs = $self->_result->borrowernumber;
64
    return unless $rs;
65
    return Koha::Patron->_new_from_dbic( $rs );
66
}
67
68
=head3 staged_by_staff
69
70
Return the staff member that staged this pickup
71
72
=cut
73
74
sub staged_by_staff {
75
    my ( $self ) = @_;
76
    my $rs = $self->_result->staged_by;
77
    return unless $rs;
78
    return Koha::Patron->_new_from_dbic( $rs );
79
}
80
81
=head3 library
82
83
Return the branch associated with this pickup
84
85
=cut
86
87
sub library {
88
    my ( $self ) = @_;
89
    my $rs = $self->_result->branchcode;
90
    return unless $rs;
91
    return Koha::Library->_new_from_dbic( $rs );
92
}
93
94
=head2 Internal methods
95
96
=head3 _type
97
98
=cut
99
100
sub _type {
101
    return 'CurbsidePickup';
102
}
103
104
1;
(-)a/Koha/CurbsidePickupIssue.pm (+57 lines)
Line 0 Link Here
1
package Koha::CurbsidePickupIssue;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
use Koha::Checkouts;
24
25
use base qw(Koha::Object);
26
27
=head1 NAME
28
29
Koha::CurbsidePickupIssue - Koha Curbside Pickup Issue Object class
30
31
=head1 API
32
33
=head2 Class methods
34
35
=head3 checkout
36
37
Return the checkout object
38
39
=cut
40
41
sub checkout {
42
    my ( $self ) = @_;
43
44
    return Koha::Checkouts->find( $self->issue_id );
45
}
46
47
=head2 Internal methods
48
49
=head3 _type
50
51
=cut
52
53
sub _type {
54
    return 'CurbsidePickupIssue';
55
}
56
57
1;
(-)a/Koha/CurbsidePickupIssues.pm (+50 lines)
Line 0 Link Here
1
package Koha::CurbsidePickupIssues;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::CurbsidePickupIssue;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::CurbsidePickupIssues - Koha Curbside Pickup Issues Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'CurbsidePickupIssue';
44
}
45
46
sub object_class {
47
    return 'Koha::CurbsidePickupIssue';
48
}
49
50
1;
(-)a/Koha/CurbsidePickupPolicies.pm (+50 lines)
Line 0 Link Here
1
package Koha::CurbsidePickupPolicies;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::CurbsidePickupPolicy;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::CurbsidePickupPolicies - Koha Curbside Pickup Policies Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'CurbsidePickupPolicy';
44
}
45
46
sub object_class {
47
    return 'Koha::CurbsidePickupPolicy';
48
}
49
50
1;
(-)a/Koha/CurbsidePickupPolicy.pm (+57 lines)
Line 0 Link Here
1
package Koha::CurbsidePickupPolicy;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::CurbsidePickupPolicy - Koha Curbside Pickup Policy Object class
29
30
=head1 API
31
32
=head2 Class methods
33
34
=head3 library
35
36
Return the branch associated with this policy
37
38
=cut
39
40
sub library {
41
    my ( $self ) = @_;
42
    my $rs = $self->_result->branchcode;
43
    return unless $rs;
44
    return Koha::Library->_new_from_dbic( $rs );
45
}
46
47
=head2 Internal methods
48
49
=head3 _type
50
51
=cut
52
53
sub _type {
54
    return 'CurbsidePickupPolicy';
55
}
56
57
1;
(-)a/Koha/CurbsidePickups.pm (-1 / +50 lines)
Line 0 Link Here
0
- 
1
package Koha::CurbsidePickups;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::CurbsidePickup;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::CurbsidePickups - Koha Curbside Pickup Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'CurbsidePickup';
44
}
45
46
sub object_class {
47
    return 'Koha::CurbsidePickup';
48
}
49
50
1;

Return to bug 30650