internationalization/localization, RT12515
[freeside.git] / httemplate / view / svc_Common.html
1 <% include('elements/svc_Common.html',
2              'table'    => $table,
3              'edit_url' => $edit_url, #$p."edit/svc_Common.html?svcdb=$table;svcnum=",
4              %opt,
5           )
6 %>
7 <%init>
8
9 # false laziness w/edit/svc_Common.html
10
11 $cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparsable svcdb";
12 my $table = $1;
13 require "FS/$table.pm";
14
15 my $edit_url = svc_url( 'm' => $m, 'action' => 'edit', 'svcdb' => $table, query => '' );
16
17 my %opt;
18 if ( UNIVERSAL::can("FS::$table", 'table_info') ) {
19   $opt{'name'}   = "FS::$table"->table_info->{'name'};
20
21   my $fields = "FS::$table"->table_info->{'fields'};
22   my %labels = map { $_ =>  ( ref($fields->{$_})
23                                ? $fields->{$_}{'label'}
24                                : $fields->{$_}
25                            );
26                    }
27                keys %$fields;
28   $opt{'labels'} = \%labels;
29 }
30
31 </%init>