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

(-)a/Koha/Checkout.pm (-1 / +1 lines)
Lines 63-69 sub item { Link Here
63
63
64
=cut
64
=cut
65
65
66
sub type {
66
sub _type {
67
    return 'Issue';
67
    return 'Issue';
68
}
68
}
69
69
(-)a/Koha/Checkouts.pm (-1 / +1 lines)
Lines 41-47 Koha::Checkouts - Koha Checkouts Object class Link Here
41
41
42
=cut
42
=cut
43
43
44
sub type {
44
sub _type {
45
    return 'Issue';
45
    return 'Issue';
46
}
46
}
47
47
(-)a/Koha/Deleted/Biblio.pm (+57 lines)
Line 0 Link Here
1
package Koha::Deleted::Biblio;
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 base qw(Koha::Biblio);
27
28
=head1 NAME
29
30
Koha::Deleted::Biblio - Koha Biblio Object class
31
32
This class is an extension of Koha::Biblio.
33
34
New methods should only be added to Koha::Biblio unless they are specifically
35
and only for dealing with deleted bibs.
36
37
=head1 API
38
39
=head2 Class Methods
40
41
=cut
42
43
=head3 type
44
45
=cut
46
47
sub _type {
48
    return 'Deletedbiblio';
49
}
50
51
=head1 AUTHOR
52
53
Kyle M Hall <kyle@bywatersolutions.com>
54
55
=cut
56
57
1;
(-)a/Koha/Deleted/BiblioItem.pm (+57 lines)
Line 0 Link Here
1
package Koha::Deleted::BiblioItem;
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 base qw(Koha::BiblioItem);
27
28
=head1 NAME
29
30
Koha::Deleted::BiblioItem - Koha Deleted BiblioItem Object class
31
32
This class is an extension of Koha::BiblioItem.
33
34
New methods should only be added to Koha::BiblioItem unless they are specifically
35
and only for dealing with deleted biblioitems.
36
37
=head1 API
38
39
=head2 Class Methods
40
41
=cut
42
43
=head3 type
44
45
=cut
46
47
sub _type {
48
    return 'Deletedbiblioitem';
49
}
50
51
=head1 AUTHOR
52
53
Kyle M Hall <kyle@bywatersolutions.com>
54
55
=cut
56
57
1;
(-)a/Koha/Deleted/BiblioItems.pm (+63 lines)
Line 0 Link Here
1
package Koha::Deleted::BiblioItems;
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::Deleted::BiblioItem;
27
28
use base qw(Koha::BiblioItems);
29
30
=head1 NAME
31
32
Koha::BiblioItem - Koha BiblioItem Object class
33
34
This class is an extension of Koha::BiblioItems.
35
36
New methods should only be added to Koha::BiblioItems unless they are specifically
37
and only for dealing with deleted biblioitem sets
38
39
=head1 API
40
41
=head2 Class Methods
42
43
=cut
44
45
=head3 type
46
47
=cut
48
49
sub _type {
50
    return 'Deletedbiblioitem';
51
}
52
53
sub object_class {
54
    return 'Koha::Deleted::BiblioItem';
55
}
56
57
=head1 AUTHOR
58
59
Kyle M Hall <kyle@bywatersolutions.com>
60
61
=cut
62
63
1;
(-)a/Koha/Deleted/Biblios.pm (+64 lines)
Line 0 Link Here
1
package Koha::Deleted::Biblios;
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::Deleted::Biblio;
27
28
use base qw(Koha::Biblios);
29
30
=head1 NAME
31
32
Koha::Deleted::Biblios - Koha Deleted Bibliographic Record set object class
33
34
This class is an extension of Koha::Biblios.
35
36
New methods should only be added to Koha::Biblios unless they are specifically
37
and only for dealing with deleted bib sets
38
39
40
=head1 API
41
42
=head2 Class Methods
43
44
=cut
45
46
=head3 type
47
48
=cut
49
50
sub _type {
51
    return 'Deletedbiblio';
52
}
53
54
sub object_class {
55
    return 'Koha::Deleted::Biblio';
56
}
57
58
=head1 AUTHOR
59
60
Kyle M Hall <kyle@bywatersolutions.com>
61
62
=cut
63
64
1;
(-)a/Koha/Deleted/Item.pm (+58 lines)
Line 0 Link Here
1
package Koha::Deleted::Item;
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 base qw(Koha::Item);
27
28
=head1 NAME
29
30
Koha::Deleted::Item - Koha Deleted Item Object class
31
32
This class is an extension of Koha::Item.
33
34
New methods should only be added to Koha::Item unless they are specifically
35
and only for dealing with deleted items only.
36
37
38
=head1 API
39
40
=head2 Class Methods
41
42
=cut
43
44
=head3 type
45
46
=cut
47
48
sub _type {
49
    return 'Deleteditem';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;
(-)a/Koha/Deleted/Items.pm (+63 lines)
Line 0 Link Here
1
package Koha::Deleted::Items;
2
3
# Copyright ByWater Solutions 2014
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::Deleted::Item;
27
28
use base qw(Koha::Items);
29
30
=head1 NAME
31
32
Koha::Deleted::Items - Koha Deleted Items Object class
33
34
This class is an extension of Koha::Items.
35
36
New methods should only be added to Koha::Items unless they are specifically
37
and only for dealing with deleted item sets
38
39
=head1 API
40
41
=head2 Class Methods
42
43
=cut
44
45
=head3 type
46
47
=cut
48
49
sub _type {
50
    return 'Deleteditem';
51
}
52
53
sub object_class {
54
    return 'Koha::Deleted::Item';
55
}
56
57
=head1 AUTHOR
58
59
Kyle M Hall <kyle@bywatersolutions.com>
60
61
=cut
62
63
1;
(-)a/Koha/Item.pm (+48 lines)
Lines 25-30 use Koha::Database; Link Here
25
25
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Libraries;
27
use Koha::Libraries;
28
use Koha::Biblios;
29
use Koha::Deleted::Biblios;
30
use Koha::BiblioItems;
31
use Koha::Deleted::BiblioItems;
28
32
29
use base qw(Koha::Object);
33
use base qw(Koha::Object);
30
34
Lines 107-112 sub last_returned_by { Link Here
107
    }
111
    }
108
}
112
}
109
113
114
=head3 biblio
115
116
my $biblio = $checkout->biblio({ deleted => 1 });
117
118
Returns the related Koha::Biblio for this checkout.
119
120
If the parameter delete is passed and true, and the biblionumber
121
is not found for current biblios, this method will look for a matching
122
deleted biblio.
123
124
=cut
125
126
sub biblio {
127
    my ( $self, $params ) = @_;
128
129
    my $biblio = Koha::Biblios->search( { biblionumber => $self->biblionumber() } )->next();
130
131
    $biblio ||= Koha::Deleted::Biblios->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} );
