display: none;
}
</STYLE>
-<A ID="<%$pre%>link" HREF="#" onclick="<%$pre%>toggle(true)">(<% mt('change') %>)</A>
+<A ID="<%$pre%>link" HREF="javascript:void(0)" onclick="<%$pre%>toggle(true)">(<% emt( $change_title ) %>)</A>
<DIV ID="<%$pre%>form" CLASS="passwordbox">
<FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svc_acct->svcnum |h%>">
+ <% $change_id_input %>
<INPUT TYPE="text" ID="<%$pre%>password" NAME="password" VALUE="<% $curr_value |h%>">
<& /elements/random_pass.html, $pre.'password', 'randomize' &>
<INPUT TYPE="submit" VALUE="change">
- <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
+% if ($opt{'popup'}) {
+ <INPUT TYPE="button" VALUE="cancel" onclick="parent.cClick();">
+% }
+% else {
+ <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
+%}
+ <DIV ID="<%$pre%>password_result" STYLE="font-size: smaller"></DIV>
+ <& '/elements/validate_password.html',
+ 'fieldid' => $pre.'password',
+ 'svcnum' => $svcnum,
+ 'contactnum' => $contactnum,
+ &>
% if ( $error ) {
<BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
% }
document.getElementById('<%$pre%>link').style.display =
val ? 'none' : 'inline';
}
-% if ( $error ) {
+% if ( $error || $opt{'popup'} ) {
<%$pre%>toggle(true);
% }
</SCRIPT>
<%init>
my %opt = @_;
-my $svc_acct = $opt{'svc_acct'};
+
+my $contactnum = $opt{'contact_num'};
my $curr_value = $opt{'curr_value'} || '';
-my $pre = 'changepw'.$svc_acct->svcnum.'_';
-my $error = $cgi->param($pre.'error');
+my $change_title = $opt{'label'} || 'change';
+
+my $svcnum;
+my $change_id_input = '';
+my $pre = 'changepw';
+
+if ($opt{'svc_acct'}) {
+ my $svc_acct = $opt{'svc_acct'};
+ $change_id_input = '<INPUT TYPE="hidden" NAME="svcnum" VALUE="' . $svc_acct->svcnum . '">';
+ $pre .= $svc_acct->svcnum . '_';
+ $svcnum = $svc_acct->svcnum;
+}
+elsif ($opt{'contact_num'}) {
+ $change_id_input = '
+ <INPUT TYPE="hidden" NAME="contactnum" VALUE="' . $opt{'contact_num'} . '">
+ <INPUT TYPE="hidden" NAME="custnum" VALUE="' . $opt{'custnum'} . '">
+ ';
+ $pre .= $opt{'contact_num'} . '_';
+}
+
+if ($opt{'popup'}) {
+ $change_id_input .= '<INPUT TYPE="hidden" NAME="popup" VALUE="' . $opt{'popup'} . '">';
+}
+
+ my $error = $cgi->param($pre.'error');
</%init>