projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 32233 Show unmask widget only if a value exists to unmask
[freeside.git]
/
httemplate
/
edit
/
cust_main
/
name.html
diff --git
a/httemplate/edit/cust_main/name.html
b/httemplate/edit/cust_main/name.html
index
713f54c
..
120475b
100644
(file)
--- a/
httemplate/edit/cust_main/name.html
+++ b/
httemplate/edit/cust_main/name.html
@@
-1,7
+1,18
@@
<%def .namepart>
<%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%>>
<DIV STYLE="display: inline-block" ID="<% $field %>_input">
<INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>>
+% if (
+% $value
+% && 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>
<BR><FONT SIZE="-1" COLOR="#333333"><% emt($label) %></FONT>
</DIV>
</%def>
@@
-13,7
+24,12
@@
<& .namepart, 'first', $cust_main->first, 'First' &>
% if ( $conf->exists('show_ss') ) {
<& .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 %>">
% }
% } else {
<INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>">
% }