diff options
author | mark <mark> | 2011-02-11 23:59:29 +0000 |
---|---|---|
committer | mark <mark> | 2011-02-11 23:59:29 +0000 |
commit | 6a10d16ff4e806357abab206254aa38c80a749d3 (patch) | |
tree | 94dfb9705ba9d5aa8b3b0d1d96be6ba460115404 /httemplate/elements | |
parent | ca2b8a8c99585a4619eb657f2c7fca12a7304249 (diff) |
rate selection by CDR type, RT#10991
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/auto-table.html | 9 | ||||
-rw-r--r-- | httemplate/elements/select-cdr_type.html | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/httemplate/elements/auto-table.html b/httemplate/elements/auto-table.html index 9c7dfd09a..49222745a 100644 --- a/httemplate/elements/auto-table.html +++ b/httemplate/elements/auto-table.html @@ -51,7 +51,9 @@ Values will be passed through as "mytable_id1", etc. <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 @@ $val eq $data[$row][$col] ? ' SELECTED' : ''%>><% shift @o %></OPTION> 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++; } diff --git a/httemplate/elements/select-cdr_type.html b/httemplate/elements/select-cdr_type.html new file mode 100644 index 000000000..9d260898a --- /dev/null +++ b/httemplate/elements/select-cdr_type.html @@ -0,0 +1,11 @@ +% 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> |