X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Frate_detail.html;h=3371926b425e949b620fe55db23f17bba1df1c5b;hb=da99804133e55d5ce02402645b593a6de06d1947;hp=5dde85f8b59d537dcbc970c6bb5768b5c6629fd8;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/httemplate/browse/rate_detail.html b/httemplate/browse/rate_detail.html index 5dde85f8b..3371926b4 100644 --- a/httemplate/browse/rate_detail.html +++ b/httemplate/browse/rate_detail.html @@ -15,44 +15,33 @@ 'Region', 'Prefix(es)', 'Included
minutes', + 'Connection
charge', 'Charge per
minute', 'Granularity', + 'Usage class', ], 'fields' => [ 'regionname', sub { shift->dest_region->prefixes_short }, - sub { shift->min_included. - ' (edit)'; - }, - sub { $money_char. shift->min_charge. - ' (edit)'; - }, + sub { shift->min_included. $edit_hint }, + $conn_charge_sub, + sub { $money_char. shift->min_charge. $edit_hint }, sub { $granularity{ shift->sec_granularity } }, + 'classname', ], - 'links' => [ '', '', $edit_link, $edit_link, '' ], - 'link_onclicks' => [ '', '', $edit_onclick, $edit_onclick, '' ], - 'align' => 'llrrc', + 'links' => [ '', '', $edit_link, $edit_link, '', '' ], + 'link_onclicks' => [ '', '', $edit_onclick, $edit_onclick, '', '' ], + 'align' => 'llrrcc', ) %> <%once> -my %granularity = ( - '1', => '1 second', - '6' => '6 second', - '30' => '30 second', # '1/2 minute', - '60' => 'minute', -); +tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); +tie my %conn_secs, 'Tie::IxHash', FS::rate_detail::conn_secs(); my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; -my $html_init = qq( - - - - -); - my $join = ' JOIN rate_region ON ( rate_detail.dest_regionnum = rate_region.regionnum )'; @@ -61,8 +50,22 @@ my $edit_link = [ 'javascript:void(0);', sub { ''; } ]; my $edit_onclick = sub { my $rate_detail = shift; my $ratedetailnum = $rate_detail->ratedetailnum; - my $color = '#333399'; - qq!overlib( OLiframeContent('${p}edit/rate_detail.html?$ratedetailnum', 540, 420, 'edit_rate_detail_popup' ), CAPTION, 'Edit tax rate', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '$color', CGCOLOR, '$color' ); return false;!; + include( '/elements/popup_link_onclick.html', + 'action' => "${p}edit/rate_detail.html?$ratedetailnum", + 'actionlabel' => 'Edit rate', + 'height' => 420, + #default# 'width' => 540, + #default# 'color' => '#333399', + ); +}; +my $edit_hint = ' (edit)'; + +my $conn_charge_sub = sub { + my $rate_detail = shift; + #return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec; + $money_char. $rate_detail->conn_charge. + ($rate_detail->conn_sec ? ' for '.$conn_secs{$rate_detail->conn_sec} : ''). + $edit_hint; }; @@ -71,6 +74,8 @@ my $edit_onclick = sub { die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $html_init = include('/elements/init_overlib.html'); + $cgi->param('ratenum') =~ /^(\d+)$/ or die "unparsable ratenum"; my $ratenum = $1; my $rate = qsearchs('rate', { 'ratenum' => $ratenum } )