X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Frate_region.cgi;h=b50d2daba8e60b362512f5ed1ba1518e350f8fae;hb=103dfde149eec5034696d073253255f508a1be78;hp=9ca3a3569a67aae2e48d91d1fdaebf3211daf096;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git
diff --git a/httemplate/edit/rate_region.cgi b/httemplate/edit/rate_region.cgi
index 9ca3a3569..b50d2daba 100644
--- a/httemplate/edit/rate_region.cgi
+++ b/httemplate/edit/rate_region.cgi
@@ -11,7 +11,14 @@
%# region info
-<% ntable('#cccccc') %>
+
+
+% if ( $rate_region->agent_regionid ) {
+
+ Legacy # |
+ <% $rate_region->agent_regionid |h %> |
+
+% }
Region name |
@@ -24,121 +31,71 @@
-
+ |
Prefixes
(comma-separated)
-
+ |
|
-
-
-%# rate plan info
-
-
-
-<% include('/elements/table-grid.html') %>
-% my $bgcolor1 = '#eeeeee';
-% my $bgcolor2 = '#ffffff';
-% my $bgcolor = '';
-
-
-
- Rate plan
- |
-
- Included minutes/calls
- |
-
- Charge per minute/call
- |
-
- Granularity
- |
-
- Usage class
- |
-
-
-% foreach my $rate ( qsearch('rate', {}) ) {
-%
-% my $n = $rate->ratenum;
-% my $rate_detail = $rate->dest_detail($rate_region)
-% || new FS::rate_region { 'min_included' => 0,
-% 'min_charge' => 0,
-% 'sec_granularity' => '60'
-% };
-%
-% if ( $bgcolor eq $bgcolor1 ) {
-% $bgcolor = $bgcolor2;
-% } else {
-% $bgcolor = $bgcolor1;
-% }
-
-
-
-
- <% $rate->ratename %>
- |
-
-
- min_included |h %>">
- |
-
-
- $min_charge |h %>">
- |
-
-
-
- |
-
-
- <% include( '/elements/select-table.html',
- 'element_name' => "classnum$n",
- 'table' => 'usage_class',
- 'name_col' => 'classname',
- 'empty_label' => '(default)',
- 'hashref' => { disabled => '' },
- 'curr_value' => ( $cgi->param("classnum$n") ||
- $rate_detail->classnum ),
- )
- %>
- |
-
-
-
-% }
+ <& /elements/tr-checkbox.html,
+ label => 'Exact match',
+ field => 'exact_match',
+ cell_style => 'font-weight: bold',
+ value => 'Y',
+ curr_value => $rate_region->exact_match
+ &>
-
-
+
">
-
+%# rate plan info, if the region has been created yet
+
+% if($rate_region->regionnum) {
+
Rates in this region
+% 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)',
+% ) ) {
+
+% }
+<% include('/edit/elements/rate_detail.html',
+ 'regionnum' => $rate_region->regionnum,
+ 'cdrtypenum' => $cdrtypenum,
+) %>
+% }
<% include('/elements/footer.html') %>
+<%once>
+
+tie my %conn_secs, 'Tie::IxHash', FS::rate_detail::conn_secs();
+%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
+
my $rate_region;
if ( $cgi->param('error') ) {
$rate_region = new FS::rate_region ( {
map { $_, scalar($cgi->param($_)) } fields('rate_region')
} );
-} elsif ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/ or die "unparsable regionnum";
+} elsif ( $cgi->param('regionnum') ) {
+ $cgi->param('regionnum') =~ /^(\d+)$/ or die "unparseable regionnum";
$rate_region = qsearchs( 'rate_region', { 'regionnum' => $1 } )
or die "unknown regionnum $1\n";
} else { #adding
@@ -159,5 +116,8 @@ if ( @rate_prefix ) {
unless $rate_prefix->countrycode eq $countrycode;
}
}
-
+my $cdrtypenum = '';
+if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {
+ $cdrtypenum = $1;
+}
%init>