doh
[freeside.git] / httemplate / elements / tr-select-did.html
1 <% include('tr-td-label.html', @_ ) %>
2
3 % if ( $opt{'curr_value'} ne '' && $use_selector ) {
4
5     <TD BGCOLOR="#dddddd" <% $cell_style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
6     
7     <% include('hidden.html', %opt ) %>
8
9 % } else {
10   
11     <TD <% $cell_style %>>
12       <% include('/elements/select-did.html', %opt ) %>
13     </TD>
14
15 % }
16
17 </TR>
18
19 <%init>
20
21 my %opt = @_;
22 warn Dumper(\%opt);
23 my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
24
25 #false laziness w/select-did.html
26 #XXX make sure this comes through on errors too
27 my $svcpart = $opt{'svcpart'} || $opt{'object'}->cust_svc->svcpart;
28
29 my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
30 die "unknown svcpart $svcpart" unless $part_svc;
31
32 my @exports = $part_svc->part_export_did;
33 if ( scalar(@exports) > 1 ) {
34   die "more than one DID-providing export attached to svcpart $svcpart";
35 }
36
37 my $use_selector = scalar(@exports) ? 1 : 0;
38
39 </%init>