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

(-)a/admin/preferences.pl (-2 / +25 lines)
Lines 92-97 sub _get_chunk { Link Here
92
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
92
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
93
        $chunk->{'type'} = 'languages';
93
        $chunk->{'type'} = 'languages';
94
    } elsif ( $options{ 'choices' } ) {
94
    } elsif ( $options{ 'choices' } ) {
95
        my $add_blank;
95
        if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) {
96
        if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) {
96
            if ( $options{'choices'} eq 'class-sources' ) {
97
            if ( $options{'choices'} eq 'class-sources' ) {
97
                my $sources = GetClassSources();
98
                my $sources = GetClassSources();
Lines 100-105 sub _get_chunk { Link Here
100
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
101
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
101
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
102
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
102
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
103
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
104
            } elsif ( $options{choices} eq 'patron-categories' ) {
105
                $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search };
106
                $add_blank = 1;
103
            } else {
107
            } else {
104
                die 'Unrecognized source of preference values: ' . $options{'choices'};
108
                die 'Unrecognized source of preference values: ' . $options{'choices'};
105
            }
109
            }
Lines 107-118 sub _get_chunk { Link Here
107
111
108
        $value ||= 0;
112
        $value ||= 0;
109
113
110
        $chunk->{'type'} = 'select';
114
        $chunk->{'type'} = ( $options{class} && $options{class} eq 'multiple' ) ? 'multiple' : 'select';
115
116
        my @values;
117
        @values = split /,/, $value if defined($value);
111
        $chunk->{'CHOICES'} = [
118
        $chunk->{'CHOICES'} = [
112
            sort { $a->{'text'} cmp $b->{'text'} }
119
            sort { $a->{'text'} cmp $b->{'text'} }
113
            map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } }
120
            map {
121
                my $c = $_;
122
                {
123
                    text     => $options{'choices'}->{$c},
124
                    value    => $c,
125
                    selected => (
126
                        grep { $_ eq $c || ( $c eq '' && ($value eq '0' || !$value ) ) } @values
127
                    ) ? 1 : 0,
128
                }
129
              }
114
            keys %{ $options{'choices'} }
130
            keys %{ $options{'choices'} }
115
        ];
131
        ];
132
133
        # Add a first blank value if needed
134
        unshift @{ $chunk->{CHOICES} }, {
135
            text  => '',
136
            value => '',
137
        } if $add_blank && $chunk->{type} eq 'select';
