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

(-)a/Koha/Acquisition/Bookseller/Contact.pm (+32 lines)
Line 0 Link Here
1
package Koha::Acquisition::Bookseller::Contact;
2
3
# Copyright KohaSuomi 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
sub type {
29
    return 'Aqcontact';
30
}
31
32
1;
(-)a/Koha/Acquisition/Bookseller/Contacts.pm (+40 lines)
Line 0 Link Here
1
package Koha::Acquisition::Bookseller::Contacts;
2
3
# Copyright KohaSuomi 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::Acquisition::Bookseller::Contact;
25
26
use base qw(Koha::Objects);
27
28
sub type {
29
    return 'Aqcontact';
30
}
31
32
sub object_class {
33
    return 'Koha::Acquisition::Bookseller::Contact';
34
}
35
36
sub _get_castable_unique_columns {
37
    return ['id'];
38
}
39
40
1;
(-)a/Koha/Acquisition/Bookseller2.pm (+32 lines)
Line 0 Link Here
1
package Koha::Acquisition::Bookseller2; #Big patch upstream which fixes bad Bookseller to follow Koha::Object
2
3
# Copyright KohaSuomi 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
sub type {
29
    return 'Aqbookseller';
30
}
31
32
1;
(-)a/Koha/Acquisition/Booksellers.pm (+40 lines)
Line 0 Link Here
1
package Koha::Acquisition::Booksellers;
2
3
# Copyright KohaSuomi 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::Acquisition::Bookseller2;
25
26
use base qw(Koha::Objects);
27
28
sub type {
29
    return 'Aqbookseller';
30
}
31
32
sub object_class {
33
    return 'Koha::Acquisition::Bookseller2';
34
}
35
36
sub _get_castable_unique_columns {
37
    return ['id'];
38
}
39
40
1;
(-)a/Koha/Biblio.pm (-21 / +1 lines)
Lines 1-6 Link Here
1
package Koha::Biblio;
1
package Koha::Biblio;
2
2
3
# Copyright ByWater Solutions 2014
3
# Copyright Open Source Freedom Fighters
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
Lines 25-52 use Koha::Database; Link Here
25
25
26
use base qw(Koha::Object);
26
use base qw(Koha::Object);
27
27
28
=head1 NAME
29
30
Koha::Biblio - Koha Biblio 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 {
28
sub type {
43
    return 'Biblio';
29
    return 'Biblio';
44
}
30
}
45
31
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
32
1;
(-)a/Koha/BiblioItem.pm (+32 lines)
Line 0 Link Here
1
package Koha::BiblioItem;
2
3
# Copyright Open Source Freedom Fighters
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
sub type {
29
    return 'BiblioItem';
30
}
31
32
1;
(-)a/Koha/BiblioItems.pm (+38 lines)
Line 0 Link Here
1
package Koha::BiblioItems;
2
3
# Copyright Open Source Freedom Fighters
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
sub type {
31
    return 'BiblioItem';
32
}
33
34
sub object_class {
35
    return 'Koha::BiblioItem';
36
}
37
38
1;
(-)a/Koha/Biblios.pm (-24 / +4 lines)
Lines 1-6 Link Here
1
package Koha::Biblios;
1
package Koha::Biblios;
2
2
3
# Copyright ByWater Solutions 2014
3
# Copyright Open Source Freedom Fighters
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
Lines 27-62 use Koha::Biblio; Link Here
27
27
28
use base qw(Koha::Objects);
28
use base qw(Koha::Objects);
29
29
30
=head1 NAME
31
32
Koha::Biblios - Koha Biblio object set class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
30
sub type {
45
    return 'Biblio';
31
    return 'Biblio';
46
}
32
}
47
33
48
=head3 object_class
49
50
=cut
51
52
sub object_class {
34
sub object_class {
53
    return 'Koha::Biblio';
35
    return 'Koha::Biblio';
54
}
36
}
55
37
56
=head1 AUTHOR
38
sub _get_castable_unique_columns {
57
39
    return ['biblionumber'];
58
Kyle M Hall <kyle@bywatersolutions.com>
40
}
59
60
=cut
61
41
62
1;
42
1;
(-)a/Koha/Checkout.pm (+52 lines)
Line 0 Link Here
1
package Koha::Checkout;
2
3
# Copyright Open Source Freedom Fighters
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::Items;
27
28
use base qw(Koha::Object);
29
30
sub type {
31
    return 'Issue';
32
}
33
34
sub cardnumber {
35
    my ($self) = @_;
36
37
    unless ($self->{borrower}) {
38
        $self->{borrower} = Koha::Borrowers->cast($self->_result->borrower);
39
    }
40
    return $self->{borrower}->cardnumber;
41
}
42
43
sub barcode {
44
    my ($self) = @_;
45
46
    unless ($self->{item}) {
47
        $self->{item} = $self->_result->item;
48
    }
49
    return $self->{item}->barcode;
50
}
51
52
1;
(-)a/Koha/Checkouts.pm (+38 lines)
Line 0 Link Here
1
package Koha::Checkouts;
2
3
# Copyright Open Source Freedom Fighters
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::Checkout;
27
28
use base qw(Koha::Objects);
29
30
sub type {
31
    return 'Issue';
32
}
33
34
sub object_class {
35
    return 'Koha::Checkout';
36
}
37
38
1;
(-)a/Koha/Item.pm (+1 lines)
Lines 1-6 Link Here
1
package Koha::Item;
1
package Koha::Item;
2
2
3
# Copyright ByWater Solutions 2014
3
# Copyright ByWater Solutions 2014
4
# Copyright Open Source Freedom Fighters
4
#
5
#
5
# This file is part of Koha.
6
# This file is part of Koha.
6
#
7
#
(-)a/Koha/Items.pm (+5 lines)
Lines 1-6 Link Here
1
package Koha::Items;
1
package Koha::Items;
2
2
3
# Copyright ByWater Solutions 2014
3
# Copyright ByWater Solutions 2014
4
# Copyright Open Source Freedom Fighters
4
#
5
#
5
# This file is part of Koha.
6
# This file is part of Koha.
6
#
7
#
Lines 59-62 Kyle M Hall <kyle@bywatersolutions.com> Link Here
59
60
60
=cut
61
=cut
61
62
63
sub _get_castable_unique_columns {
64
    return ['itemnumber', 'barcode'];
65
}
66
62
1;
67
1;
(-)a/Koha/LetterTemplate.pm (+32 lines)
Line 0 Link Here
1
package Koha::LetterTemplate;
2
3
# Copyright Open Source Freedom Fighters
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
sub type {
29
    return 'Letter';
30
}
31
32
1;
(-)a/Koha/LetterTemplates.pm (+38 lines)
Line 0 Link Here
1
package Koha::LetterTemplates;
2
3
# Copyright Open Source Freedom Fighters
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::LetterTemplate;
27
28
use base qw(Koha::Objects);
29
30
sub type {
31
    return 'Letter';
32
}
33
34
sub object_class {
35
    return 'Koha::LetterTemplate';
36
}
37
38
1;
(-)a/Koha/Schema/Result/Serial.pm (+7 lines)
Lines 150-155 __PACKAGE__->has_many( Link Here
150
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-28 10:10:55
150
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-28 10:10:55
151
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xscBtY2sJRoXXw7hVPTqCQ
151
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xscBtY2sJRoXXw7hVPTqCQ
152
152
153
__PACKAGE__->belongs_to(
154
  "subscription",
155
  "Koha::Schema::Result::Subscription",
156
  { "foreign.subscriptionid" => "self.subscriptionid" },
157
  { cascade_copy => 0, cascade_delete => 0 },
158
);
159
153
160
154
# You can replace this text with custom content, and it will be preserved on regeneration
161
# You can replace this text with custom content, and it will be preserved on regeneration
155
1;
162
1;
(-)a/Koha/Schema/Result/Subscription.pm (+20 lines)
Lines 432-437 __PACKAGE__->has_many( Link Here
432
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
432
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
433
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57kc1/B3eNKQXAk9tlOy0A
433
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57kc1/B3eNKQXAk9tlOy0A
434
434
435
=head2 biblio
436
437
Type: belongs_to
438
439
Related object: L<Koha::Schema::Result::Biblio>
440
441
=cut
442
443
__PACKAGE__->belongs_to(
444
  "biblio",
445
  "Koha::Schema::Result::Biblio",
446
  { biblionumber => "biblionumber" },
447
  {
448
    is_deferrable => 1,
449
    join_type     => "LEFT",
450
    on_delete     => "SET NULL",
451
    on_update     => "CASCADE",
452
  },
453
);
454
435
455
436
# You can replace this text with custom content, and it will be preserved on regeneration
456
# You can replace this text with custom content, and it will be preserved on regeneration
437
1;
457
1;
(-)a/Koha/Serial/Subscription.pm (+160 lines)
Line 0 Link Here
1
package Koha::Serial::Subscription;
2
3
# Copyright KohaSuomi 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::Serial::Subscription::Frequencies;
26
use Koha::Serial::Subscription::Numberpatterns;
27
use Koha::Serial::Serials;
28
use Koha::Borrowers;
29
use Koha::Biblios;
30
use Koha::Acquisition::Booksellers;
31
use Koha::Items;
32
33
use base qw(Koha::Object);
34
35
sub type {
36
    return 'Subscription';
37
}
38
39
sub periodicity {
40
    my ($self, $periodicity) = @_;
41
42
    if ($periodicity) {
43
        $periodicity = Koha::Serial::Subscription::Frequencies->cast($periodicity);
44
        $self->{periodicity} = $periodicity;
45
        $self->set({periodicity => $periodicity->_result()->id});
46
        $self->store();
47
    }
48
49
    unless ($self->{periodicity}) {
50
        my $frequency = $self->_result()->periodicity();
51
        $self->{periodicity} = Koha::Serial::Subscription::Frequencies->cast($frequency);
52
    }
53
54
    return $self->{periodicity};
55
}
56
57
sub numberpattern {
58
    my ($self, $numberpattern) = @_;
59
60
    if ($numberpattern) {
61
        $numberpattern = Koha::Serial::Subscription::Numberpatterns->cast($numberpattern);
62
        $self->{numberpattern} = $numberpattern;
63
        $self->set({numberpattern => $numberpattern->_result()->id});
64
        $self->store();
65
    }
66
67
    unless ($self->{numberpattern}) {
68
        my $numberpattern = $self->_result()->numberpattern();
69
        $self->{numberpattern} = Koha::Serial::Subscription::Numberpatterns->cast($numberpattern);
70
    }
71
72
    return $self->{numberpattern};
73
}
74
75
sub biblio {
76
    my ($self, $biblio) = @_;
77
78
    if ($biblio) {
79
        $biblio = Koha::Biblios->cast($biblio);
80
        $self->{biblio} = $biblio;
81
        $self->set({biblio => $biblio->_result()->id});
82
        $self->store();
83
    }
84
85
    unless ($self->{biblio}) {
86
        my $biblio = $self->_result()->biblio();
87
        $self->{biblio} = Koha::Biblios->cast($biblio);
88
    }
89
90
    return $self->{biblio};
91
}
92
93
sub borrower {
94
    my ($self, $borrower) = @_;
95
96
    if ($borrower) {
97
        $borrower = Koha::Borrowers->cast($borrower);
98
        $self->{borrower} = $borrower;
99
        $self->set({librarian => $borrower->_result()->id});
100
        $self->store();
101
    }
102
103
    unless ($self->{borrower}) {
104
        my $borrower = $self->_result()->librarian();
105
        $self->{borrower} = Koha::Borrowers->cast($borrower);
106
    }
107
108
    return $self->{borrower};
109
}
110
111
sub bookseller {
112
    my ($self, $bookseller) = @_;
113
114
    if ($bookseller) {
115
        $bookseller = Koha::Acquisition::Booksellers->cast($bookseller);
116
        $self->{bookseller} = $bookseller;
117
        $self->set({bookseller => $bookseller->_result()->id});
118
        $self->store();
119
    }
120
121
    unless ($self->{bookseller}) {
122
        my $booksellerid = $self->_result()->aqbooksellerid();
123
        $self->{bookseller} = Koha::Acquisition::Booksellers->cast($booksellerid);
124
    }
125
126
    return $self->{bookseller};
127
}
128
129
sub serials {
130
    my ($self) = @_;
131
132
    unless ($self->{serials}) {
133
        my @serials = Koha::Serial::Serials->search({subscriptionid => $self->subscriptionid});
134
        $self->{serials} = \@serials;
135
    }
136
137
    return $self->{serials};
138
}
139
140
sub items {
141
    my ($self) = @_;
142
143
    unless ($self->{items}) {
144
        my @items;
145
        my $serials = $self->serials();
146
        for (my $i=0 ; $i<scalar(@$serials) ; $i++) {
147
            my @serialitems = $serials->[$i]->_result()->serialitems();
148
            foreach my $si (@serialitems) {
149
                my $item = $si->itemnumber;
150
                $item = Koha::Items->cast($item);
151
                push @items, $item;
152
            }
153
        }
154
        $self->{items} = \@items;
155
    }
156
157
    return $self->{items};
158
}
159
160
1;
(-)a/Koha/Serial/Subscription/Frequencies.pm (+40 lines)
Line 0 Link Here
1
package Koha::Serial::Subscription::Frequencies;
2
3
# Copyright KohaSuomi 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::Serial::Subscription::Frequency;
25
26
use base qw(Koha::Objects);
27
28
sub type {
29
    return 'SubscriptionFrequency';
30
}
31
32
sub object_class {
33
    return 'Koha::Serial::Subscription::Frequency';
34
}
35
36
sub _get_castable_unique_columns {
37
    return ['id'];
38
}
39
40
1;
(-)a/Koha/Serial/Subscription/Frequency.pm (+43 lines)
Line 0 Link Here
1
package Koha::Serial::Subscription::Frequency;
2
3
# Copyright KohaSuomi 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
sub type {
29
    return 'SubscriptionFrequency';
30
}
31
32
sub subscriptions {
33
    my ($self) = @_;
34
35
    unless ($self->{subscriptions}) {
36
        my @subscriptions = Koha::Serial::Subscriptions->search({periodicity => $self->id});
37
        $self->{subscriptions} = \@subscriptions;
38
    }
39
40
    return $self->{subscriptions};
41
}
42
43
1;
(-)a/Koha/Serial/Subscription/Numberpattern.pm (+43 lines)
Line 0 Link Here
1
package Koha::Serial::Subscription::Numberpattern;
2
3
# Copyright KohaSuomi 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
sub type {
29
    return 'SubscriptionNumberpattern';
30
}
31
32
sub subscriptions {
33
    my ($self) = @_;
34
35
    unless ($self->{subscriptions}) {
36
        my @subscriptions = Koha::Serial::Subscriptions->search({numberpattern => $self->id});
37
        $self->{subscriptions} = \@subscriptions;
38
    }
39
40
    return $self->{subscriptions};
41
}
42
43
1;
(-)a/Koha/Serial/Subscription/Numberpatterns.pm (+40 lines)
Line 0 Link Here
1
package Koha::Serial::Subscription::Numberpatterns;
2
3
# Copyright KohaSuomi 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::Serial::Subscription::Numberpattern;
25
26
use base qw(Koha::Objects);
27
28
sub type {
29
    return 'SubscriptionNumberpattern';
30
}
31
32
sub object_class {
33
    return 'Koha::Serial::Subscription::Numberpattern';
34
}
35
36
sub _get_castable_unique_columns {
37
    return ['id'];
38
}
39
40
1;
(-)a/Koha/Serial/Subscriptions.pm (-1 / +40 lines)
Line 0 Link Here
0
- 
1
package Koha::Serial::Subscriptions;
2
3
# Copyright KohaSuomi 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::Serial::Subscription;
25
26
use base qw(Koha::Objects);
27
28
sub type {
29
    return 'Subscription';
30
}
31
32
sub object_class {
33
    return 'Koha::Serial::Subscription';
34
}
35
36
sub _get_castable_unique_columns {
37
    return ['subscriptionid'];
38
}
39
40
1;

Return to bug 14616