summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-did.html
blob: c8a653e5736890549a91a9c3780973e9f1474b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<% include('tr-td-label.html', @_ ) %>

% if ( $opt{'curr_value'} ne '' && $use_selector ) {

    <TD BGCOLOR="#dddddd" <% $cell_style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
    
    <% include('hidden.html', %opt ) %>

% } else {
  
    <TD <% $cell_style %>>
      <% include('/elements/select-did.html', %opt ) %>
    </TD>

% }

</TR>

<%init>

my %opt = @_;

my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';

#false laziness w/select-did.html
#XXX make sure this comes through on errors too
my $svcpart = $opt{'svcpart'} || $opt{'object'}->svcpart;

my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;

my @exports = $part_svc->part_export_did;
if ( scalar(@exports) > 1 ) {
  die "more than one DID-providing export attached to svcpart $svcpart";
}

my $use_selector = scalar(@exports) ? 1 : 0;

</%init>