diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-05-15 18:25:37 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-05-15 18:25:37 -0700 |
commit | 49fc33db77d202f175a4d8a33e3eab1e52080a4d (patch) | |
tree | 9ce8e9a30a35ac581facf78479d4aee27fe89942 /httemplate/elements | |
parent | 1ae273f69e5bf2b46c9c5fcd990ad923770ace56 (diff) |
read only access to message templates, RT#1`7477
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/menu.html | 7 | ||||
-rw-r--r-- | httemplate/elements/tr-fixed.html | 16 | ||||
-rw-r--r-- | httemplate/elements/tr-select-agent.html | 19 |
3 files changed, 27 insertions, 15 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index fcc17eaa2..cf79af9d5 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -532,7 +532,7 @@ $config_billing{'Billing events'} = [ $fsurl.'browse/part_event.html', 'Billing || $curuser->access_right('Edit global billing events'); if ( $curuser->access_right('Configuration') ) { #$config_billing{'Invoice events'} = [ $fsurl.'browse/part_bill_event.cgi', 'Deprecated, old-style actions for overdue invoices' ]; - $config_billing{'Invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ]; +#this doesn't work right# $config_billing{'Invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ]; $config_billing{'Prepaid cards'} = [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ]; $config_billing{'Call rates and regions'} = [ \%config_billing_rates, 'Manage rate plans, regions and prefixes for VoIP and call billing' ]; @@ -565,9 +565,8 @@ tie my %config_nms, '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') - || $curuser->access_right('Configuration'); + if $curuser->access_right(['View templates', 'View global templates', + 'Edit templates', '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'); diff --git a/httemplate/elements/tr-fixed.html b/httemplate/elements/tr-fixed.html index f358343dd..dd07d90b6 100644 --- a/httemplate/elements/tr-fixed.html +++ b/httemplate/elements/tr-fixed.html @@ -13,13 +13,15 @@ my %opt = @_; my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; my $value = $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'}; -#compatibility with select-table and friends -if ( $opt{'multiple'} ) { - $value = [ split(/\s*,\s*/, $value) ] if !ref $value; - $value = join('<BR>', map {encode_entities($_)} @$value); -} -else { - $value = encode_entities($value) + +unless ( $opt{'noescape'} ) { + #compatibility with select-table and friends + if ( $opt{'multiple'} ) { + $value = [ split(/\s*,\s*/, $value) ] if !ref $value; + $value = join('<BR>', map {encode_entities($_)} @$value); + } else { + $value = encode_entities($value) + } } </%init> diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index ce03c40f5..321bd6b32 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -22,7 +22,7 @@ Example: ); </%doc> -% if ( scalar(@agents) == 1 ) { +% if ( scalar(@agents) == 1 || $opt{'fixed'} ) { <INPUT TYPE = "hidden" NAME = "<% $opt{'field'} || 'agentnum' %>" @@ -30,9 +30,20 @@ Example: VALUE = "<% $agents[0]->agentnum %>" > -%# YUCK. empty row so we don't throw g_row in edit.html off :/ - <TR> - </TR> +% if ( scalar(@agents) != 1 ) { + <TR> + <TD ALIGN="right"><% $opt{'label'} || emt('Agent') %></TD> + <TD BGCOLOR="#dddddd" <% $colspan %>> +% my $agent = qsearchs('agent', { 'agentnum' => $agentnum }); + <% $agent ? $agent->agent : '(all)' |h %> + </TD> + </TR> + +% } else { # YUCK. empty row so we don't throw g_row in edit.html off :/ + <TR> + </TR> +% } +% % } else { <TR> |