X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Frate.cgi;h=4c0abfe01c83f8b9e93fefd0f9bc08727aee8a5a;hb=20f38e4c256094bd938b732950e8f93319f851a5;hp=9aa4e7291375ebd4ae935e1502e8cc4a12a1e611;hpb=ff24bc786a5fd479f2252260e0da580a736f97be;p=freeside.git diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi index 9aa4e7291..4c0abfe01 100644 --- a/httemplate/edit/rate.cgi +++ b/httemplate/edit/rate.cgi @@ -1,40 +1,9 @@ -<% - -my $rate; -if ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $rate = qsearchs( 'rate', { 'ratenum' => $1 } ); -} else { #adding - $rate = new FS::rate {}; -} -my $action = $rate->ratenum ? 'Edit' : 'Add'; - -my $p1 = popurl(1); - -my %granularity = ( - '1', => '1 second', - '6' => '6 second', - '30' => '30 second', # '1/2 minute', - '60' => 'minute', -); - -#my $nous = < - -<%= include("/elements/header.html","$action Rate plan", menubar( - 'Main Menu' => $p, +<% include("/elements/header.html","$action Rate plan", menubar( 'View all rate plans' => "${p}browse/rate.cgi", )) %> -<%= include('/elements/progress-init.html', +<% include('/elements/progress-init.html', 'OneTrueForm', [ 'rate', 'min_', 'sec_' ], 'process/rate.cgi', @@ -42,72 +11,33 @@ my %granularity = ( ) %>
- + Rate plan - +

-<%= table() %> - - Region - Prefix(es) - Included
minutes
- Charge per
minute
- Granularity - - -<% foreach my $rate_region ( - sort { lc($a->regionname) cmp lc($b->regionname) } - qsearch({ - 'select' => 'DISTINCT ON ( regionnum ) rate_region.*', - 'table' => 'rate_region', - 'hashref' => {}, - #'addl_from' => 'INNER JOIN rate_prefix USING ( regionnum )', - #'extra_sql' => "WHERE countrycode != '1'", - - # 'ORDER BY regionname' - # ERROR: SELECT DISTINCT ON expressions must - # match initial ORDER BY expressions - }) - ) { - my $n = $rate_region->regionnum; - my $rate_detail = - $rate->dest_detail($rate_region) - || new FS::rate_detail { 'min_included' => 0, - 'min_charge' => 0, - 'sec_granularity' => '60' - }; -%> - - - <%= $rate_region->regionname %> - <%= $rate_region->prefixes_short %> - min_included %>"> - $min_charge ) %>"> - - - +" onClick="document.OneTrueForm.submit.disabled=true; process();"> -<% } %> +
- - - Add a region - - +<% include('/elements/footer.html') %> - +<%init> -
" onClick="document.OneTrueForm.submit.disabled=true; process();"> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - - - +my $rate; +if ( $cgi->keywords ) { + my($query) = $cgi->keywords; + $query =~ /^(\d+)$/; + $rate = qsearchs( 'rate', { 'ratenum' => $1 } ); +} else { #adding + $rate = new FS::rate {}; +} +my $action = $rate->ratenum ? 'Edit' : 'Add'; +