diff options
author | ivan <ivan> | 2005-08-24 13:22:27 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-08-24 13:22:27 +0000 |
commit | 2b49cbe76b94c6c1561aa2bf37beba7d47591190 (patch) | |
tree | 7dceb6e839c8c1090f48c17348a81764dcebf16d /httemplate/elements/select-month_year.html | |
parent | 9eb89294e2909ca9a8043b05f2492b7018b14adb (diff) |
customer edit: abstract out billing info to billing.html, re-do payment type selection with HTML::Widgets::SelectLayers, add Switch/Solo/Maestro support for start date & issue #. customer view: re-order fields for consistency. selfservice API: support paystart_month, paystart_year, payissue and payip in MyAccount::process_payment and ::edit_info and Signup::new_customer, FS::cust_main::realtime_bop: support paystart_month paystart_year payissue payip fields
Diffstat (limited to 'httemplate/elements/select-month_year.html')
-rw-r--r-- | httemplate/elements/select-month_year.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/httemplate/elements/select-month_year.html b/httemplate/elements/select-month_year.html new file mode 100644 index 000000000..a0ea74ddd --- /dev/null +++ b/httemplate/elements/select-month_year.html @@ -0,0 +1,50 @@ +<% + + my %opt = @_; + + my $prefix = $opt{'prefix'} || ''; + my $disabled = $opt{'disabled'} || ''; + my $empty = $opt{'empty_option'} || ''; + my $date = $opt{'selected_date'} || ''; + $date = '' if $date eq '-'; + #$date ||= '01-2000' unless $empty; + my $start_year = $opt{'start_year'}; + my $end_year = $opt{'end_year'} || '2037'; + + my( $mon, $year ) = (0, 0); + if ( $date ) { + if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format + ( $mon, $year ) = ( $2, $1 ); + } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { + ( $mon, $year ) = ( $1, $3 ); + } else { + die "unrecognized expiration date format: $date"; + } + } + + unless ( $start_year ) { + my @t = localtime; + $start_year = $t[5] + 1900; + } + $start_year = $year if $start_year > $year && $year > 0; + +%> + +<SELECT NAME="<%= $prefix %>_month" SIZE="1" <%= $disabled%>> + +<%= $empty ? '<OPTION VALUE="">' : '' %> + +<% for ( 1 .. 12 ) { %> + <OPTION<%= $_ == $mon ? ' SELECTED' : '' %> VALUE="<%= $_ %>"><%= $_ %> +<% } %> + +</SELECT>/<SELECT NAME="<%= $prefix %>_year" SIZE="1" <%= $disabled%>> + +<%= $empty ? '<OPTION VALUE="">' : '' %> + +<% for ( $start_year .. $end_year ) { %> + <OPTION<%= $_ == $year ? ' SELECTED' : '' %> VALUE="<%= $_ %>"><%= $_ %> +<% } %> + +</SELECT> + |