im_allocation_date_optionlist db { start_block " " } { start_of_larger_unit_p " " } { number_months_ahead "18" }What it does:
Returns an optionlist of valid allocation start dates. If start_of_larger_unit_p is t/f, then we limit to those blocks matching t/f. Number_months_ahead specified the number of months of start blocks from today to include. This is great for limiting the size of select bars. Specifying a negative value includes all of the start blocks.Defined in: /web/philip/tcl/intranet-defs.tcl
Source code:
if { [empty_string_p $start_of_larger_unit_p] } {
set start_p_sql ""
} else {
set start_p_sql " and start_of_larger_unit_p='$start_of_larger_unit_p' "
}
if { $number_months_ahead >= 0 } {
set number_months_sql ""
} else {
set number_months_sql " and start_block <= add_months(sysdate, '$number_months_ahead') "
}
# Only go as far as 1 year into the future to save space
return [ad_db_optionlist $db "select to_char(start_block,'Month YYYY'), start_block
from im_start_blocks
where 1=1 $number_months_sql $start_p_sql
order by start_block asc" $start_block]