[freeside-commits] freeside/httemplate/elements select-cdr_type.html, NONE, 1.1 auto-table.html, 1.2, 1.3

Mark Wells mark at wavetail.420.am
Fri Feb 11 15:59:30 PST 2011


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

Modified Files:
	auto-table.html 
Added Files:
	select-cdr_type.html 
Log Message:
rate selection by CDR type, RT#10991

--- NEW FILE: select-cdr_type.html ---
% if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM cdr_type') ) {
<% include( '/elements/select-table.html',
              'table'       => 'cdr_type',
              'name_col'    => 'cdrtypenum',
              'empty_label' => '(none)',
              @_
          )
%>
% }
<%init>
</%init>

Index: auto-table.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/auto-table.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- auto-table.html	22 Jul 2010 00:11:56 -0000	1.2
+++ auto-table.html	11 Feb 2011 23:59:28 -0000	1.3
@@ -51,7 +51,9 @@
   <TR>
 %   my $col = 0;
 %   for ( $col = 0; $col < scalar @fields; $col++ ) {
-%     my $id = $prefix . $fields[$col] . $row;
+%     my $id = $prefix . $fields[$col];
+%     # don't suffix rownum in the final, blank row
+%     $id .= $row if $row < (scalar @data) - 1; 
     <TD>
 %     my @o = @{ $select[$col] };
 %     if( @o ) {
@@ -117,7 +119,10 @@
     var row = <% $prefix %>table.insertRow(-1);
     var cells = <% $prefix %>_blank.cells;
     for (i=0; i<cells.length; i++) {
-      row.appendChild(cells[i].cloneNode(true));
+      var node = row.appendChild(cells[i].cloneNode(true));
+      var input = node.children[0];
+      input.id = input.id + row.sectionRowIndex;
+      input.name = input.name + row.sectionRowIndex;
     }
     <% $prefix %>rownum++;
   }



More information about the freeside-commits mailing list