summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-input-beginning_ending.html
blob: 8a1dd62a998d60b124d489d16b43598954a2fe98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
% unless ( $m->count == $previous_request_count ) {
  <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">From date: </TD>
  <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>beginning" ID="<% $opt{prefix} %>beginning_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>beginning_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>beginning_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD>
<SCRIPT TYPE="text/javascript">
  Calendar.setup({
    inputField: "<% $opt{prefix} %>beginning_text",
    ifFormat:   "%m/%d/%Y<% $time_format %>",
    button:     "<% $opt{prefix} %>beginning_button",
    align:      "BR"
    <% $input_time %>
  });
</SCRIPT>

% unless ( $opt{layout} =~ /^h/i ) { #horizontal

</TR>
<TR>

% }

  <TD ALIGN="right">To date: </TD>
  <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>ending" ID="<% $opt{prefix} %>ending_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>ending_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>ending_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD>
<SCRIPT TYPE="text/javascript">
  Calendar.setup({
    inputField: "<% $opt{prefix} %>ending_text",
    ifFormat:   "%m/%d/%Y<% $time_format %>",
    button:     "<% $opt{prefix} %>ending_button",
    align:      "BR"
    <% $input_time %>
  });
</SCRIPT>
</TR>

<TR>
  <TD></TD>
  <TD COLSPAN=<% $opt{layout} =~ /^h/i ? 3 : 1 %>>
    <FONT SIZE="-1">(leave one or both dates blank for an open-ended search)</FONT>
  </TD>
</TR>

<%once>

my $previous_request_count = '';

</%once>
<%init>

my %opt = @_;

$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};

my( $input_time, $time_format, $time_hint ) = ( '', '', '' );
my( $size, $maxlength ) = ( 11, 10 );
if ( $opt{'input_time'} ) {
  $input_time  = ', showsTime: true, timeFormat: "12"'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3
  $time_format = ' %k:%M:%S'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_5.3.5
  $time_hint   = ' h:m:s';
  $size = 21;
  $maxlength = 27;
}

</%init>
<%cleanup>

$previous_request_count = $m->count;

</%cleanup>