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

(-)a/C4/Koha.pm (-12 / +12 lines)
Lines 57-64 BEGIN { Link Here
57
		&GetKohaAuthorisedValues
57
		&GetKohaAuthorisedValues
58
		&GetKohaAuthorisedValuesFromField
58
		&GetKohaAuthorisedValuesFromField
59
    &GetKohaAuthorisedValueLib
59
    &GetKohaAuthorisedValueLib
60
      &GetAuthorisedValueByCode
60
    &GetAuthorisedValueByCode
61
      &GetKohaImageurlFromAuthorisedValues
61
    &GetKohaImageurlFromAuthorisedValues
62
		&GetAuthValCode
62
		&GetAuthValCode
63
		&GetNormalizedUPC
63
		&GetNormalizedUPC
64
		&GetNormalizedISBN
64
		&GetNormalizedISBN
Lines 957-965 sub GetKohaImageurlFromAuthorisedValues { Link Here
957
    my $dbh = C4::Context->dbh;
957
    my $dbh = C4::Context->dbh;
958
    my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?");
958
    my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?");
959
    $sth->execute( $category, $lib );
959
    $sth->execute( $category, $lib );
960
     while ( my $data = $sth->fetchrow_hashref ) {
960
    while ( my $data = $sth->fetchrow_hashref ) {
961
     	return $data->{'imageurl'};
961
        return $data->{'imageurl'};
962
     }
962
    }
963
}
963
}
964
964
965
=head2 GetAuthValCode
965
=head2 GetAuthValCode
Lines 1060-1078 sub GetAuthorisedValueCategories { Link Here
1060
1060
1061
$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode );
1061
$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode );
1062
1062
1063
Return an hashref of the authorised value represented by $authvalcode.
1063
Return the lib attribute from authorised_values from the row identified
1064
by the passed category and code
1064
1065
1065
=cut
1066
=cut
1066
1067
1067
sub GetAuthorisedValueByCode {
1068
sub GetAuthorisedValueByCode {
1068
	my ( $category, $authvalcode ) = @_;
1069
    my ( $category, $authvalcode ) = @_;
1069
	
1070
1070
    my $dbh = C4::Context->dbh;
1071
    my $dbh = C4::Context->dbh;
1071
    my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?");
1072
    my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?");
1072
    $sth->execute( $category, $authvalcode );
1073
    $sth->execute( $category, $authvalcode );
1073
     while ( my $data = $sth->fetchrow_hashref ) {
1074
    while ( my $data = $sth->fetchrow_hashref ) {
1074
     	return $data->{'lib'};
1075
        return $data->{'lib'};
1075
     }
1076
    }
1076
}
1077
}
1077
1078
1078
=head2 GetKohaAuthorisedValues
1079
=head2 GetKohaAuthorisedValues
1079
- 

Return to bug 5880