X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_virtual_field.cgi;h=04ba9b0c0ea9946ad059f914089427497e806d7f;hp=7b2c768a7a527ef9df709a6b8c3f410945c1a163;hb=c49cfd25a8f92c7a2f44b51d72506a21f6b8d09f;hpb=2c757d7db4cb6a7b9655de13206fcc84fb7ce61f diff --git a/httemplate/edit/part_virtual_field.cgi b/httemplate/edit/part_virtual_field.cgi index 7b2c768a7..04ba9b0c0 100644 --- a/httemplate/edit/part_virtual_field.cgi +++ b/httemplate/edit/part_virtual_field.cgi @@ -1,83 +1,67 @@ -<% -my ($vfieldpart, $part_virtual_field); +<% include('/elements/header.html', "$action Virtual Field Definition") %> -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); - -%><%= include('/elements/header.html', "$action Virtual Field Definition") %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -

-<% } %> +<% include('/elements/error.html') %> -
+ -browse/part_virtual_field.cgi"> + -Field #<%=$vfieldpart or "(NEW)"%>

+Field #<%$vfieldpart or "(NEW)"%>

-<%=ntable("#cccccc",2)%> +<%ntable("#cccccc",2)%> Name - Table - <% if ($action eq 'Add') { %> - <% - } else { # Edit - %><%=$part_virtual_field->dbtable%> - - <% } %> + +% if ($action eq 'Add') { + + +% +% } else { # Edit +% +<%$part_virtual_field->dbtable%> + +% } + Label - Length - Check - List source -
@@ -88,4 +72,33 @@ Field #<%=$vfieldpart or "(NEW)"%>

If you don't understand what check_block and list_source mean, LEAVE THEM BLANK. We mean it. -<%= include('/elements/footer.html') %> +<% 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); + +