[freeside-commits] freeside/httemplate/elements tr-select-did.html, 1.2, 1.3 select-did.html, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Sun Jul 5 16:56:26 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv21058

Modified Files:
	tr-select-did.html select-did.html 
Log Message:
allow svc_phone.phonenum to be edited when a DID selector is not in use

Index: tr-select-did.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-did.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tr-select-did.html	29 Jun 2008 20:53:34 -0000	1.2
+++ tr-select-did.html	5 Jul 2009 23:56:24 -0000	1.3
@@ -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 $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>

Index: select-did.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-did.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- select-did.html	28 Dec 2008 18:48:51 -0000	1.3
+++ select-did.html	5 Jul 2009 23:56:24 -0000	1.4
@@ -68,6 +68,7 @@
 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;
 



More information about the freeside-commits mailing list