diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/edit/cust_main-contacts.html | 7 | ||||
| -rw-r--r-- | httemplate/edit/elements/edit.html | 2 | ||||
| -rw-r--r-- | httemplate/edit/process/elements/process.html | 2 | ||||
| -rw-r--r-- | httemplate/elements/contact.html | 37 |
4 files changed, 29 insertions, 19 deletions
diff --git a/httemplate/edit/cust_main-contacts.html b/httemplate/edit/cust_main-contacts.html index b3f67726b..b046c5b18 100644 --- a/httemplate/edit/cust_main-contacts.html +++ b/httemplate/edit/cust_main-contacts.html @@ -51,6 +51,13 @@ my $curuser = $FS::CurrentUser::CurrentUser; my $conf = new FS::Conf; +if ( $cgi->param('redirect') ) { + my $session = $cgi->param('redirect'); + my $pref = $curuser->option("redirect$session"); + die "unknown redirect session $session\n" unless length($pref); + $cgi = new CGI($pref); +} + my $custnum; if ( $cgi->param('error') ) { $custnum = scalar($cgi->param('custnum')); diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 3826f9752..ff1da4945 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -633,7 +633,7 @@ Example: var newrow = <% include(@layer_opt, html_only=>1) |js_string %>; % #until the rest have html/js_only -% if ( $type eq 'selectlayers' || $type =~ /^select-cgp_rule_/ ) { +% if ( $type eq 'selectlayers' || $type =~ /^select-cgp_rule_/ || $type eq 'contact') { var newfunc = <% include(@layer_opt, js_only=>1) |js_string %>; % } else { var newfunc = ''; diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 11757237a..5b9ed6b52 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -123,7 +123,7 @@ Example: % " attempting to set redirect$session to ". $cgi->query_string."\n"; % } % -<% $cgi->redirect("$error_redirect?redirect=$session") %> +<% $cgi->redirect("$error_redirect"."redirect=$session") %> % % } else { % diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index e330e1fea..ccbb431ab 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -1,4 +1,6 @@ -% unless ( $opt{'js_only'} ) { +% if ( $opt{'js_only'} ) { +<% $js %> +% } else { <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>"> @@ -70,23 +72,8 @@ VALUE = "" placeholder = "<% $value |h %>" > -% my $contactnum = $curr_value ? $curr_value : '0'; - <SCRIPT> - add_password_validation('<% "changepw".$id."_password" %>', 'submit', '', '<% $contactnum %>'); - </SCRIPT> - - <SCRIPT TYPE="text/javascript"> - var selfService = document.getElementById("<%$id%>_selfservice_access").value; - - if (selfService !== "Y") { document.getElementById("changepw<%$id%>_password").disabled = 'true'; } - document.getElementById("<%$id%>_selfservice_access").onchange = function() { - if (this.value == "P" || this.value == "E" || this.value =="Y") { - document.getElementById("changepw<%$id%>_password").disabled = ''; - } - else { document.getElementById("changepw<%$id%>_password").disabled = 'true'; } - return false; - } + <% $js %> </SCRIPT> % } elsif ( $field eq 'invoice_dest' ) { % my $curr_value = $cgi->param($name . '_' . $field); @@ -131,6 +118,7 @@ my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum'; my $id = $opt{'id'} || 'contactnum'; my $curr_value = $opt{'curr_value'} || $opt{'value'}; +my $contactnum = $curr_value ? $curr_value : '0'; my $onchange = ''; if ( $opt{'onchange'} ) { @@ -177,4 +165,19 @@ $label{'comment'} = 'Comment'; my @fields = $opt{'name_only'} ? qw( first last ) : keys %label; +my $js = qq( + add_password_validation('changepw$id\_password', 'submit', '', '$contactnum'); + + var selfService = document.getElementById("$id\_selfservice_access").value; + + if (selfService !== "Y") { document.getElementById("changepw$id\_password").disabled = 'true'; } + document.getElementById("$id\_selfservice_access").onchange = function() { + if (this.value == "P" || this.value == "E" || this.value =="Y") { + document.getElementById("changepw$id\_password").disabled = ''; + } + else { document.getElementById("changepw$id\_password").disabled = 'true'; } + return false; + } +); + </%init> |
