From b153693eaaf58e5af5f454e40f9ec169128f6d92 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 5 Jul 2009 23:56:24 +0000 Subject: [PATCH] allow svc_phone.phonenum to be edited when a DID selector is not in use --- httemplate/elements/select-did.html | 1 + httemplate/elements/tr-select-did.html | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 ) { ><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %> @@ -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; + -- 2.11.0