X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fbrowse%2Frate_detail.html;h=aef550513ee3c502ba32bbfa84cf7e62149b1940;hb=5250c44bd7f282c7d782bf0e8349af12376929df;hp=5dde85f8b59d537dcbc970c6bb5768b5c6629fd8;hpb=8baad1bb7327eb2f704bdcc5d040a24a94de8879;p=freeside.git
diff --git a/httemplate/browse/rate_detail.html b/httemplate/browse/rate_detail.html
index 5dde85f8b..aef550513 100644
--- a/httemplate/browse/rate_detail.html
+++ b/httemplate/browse/rate_detail.html
@@ -1,69 +1,21 @@
-<% include( 'elements/browse.html',
- 'title' => $title,
- 'name_singular' => 'rate',
- 'html_init' => $html_init,
- 'menubar' => [ 'Rate plans' => $p.'browse/rate.cgi' ],
- 'query' => {
- 'table' => 'rate_detail',
- 'addl_from' => $join,
- 'hashref' => { 'ratenum' => $ratenum },
- 'extra_sql' => $where,
- },
- 'count_query' => "SELECT COUNT(*) FROM rate_detail $join".
- " WHERE ratenum = $ratenum $where",
- 'header' => [
- 'Region',
- 'Prefix(es)',
- 'Included
minutes',
- 'Charge per
minute',
- 'Granularity',
- ],
- 'fields' => [
- 'regionname',
- sub { shift->dest_region->prefixes_short },
- sub { shift->min_included.
- ' (edit)';
- },
- sub { $money_char. shift->min_charge.
- ' (edit)';
- },
- sub { $granularity{ shift->sec_granularity } },
- ],
- 'links' => [ '', '', $edit_link, $edit_link, '' ],
- 'link_onclicks' => [ '', '', $edit_onclick, $edit_onclick, '' ],
- 'align' => 'llrrc',
- )
-%>
-<%once>
+<% include('/elements/init_overlib.html') %>
+<% include('/elements/header.html',$title) %>
+<% include('/elements/menubar.html',@menubar) %>
+<% include('/edit/elements/rate_detail.html',
+ 'ratenum' => $ratenum,
+ 'countrycode' => $countrycode,
+) %>
+<% include('/elements/footer.html') %>
-my %granularity = (
- '1', => '1 second',
- '6' => '6 second',
- '30' => '30 second', # '1/2 minute',
- '60' => 'minute',
-);
+<%once>
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 )';
-
-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;!;
-};
+my @menubar = ( 'Rate plans' => $p.'browse/rate.cgi',
+ 'Regions and Prefixes' => $p.'browse/rate_region.html',
+ 'Time Periods' => $p.'browse/rate_time.html',
+ );
%once>
<%init>
@@ -78,18 +30,11 @@ my $rate = qsearchs('rate', { 'ratenum' => $ratenum } )
my $ratename = $rate->ratename;
my $title = "$ratename rates";
-my @where = ();
-
+my $where;
+my $countrycode = '';
if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
- my $countrycode = $1;
- push @where, "0 < ( SELECT COUNT(*) FROM rate_prefix
- WHERE rate_prefix.regionnum = rate_region.regionnum
- AND countrycode = '$countrycode'
- )
- ";
+ $countrycode = $1;
$title .= " for +$countrycode";
}
-my $where = scalar(@where) ? ' AND '.join(' AND ', @where ) : '';
-
%init>