'View package definition costs', #NEWNEW
'Change package start date',
'Change package contract end date',
+ 'Unmask customer DL',
+ 'Unmask customer SSN',
],
###
=cut
1;
-
my @cust_bill_pkg = grep { $_->feepart } $self->cust_bill_pkg;
my $escape_function = $options{escape_function};
- my $locale = $self->cust_main->locale;
+ my $locale = $self->quotationnum
+ ? $self->prospect_main->locale
+ : $self->cust_main->locale;
my @items;
foreach my $cust_bill_pkg (@cust_bill_pkg) {
<%def .namepart>
-% my ($field, $value, $label, $extra) = @_;
+% my ($field, $value, $label, $extra, $unmask_field) = @_;
<DIV STYLE="display: inline-block" ID="<% $field %>_input">
<INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>>
+% if (
+% ref $unmask_field
+% && !$unmask_field->{unmask_ss}
+% && $FS::CurrentUser::CurrentUser->access_right( $unmask_field->{access_right} )
+% ) {
+ <& /elements/link-replace_element_text.html, {
+ target_id => $unmask_field->{target_id},
+ replace_text => $unmask_field->{replace_text},
+ } &>
+% }
<BR><FONT SIZE="-1" COLOR="#333333"><% emt($label) %></FONT>
</DIV>
</%def>
<& .namepart, 'first', $cust_main->first, 'First' &>
% if ( $conf->exists('show_ss') ) {
- <& .namepart, 'ss', $ss, 'SS#', "SIZE=11" &>
+ <& .namepart, 'ss', $ss, 'SS#', "SIZE=11 ID='ss'", {
+ target_id => 'ss',
+ replace_text => $cust_main->ss,
+ access_right => 'Unmask customer SSN',
+ unmask_ss => $conf->exists('unmask_ss'),
+ } &>
% } else {
<INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>">
% }
% if ( $conf->exists('show_stateid') ) {
<TR>
<TH ALIGN="right"><% $stateid_label %></TH>
- <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12></TD>
+ <TD>
+ <INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12 ID="stateid">
+% if ( $FS::CurrentUser::CurrentUser->access_right( 'Unmask customer DL' )) {
+ <& /elements/link-replace_element_text.html, {target_id => 'stateid', replace_text => $cust_main->stateid} &>
+% }
+ </TD>
<TD><& /elements/select-state.html,
state => $cust_main->stateid_state,
country => $cust_main->country, # how does this work on new customer?
--- /dev/null
+<%doc>
+
+Display a link with javascript to replace text within a element.
+
+Usage:
+
+<& /elements/link-replace_element_text.html, {
+ target_id => 'input_id',
+ replace_text => 'hello',
+
+ element_type => 'input', # Uses jquery val() method to replace text
+ element_type => 'div', # Uses jquery text() method to replace text
+
+ href => ...
+ style => ...
+ class => ...
+ }
+&>
+
+</%doc>
+<a href="<% $param{href} %>"
+ style="<% $param{style} %>"
+% if ($param{class}) {
+ class="<% $param{class} %>"
+% }
+ onClick="$('#<% $param{target_id} %>').<% $param{jmethod} %>('<% $param{replace_text} |h %>');">◁</a>
+<%init>
+
+die "template call requires a parameter hashref" unless ref $_[0];
+
+# Defaults that can be overridden in param hashref
+my %param = (
+ target_id => 'SPECIFY_AN_INPUT_ELEMENT_ID',
+ replace_text => 'REPLACEMENT_TEXT_FOR_INPUT_ELEMENT',
+ element_type => 'input',
+
+ link_text => '%#x25C1;', # ◁
+ href => 'javascript:void(0)',
+ style => 'text-decoration:none;',
+ class => undef,
+
+ %{ $_[0] },
+);
+$param{jmethod} = $param{element_type} eq 'input' ? 'val' : 'text';
+</%init>
}
$pm->prospect_contact
];
- ''
},
sub {
my $pr = shift->part_referral;
<TD COLSPAN=5><% $cust_main->contact |h %></TD>
% if ( $conf->exists('show_ss') ) {
<TH ALIGN="right"><% mt('SS#') |h %></TH>
- <TD><% $conf->exists('unmask_ss')
- ? $cust_main->ss
- : $cust_main->masked('ss') || ' ' %></TD>
+ <TD>
+ <span id="ss_span" style="white-space:nowrap;">
+ <% $conf->exists('unmask_ss')
+ ? $cust_main->ss
+ : $cust_main->masked('ss') || ' ' %>
+% if ( !$conf->exists('unmask_ss') && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')) {
+ <& /elements/link-replace_element_text.html, {
+ target_id => 'ss_span',
+ replace_text => $cust_main->ss,
+ element_type => 'span'
+ } &>
+% }
+ </span>
+ </TD>
% }
</TR>
% if ( $conf->exists('cust_main-enable_spouse') and
<TR>
<TH ALIGN="right"><% $stateid_label %></TH>
- <TD><% $cust_main->masked('stateid') || ' ' %></TD>
+ <TD>
+ <span id="stateid_span" style="white-space:nowrap;">
+ <% $cust_main->masked('stateid') || ' ' %>
+% if ( $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')) {
+ <& /elements/link-replace_element_text.html, {
+ target_id => 'stateid_span',
+ replace_text => $cust_main->stateid,
+ element_type => 'span'
+ } &>
+% }
+ </span>
+ </TD>
<TH ALIGN="right"><% $stateid_state_label %></TH>
<TD><% $cust_main->stateid_state || ' ' %></TD>
</TR>
% foreach my $prospect_contact ( $prospect_main->prospect_contact ) {
% my $contact = $prospect_contact->contact;
<TR>
- <TH ALIGN="right"><% $prospect_contact->contact_classname %> Contact</TD>
- <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
+ <TH ALIGN="right" VALIGN="top"><% $prospect_contact->contact_classname %> Contact</TH>
+ <TD BGCOLOR="#FFFFFF">
+ <% $contact->line %><br>
+ <table>
+% for my $row ( $contact->contact_email ) {
+ <tr><th>E-Mail:</th><td><% $row->emailaddress %></td></tr>
+% }
+% for my $row ( $contact->contact_phone ) {
+ <tr><th><% $row->phone_type->typename %>:</th><td><% $row->phonenum_pretty %></td></tr>
+% }
+% if ( $prospect_contact->comment ) {
+ <tr><th>Comment:</th><td><% $prospect_contact->comment %></td></tr>
+% }
+ </table>
+ </TD>
</TR>
%}