X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-did.html;h=2aa712f794e3c121d9188774c1e239f89bdc6be3;hb=c6d8896d882b684b1f3c7a2538a90358b27aaf89;hp=29c5bb7dd38ca157bb1863dcff5a43a99651eea4;hpb=9c7dee35f91a386fcce14cb6c3e9d23ba3eee8af;p=freeside.git
diff --git a/httemplate/elements/tr-select-did.html b/httemplate/elements/tr-select-did.html
index 29c5bb7dd..2aa712f79 100644
--- a/httemplate/elements/tr-select-did.html
+++ b/httemplate/elements/tr-select-did.html
@@ -1,8 +1,10 @@
<% include('tr-td-label.html', @_ ) %>
-% if ( $opt{'curr_value'} ne '' ) {
+% if ( $use_selector && $opt{'curr_value'} ne '' && ! $can_edit ) {
><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %> |
+
+ <% include('hidden.html', %opt ) %>
% } else {
@@ -17,7 +19,25 @@
<%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;
+
+my $can_edit = scalar(@exports) && $exports[0]->get_dids_can_edit;
+
%init>