X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Frate_detail.html;h=dd8c3f6b38c1a7491f7253b4d394785da35fa0d3;hb=e078ca418dcf3c7b92efcd371ce761df3314c369;hp=b9eaf657ea98cdb9b65ee1d26149e72f02c2ac6f;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/edit/rate_detail.html b/httemplate/edit/rate_detail.html index b9eaf657e..dd8c3f6b3 100644 --- a/httemplate/edit/rate_detail.html +++ b/httemplate/edit/rate_detail.html @@ -5,9 +5,10 @@ 'labels' => { 'ratedetailnum' => 'Rate', #should hide... 'dest_regionname' => 'Region', 'dest_prefixes_short' => 'Prefix(es)', - 'min_included' => 'Included minutes', - 'min_charge' => 'Charge per minute', + 'min_included' => 'Included minutes/calls', + 'min_charge' => 'Charge per minute/call', 'sec_granularity' => 'Granularity', + 'classnum' => 'Usage class', }, 'fields' => [ { field=>'ratenum', type=>'hidden', }, @@ -19,22 +20,24 @@ { field=>'min_charge', type=>'money', size=>4 }, { field =>'sec_granularity', type =>'select', - options => [qw( 1 6 30 60 )], + options => [ keys %granularity ], labels => \%granularity, disable_empty => 1, }, + { field =>'classnum', + type =>'select-table', + table =>'usage_class', + name_col =>'classname', + empty_label =>'(default)', + hashref =>{ disabled => '' }, + }, ], ) %> <%once> -tie my %granularity, 'Tie::IxHash', - '1', => '1 second', - '6' => '6 second', - '30' => '30 second', # '1/2 minute', - '60' => 'minute', -; +tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); @@ -46,7 +49,8 @@ die "access denied" #slightly inefficient, i suppose an edit+error callback would be better my $name = 'rate'; -if ( $cgi->keywords =~ /^(\d+)$/ +my ($keywords) = $cgi->keywords; +if ( $keywords =~ /^(\d+)$/ || $cgi->param('ratedetailnum') =~ /^(\d+)$/ ) { my $rate_detail = qsearchs('rate_detail', { 'ratedetailnum' => $1 } ) or die "unknown ratedetailnum $1";