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; |