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

(-)a/Koha/BiblioItem.pm (+52 lines)
Line 0 Link Here
1
package Koha::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::Object);
27
28
=head1 NAME
29
30
Koha::BiblioItem - Koha BiblioItem Object 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 'Biblioitem';
44
}
45
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
(-)a/Koha/BiblioItems.pm (+58 lines)
Line 0 Link Here
1
package Koha::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::BiblioItem;
27
28
use base qw(Koha::Objects);
29
30
=head1 NAME
31
32
Koha::BiblioItem - Koha BiblioItem Object class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
45
    return 'Biblioitem';
46
}
47
48
sub object_class {
49
    return 'Koha::BiblioItem';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;
(-)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 (-1 / +47 lines)
Lines 24-29 use Carp; Link Here
24
use Koha::Database;
24
use Koha::Database;
25
25
26
use Koha::Branches;
26
use Koha::Branches;
27
use Koha::Biblios;
28
use Koha::Deleted::Biblios;
29
use Koha::BiblioItems;
30
use Koha::Deleted::BiblioItems;
27
31
28
use base qw(Koha::Object);
32
use base qw(Koha::Object);
29
33
Lines 73-78 sub holding_branch { Link Here
73
    return $self->{_holding_branch};
77
    return $self->{_holding_branch};
74
}
78
}
75
79
80
=head3 biblio
81
82
my $biblio = $checkout->biblio({ deleted => 1 });
83
84
Returns the related Koha::Biblio for this checkout.
85
86
If the parameter delete is passed and true, and the biblionumber
87
is not found for current biblios, this method will look for a matching
88
deleted biblio.
89
90
=cut
91
92
sub biblio {
93
    my ( $self, $params ) = @_;
94
95
    my $biblio = Koha::Biblios->search( { biblionumber => $self->biblionumber() } )->next();
96
97
    $biblio ||= Koha::Deleted::Biblios->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} );
98
99
    return $biblio || undef;
100
}
101
102
=head3 biblioitem
103
104
my $biblioitem = $checkout->biblio({ deleted => 1 });
105
106
Returns the related Koha::Biblio for this checkout.
107
108
If the parameter delete is passed and true, and the biblioitemnumber
109
is not found for current biblioitems, this method will look for a matching
110
deleted biblioitem.
111
112
=cut
113
114
sub biblioitem {
115
    my ( $self, $params ) = @_;
116
117
    my $biblioitem = Koha::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next();
118
119
    $biblioitem ||= Koha::Deleted::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} );
120
121
    return $biblioitem || undef;
122
}
76
123
77
=head3 type
124
=head3 type
78
125
79
- 

Return to bug 8483