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

(-)a/admin/preferences.pl (-7 / +6 lines)
Lines 46-52 sub GetTab { Link Here
46
    my $tab_template = C4::Templates::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input );
46
    my $tab_template = C4::Templates::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input );
47
47
48
    my $active_currency = GetCurrency();
48
    my $active_currency = GetCurrency();
49
    my $local_currency;
49
    my $local_currency;;
50
    if ($active_currency) {
50
    if ($active_currency) {
51
        $local_currency = $active_currency->{currency};
51
        $local_currency = $active_currency->{currency};
52
    }
52
    }
Lines 61-67 sub _get_chunk { Link Here
61
    my ( $value, %options ) = @_;
61
    my ( $value, %options ) = @_;
62
62
63
    my $name = $options{'pref'};
63
    my $name = $options{'pref'};
64
    my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} };
64
    my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} };;
65
65
66
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
66
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
67
        $chunk->{'input_type'} = 'password';
67
        $chunk->{'input_type'} = 'password';
Lines 108-125 sub _get_chunk { Link Here
108
    } elsif ( $options{'multiple'} ) {
108
    } elsif ( $options{'multiple'} ) {
109
        my @values = split /,/, $value;
109
        my @values = split /,/, $value;
110
        $chunk->{type}    = 'multiple';
110
        $chunk->{type}    = 'multiple';
111
        $chunk->{CHOICES} = [
111
        $chunk->{CHOICES} = { 
112
            sort { $a->{'text'} cmp $b->{'text'} }
112
            sort { $a->{'text'} cmp $b->{'text'} }
113
              map {
113
              map {
114
                my $option_value = $_;
114
                my $option_value = $_;
115
                {
115
                {
116
                    text     => $options{multiple}->{$option_value},
116
                    text     => $options{type}->{$option_value},
117
                    value    => $option_value,
117
                    value    => $option_value,
118
                    selected => grep /^$option_value$/, @values,
118
                    selected => grep /^$option_value$/, @values,
119
                }
119
                }
120
              }
120
              }
121
              keys %{ $options{multiple} }
121
              keys %{ $options{type} }
122
        ];
122
        };
123
    }
123
    }
124
124
125
    $chunk->{ 'type_' . $chunk->{'type'} } = 1;
125
    $chunk->{ 'type_' . $chunk->{'type'} } = 1;
126
- 

Return to bug 14145