X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_Common.html;h=5949a4dc0fcaccdb75258ee532cfe55f1c654d7e;hp=6393f9ebcdd6b658f9b75a4e2573b51bd76ad5ff;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=633c48448d9468690b7ad77eb6ff7c660a286658 diff --git a/httemplate/edit/svc_Common.html b/httemplate/edit/svc_Common.html index 6393f9ebc..5949a4dc0 100644 --- a/httemplate/edit/svc_Common.html +++ b/httemplate/edit/svc_Common.html @@ -1,5 +1,14 @@ +<% include('elements/svc_Common.html', + 'table' => $table, + 'post_url' => popurl(1). "process/svc_Common.html", + %opt, + ) +%> <%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"; @@ -11,6 +20,7 @@ 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->{$_} @@ -19,12 +29,17 @@ if ( UNIVERSAL::can("FS::$table", 'table_info') ) { keys %$fields; $opt{'labels'} = \%labels; + #transform FS::svc_* table_info's structure into one edit.html likes + delete $fields->{svcnum}; + $opt{'fields'} = [ map { ref $fields->{$_} + ? { field => $_, + %{ $fields->{$_} } + } + : $_ + } keys %$fields + ]; + + } -<% include('elements/svc_Common.html', - 'table' => $table, - 'post_url' => popurl(1). "process/svc_Common.html", - %opt, - ) -%>