blob: 1d45e126f7762abd6dc064e8f6260fa7ce069dd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<& elements/process.html,
'table' => 'invoice_conf',
'viewall_dir' => 'browse',
'fields' => [ FS::invoice_conf->fields, 'modename', 'agentnum' ],
'precheck_callback' => \&precheck_callback,
&>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates','Edit global templates']);
sub precheck_callback {
my $cgi = shift;
$cgi->param('locale') =~ /^(\w*)$/;
my $locale = $1;
return mt('Language required') if $locale eq 'new'; # the user didn't choose
die "unknown locale $locale" if ( $locale and
!FS::Locales->locale_info($locale) );
}
# invoice_conf itself knows to create/update invoice_mode if necessary,
# so nothing special here
</%init>
|