X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Frate.cgi;h=c0e8d93f07162e7e04e7b72b41f908403519c615;hp=4c0abfe01c83f8b9e93fefd0f9bc08727aee8a5a;hb=c49cfd25a8f92c7a2f44b51d72506a21f6b8d09f;hpb=0930d22ffc440f80c1b222b2e750cadbabd9e8f6 diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi index 4c0abfe01..c0e8d93f0 100644 --- a/httemplate/edit/rate.cgi +++ b/httemplate/edit/rate.cgi @@ -1,11 +1,15 @@ -<% include("/elements/header.html","$action Rate plan", menubar( +<& /elements/header.html, + "$action Rate plan", + menubar( 'View all rate plans' => "${p}browse/rate.cgi", - )) -%> + 'View packages that use this plan' => "${p}browse/part_pkg.cgi?ratenum=" + . $rate->ratenum, + ) +&> <% include('/elements/progress-init.html', 'OneTrueForm', - [ 'rate', 'min_', 'sec_' ], + [ 'rate', 'agentnum' ], 'process/rate.cgi', $p.'browse/rate.cgi', ) @@ -13,15 +17,54 @@
-Rate plan - -

+ + +<& /elements/tr-select-agent.html, + disable_empty => ! $FS::CurrentUser::CurrentUser->access_right('Configuration'), #, 'Edit global CDR rates' + empty_label => '(global)', +&> + +% if ( $rate->agent_rateid ) { + + + + +% } + + + + + +
Legacy #<% $rate->agent_rateid |h %>
Rate plan
+
" onClick="document.OneTrueForm.submit.disabled=true; process();"> +
+% if($rate->ratenum) { +

Rates in this plan +% if ( my $select_cdr_type = include('/elements/select-cdr_type.html', +% 'curr_value' => $cdrtypenum, +% 'onchange' => 'form.submit();', +% 'name_col' => 'cdrtypename', +% 'value_col' => 'cdrtypenum', +% 'empty_label' => '(default)', +% ) ) { +
+ + +Usage type: <% $select_cdr_type %>
+% } + +<% include('/edit/elements/rate_detail.html', + 'ratenum' => $rate->ratenum, + 'countrycode' => $countrycode, + 'cdrtypenum' => $cdrtypenum, +) %> +% } <% include('/elements/footer.html') %> @@ -31,13 +74,21 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my $rate; -if ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; +if ( $cgi->param('ratenum') ) { + $cgi->param('ratenum') =~ /^(\d+)$/; $rate = qsearchs( 'rate', { 'ratenum' => $1 } ); } else { #adding $rate = new FS::rate {}; } my $action = $rate->ratenum ? 'Edit' : 'Add'; +my $countrycode = ''; +if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) { + $countrycode = $1; +} + +my $cdrtypenum = ''; +if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) { + $cdrtypenum = $1; +}