diff options
author | ivan <ivan> | 2007-02-14 08:48:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-02-14 08:48:36 +0000 |
commit | ab9e07a6507647e1aaf59df75edc54b40a745643 (patch) | |
tree | 5dab2799798284496a30c04aebcaf71c6858325f /httemplate/elements | |
parent | b270bdf15e7ac5e9c47a127f82625da25ff16436 (diff) |
add more options to advanced package reporting
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-cust_pkg-status.html | 27 | ||||
-rw-r--r-- | httemplate/elements/tr-input-beginning_ending.html | 28 |
2 files changed, 33 insertions, 22 deletions
diff --git a/httemplate/elements/select-cust_pkg-status.html b/httemplate/elements/select-cust_pkg-status.html index 58f270342..71aaa84b6 100644 --- a/httemplate/elements/select-cust_pkg-status.html +++ b/httemplate/elements/select-cust_pkg-status.html @@ -1,20 +1,21 @@ -% -% my( $status, %opt ) = @_; -% -% $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) -% -% - - -<SELECT NAME="status"> +<SELECT NAME="status" <% $opt{'onchange'} %>> <OPTION VALUE="">all -% foreach my $status ( @{ $opt{'statuses'} } ) { - - <OPTION VALUE="<% $status %>"><% $status %> +% foreach my $option ( @{ $opt{'statuses'} } ) { + <OPTION VALUE="<% $option %>" <% $option eq $status ? 'SELECTED' : '' %>><% $option %> % } - </SELECT> +<%init> + my( $status, %opt ) = @_; + + $opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } ) + + if ( exists $opt{'onchange'} && $opt{'onchange'} ) { + $opt{'onchange'} = ' onChange="' . $opt{'onchange'}. '"'; + } else { + $opt{'onchange'} = ''; + } +</%init> diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index 6bef6b4ef..9c067dbea 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -3,29 +3,33 @@ <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="beginning" ID="beginning_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="beginning_button" STYLE="cursor: pointer" TITLE="Select date"><BR><i>m/d/y<% $time_hint %></i></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: "beginning_text", + inputField: "<% $opt{prefix} %>beginning_text", ifFormat: "%m/%d/%Y<% $time_format %>", - button: "beginning_button", + button: "<% $opt{prefix} %>beginning_button", align: "BR" <% $input_time %> }); </SCRIPT> -</TR> +% unless ( $opt{layout} =~ /^h/i ) { #horizontal + +</TR> <TR> + +% } + <TD ALIGN="right">To date: </TD> - <TD><INPUT TYPE="text" NAME="ending" ID="ending_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="ending_button" STYLE="cursor: pointer" TITLE="Select date"><BR><i>m/d/y<% $time_hint %></i></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: "ending_text", + inputField: "<% $opt{prefix} %>ending_text", ifFormat: "%m/%d/%Y<% $time_format %>", - button: "ending_button", + button: "<% $opt{prefix} %>ending_button", align: "BR" <% $input_time %> }); @@ -34,13 +38,18 @@ <TR> <TD></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> <%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'} ) { @@ -50,4 +59,5 @@ if ( $opt{'input_time'} ) { $size = 21; $maxlength = 27; } + </%init> |