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 104-109
sub _get_chunk {
Link Here
|
104 |
map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } |
103 |
map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } |
105 |
keys %{ $options{'choices'} } |
104 |
keys %{ $options{'choices'} } |
106 |
]; |
105 |
]; |
|
|
106 |
} elsif ( $options{'multiple'} ) { |
107 |
my @values = split /\|/, $value; |
108 |
$chunk->{type} = 'multiple'; |
109 |
$chunk->{CHOICES} = [ |
110 |
sort { $a->{'text'} cmp $b->{'text'} } |
111 |
map { { text => $options{multiple}->{$_}, value => $_, selected => ( $_ ~~ @values ) } } |
112 |
keys %{ $options{multiple} } |
113 |
]; |
107 |
} |
114 |
} |
108 |
|
115 |
|
109 |
$chunk->{ 'type_' . $chunk->{'type'} } = 1; |
116 |
$chunk->{ 'type_' . $chunk->{'type'} } = 1; |