|
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'}, |