|
Lines 2058-2063
sub is_denied_renewal {
Link Here
|
| 2058 |
return 0; |
2058 |
return 0; |
| 2059 |
} |
2059 |
} |
| 2060 |
|
2060 |
|
|
|
2061 |
=head3 api_strings_mapping |
| 2062 |
|
| 2063 |
Retrieves for each column name the unblessed authorised value. |
| 2064 |
|
| 2065 |
=cut |
| 2066 |
|
| 2067 |
sub api_strings_mapping { |
| 2068 |
my ( $self, $params ) = @_; |
| 2069 |
|
| 2070 |
my $columns_info = $self->_result->result_source->columns_info; |
| 2071 |
my $framworkcode = $self->biblio->frameworkcode; |
| 2072 |
|
| 2073 |
# Handle not null and default values for integers and dates |
| 2074 |
my $avs = {}; |
| 2075 |
foreach my $col ( keys %{$columns_info} ) { |
| 2076 |
next unless defined $self->$col; |
| 2077 |
my $field = $self->_result->result_source->name . '.' . $col; |
| 2078 |
my $mss = Koha::MarcSubfieldStructures->find( |
| 2079 |
{ frameworkcode => $framworkcode, |
| 2080 |
kohafield => $field, |
| 2081 |
} |
| 2082 |
); |
| 2083 |
if ( $mss && $mss->authorised_value ) { |
| 2084 |
my $av = Koha::AuthorisedValues->find( |
| 2085 |
{ category => $mss->authorised_value, |
| 2086 |
authorised_value => $self->$col |
| 2087 |
} |
| 2088 |
); |
| 2089 |
|
| 2090 |
$avs->{$col} = { |
| 2091 |
category => $mss->authorised_value, |
| 2092 |
str => $params->{public} ? $av->opac_description : $av->lib, |
| 2093 |
type => 'av', |
| 2094 |
} |
| 2095 |
if $av; |
| 2096 |
} |
| 2097 |
} |
| 2098 |
|
| 2099 |
return $avs; |
| 2100 |
} |
| 2101 |
|
| 2061 |
=head3 _type |
2102 |
=head3 _type |
| 2062 |
|
2103 |
|
| 2063 |
=cut |
2104 |
=cut |