summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2010-07-12 13:17:45 +0000
committerivan <ivan>2010-07-12 13:17:45 +0000
commit9569b2f1e6147f97bfacb41bc94c6605eb59206f (patch)
treef147e4cb6f0422b1345820d22ae4b78905364dae /httemplate
parent184a1a9cfcd3beb1c4eabbdb2cfa5b5064684b9c (diff)
message templates, RT#8896
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/msg_template.html27
-rw-r--r--httemplate/edit/msg_template.html16
-rw-r--r--httemplate/edit/process/msg_template.html12
-rw-r--r--httemplate/elements/menu.html5
-rw-r--r--httemplate/elements/tr-htmlarea.html25
5 files changed, 84 insertions, 1 deletions
diff --git a/httemplate/browse/msg_template.html b/httemplate/browse/msg_template.html
new file mode 100644
index 000000000..331906ccf
--- /dev/null
+++ b/httemplate/browse/msg_template.html
@@ -0,0 +1,27 @@
+<% include( 'elements/browse.html',
+ 'title' => 'Message templates',
+ 'name_singular' => 'template',
+ 'menubar' => [ 'Add a new template' =>
+ $p.'edit/msg_template.html',
+ ],
+ 'query' => { 'table' => 'msg_template', },
+ 'count_query' => 'SELECT COUNT(*) FROM msg_template',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 2,
+ 'agent_virt' => 1,
+ 'agent_null_right' => 'Edit global templates',
+ 'agent_pos' => 3,
+ 'header' => [ 'Name' ],
+ 'fields' => [ 'msgname' ],
+ 'links' => [ $link ],
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
+ || $FS::CurrentUser::CurrentUser->access_right('Edit global templates');
+
+my $link = [ "${p}edit/msg_template.html?", 'msgnum' ];
+
+</%init>
diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html
new file mode 100644
index 000000000..6632d027a
--- /dev/null
+++ b/httemplate/edit/msg_template.html
@@ -0,0 +1,16 @@
+<% include( 'elements/edit.html',
+ 'name_singular' => 'template',
+ 'table' => 'msg_template',
+ 'viewall_dir' => 'browse',
+ 'fields' => [ 'msgname',
+ { field=>'body', type=>'htmlarea' },
+ ],
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
+ || $FS::CurrentUser::CurrentUser->access_right('Edit global templates');
+
+</%init>
diff --git a/httemplate/edit/process/msg_template.html b/httemplate/edit/process/msg_template.html
new file mode 100644
index 000000000..5cf88bfad
--- /dev/null
+++ b/httemplate/edit/process/msg_template.html
@@ -0,0 +1,12 @@
+<% include( 'elements/process.html',
+ 'table' => 'msg_template',
+ 'viewall_dir' => 'browse',
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
+ || $FS::CurrentUser::CurrentUser->access_right('Edit global templates');
+
+</%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index ef105b1d6..190455772 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -472,12 +472,15 @@ tie my %config_phone, 'Tie::IxHash',
;
tie my %config_misc, 'Tie::IxHash';
+$config_misc{'Message templates'} = [ $fsurl.'browse/msg_template.html', 'Templates for customer notices' ]
+ if $curuser->access_right('Edit templates')
+ || $curuser->access_right('Edit global templates');
$config_misc{'Advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service.' ]
if $curuser->access_right('Edit advertising sources')
|| $curuser->access_right('Edit global advertising sources');
if ( $curuser->access_right('Configuration') ) {
$config_misc{'Virtual fields'} = [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ];
- $config_misc{'Message catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ];
+ $config_misc{'Error catalog'} = [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ];
}
$config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ]
if $curuser->access_right('Edit inventory')
diff --git a/httemplate/elements/tr-htmlarea.html b/httemplate/elements/tr-htmlarea.html
new file mode 100644
index 000000000..1a4e25080
--- /dev/null
+++ b/httemplate/elements/tr-htmlarea.html
@@ -0,0 +1,25 @@
+<% include('tr-td-label.html', @_ ) %>
+
+ <TD <% $cell_style %>>
+
+ <% include('htmlarea.html', @_ ) %>
+
+ </TD>
+
+</TR>
+
+<%init>
+
+my %opt = @_;
+
+my $onchange = $opt{'onchange'}
+ ? 'onChange="'. $opt{'onchange'}. '(this)"'
+ : '';
+
+#my $rows = $opt{'rows'} ? 'ROWS="'.$opt{'rows'}.'"' : '';
+#my $cols = $opt{'cols'} ? 'COLS="'.$opt{'cols'}.'"' : '';
+
+my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+#my $curr_value = $opt{'curr_value'};
+
+</%init>