132
133
    return $biblio || undef;
134
}
135
136
=head3 biblioitem
137
138
my $biblioitem = $checkout->biblio({ deleted => 1 });
139
140
Returns the related Koha::Biblio for this checkout.
141
142
If the parameter delete is passed and true, and the biblioitemnumber
143
is not found for current biblioitems, this method will look for a matching
144
deleted biblioitem.
145
146
=cut
147
148
sub biblioitem {
149
    my ( $self, $params ) = @_;
150
151
    my $biblioitem = Koha::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next();
152
153
    $biblioitem ||= Koha::Deleted::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} );
154
155
    return $biblioitem || undef;
156
}
157
110
=head3 type
158
=head3 type
111
159
112
=cut
160
=cut
(-)a/Koha/Old/Checkout.pm (-1 / +1 lines)
Lines 44-50 and only for dealing with old checkouts. Link Here
44
44
45
=cut
45
=cut
46
46
47
sub type {
47
sub _type {
48
    return 'OldIssue';
48
    return 'OldIssue';
49
}
49
}
50
50
(-)a/Koha/Old/Checkouts.pm (-2 / +1 lines)
Lines 46-52 and only for dealing with old checkouts. Link Here
46
46
47
=cut
47
=cut
48
48
49
sub type {
49
sub _type {
50
    return 'OldIssue';
50
    return 'OldIssue';
51
}
51
}
52
52
53
- 

Return to bug 8483