X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fmsg_template.html;h=8a6ccf741b2a110fc8b4ca24f737540b2abb04e1;hb=d838063ab25f047e88c3e5ae16f77fc4f3481ce9;hp=0cd33c79752dffa456552d1ee10b82c88c0a9cbf;hpb=f07729b883f93aab6eaf4dffaa9b725e36c6852a;p=freeside.git diff --git a/httemplate/browse/msg_template.html b/httemplate/browse/msg_template.html index 0cd33c797..8a6ccf741 100644 --- a/httemplate/browse/msg_template.html +++ b/httemplate/browse/msg_template.html @@ -9,11 +9,13 @@ 'disableable' => 1, 'disabled_statuspos' => 2, 'agent_virt' => 1, - 'agent_null_right' => 'Edit global templates', - 'agent_pos' => 3, - 'header' => [ 'Name' ], - 'fields' => [ 'msgname' ], - 'links' => [ $link ], + 'agent_null_right' => ['Edit global templates','Configuration'], + 'agent_pos' => 1, + 'header' => [ 'Name', '', ('' x scalar @locales) ], + 'fields' => [ 'msgname', @locales ], + 'links' => [ $link, @locale_links ], + 'cell_style' => + [ '', '', ($locale_style) x (scalar @locales) ], ) %> <%init> @@ -23,6 +25,22 @@ die "access denied" || $FS::CurrentUser::CurrentUser->access_right('Edit global templates') || $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my $link = [ "${p}edit/msg_template.html?", 'msgnum' ]; +my $link = [ "${p}edit/msg_template.html?msgnum=", 'msgnum' ]; + +my $locale_style = 'font-size:0.8em; padding:3px; background-color:'; + +my (@locales, @locale_links); +foreach my $l ( FS::Locales->locales ) { + push @locales, sub { + exists ( $_[0]->content_locales->{$l} ) + ? +{ FS::Locales->locale_info($l) }->{'name'} + : ''; + }; + push @locale_links, sub { + my $content = $_[0]->content_locales->{$l} or return ''; + [ "${p}edit/msg_template.html?locale=$l;msgnum=", 'msgnum' ]; + }; +} +