[freeside-commits] freeside/httemplate/elements rate_tier_detail.html, NONE, 1.1.2.2 tr-rate_tier_detail.html, NONE, 1.1.2.2
Ivan,,,
ivan at wavetail.420.am
Sun Nov 13 20:28:52 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv30904/httemplate/elements
Added Files:
Tag: FREESIDE_2_3_BRANCH
rate_tier_detail.html tr-rate_tier_detail.html
Log Message:
rate tiers for vnes, RT#14903
--- NEW FILE: tr-rate_tier_detail.html ---
% unless ( $opt{'js_only'} ) {
<% include('tr-td-label.html', %opt) %>
<TD <% $cell_style %>>
% }
%
<% include( '/elements/rate_tier_detail.html', %opt ) %>
%
% unless ( $opt{'js_only'} ) {
</TD>
</TR>
% }
<%init>
my( %opt ) = @_;
my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
$opt{'label'} ||= 'Tier';
</%init>
--- NEW FILE: rate_tier_detail.html ---
% unless ( $opt{'js_only'} ) {
<INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
<TABLE>
<TR>
% foreach my $field ( @fields ) {
%
% my $value = $rate_tier_detail->get($field);
<TD>
<% $field eq 'min_charge' ? $money_char : '' %>
<INPUT TYPE = "text"
NAME = "<%$name%>_<%$field%>"
ID = "<%$id%>_<%$field%>"
SIZE = "<% $size{$field} || 15 %>"
STYLE = "text-align:right"
VALUE = "<% scalar($cgi->param($name."_$field"))
|| $value |h %>"
<% $onchange %>
><BR>
<FONT SIZE="-1"><% $label{$field} %></FONT>
</TD>
% }
</TR>
</TABLE>
% }
<%init>
my( %opt ) = @_;
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
my $name = $opt{'element_name'} || $opt{'field'} || 'tierdetailnum';
my $id = $opt{'id'} || 'tierdetailnum';
my $curr_value = $opt{'curr_value'} || $opt{'value'};
my $onchange = '';
if ( $opt{'onchange'} ) {
$onchange = $opt{'onchange'};
$onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
$onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
#callbacks should act the same
$onchange = 'onChange="'. $onchange. '"';
}
my $rate_tier_detail;
if ( $curr_value ) {
$rate_tier_detail = qsearchs('rate_tier_detail', { 'tierdetailnum' => $curr_value } );
} else {
$rate_tier_detail = new FS::rate_tier_detail {};
}
my %size = ( 'title' => 12 );
tie my %label, 'Tie::IxHash',
'min_quan' => 'Minimum quantity',
'min_charge' => 'Charge per minute/call',
;
my @fields = keys %label;
</%init>
More information about the freeside-commits
mailing list