if ( $op eq 'add' ) {
# If the user has pressed the "add new branch" button.
- $template->param( 'heading-branches-add-branch-p' => 1 );
+ $template->param( 'heading_branches_add_branch_p' => 1 );
editbranchform($branchcode,$template);
}
elsif ( $op eq 'edit' ) {
# if the user has pressed the "edit branch settings" button.
- $template->param( 'heading-branches-add-branch-p' => 0,
+ $template->param( 'heading_branches_add_branch_p' => 0,
'add' => 1, );
editbranchform($branchcode,$template);
}
if ($existing > 0) {
$mod_branch = 0;
_branch_to_template($params, $template); # preserve most (FIXME) of user's input
- $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, 'ERROR1' => 1 );
+ $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, 'ERROR1' => 1 );
}
}
if ($mod_branch) {
# copy input parameters back to form
# FIXME - doing this doesn't preserve any branch group selections, but good enough for now
editbranchform($branchcode,$template);
- $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, "ERROR$error" => 1 );
+ $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, "ERROR$error" => 1 );
} else {
$template->param( else => 1);
default("MESSAGE2",$template);
elsif ( $op eq 'editcategory' ) {
# If the user has pressed the "add new category" or "modify" buttons.
- $template->param( 'heading-branches-edit-category-p' => 1 );
+ $template->param( 'heading_branches_edit_category_p' => 1 );
editcatform($categorycode,$template);
}
elsif ( $op eq 'addcategory_validate' ) {
my $innertemplate = shift or return;
$innertemplate->param($message => 1) if $message;
$innertemplate->param(
- 'heading-branches-p' => 1,
+ 'heading_branches_p' => 1,
);
branchinfotable("",$innertemplate);
}
for my $field (
'branchaddress1', 'branchaddress2',
'branchaddress3', 'branchzip',
- 'branchcity', 'branchcountry',
+ 'branchcity', 'branchstate', 'branchcountry',
'branchphone', 'branchfax',
'branchemail', 'branchurl',
'branchip', 'branchprinter', 'branchnotes'
categorytype => $cat->{'categorytype'},
};
}
- push @branchcategories, { categorytype => $ctype , $ctype => 1 , catloop => \@categories};
+ push @branchcategories, { categorytype => $ctype , $ctype => 1 , catloop => ( @categories ? \@categories : undef) };
}
$innertemplate->param(
branches => \@loop_data,
branchaddress3 => $data->{'branchaddress3'},
branchzip => $data->{'branchzip'},
branchcity => $data->{'branchcity'},
+ branchstate => $data->{'branchstate'},
branchcountry => $data->{'branchcountry'},
branchphone => $data->{'branchphone'},
branchfax => $data->{'branchfax'},