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

(-)a/C4/Koha.pm (-1 / +40 lines)
Lines 57-62 BEGIN { Link Here
57
		&GetKohaAuthorisedValues
57
		&GetKohaAuthorisedValues
58
		&GetKohaAuthorisedValuesFromField
58
		&GetKohaAuthorisedValuesFromField
59
    &GetKohaAuthorisedValueLib
59
    &GetKohaAuthorisedValueLib
60
      &GetAuthorisedValueByCode
61
      &GetKohaImageurlFromAuthorisedValues
60
		&GetAuthValCode
62
		&GetAuthValCode
61
		&GetNormalizedUPC
63
		&GetNormalizedUPC
62
		&GetNormalizedISBN
64
		&GetNormalizedISBN
Lines 941-946 sub displayServers { Link Here
941
    return \@primaryserverloop;
943
    return \@primaryserverloop;
942
}
944
}
943
945
946
947
=head2 GetKohaImageurlFromAuthorisedValues
948
949
$authhorised_value = GetKohaImageurlFromAuthorisedValues( $category, $authvalcode );
950
951
Return the first url of the authorised value image represented by $lib.
952
953
=cut
954
955
sub GetKohaImageurlFromAuthorisedValues {
956
    my ( $category, $lib ) = @_;
957
    my $dbh = C4::Context->dbh;
958
    my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?");
959
    $sth->execute( $category, $lib );
960
     while ( my $data = $sth->fetchrow_hashref ) {
961
     	return $data->{'imageurl'};
962
     }
963
}
964
944
=head2 GetAuthValCode
965
=head2 GetAuthValCode
945
966
946
  $authvalcode = GetAuthValCode($kohafield,$frameworkcode);
967
  $authvalcode = GetAuthValCode($kohafield,$frameworkcode);
Lines 1035-1040 sub GetAuthorisedValueCategories { Link Here
1035
    return \@results;
1056
    return \@results;
1036
}
1057
}
1037
1058
1059
=head2 GetAuthorisedValueByCode
1060
1061
$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode );
1062
1063
Return an hashref of the authorised value represented by $authvalcode.
1064
1065
=cut
1066
1067
sub GetAuthorisedValueByCode {
1068
	my ( $category, $authvalcode ) = @_;
1069
	
1070
    my $dbh = C4::Context->dbh;
1071
    my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?");
1072
    $sth->execute( $category, $authvalcode );
1073
     while ( my $data = $sth->fetchrow_hashref ) {
1074
     	return $data->{'lib'};
1075
     }
1076
}
1077
1038
=head2 GetKohaAuthorisedValues
1078
=head2 GetKohaAuthorisedValues
1039
1079
1040
Takes $kohafield, $fwcode as parameters.
1080
Takes $kohafield, $fwcode as parameters.
1041
- 

Return to bug 5880