X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Frate_detail.html;h=869ace8d4a456a9597cb4aee938d7172295a72a7;hp=b9eaf657ea98cdb9b65ee1d26149e72f02c2ac6f;hb=bf4223e554e0eb72f45f82392442780e8af4e0f9;hpb=5e05724a635a22776f1b973f5d7e77989da4e048 diff --git a/httemplate/edit/rate_detail.html b/httemplate/edit/rate_detail.html index b9eaf657e..869ace8d4 100644 --- a/httemplate/edit/rate_detail.html +++ b/httemplate/edit/rate_detail.html @@ -5,9 +5,12 @@ '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', + 'conn_charge' => 'Connection charge', + 'conn_sec' => 'For', + 'min_charge' => 'Charge per minute/call', 'sec_granularity' => 'Granularity', + 'classnum' => 'Usage class', }, 'fields' => [ { field=>'ratenum', type=>'hidden', }, @@ -16,28 +19,37 @@ { field=>'dest_regionname', type=>'fixed', }, { field=>'dest_prefixes_short', type=>'fixed', }, { field=>'min_included', type=>'text', size=>5 }, + { field=>'conn_charge', type=>'money', size=>4 }, + { field =>'conn_sec', + type =>'select', + options => [ keys %conn_secs ], + labels => \%conn_secs, + disable_empty => 1, + }, { 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(); +tie my %conn_secs, 'Tie::IxHash', FS::rate_detail::conn_secs(); - <%init> my $conf = new FS::Conf; @@ -46,7 +58,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";