% include('/elements/header.html', "$action Virtual Field Definition") %>
<% include('/elements/error.html') %>
If you don't understand what check_block and
list_source mean, LEAVE THEM BLANK. We mean it.
<% include('/elements/footer.html') %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my ($vfieldpart, $part_virtual_field);
if ( $cgi->param('error') ) {
$part_virtual_field = new FS::part_virtual_field ( {
map { $_, scalar($cgi->param($_)) } fields('part_virtual_field')});
$vfieldpart = $part_virtual_field->vfieldpart;
} else {
my($query) = $cgi->keywords;
if ( $query =~ /^(\d+)$/ ) { #editing
$vfieldpart=$1;
$part_virtual_field=qsearchs('part_virtual_field',
{'vfieldpart' => $vfieldpart})
or die "Unknown vfieldpart!";
} else { #adding
$part_virtual_field = new FS::part_virtual_field({});
}
}
my $action = $part_virtual_field->vfieldpart ? 'Edit' : 'Add';
my $p1 = popurl(1);
%init>