summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-did.html
diff options
context:
space:
mode:
authorivan <ivan>2009-07-05 23:56:24 +0000
committerivan <ivan>2009-07-05 23:56:24 +0000
commitb153693eaaf58e5af5f454e40f9ec169128f6d92 (patch)
treecfd731f9532d3ec36d93a5aba6530109a7b28b9c /httemplate/elements/tr-select-did.html
parent7a62aaba31a74ee3dd5e3b77907aa6f06687608d (diff)
allow svc_phone.phonenum to be edited when a DID selector is not in use
Diffstat (limited to 'httemplate/elements/tr-select-did.html')
-rw-r--r--httemplate/elements/tr-select-did.html16
1 files changed, 15 insertions, 1 deletions
diff --git a/httemplate/elements/tr-select-did.html b/httemplate/elements/tr-select-did.html
index c78403345..c8a653e57 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>
@@ -22,4 +22,18 @@ 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>