diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-11-17 17:00:06 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-11-17 17:00:06 -0800 |
commit | f32ac83068c6211f829f1688a1a9cdec71bc6ec7 (patch) | |
tree | a6b6866f50a90fc7716861b4884ec4ffeb5ce535 /httemplate/misc | |
parent | 2c112f32561f23f9c538ace00db46659ce16da32 (diff) | |
parent | c0886229d19cfa798580fbeb342826fd11ceeeb0 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/cust_credit-import.html | 2 | ||||
-rw-r--r-- | httemplate/misc/process/change-password.html | 4 | ||||
-rw-r--r-- | httemplate/misc/reason-merge.html | 77 |
3 files changed, 81 insertions, 2 deletions
diff --git a/httemplate/misc/cust_credit-import.html b/httemplate/misc/cust_credit-import.html index 9a63a04c5..937010dd6 100644 --- a/httemplate/misc/cust_credit-import.html +++ b/httemplate/misc/cust_credit-import.html @@ -69,7 +69,7 @@ Field information: <ul> <li><i>custnum</i>: Customer number <li><i>amount</i>: - <li><i>reasonnum</i>: <A HREF="<%$p%>browse/reason.html?class=R">Credit reason</A> + <li><i>reasonnum</i>: <A HREF="<%$p%>browse/reason_type.html?class=R">Credit reason</A> <li><i>invnum</i>: Invoice number </ul> <BR><BR> diff --git a/httemplate/misc/process/change-password.html b/httemplate/misc/process/change-password.html index 7cab9c4e3..d58ce544d 100644 --- a/httemplate/misc/process/change-password.html +++ b/httemplate/misc/process/change-password.html @@ -11,7 +11,9 @@ die "access denied" unless ( ( $curuser->access_right('Edit password') and ! $part_svc->restrict_edit_password ) ); -my $error = $svc_acct->set_password($cgi->param('password')) +my $newpass = $cgi->param('password'); +my $error = $svc_acct->is_password_allowed($newpass) + || $svc_acct->set_password($newpass) || $svc_acct->replace; # annoyingly specific to view/svc_acct.cgi, for now... diff --git a/httemplate/misc/reason-merge.html b/httemplate/misc/reason-merge.html new file mode 100644 index 000000000..14f5ebb84 --- /dev/null +++ b/httemplate/misc/reason-merge.html @@ -0,0 +1,77 @@ +% if ($success) { +<% include('/elements/header-popup.html', 'Reason Merge Success') %> +<SCRIPT> +window.top.location.reload() +</SCRIPT> +% } else { +<% include('/elements/header-popup.html', 'Merge Reasons') %> +% if ($error) { +<P STYLE="color: red;"><% emt($error) %></P> +% } +% if (@reasons > 1) { +<P> +The following reasons will be merged into one. +Please select one reason to merge the others into. +</P> +<FORM METHOD="POST" ACTION="<% "${p}misc/reason-merge.html" %>"> +<P> +% foreach my $reason (@reasons) { +<INPUT TYPE="hidden" NAME="reasonnum" VALUE="<% $reason->reasonnum %>"> +<INPUT TYPE="radio" NAME="destreasonnum" VALUE="<% $reason->reasonnum %>"> +<% $reason->reason %><BR> +% } +<P> +<P>Caution: merging reasons cannot be undone!</P> +<P><INPUT TYPE="submit" NAME="process_merge" value="Merge"></P> +</FORM> +% } else { +<BUTTON TYPE="button" onClick="parent.cClick();">Close</BUTTON> +% } +% } + +<%init> +my @reasonnums = $cgi->param('reasonnum'); +my $destreasonnum = $cgi->param('destreasonnum'); + +my $error; +my $class; +my @reasons; +my $destreason; +foreach my $reasonnum (@reasonnums) { + unless ($reasonnum =~ /^\d+$/) { + $error = "Invalid reasonnum $reasonnum."; + last; + } + my $reason = qsearchs('reason',{ 'reasonnum' => $reasonnum }); + unless ($reason) { + $error = "Reason $reasonnum could not be loaded."; + last; + } + my $reasontype = $reason->reasontype; + $class ||= $reasontype->class; + if ($class ne $reasontype->class) { + $error = "Selected reasons must have the same reason type class."; + last; + } + push(@reasons, $reason); + $destreason = $reason if $reasonnum eq $destreasonnum; +} + +unless ($error) { + $error = "No reasons selected." unless @reasons; + $error = "Select two or more reasons to merge." unless @reasons > 1; +} + +@reasons = () if $error; + +my $success = 0; +if ($cgi->param('process_merge') && !$error) { + if ($destreason) { + $error = $destreason->merge(\@reasons); + $success = 1 unless $error; + } else { + $error = "No destination reason selected."; + } +} + +</%init> |