summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-did.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/tr-select-did.html')
-rw-r--r--httemplate/elements/tr-select-did.html20
1 files changed, 18 insertions, 2 deletions
diff --git a/httemplate/elements/tr-select-did.html b/httemplate/elements/tr-select-did.html
index c784033..987ade6 100644
--- a/httemplate/elements/tr-select-did.html
+++ b/httemplate/elements/tr-select-did.html
@@ -1,6 +1,6 @@
<% include('tr-td-label.html', @_ ) %>
-% if ( $opt{'curr_value'} ne '' ) {
+% if ( $opt{'curr_value'} ne '' && $use_selector ) {
<TD BGCOLOR="#dddddd" <% $cell_style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
@@ -19,7 +19,23 @@
<%init>
my %opt = @_;
-
+#warn Dumper(\%opt); if $DEBUG;
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
+ || $opt{'object'}->cust_svc->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>