summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-09-27 17:29:17 -0700
committerMark Wells <mark@freeside.biz>2013-09-27 17:29:17 -0700
commit1d6a32338660e3d7202faa7e4ce14736b4569a48 (patch)
tree681f6a7887f43974b7e58508e5aeb5b59db531b7 /httemplate/edit/process
parentc64ff892b9067f7aa719e78b20379d3274907946 (diff)
invoice configurations, #24723
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/invoice_conf.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/httemplate/edit/process/invoice_conf.html b/httemplate/edit/process/invoice_conf.html
new file mode 100644
index 000000000..1d45e126f
--- /dev/null
+++ b/httemplate/edit/process/invoice_conf.html
@@ -0,0 +1,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>