summaryrefslogtreecommitdiff
path: root/httemplate
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
parent7a62aaba31a74ee3dd5e3b77907aa6f06687608d (diff)
allow svc_phone.phonenum to be edited when a DID selector is not in use
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/select-did.html1
-rw-r--r--httemplate/elements/tr-select-did.html16
2 files changed, 16 insertions, 1 deletions
diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html
index 069516476..fcc5adc2b 100644
--- a/httemplate/elements/select-did.html
+++ b/httemplate/elements/select-did.html
@@ -68,6 +68,7 @@ my %opt = @_;
my $conf = new FS::Conf;
my $country = $conf->config('countrydefault') || 'US';
+#false laziness w/tr-select-did.html
#XXX make sure this comes through on errors too
my $svcpart = $opt{'svcpart'} || $opt{'object'}->svcpart;
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>