diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-10-13 10:10:40 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-10-13 10:10:40 -0700 |
| commit | 2b2dd969f3c18751afc583ad1e836ab8e6f73b5d (patch) | |
| tree | 72ad19092f9d3a5118add9a55067b8a97c168f46 /httemplate/edit/process/msg_template.html | |
| parent | d31d59c63c8f4dfd52ca19a02ffcf32fcf49f497 (diff) | |
| parent | cd468ecb9a321ca96254b7204f6dc193b11cd903 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process/msg_template.html')
| -rw-r--r-- | httemplate/edit/process/msg_template.html | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/httemplate/edit/process/msg_template.html b/httemplate/edit/process/msg_template.html index e146adf76..d8b125ae0 100644 --- a/httemplate/edit/process/msg_template.html +++ b/httemplate/edit/process/msg_template.html @@ -1,7 +1,7 @@ <% include( 'elements/process.html', 'table' => 'msg_template', - 'viewall_dir' => 'browse', - #'popup_reload'=> 1, + 'fields' => $fields, + 'viewall_url' => "browse/msg_template/$msgclass.html", 'debug' => 0, 'precheck_callback' => \&precheck_callback, 'args_callback' => \&args_callback, @@ -11,9 +11,21 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates','Edit global templates']); +my $msgclass = 'email'; +if ( $cgi->param('msgclass') =~ /^(\w+)$/ ) { + $msgclass = $1; +} + +my $fields = [ fields('msg_template') ]; +my $class = "FS::msg_template::$msgclass"; +eval "use $class;"; +if ( $class->extension_table ) { + push @$fields, fields($class->extension_table); +} + sub precheck_callback { my $cgi = shift; - # validate some fields + # validate locale field (for email-type records) $cgi->param('locale') =~ /^(\w*)$/; my $locale = $1; return mt('Language required') if $locale eq 'new'; # the user didn't choose |
