Minor cleanup, updated POD.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Joe Atzberger 2008-09-08 12:49:39 -05:00 committed by Galen Charlton
parent 7b2e4ebce2
commit 5897704e78

View file

@ -463,23 +463,19 @@ returns the full path to the appropriate directory containing images.
=cut =cut
sub getitemtypeimagedir { sub getitemtypeimagedir {
my $src = shift; my $src = shift || 'opac';
$src = 'opac' unless defined $src;
if ($src eq 'intranet') { if ($src eq 'intranet') {
return C4::Context->config('intrahtdocs') . '/' .C4::Context->preference('template') . '/img/itemtypeimg'; return C4::Context->config('intrahtdocs') . '/' .C4::Context->preference('template') . '/img/itemtypeimg';
} } else {
else {
return C4::Context->config('opachtdocs') . '/' . C4::Context->preference('template') . '/itemtypeimg'; return C4::Context->config('opachtdocs') . '/' . C4::Context->preference('template') . '/itemtypeimg';
} }
} }
sub getitemtypeimagesrc { sub getitemtypeimagesrc {
my $src = shift; my $src = shift || 'opac';
if ($src eq 'intranet') { if ($src eq 'intranet') {
return '/intranet-tmpl' . '/' . C4::Context->preference('template') . '/img/itemtypeimg'; return '/intranet-tmpl' . '/' . C4::Context->preference('template') . '/img/itemtypeimg';
} } else {
else {
return '/opac-tmpl' . '/' . C4::Context->preference('template') . '/itemtypeimg'; return '/opac-tmpl' . '/' . C4::Context->preference('template') . '/itemtypeimg';
} }
} }
@ -995,18 +991,16 @@ sub GetAuthValCode {
=head2 GetAuthorisedValues =head2 GetAuthorisedValues
$authvalues = GetAuthorisedValues($category); $authvalues = GetAuthorisedValues([$category], [$selected]);
this function get all authorised values from 'authosied_value' table into a reference to array which This function returns all authorised values from the'authosied_value' table in a reference to array of hashrefs.
each value containt an hashref.
Set C<$category> on input args if you want to limits your query to this one. This params is not mandatory. C<$category> returns authorised values for just one category (optional).
=cut =cut
sub GetAuthorisedValues { sub GetAuthorisedValues {
my ($category,$selected) = @_; my ($category,$selected) = @_;
my $count = 0;
my @results; my @results;
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;
my $query = "SELECT * FROM authorised_values"; my $query = "SELECT * FROM authorised_values";
@ -1018,8 +1012,7 @@ sub GetAuthorisedValues {
if ($selected eq $data->{'authorised_value'} ) { if ($selected eq $data->{'authorised_value'} ) {
$data->{'selected'} = 1; $data->{'selected'} = 1;
} }
$results[$count] = $data; push @results, $data;
$count++;
} }
#my $data = $sth->fetchall_arrayref({}); #my $data = $sth->fetchall_arrayref({});
return \@results; #$data; return \@results; #$data;