summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2010-03-08 10:57:06 +0000
committerivan <ivan>2010-03-08 10:57:06 +0000
commit06a85a88bfdb0d3fc79ee055eb8327658dfe63ab (patch)
tree239e526d182be4b3a8824811fde923fbd50621f5 /httemplate/edit
parent611624bc08f525d19e1bd548a7d005aa73a53145 (diff)
proper use of date_format config for international date formats, RT#7009
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/REAL_cust_pkg.cgi16
-rwxr-xr-xhttemplate/edit/cust_credit.cgi8
-rwxr-xr-xhttemplate/edit/cust_pay.cgi7
-rwxr-xr-xhttemplate/edit/cust_refund.cgi6
-rw-r--r--httemplate/edit/elements/ApplicationCommon.html7
-rw-r--r--httemplate/edit/quick-charge.html3
6 files changed, 23 insertions, 24 deletions
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi
index c31213805..18d4415c6 100755
--- a/httemplate/edit/REAL_cust_pkg.cgi
+++ b/httemplate/edit/REAL_cust_pkg.cgi
@@ -94,7 +94,7 @@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $column %>_text",
- ifFormat: "%m/%d/%Y",
+ ifFormat: "<% $date_format %>",
button: "<% $column %>_button",
align: "BR"
});
@@ -129,20 +129,16 @@
<% include('/elements/footer.html') %>
-<%once>
-
-#my $format = "%c %z (%Z)";
-my $format = "%m/%d/%Y %T %z (%Z)";
-
-#false laziness w/view/cust_main/packages.html
-#my( $billed_or_prepaid,
-
-</%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates');
+my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+my $format = $date_format. ' %T %z (%Z)';
+
my $error = '';
my( $pkgnum, $cust_pkg );
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi
index febf281f9..dc80847de 100755
--- a/httemplate/edit/cust_credit.cgi
+++ b/httemplate/edit/cust_credit.cgi
@@ -14,7 +14,7 @@
<TR>
<TD ALIGN="right">Date</TD>
- <TD BGCOLOR="#ffffff"><% time2str("%D",$_date) %></TD>
+ <TD BGCOLOR="#ffffff"><% time2str($date_format, $_date) %></TD>
</TR>
<TR>
@@ -64,12 +64,10 @@
</FORM>
</BODY>
</HTML>
-<%once>
+<%init>
my $conf = new FS::Conf;
-
-</%once>
-<%init>
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi
index 07e51989e..a6b73b13a 100755
--- a/httemplate/edit/cust_pay.cgi
+++ b/httemplate/edit/cust_pay.cgi
@@ -26,7 +26,7 @@ Payment
<TR>
<TD ALIGN="right">Date</TD>
<TD COLSPAN=2>
- <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str("%m/%d/%Y %r",$_date) %>">
+ <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str($date_format.' %r',$_date) %>">
<IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="Select date">
</TD>
</TR>
@@ -34,7 +34,7 @@ Payment
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "_date_text",
- ifFormat: "%m/%d/%Y",
+ ifFormat: "<% $date_format %>",
button: "_date_button",
align: "BR"
});
@@ -100,7 +100,8 @@ Payment
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
+my $money_char = $conf->config('money_char') || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi
index 34e3812f3..59417b4c4 100755
--- a/httemplate/edit/cust_refund.cgi
+++ b/httemplate/edit/cust_refund.cgi
@@ -41,7 +41,7 @@
</TR>
<TR>
- <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str("%D",$cust_pay->_date) %></TD>
+ <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str($date_format, $cust_pay->_date) %></TD>
</TR>
<TR>
@@ -93,7 +93,7 @@
<TR>
<TD ALIGN="right">Date</TD>
- <TD BGCOLOR="#ffffff"><% time2str("%D",$_date) %></TD>
+ <TD BGCOLOR="#ffffff"><% time2str($date_format, $_date) %></TD>
</TR>
<TR>
@@ -134,6 +134,8 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Refund payment');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
my $custnum = $cgi->param('custnum');
my $refund = $cgi->param('refund');
my $payby = $cgi->param('payby');
diff --git a/httemplate/edit/elements/ApplicationCommon.html b/httemplate/edit/elements/ApplicationCommon.html
index 459570511..7b1050ade 100644
--- a/httemplate/edit/elements/ApplicationCommon.html
+++ b/httemplate/edit/elements/ApplicationCommon.html
@@ -54,7 +54,7 @@ Examples:
<TR>
<TD ALIGN="right">Date: </TD>
- <TD><B><% time2str("%D", $src->_date) %></B></TD>
+ <TD><B><% time2str($date_format, $src->_date) %></B></TD>
</TR>
<TR>
@@ -354,7 +354,7 @@ function src_amount_changed () {
<OPTION VALUE="">Select <% $dst_thing %>
% foreach my $dst ( @dst ) {
- <OPTION<% $dst->$dst_pkey eq $dst_pkeyvalue ? ' SELECTED' : '' %> VALUE="<% $dst->$dst_pkey %>">#<% $dst->$dst_pkey %> - <% time2str("%D", $dst->_date) %> - $<% $dst->$dst_unapplied %>
+ <OPTION<% $dst->$dst_pkey eq $dst_pkeyvalue ? ' SELECTED' : '' %> VALUE="<% $dst->$dst_pkey %>">#<% $dst->$dst_pkey %> - <% time2str($date_format, $dst->_date) %> - $<% $dst->$dst_unapplied %>
% }
</SELECT>
@@ -399,7 +399,8 @@ function myOnLoadFunction () {
my %opt = @_;
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
+my $money_char = $conf->config('money_char') || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my $src_thing = ucfirst($opt{'src_thing'});
my $src_table = $opt{'src_table'};
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index c96fa6c81..64ad3a289 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -147,7 +147,7 @@ function bill_now_changed (what) {
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
- ifFormat: "%m/%d/%Y",
+ ifFormat: "<% $date_format %>",
button: "start_date_button",
align: "BR"
});
@@ -250,6 +250,7 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('One-time charge');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
my $custnum = $1;