summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/change_password.html13
-rw-r--r--httemplate/elements/contact.html26
2 files changed, 27 insertions, 12 deletions
diff --git a/httemplate/elements/change_password.html b/httemplate/elements/change_password.html
index b3a432f95..a8cc883b9 100644
--- a/httemplate/elements/change_password.html
+++ b/httemplate/elements/change_password.html
@@ -15,7 +15,12 @@
<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',
@@ -34,7 +39,7 @@ function <%$pre%>toggle(val) {
document.getElementById('<%$pre%>link').style.display =
val ? 'none' : 'inline';
}
-% if ( $error ) {
+% if ( $error || $opt{'popup'} ) {
<%$pre%>toggle(true);
% }
</SCRIPT>
@@ -63,5 +68,9 @@ elsif ($opt{'contact_num'}) {
$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>
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
index 779905234..755daed24 100644
--- a/httemplate/elements/contact.html
+++ b/httemplate/elements/contact.html
@@ -72,18 +72,20 @@
<FONT SIZE="-1"><% $label{$field} %></FONT>
</TD>
% }
-% my $pwd_change_label = 'change password';
-% $pwd_change_label = 'setup password' unless $contact->_password;
+% my $pwd_change_label = 'change';
+% $pwd_change_label = 'setup' unless $contact->_password;
+% my $action = $fsurl . "edit/cust_main-contacts-password.html?custnum=" . $opt{'custnum'} . "&contactnum=" . $curr_value . "&label=" . $pwd_change_label . "&popup=1";
% if ($curr_value) {
<TD>
- <span STYLE="white-space: nowrap">
- <& /elements/change_password.html,
- 'contact_num' => $curr_value,
- 'custnum' => $opt{'custnum'},
- 'curr_value' => '',
- 'label' => $pwd_change_label,
- &>
- </span>
+ <% include('/elements/popup_link.html',
+ 'action' => $action,
+ 'width' => '763',
+ 'height' => '408',
+ 'actionlabel' => "$pwd_change_label password",
+ 'html_label' => "$pwd_change_label password",
+
+ )
+ %>
<br>
<FONT SIZE="-1">Password</FONT>
</TD>
@@ -97,6 +99,10 @@
my( %opt ) = @_;
my $conf = new FS::Conf;
+
+use Data::Dumper;
+print Dumper($conf->config);
+
my $self_base_url = $conf->config('selfservice_server-base_url');
my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum';