[freeside-commits] freeside/httemplate/browse rate_detail.html, 1.5, 1.6

Ivan,,, ivan at wavetail.420.am
Sun Mar 21 16:13:26 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv11324/httemplate/browse

Modified Files:
	rate_detail.html 
Log Message:
connection fee for initial N seconds support, RT#7018

Index: rate_detail.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/rate_detail.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- rate_detail.html	23 Aug 2008 21:59:45 -0000	1.5
+++ rate_detail.html	21 Mar 2010 23:13:24 -0000	1.6
@@ -15,6 +15,7 @@
                            'Region',
                            'Prefix(es)',
                            'Included<BR>minutes',
+                           'Connection<BR>charge',
                            'Charge per<BR>minute',
                            'Granularity',
                            'Usage class',
@@ -22,12 +23,9 @@
      'fields'         => [
                            'regionname',
                            sub { shift->dest_region->prefixes_short },
-                           sub { shift->min_included.
-                                 '&nbsp;<FONT SIZE="-1">(edit)</FONT>';
-                               },
-                           sub { $money_char. shift->min_charge.
-                                 '&nbsp;<FONT SIZE="-1">(edit)</FONT>';
-                               },
+                           sub { shift->min_included. $edit_hint },
+                           $conn_charge_sub,
+                           sub { $money_char. shift->min_charge. $edit_hint },
                            sub { $granularity{ shift->sec_granularity } },
                            'classname',
                          ],
@@ -39,6 +37,7 @@
 <%once>
 
 tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
+tie my %conn_secs,   'Tie::IxHash', FS::rate_detail::conn_secs();
 
 my $conf = new FS::Conf;
 my $money_char = $conf->config('money_char') || '$';
@@ -59,6 +58,15 @@
              #default# 'color'       => '#333399',
          );
 };
+my $edit_hint = '&nbsp;<FONT SIZE="-1">(edit)</FONT>';
+
+my $conn_charge_sub = sub {
+   my $rate_detail = shift;
+   #return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec;
+   $money_char. $rate_detail->conn_charge.
+     ($rate_detail->conn_sec ? ' for '.$conn_secs{$rate_detail->conn_sec} : '').
+     $edit_hint;
+};
 
 </%once>
 <%init>



More information about the freeside-commits mailing list