Lines 17-24
Link Here
|
17 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
17 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 |
|
19 |
|
20 |
use strict; |
20 |
use Modern::Perl; |
21 |
use warnings; |
|
|
22 |
|
21 |
|
23 |
use CGI; |
22 |
use CGI; |
24 |
use C4::Auth; |
23 |
use C4::Auth; |
Lines 105-110
sub _get_chunk {
Link Here
|
105 |
map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } |
104 |
map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } |
106 |
keys %{ $options{'choices'} } |
105 |
keys %{ $options{'choices'} } |
107 |
]; |
106 |
]; |
|
|
107 |
} elsif ( $options{'multiple'} ) { |
108 |
my @values = split /\|/, $value; |
109 |
$chunk->{type} = 'multiple'; |
110 |
$chunk->{CHOICES} = [ |
111 |
sort { $a->{'text'} cmp $b->{'text'} } |
112 |
map { { text => $options{multiple}->{$_}, value => $_, selected => ( $_ ~~ @values ) } } |
113 |
keys %{ $options{multiple} } |
114 |
]; |
108 |
} |
115 |
} |
109 |
|
116 |
|
110 |
$chunk->{ 'type_' . $chunk->{'type'} } = 1; |
117 |
$chunk->{ 'type_' . $chunk->{'type'} } = 1; |