1 <& /browse/elements/browse.html,
2 'title' => 'External message interfaces',
3 'name_singular' => 'interface', # what else do we call them?
4 'menubar' => \@menubar,
6 'count_query' => $count_query,
8 'disabled_statuspos' => 4,
10 'agent_null_right' => ['View global templates','Edit global templates'],
17 'fields' => [ 'msgname',
22 'links' => [ $link, ],
23 'link_onclicks' => [ '', '', '', $disable_link ],
24 'cell_style' => [ '', '', $url_style, $url_style ],
28 my $curuser = $FS::CurrentUser::CurrentUser;
31 unless $curuser->access_right([ 'View templates', 'View global templates',
32 'Edit templates', 'Edit global templates', ]);
35 if ( $curuser->access_right(['Edit templates', 'Edit global templates']) ) {
36 push @menubar, 'Add a new interface' => $fsurl.'edit/msg_template/http.html';
38 push @menubar, 'Email templates' => $fsurl.'browse/msg_template/email.html';
39 push @menubar, 'Template images' => $fsurl.'browse/template_image.html';
42 'table' => 'msg_template',
44 'hashref' => { 'msgclass' => 'http' },
47 my $count_query = "SELECT COUNT(*) FROM msg_template WHERE msgclass = 'http'";
49 my $link = [ $fsurl.'edit/msg_template/http.html?msgnum=', 'msgnum' ];
51 my $url_style = 'font-size:0.8em; padding:3px'; # also for (disable) label
53 my $disable_link = sub {
55 include('/elements/popup_link_onclick.html',
56 action => $fsurl.'misc/disable-msg_template.cgi?msgnum=' .
58 ($template->disabled ? ';enable=1' : ''),
59 actionlabel => 'Disable template',
63 my $disable_link_label = sub {
65 $template->disabled ? '(enable)' : '(disable)' ;