[freeside-commits] freeside/httemplate/edit rate_detail.html, 1.4, 1.4.4.1 rate_region.cgi, 1.12, 1.12.4.1

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


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

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

Index: rate_region.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/rate_region.cgi,v
retrieving revision 1.12
retrieving revision 1.12.4.1
diff -u -w -d -r1.12 -r1.12.4.1
--- rate_region.cgi	4 Oct 2008 20:55:54 -0000	1.12
+++ rate_region.cgi	21 Mar 2010 23:13:25 -0000	1.12.4.1
@@ -52,6 +52,12 @@
       <FONT SIZE=-1>Included<BR>minutes/calls</FONT>
     </TH>
     <TH CLASS="grid" BGCOLOR="#cccccc">
+      <FONT SIZE=-1>Connection<BR>charge</FONT>
+    </TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc">
+      <FONT SIZE=-1>Connection<BR>charge for</FONT>
+    </TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc">
       <FONT SIZE=-1>Charge per<BR>minute/call</FONT>
     </TH>
     <TH CLASS="grid" BGCOLOR="#cccccc">
@@ -88,7 +94,20 @@
     </TD>
 
     <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-      $<INPUT TYPE="text" SIZE=6 NAME="min_charge<%$n%>" VALUE="<% $cgi->param("min_charge$n") || $rate_detail->min_charge |h %>">
+      <%$money_char%><INPUT TYPE="text" SIZE=9 NAME="conn_charge<%$n%>" VALUE="<% $cgi->param("conn_charge$n") || $rate_detail->conn_charge |h %>">
+    </TD>
+
+    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+      <SELECT NAME="conn_sec<%$n%>">
+%       foreach my $conn_sec ( keys %conn_secs ) {
+%         my $curr_value = $cgi->param("conn_sec$n") || $rate_detail->conn_sec;
+%         my $selected = ($conn_sec==$curr_value) ? ' SELECTED' : '';
+          <OPTION VALUE="<% $conn_sec %>" <%$selected%>><% $conn_secs{$conn_sec} %></OPTION>
+%       }
+    </TD>
+
+    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+      <%$money_char%><INPUT TYPE="text" SIZE=6 NAME="min_charge<%$n%>" VALUE="<% $cgi->param("min_charge$n") || $rate_detail->min_charge |h %>">
     </TD>
 
     <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
@@ -125,12 +144,19 @@
 </FORM>
 
 <% 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 ( {

Index: rate_detail.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/rate_detail.html,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -u -w -d -r1.4 -r1.4.4.1
--- rate_detail.html	31 Dec 2008 03:28:57 -0000	1.4
+++ rate_detail.html	21 Mar 2010 23:13:25 -0000	1.4.4.1
@@ -6,6 +6,8 @@
                    'dest_regionname'     => 'Region',
                    'dest_prefixes_short' => 'Prefix(es)',
                    'min_included'        => 'Included minutes/calls',
+                   'conn_charge'         => 'Connection charge',
+                   'conn_sec'            => 'For',
                    'min_charge'          => 'Charge per minute/call',
                    'sec_granularity'     => 'Granularity',
                    'classnum'            => 'Usage class',
@@ -17,6 +19,13 @@
                    { field=>'dest_regionname',     type=>'fixed',  },
                    { field=>'dest_prefixes_short', type=>'fixed',  },
                    { field=>'min_included',        type=>'text',  size=>5 },
+                   { field=>'conn_charge',         type=>'money', size=>4 },
+                   { field          =>'conn_sec',
+                      type          =>'select',
+                      options       => [ keys %conn_secs ],
+                      labels        => \%conn_secs,
+                      disable_empty => 1,
+                   },
                    { field=>'min_charge',          type=>'money', size=>4 },
                    { field         =>'sec_granularity',
                      type          =>'select',
@@ -38,9 +47,9 @@
 <%once>
 
 tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
+tie my %conn_secs,   'Tie::IxHash', FS::rate_detail::conn_secs();
 
 </%once>
-
 <%init>
 
 my $conf = new FS::Conf;



More information about the freeside-commits mailing list