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

(-)a/admin/branches.pl (-3 / +3 lines)
Lines 254-268 sub editbranchform { Link Here
254
    #
254
    #
255
    # We export a "categoryloop" array to the template, each element of which
255
    # We export a "categoryloop" array to the template, each element of which
256
    # contains separate 'categoryname', 'categorycode', 'codedescription', and
256
    # contains separate 'categoryname', 'categorycode', 'codedescription', and
257
    # 'checked' fields. The $checked field is either '' or 'checked="checked"'
257
    # 'checked' fields. The $checked field is either empty or 1'
258
258
259
    my $catinfo = GetBranchCategory();
259
    my $catinfo = GetBranchCategory();
260
    my @categoryloop = ();
260
    my @categoryloop = ();
261
    foreach my $cat (@$catinfo) {
261
    foreach my $cat (@$catinfo) {
262
        my $checked = "";
262
        my $checked;
263
        my $tmp     = quotemeta( $cat->{'categorycode'} );
263
        my $tmp     = quotemeta( $cat->{'categorycode'} );
264
        if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) {
264
        if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) {
265
            $checked = "checked=\"checked\"";
265
            $checked = 1;
266
        }
266
        }
267
        push @categoryloop, {
267
        push @categoryloop, {
268
            categoryname    => $cat->{'categoryname'},
268
            categoryname    => $cat->{'categoryname'},
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt (-2 / +6 lines)
Lines 99-105 Link Here
99
        <ol>
99
        <ol>
100
		[% FOREACH categoryloo IN categoryloop %]
100
		[% FOREACH categoryloo IN categoryloop %]
101
            <li><label for="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</label>
101
            <li><label for="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</label>
102
                <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" [% categoryloo.checked %] /> <span class="hint">[% categoryloo.codedescription %]</span>
102
                [% IF ( categoryloo.checked ) %]
103
                    <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" checked="checked" />
104
                [% ELSE %]
105
                    <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" />
106
                [% END %]
107
                <span class="hint">[% categoryloo.codedescription %]</span>
103
            </li>
108
            </li>
104
        [% END %]
109
        [% END %]
105
		</ol>
110
		</ol>
106
- 

Return to bug 6458