138
116
    } elsif ( $options{'multiple'} ) {
139
    } elsif ( $options{'multiple'} ) {
117
        my @values;
140
        my @values;
118
        @values = split /,/, $value if defined($value);
141
        @values = split /,/, $value if defined($value);
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 116-122 my $batch = $query->param('batch'); Link Here
116
my $batch_allowed = 0;
116
my $batch_allowed = 0;
117
if ( $batch && C4::Context->preference('BatchCheckouts') ) {
117
if ( $batch && C4::Context->preference('BatchCheckouts') ) {
118
    $template_name = q|circ/circulation_batch_checkouts.tt|;
118
    $template_name = q|circ/circulation_batch_checkouts.tt|;
119
    my @batch_category_codes = split '\|', C4::Context->preference('BatchCheckoutsValidCategories');
119
    my @batch_category_codes = split ',', C4::Context->preference('BatchCheckoutsValidCategories');
120
    my $categorycode = $patron->categorycode;
120
    my $categorycode = $patron->categorycode;
121
    if ( $categorycode && grep { $_ eq $categorycode } @batch_category_codes ) {
121
    if ( $categorycode && grep { $_ eq $categorycode } @batch_category_codes ) {
122
        $batch_allowed = 1;
122
        $batch_allowed = 1;
(-)a/installer/data/mysql/atomicupdate/bug_27652.perl (+11 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do(q{
5
        UPDATE systempreferences
6
        value=REPLACE(value, '|', ',')
7
        WHERE variable="OPACHoldsIfAvailableAtPickupExceptions"
8
           OR variable="BatchCheckoutsValidCategories"
9
    });
10
    NewVersion( $DBversion, 27652, "Separate values for OPACHoldsIfAvailableAtPickupExceptions and BatchCheckoutsValidCategories with comma");
11
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 / +1 lines)
Lines 125-131 Link Here
125
<ul>
125
<ul>
126
    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
126
    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
127
        [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]">Check out</a></li>
127
        [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]">Check out</a></li>
128
        [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep('^' _ patron.categorycode _ '$').size > 0 %]
128
        [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split(',').grep('^' _ patron.categorycode _ '$').size > 0 %]
129
          [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;batch=1">Batch check out</a></li>
129
          [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;batch=1">Batch check out</a></li>
130
        [% END %]
130
        [% END %]
131
    [% END %]
131
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+1 lines)
Lines 183-188 Administration: Link Here
183
        -
183
        -
184
            - "Use this category code when automatically registering a Google Open ID patron: "
184
            - "Use this category code when automatically registering a Google Open ID patron: "
185
            - pref: GoogleOpenIDConnectDefaultCategory
185
            - pref: GoogleOpenIDConnectDefaultCategory
186
              choices: patron-categories
186
            - "."
187
            - "."
187
        -
188
        -
188
            - "Use this branch code when automatically registering a Google Open ID patron: "
189
            - "Use this branch code when automatically registering a Google Open ID patron: "
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +4 lines)
Lines 880-886 Circulation: Link Here
880
        -
880
        -
881
            - 'Patron categories not affected by <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACHoldsIfAvailableAtPickup">OPACHoldsIfAvailableAtPickup</a>:'
881
            - 'Patron categories not affected by <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACHoldsIfAvailableAtPickup">OPACHoldsIfAvailableAtPickup</a>:'
882
            - pref: OPACHoldsIfAvailableAtPickupExceptions
882
            - pref: OPACHoldsIfAvailableAtPickupExceptions
883
            - "(list of patron categories separated with a pipe '|')"
883
              choices: patron-categories
884
              class: multiple
884
        -
885
        -
885
            - pref: CanMarkHoldsToPullAsLost
886
            - pref: CanMarkHoldsToPullAsLost
886
              choices:
887
              choices:
Lines 1142-1148 Circulation: Link Here
1142
        -
1143
        -
1143
            - "Patron categories allowed to checkout in a batch:"
1144
            - "Patron categories allowed to checkout in a batch:"
1144
            - pref: BatchCheckoutsValidCategories
1145
            - pref: BatchCheckoutsValidCategories
1145
            - "(list of patron categories separated with a pipe '|')."
1146
              choices: patron-categories
1147
              class: multiple
1146
    Housebound module:
1148
    Housebound module:
1147
        -
1149
        -
1148
            - pref: HouseboundModule
1150
            - pref: HouseboundModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 807-813 OPAC: Link Here
807
        -
807
        -
808
            - "Use the patron category code"
808
            - "Use the patron category code"
809
            - pref: PatronSelfRegistrationDefaultCategory
809
            - pref: PatronSelfRegistrationDefaultCategory
810
              class: short
810
              choices: patron-categories
811
            - "as the default patron category for patrons registered via the OPAC."
811
            - "as the default patron category for patrons registered via the OPAC."
812
            - "<br><strong>WARNING: Do not use a regular patron category for self registration.</strong> If the <code>misc/cronjobs/cleanup_database.pl</code> cronjob is setup to delete unverified and unfinished OPAC self registrations, it will permanently and unrecoverably delete all patrons that have registered more than <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronSelfRegistrationExpireTemporaryAccountsDelay'>PatronSelfRegistrationExpireTemporaryAccountsDelay</a> days ago."
812
            - "<br><strong>WARNING: Do not use a regular patron category for self registration.</strong> If the <code>misc/cronjobs/cleanup_database.pl</code> cronjob is setup to delete unverified and unfinished OPAC self registrations, it will permanently and unrecoverably delete all patrons that have registered more than <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronSelfRegistrationExpireTemporaryAccountsDelay'>PatronSelfRegistrationExpireTemporaryAccountsDelay</a> days ago."
813
        -
813
        -
(-)a/opac/opac-reserve.pl (-2 / +1 lines)
Lines 75-81 my $category = $patron->category; Link Here
75
75
76
my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup');
76
my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup');
77
unless ( $can_place_hold_if_available_at_pickup ) {
77
unless ( $can_place_hold_if_available_at_pickup ) {
78
    my @patron_categories = split '\|', C4::Context->preference('OPACHoldsIfAvailableAtPickupExceptions');
78
    my @patron_categories = split ',', C4::Context->preference('OPACHoldsIfAvailableAtPickupExceptions');
79
    if ( @patron_categories ) {
79
    if ( @patron_categories ) {
80
        my $categorycode = $patron->categorycode;
80
        my $categorycode = $patron->categorycode;
81
        $can_place_hold_if_available_at_pickup = grep { $_ eq $categorycode } @patron_categories;
81
        $can_place_hold_if_available_at_pickup = grep { $_ eq $categorycode } @patron_categories;
82
- 

Return to bug 27652