projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
search services by tower/sector, #15950
[freeside.git]
/
httemplate
/
elements
/
tr-input-beginning_ending.html
diff --git
a/httemplate/elements/tr-input-beginning_ending.html
b/httemplate/elements/tr-input-beginning_ending.html
index
2aa5974
..
7481c9b
100644
(file)
--- a/
httemplate/elements/tr-input-beginning_ending.html
+++ b/
httemplate/elements/tr-input-beginning_ending.html
@@
-7,7
+7,7
@@
<TR>
<TD ALIGN="right">From date: </TD>
<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>
+ <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>beginning" ID="<% $opt{prefix} %>beginning_text" VALUE="
<% $from %>
" 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",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>beginning_text",
@@
-26,7
+26,7
@@
% }
<TD ALIGN="right">To date: </TD>
% }
<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>
+ <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>ending" ID="<% $opt{prefix} %>ending_text" VALUE="
<% $to %>
" 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",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>ending_text",
@@
-38,12
+38,14
@@
</SCRIPT>
</TR>
</SCRIPT>
</TR>
+% unless ( $datesrequired ) {
<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>
<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>
<%once>
@@
-57,6
+59,13
@@
my %opt = @_;
my $conf = new FS::Conf;
my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my $conf = new FS::Conf;
my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+my $datesrequired = 0;
+$datesrequired = $opt{'datesrequired'} if $opt{'datesrequired'};
+
+my $from = '';
+$from = $opt{'from'} if $opt{'from'};
+my $to = '';
+$to = $opt{'to'} if $opt{'to'};
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};