From 77baa73413d756538cfb6f10dac71b60604f0184 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Thu, 29 Jun 2017 12:51:25 -0400 Subject: RT# 75817 - updated set contact password to use popup window. fixes break in first contact. --- httemplate/elements/change_password.html | 13 +++++++++++-- httemplate/elements/contact.html | 26 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 12 deletions(-) (limited to 'httemplate/elements') 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 @@ <& /elements/random_pass.html, $pre.'password', 'randomize' &> - +% if ($opt{'popup'}) { + +% } +% else { + +%}
<& '/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); % } @@ -63,5 +68,9 @@ elsif ($opt{'contact_num'}) { $pre .= $opt{'contact_num'} . '_'; } +if ($opt{'popup'}) { + $change_id_input .= ''; +} + my $error = $cgi->param($pre.'error'); diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index e1e4b6d90..d69029053 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -85,18 +85,20 @@ <% $label{$field} %> % } -% 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) { - - <& /elements/change_password.html, - 'contact_num' => $curr_value, - 'custnum' => $opt{'custnum'}, - 'curr_value' => '', - 'label' => $pwd_change_label, - &> - + <% include('/elements/popup_link.html', + 'action' => $action, + 'width' => '763', + 'height' => '408', + 'actionlabel' => "$pwd_change_label password", + 'html_label' => "$pwd_change_label password", + + ) + %>
Password @@ -110,6 +112,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'; -- cgit v1.2.1