X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_Common.html;h=9c4d71eb8e9b4e2967846204ba826dc276970199;hp=7ed63c7aa4aa953908f7bbdf88aa48ac50e676af;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/httemplate/view/svc_Common.html b/httemplate/view/svc_Common.html index 7ed63c7aa..9c4d71eb8 100644 --- a/httemplate/view/svc_Common.html +++ b/httemplate/view/svc_Common.html @@ -1,14 +1,13 @@ -<% include('elements/svc_Common.html', +<& elements/svc_Common.html, 'table' => $table, 'edit_url' => $edit_url, #$p."edit/svc_Common.html?svcdb=$table;svcnum=", %opt, - ) -%> +&> <%init> # false laziness w/edit/svc_Common.html -$cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparsable svcdb"; +$cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparseable svcdb"; my $table = $1; require "FS/$table.pm"; @@ -26,6 +25,17 @@ if ( UNIVERSAL::can("FS::$table", 'table_info') ) { } keys %$fields; $opt{'labels'} = \%labels; + + #transform FS::svc_* table_info's structure into one svc_Common.html likes + delete $fields->{svcnum}; + $opt{'fields'} = [ map { ref $fields->{$_} + ? { field => $_, + %{ $fields->{$_} } + } + : $_ + } keys %$fields + ]; + }