adding export to read mailbox status information, RT#15987
[freeside.git] / httemplate / elements / tr-input-date-field.html
index 2a731e1..37a22e5 100644 (file)
@@ -1,14 +1,15 @@
-
+% unless ( $noinit ) {
 <LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2">
 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT>
+% }
 
 <TR>
   <TD ALIGN="right"><% $label %></TD>
   <TD>
     <INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% $value %>">
-    <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name  %>_button" STYLE="cursor: pointer" TITLE="Select date">
+    <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name  %>_button" STYLE="cursor: pointer" TITLE="<% mt('Select date') |h %>">
   </TD>
 </TR>
 
@@ -21,9 +22,9 @@
   });
 </SCRIPT>
 
-
 <%init>
-my($name, $value, $label, $format, $usedatetime);
+
+my($name, $value, $label, $format, $usedatetime, $noinit);
 if ( ref($_[0]) ) {
   my $opt = shift;
   $name        = $opt->{'name'};
@@ -31,11 +32,15 @@ if ( ref($_[0]) ) {
   $label       = $opt->{'label'};
   $format      = $opt->{'format'};
   $usedatetime = $opt->{'usedatetime'};
+  $noinit      = $opt->{'noinit'};
 } else {
   ($name, $value, $label, $format, $usedatetime) = @_;
 }
 
-$format = "%m/%d/%Y" unless $format;
+my $conf = new FS::Conf;
+
+$format ||= $conf->config('date_format') || '%m/%d/%Y';
+
 $label = $name unless $label;
 
 if ( $value =~ /\S/ ) {