4.x style
[freeside.git] / httemplate / elements / tr-input-fiber_circuit.html
1 <& /elements/tr-td-label.html, %opt &>
2   <td>
3     <table class="inv">
4       <tr>
5         <th>FDU#</th>
6         <td><input name="<% $field %>_fdu" value="<% $fdu |h %>" SIZE="1"></td>
7         <th>FAT#</th>
8         <td><input name="<% $field %>_fat" value="<% $fat |h %>" SIZE="1">
9             <input name="<% $field %>_subfat" value="<% $subfat |h %>" SIZE="1">
10         </td>
11         <th>Port#</th>
12         <td><input name="<% $field %>_port" value="<% $port |h %>" SIZE="1"></td>
13       </tr>
14     </table>
15   </td>
16 </tr>
17 <%doc>
18 Supports a circuit ID of the form
19 FDU# (digit), FAT# (digit), SubFAT (letter), Port# (numeric)
20 May support other formats in the future, or just a free text field.
21 </%doc>
22 <%init>
23 my %opt = @_;
24 my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
25 my ($fdu, $fat, $port) = split('/', $value);
26 my $subfat = '';
27 if ( $fat =~ /[A-Z]$/i ) {
28   $subfat = substr($fat, -1, 1, '');
29 }
30 my $field = $opt{'field'} || 'circuit_id';
31 </%init>