summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/reason.html22
-rw-r--r--httemplate/browse/reason_type.html21
-rw-r--r--httemplate/browse/router.cgi4
-rw-r--r--httemplate/docs/license.html8
-rw-r--r--httemplate/edit/msg_template/email.html2
-rw-r--r--httemplate/edit/process/reason.html2
-rwxr-xr-xhttemplate/edit/process/svc_acct.cgi7
-rw-r--r--httemplate/edit/quotation_pkg_detail.html10
-rw-r--r--httemplate/misc/cust_credit-import.html2
-rw-r--r--httemplate/misc/process/change-password.html4
-rw-r--r--httemplate/misc/reason-merge.html77
-rw-r--r--httemplate/search/elements/checkbox-foot.html9
12 files changed, 154 insertions, 14 deletions
diff --git a/httemplate/browse/reason.html b/httemplate/browse/reason.html
index 8af88a950..bdbcf3704 100644
--- a/httemplate/browse/reason.html
+++ b/httemplate/browse/reason.html
@@ -18,6 +18,8 @@
'fields' => \@fields,
'links' => \@links,
'align' => $align,
+ 'html_form' => qq!<FORM ACTION="${p}misc/reason_merge.html" METHOD="POST">!,
+ 'html_foot' => $html_foot,
)
%>
<%init>
@@ -31,7 +33,8 @@ my $class = $1;
my $classname = $FS::reason_type::class_name{$class};
my $classpurpose = $FS::reason_type::class_purpose{$class};
-my $html_init = ucfirst($classname). " reasons $classpurpose.<BR><BR>".
+my $html_init = include('/elements/init_overlib.html').
+ucfirst($classname). " reasons $classpurpose.<BR><BR>".
qq!<A HREF="${p}edit/reason.html?class=$class">!.
"<I>Add a $classname reason</I></A><BR><BR>";
@@ -107,5 +110,22 @@ if ( $class eq 'S' ) {
$align .= 'cl';
}
+# reason merge handling
+push @header, '';
+push @fields, sub {
+ my $reason = shift;
+ my $reasonnum = $reason->reasonnum;
+ qq!<INPUT TYPE="checkbox" NAME="reasonnum" VALUE="$reasonnum">!;
+};
+push @links, '';
+$align .= 'l';
+my $html_foot = include('/search/elements/checkbox-foot.html',
+ onclick => include( '/elements/popup_link_onclick.html',
+ js_action => q!'! . "${p}misc/reason-merge.html?" . q!' + toCGIString()!,
+ actionlabel => 'Merge reasons',
+ ),
+ label => 'merge selected reasons',
+ minboxes => 2,
+) . '</FORM>';
</%init>
diff --git a/httemplate/browse/reason_type.html b/httemplate/browse/reason_type.html
index 0cb6e7a39..e5f42e839 100644
--- a/httemplate/browse/reason_type.html
+++ b/httemplate/browse/reason_type.html
@@ -21,6 +21,8 @@
'',
],
'disable_total' => 1,
+ 'html_form' => qq!<FORM ACTION="${p}misc/reason_merge.html" METHOD="POST">!,
+ 'html_foot' => $html_foot,
&>
<%init>
@@ -44,7 +46,8 @@ my $html_init = 'Reasons: ' .
} keys (%FS::reason_type::class_name)
);
-$html_init .= '<BR><P>' .
+$html_init .= include('/elements/init_overlib.html').
+ '<BR><P>' .
$classname . ' reasons ' .
$FS::reason_type::class_purpose{$class} .
'. Reason types allow reasons to be grouped for reporting purposes.' .
@@ -64,6 +67,10 @@ my $reasons_sub = sub {
'link' => $p. "edit/reason.html?class=$class&reasonnum=".
$_->reasonnum,
},
+ {
+ 'data' => q!<INPUT TYPE="checkbox" NAME="reasonnum" VALUE="! . $_->reasonnum . q!">!,
+ 'align' => 'right',
+ },
];
}
$reason_type->enabled_reasons ),
@@ -73,7 +80,8 @@ my $reasons_sub = sub {
'align' => 'left',
'link' => $p. "edit/reason.html?class=$class",
'data_style' => 'i',
- }
+ },
+ { 'data' => '' },
]
];
@@ -86,4 +94,13 @@ $count_query .= $where_clause;
my $link = [ $p.'edit/reason_type.html?class='.$class.'&typenum=', 'typenum' ];
+my $html_foot = include('/search/elements/checkbox-foot.html',
+ onclick => include( '/elements/popup_link_onclick.html',
+ js_action => q!'! . "${p}misc/reason-merge.html?" . q!' + toCGIString()!,
+ actionlabel => 'Merge reasons',
+ ),
+ label => 'merge selected reasons',
+ minboxes => 2,
+) . '</FORM>';
+
</%init>
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
index ef8ad3160..85512f8df 100644
--- a/httemplate/browse/router.cgi
+++ b/httemplate/browse/router.cgi
@@ -43,11 +43,13 @@ my @menubar = ( 'Add a new router', "${p2}edit/router.cgi" );
if ($cgi->param('hidecustomerrouters') eq '1') {
$extra_sql = 'WHERE svcnum > 0';
- $cgi->param('hidecustomerrouters', 0);
+ $cgi->delete('hidecustomerrouters');
push @menubar, 'Show customer routers', $cgi->self_url();
+ $cgi->param('hidecustomerrouters', 1);
} else {
$cgi->param('hidecustomerrouters', 1);
push @menubar, 'Hide customer routers', $cgi->self_url();
+ $cgi->delete('hidecustomerrouters');
}
my $count_sql = $extra_sql. ( $extra_sql =~ /WHERE/ ? ' AND' : 'WHERE' ).
diff --git a/httemplate/docs/license.html b/httemplate/docs/license.html
index 7e5bb1e3e..3f80570d9 100644
--- a/httemplate/docs/license.html
+++ b/httemplate/docs/license.html
@@ -63,7 +63,7 @@ GmbH, licensed under the terms of the GNU GPL.
<P>
Latex invoice template based on a template from eBills
<http://ebills.sourceforge.net/> by Mark Asplen-Taylor <mark@asplen.co.uk>,
-licensed under the terms fo the GNU GPL.
+licensed under the terms of the GNU GPL.
<P>
Contains "JS Calendar" <http://dynarch.com/mishoo/calendar.epl>
@@ -143,5 +143,11 @@ Contains icons from
by Mark James, licensed under the terms of the Creative Commons Attribution
2.5 License.
+<P>
+Includes icon from
+http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-document-edit-icon.html
+licensed under GNU Lesser General Public License
+</P>
+
</BODY>
</HTML>
diff --git a/httemplate/edit/msg_template/email.html b/httemplate/edit/msg_template/email.html
index 12a4a6f56..53f538b11 100644
--- a/httemplate/edit/msg_template/email.html
+++ b/httemplate/edit/msg_template/email.html
@@ -300,6 +300,7 @@ my %substitutions = (
'$payby' => 'Payment method',
'$date' => 'Payment date',
'$payinfo' => 'Card/account# (masked)',
+ '$payinfo_end' => 'Card/account last 4 digits',
'$error' => 'Decline reason',
],
'cust_refund' => [
@@ -308,6 +309,7 @@ my %substitutions = (
'$payby' => 'Refund method',
'$date' => 'Refund date',
'$payinfo' => 'Card/account# (masked)',
+ '$payinfo_end' => 'Card/account last 4 digits',
],
'system_log' => [
'$logmessage' => 'Log entry message',
diff --git a/httemplate/edit/process/reason.html b/httemplate/edit/process/reason.html
index cb79ed254..dfc18624e 100644
--- a/httemplate/edit/process/reason.html
+++ b/httemplate/edit/process/reason.html
@@ -1,6 +1,6 @@
<% include( 'elements/process.html',
'table' => 'reason',
- 'redirect' => popurl(3) . 'browse/reason.html?class=' .
+ 'redirect' => popurl(3) . 'browse/reason_type.html?class=' .
$cgi->param('class') . '&',
)
%>
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi
index 9cac2c568..d75ff92c1 100755
--- a/httemplate/edit/process/svc_acct.cgi
+++ b/httemplate/edit/process/svc_acct.cgi
@@ -81,7 +81,12 @@ if ( $cgi->param('clear_password') eq '*HIDDEN*'
|| $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) {
die "fatal: no previous account to recall hidden password from!" unless $old;
} else {
- $error ||= $new->set_password($cgi->param('clear_password'));
+ my $newpass = $cgi->param('clear_password');
+ if ( ! $old->check_password($newpass) ) {
+ # then the password is being changed
+ $error ||= $new->is_password_allowed($newpass)
+ || $new->set_password($newpass);
+ }
}
if ( ! $error ) {
diff --git a/httemplate/edit/quotation_pkg_detail.html b/httemplate/edit/quotation_pkg_detail.html
index b8f589a9a..80a904420 100644
--- a/httemplate/edit/quotation_pkg_detail.html
+++ b/httemplate/edit/quotation_pkg_detail.html
@@ -21,15 +21,11 @@
<TD BGCOLOR="#ffffff"><% $part_pkg->comment |h %></TD>
</TR>
- <TR>
- <TD COLSPAN=2>Detail: </TD>
- </TR>
-
% my $row = 0;
% for ( @details ) {
<TR>
- <TD></TD>
+ <TD ALIGN="right"><% $row ? '' : 'Detail' %></TD>
<TD>
<INPUT TYPE="text" NAME="detail<% $row %>" SIZE="60" MAXLENGTH="65" VALUE="<% $_ |h %>" rownum="<% $row++ %>" onkeyup="possiblyAddRow" onchange="possiblyAddrow">
</TD>
@@ -63,6 +59,10 @@
var row = document.createElement('TR');
var empty_cell = document.createElement('TD');
+ if (!rownum) {
+ empty_cell.innerHTML = 'Detail:'
+ empty_cell.style.textAlign = 'right';
+ }
row.appendChild(empty_cell);
var detail_cell = document.createElement('TD');
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>
diff --git a/httemplate/search/elements/checkbox-foot.html b/httemplate/search/elements/checkbox-foot.html
index c47009425..ae8b79470 100644
--- a/httemplate/search/elements/checkbox-foot.html
+++ b/httemplate/search/elements/checkbox-foot.html
@@ -11,6 +11,7 @@
},
],
filter => '.name = "pkgpart"', # see below
+ minboxes => 2, #will remove checkboxes if there aren't at least this many
),
&>
@@ -67,6 +68,14 @@ for (var i = 0; i < inputs.length; i++) {
}
}
%# avoid the need for "$areboxes" late-evaluation hackery
+% if ($opt{'minboxes'}) {
+if ( checkboxes.length < <% $opt{'minboxes'} %> ) {
+ for (i = 0; i < checkboxes.length; i++) {
+ checkboxes[i].parentNode.removeChild(checkboxes[i]);
+ }
+ checkboxes = [];
+}
+% }
if ( checkboxes.length == 0 ) {
document.getElementById('checkbox_footer').style.display = 'none';
}