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

(-)a/Koha/Acquisition/Bookseller.pm (+12 lines)
Lines 20-25 use Modern::Perl; Link Here
20
use Koha::Acquisition::Bookseller::Aliases;
20
use Koha::Acquisition::Bookseller::Aliases;
21
use Koha::Acquisition::Bookseller::Contacts;
21
use Koha::Acquisition::Bookseller::Contacts;
22
use Koha::Acquisition::Bookseller::Interfaces;
22
use Koha::Acquisition::Bookseller::Interfaces;
23
use Koha::Acquisition::Bookseller::Issues;
23
use Koha::Subscriptions;
24
use Koha::Subscriptions;
24
25
25
use base qw( Koha::Object );
26
use base qw( Koha::Object );
Lines 137-142 sub interfaces { Link Here
137
    return Koha::Acquisition::Bookseller::Interfaces->_new_from_dbic( $rs );
138
    return Koha::Acquisition::Bookseller::Interfaces->_new_from_dbic( $rs );
138
}
139
}
139
140
141
=head3 issues
142
143
    my $issues = $vendor->issues
144
145
=cut
146
147
sub issues {
148
    my ($self) = @_;
149
    my $rs = $self->_result->aqbookseller_issues;
150
    return Koha::Acquisition::Bookseller::Issues->_new_from_dbic( $rs );
151
}
140
152
141
=head3 to_api_mapping
153
=head3 to_api_mapping
142
154
(-)a/Koha/Acquisition/Bookseller/Issue.pm (+77 lines)
Line 0 Link Here
1
package Koha::Acquisition::Bookseller::Issue;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
21
use Koha::Database;
22
23
use base qw(Koha::Object);
24
25
=head1 NAME
26
27
Koha::Acquisition::Bookseller::Issue - Koha Issue Object class
28
29
=head1 API
30
31
=head2 Class methods
32
33
=head3 strings_map
34
35
=cut
36
37
sub strings_map {
38
    my ( $self, $params ) = @_;
39
40
    my $strings = {};
41
42
    if ( defined $self->type ) {
43
        my $type_av_category = 'VENDOR_ISSUE_TYPE';
44
        my $av = Koha::AuthorisedValues->search(
45
            {
46
                category => $type_av_category,
47
                authorised_value => $self->type,
48
            }
49
        );
50
51
        my $type_str = $av->count
52
          ? $params->{public}
53
              ? $av->next->opac_description
54
              : $av->next->lib
55
          : $self->type;
56
57
        $strings->{type} = {
58
            category => 'VENDOR_ISSUE_TYPE',
59
            str      => $type_str,
60
            type     => 'av',
61
        };
62
    }
63
64
    return $strings;
65
}
66
67
=head2 Internal methods
68
69
=head3 _type
70
71
=cut
72
73
sub _type {
74
    return 'AqbooksellerIssue';
75
}
76
77
1;
(-)a/Koha/Acquisition/Bookseller/Issues.pm (-1 / +49 lines)
Line 0 Link Here
0
- 
1
package Koha::Acquisition::Bookseller::Issues;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
21
use Koha::Database;
22
23
use Koha::Acquisition::Bookseller::Issue;
24
25
use base qw(Koha::Objects);
26
27
=head1 NAME
28
29
Koha::Acquisition::Bookseller::Issues
30
31
=head1 API
32
33
=head2 Class Methods
34
35
=cut
36
37
=head3 type
38
39
=cut
40
41
sub _type {
42
    return 'AqbooksellerIssue';
43
}
44
45
sub object_class {
46
    return 'Koha::Acquisition::Bookseller::Issue';
47
}
48
49
1;

Return to bug 33105