|
Lines 44-71
sub GetByCode {
Link Here
|
| 44 |
return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) ); |
44 |
return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) ); |
| 45 |
} |
45 |
} |
| 46 |
|
46 |
|
| 47 |
sub BuildDropbox { |
47 |
sub GetAuthValueDropbox { |
| 48 |
my ( $self, $name, $category, $default, $params ) = @_; |
48 |
my ( $self, $category, $default ) = @_; |
| 49 |
my $class = $params->{class}; |
49 |
return C4::Koha::GetAuthvalueDropbox($category, $default); |
| 50 |
my $avs = C4::Koha::GetAuthvalueDropbox($category, $default); |
|
|
| 51 |
my $size = $params->{size} || 20; |
| 52 |
my $html; |
| 53 |
if ( @$avs ) { |
| 54 |
$html = qq|<select id="$name" name="$name" class="$class" >|; |
| 55 |
for my $av ( @$avs ) { |
| 56 |
if ( $av->{default} ) { |
| 57 |
$html .= qq|<option value="$av->{value}" selected="selected">$av->{label}</option>|; |
| 58 |
} else { |
| 59 |
$html .= qq|<option value="$av->{value}">$av->{label}</option>|; |
| 60 |
} |
| 61 |
} |
| 62 |
$html .= q|</select>|; |
| 63 |
} else { |
| 64 |
$html .= qq|<input type="text" id="$name" name="$name" size="$size" value="$default" class="$class" />|; |
| 65 |
|
| 66 |
} |
| 67 |
|
| 68 |
return encode( 'UTF-8', $html ); |
| 69 |
} |
50 |
} |
| 70 |
|
51 |
|
| 71 |
1; |
52 |
1; |