[freeside-commits] branch FREESIDE_4_BRANCH updated. cb1d012f6abd6a122da3257ef38af9ec85c9c6c0
Christopher Burger
burgerc at freeside.biz
Sat Jan 13 09:53:18 PST 2018
The branch, FREESIDE_4_BRANCH has been updated
via cb1d012f6abd6a122da3257ef38af9ec85c9c6c0 (commit)
via ffedd8292b8b9a5db9beab1081c62277629742c3 (commit)
via 3ae49863cc01b2364715b9828f22a79caba632d6 (commit)
via e04426158a654a07dcf17f58befc5c77737f3909 (commit)
from 4bc22241c53c2c990b81d99afd870f5158e3daac (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cb1d012f6abd6a122da3257ef38af9ec85c9c6c0
Author: Christopher Burger <burgerc at freeside.biz>
Date: Fri Jan 12 16:52:28 2018 -0500
RT# 78617 - updated redirect to freeside_status to show update message
diff --git a/httemplate/elements/alert.html b/httemplate/elements/alert.html
deleted file mode 100644
index 620588b0c..000000000
--- a/httemplate/elements/alert.html
+++ /dev/null
@@ -1,4 +0,0 @@
-% if ( $cgi->param('alert') ) {
- <FONT SIZE="+1" COLOR="#008000"><% mt($cgi->param('alert')) |h %></FONT>
- <BR><BR>
-% }
\ No newline at end of file
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index 96d301815..1b18d2ec8 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -1,10 +1,15 @@
% if ( $error ) {
% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(1). "pref.html?". $cgi->query_string ) %>
+ <% $cgi->redirect(popurl(1). "pref.html?". $cgi->query_string ) %>
% } else {
-<% include('/elements/header.html', mt('Preferences updated')) %>
-<% include('/elements/footer.html') %>
-<% $cgi->redirect(popurl(1). "pref.html?alert=Preferences updated" ) %>
+ <% $cgi->redirect( -uri => popurl(1). "pref.html",
+ -cookie => CGI::Cookie->new(
+ -name => 'freeside_status',
+ -value => mt('Preferences updated'),
+ -expires => '+5m',
+ ),
+ )
+ %>
% }
<%init>
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index ceafa9850..56fde6d44 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -6,8 +6,6 @@
<& /elements/error.html &>
-<& /elements/alert.html &>
-
% if ( FS::Auth->auth_class->can('change_password') ) {
<FONT CLASS="fsinnerbox-title"><% emt('Change password (leave blank for no change)') %></FONT>
commit ffedd8292b8b9a5db9beab1081c62277629742c3
Author: Christopher Burger <burgerc at freeside.biz>
Date: Fri Jan 12 16:20:20 2018 -0500
RT# 78617 - removed some test code
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index c50f5ca3c..ceafa9850 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -273,8 +273,6 @@
% );
<% include("/elements/footer.html", %footerdata) %>
-%#<&/elements/footer.html &>
-
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
commit 3ae49863cc01b2364715b9828f22a79caba632d6
Author: Christopher Burger <burgerc at freeside.biz>
Date: Fri Jan 12 15:54:35 2018 -0500
RT# 78617 - added alert code that can be placed on any page.
diff --git a/httemplate/elements/alert.html b/httemplate/elements/alert.html
new file mode 100644
index 000000000..620588b0c
--- /dev/null
+++ b/httemplate/elements/alert.html
@@ -0,0 +1,4 @@
+% if ( $cgi->param('alert') ) {
+ <FONT SIZE="+1" COLOR="#008000"><% mt($cgi->param('alert')) |h %></FONT>
+ <BR><BR>
+% }
\ No newline at end of file
commit e04426158a654a07dcf17f58befc5c77737f3909
Author: Christopher Burger <burgerc at freeside.biz>
Date: Fri Jan 12 15:36:13 2018 -0500
RT# 78617 - fixed preference field customer_view_emails to only except whole numbers, also added redirection back to preference page after edit.
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index 75e57958f..96d301815 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -4,6 +4,7 @@
% } else {
<% include('/elements/header.html', mt('Preferences updated')) %>
<% include('/elements/footer.html') %>
+<% $cgi->redirect(popurl(1). "pref.html?alert=Preferences updated" ) %>
% }
<%init>
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index abd1ea57f..c50f5ca3c 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -1,9 +1,13 @@
<& /elements/header.html, mt('Preferences for [_1]', $FS::CurrentUser::CurrentUser->username) &>
+% my $js_form_validate = { 'pref_form' => { 'name' => 'pref_form' } };
+
<FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
<& /elements/error.html &>
+<& /elements/alert.html &>
+
% if ( FS::Auth->auth_class->can('change_password') ) {
<FONT CLASS="fsinnerbox-title"><% emt('Change password (leave blank for no change)') %></FONT>
@@ -143,10 +147,14 @@
</TD>
</TR>
+% my $validate_field_cve = 'customer_view_emails';
+% $js_form_validate->{pref_form}->{validate_fields}{$validate_field_cve} = 'digits: true';
+% $js_form_validate->{pref_form}->{error_message}{$validate_field_cve} = 'Please only enter numbers here.';
+
<TR>
<TH ALIGN="right"><% emt("How many recent outbound emails to show in customer view") %></TH>
<TD ALIGN="left" COLSPAN=2>
- <INPUT TYPE="text" NAME="customer_view_emails" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
+ <INPUT TYPE="text" ID="<% $validate_field_cve %>" NAME="<% $validate_field_cve %>" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
</TD>
</TR>
@@ -260,7 +268,13 @@
<INPUT TYPE="submit" VALUE="<% emt("Update preferences") %>">
-<&/elements/footer.html &>
+% my %footerdata = (
+% 'formvalidation' => $js_form_validate,
+% );
+<% include("/elements/footer.html", %footerdata) %>
+
+%#<&/elements/footer.html &>
+
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
-----------------------------------------------------------------------
Summary of changes:
httemplate/pref/pref-process.html | 12 +++++++++---
httemplate/pref/pref.html | 14 ++++++++++++--
2 files changed, 21 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list