X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_Common.html;h=3da72d2e8a7fe32ad7a631f296d31f7a82ad1c27;hp=9cf88612060a0e5e8c5797858de488d2a37c71b4;hb=75e11f1d1a5ced24496b5732e290f7762403feb8;hpb=5657663a43689787fdc3c5da73775502daecc588 diff --git a/httemplate/edit/svc_Common.html b/httemplate/edit/svc_Common.html index 9cf886120..3da72d2e8 100644 --- a/httemplate/edit/svc_Common.html +++ b/httemplate/edit/svc_Common.html @@ -1,6 +1,33 @@ <% include('elements/svc_Common.html', 'table' => $table, 'post_url' => popurl(1). "process/svc_Common.html", + %opt, ) %> -%# i don't think this is actuallly used by anything?? +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific? + +# false laziness w/view/svc_Common.html + +$cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparsable svcdb"; +my $table = $1; +require "FS/$table.pm"; + +my %opt; +if ( UNIVERSAL::can("FS::$table", 'table_info') ) { + $opt{'name'} = "FS::$table"->table_info->{'name'}; + + my $fields = "FS::$table"->table_info->{'fields'}; + my %labels = map { $_ => ( ref($fields->{$_}) + ? $fields->{$_}{'label'} + : $fields->{$_} + ); + } + keys %$fields; + $opt{'labels'} = \%labels; + +} + +