diff options
| author | Mark Wells <mark@freeside.biz> | 2015-08-29 21:27:20 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-08-29 21:27:20 -0700 |
| commit | 9fd03716b831bd00a725a63edbe19cfe6b88aea0 (patch) | |
| tree | a6854452a54eb2867004a25a154ac13ed320980d /httemplate/browse/msg_template.html | |
| parent | d622148c3ad8e98aef7ae1ca163e28483e023609 (diff) | |
#21564: user interface for REST client
Diffstat (limited to 'httemplate/browse/msg_template.html')
| -rw-r--r-- | httemplate/browse/msg_template.html | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/httemplate/browse/msg_template.html b/httemplate/browse/msg_template.html deleted file mode 100644 index 1646bc169..000000000 --- a/httemplate/browse/msg_template.html +++ /dev/null @@ -1,65 +0,0 @@ -<% include( 'elements/browse.html', - 'title' => 'Message templates', - 'name_singular' => 'template', - 'menubar' => \@menubar, - 'query' => { 'table' => 'msg_template', }, - 'count_query' => 'SELECT COUNT(*) FROM msg_template', - 'disableable' => 1, - 'disabled_statuspos' => (scalar(@locales) + 3), - 'agent_virt' => 1, - 'agent_null_right' => ['View global templates','Edit global templates'], - 'agent_pos' => 1, - 'header' => [ 'Name', '', map ('', @locales), '' ], - 'fields' => [ 'msgname', @locales, $disable_link_label ], - 'links' => [ $link, @locale_links, '' ], - 'link_onclicks' => [ '', map('', @locale_links), $disable_link ], - 'cell_style' => [ '', '', map ($locale_style, @locales), $locale_style ], - ) -%> -<%init> - -my $curuser = $FS::CurrentUser::CurrentUser; - -die "access denied" - unless $curuser->access_right([ 'View templates', 'View global templates', - 'Edit templates', 'Edit global templates', ]); - -my @menubar = (); -if ( $curuser->access_right(['Edit templates', 'Edit global templates']) ) { - push @menubar, 'Add a new template' => $p.'edit/msg_template.html'; -} -push @menubar, 'View template images' => $p.'browse/template_image.html'; - -my $link = [ "${p}edit/msg_template.html?msgnum=", 'msgnum' ]; - -my $locale_style = 'font-size:0.8em; padding:3px'; - -my (@locales, @locale_links); -foreach my $l ( FS::Locales->locales ) { - push @locales, sub { - exists ( $_[0]->content_locales->{$l} ) - ? +{ FS::Locales->locale_info($l) }->{'label'} - : ''; - }; - push @locale_links, sub { - my $content = $_[0]->content_locales->{$l} or return ''; - [ "${p}edit/msg_template.html?locale=$l;msgnum=", 'msgnum' ]; - }; -} - -my $disable_link = sub { - my $template = shift; - include('/elements/popup_link_onclick.html', - action => $p.'misc/disable-msg_template.cgi?msgnum=' . - $template->msgnum . - ($template->disabled ? ';enable=1' : ''), - actionlabel => 'Disable template', - ); -}; - -my $disable_link_label = sub { - my $template = shift; - $template->disabled ? '(enable)' : '(disable)' ; -}; - -</%init> |
