Index: openacs-4/packages/dotlrn/tcl/term-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/term-procs-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/term-procs-oracle.xql 1 May 2002 01:19:47 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/term-procs-oracle.xql 26 Jul 2002 02:01:34 -0000 1.6 @@ -46,4 +46,14 @@ + + + select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year as term, + dotlrn_terms.term_id + from dotlrn_terms + where dotlrn_terms.end_date > sysdate + order by dotlrn_terms.start_date + + + Index: openacs-4/packages/dotlrn/tcl/term-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/term-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/tcl/term-procs-postgresql.xql 11 Jul 2002 15:54:13 -0000 1.1 +++ openacs-4/packages/dotlrn/tcl/term-procs-postgresql.xql 26 Jul 2002 02:01:34 -0000 1.2 @@ -46,4 +46,14 @@ + + + select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year as term, + dotlrn_terms.term_id + from dotlrn_terms + where dotlrn_terms.end_date > current_timestamp + order by dotlrn_terms.start_date + + + Index: openacs-4/packages/dotlrn/tcl/term-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/term-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/tcl/term-procs.tcl 6 May 2002 15:56:22 -0000 1.6 +++ openacs-4/packages/dotlrn/tcl/term-procs.tcl 26 Jul 2002 02:01:34 -0000 1.7 @@ -111,4 +111,29 @@ } + ad_proc -public start_end_dates_to_term_year { + {-start_date:required} + {-end_date:required} + } { + generate a "term year" string from the start and end dates + a "term year" is either a 4-digit year like "2002" or + two different 4-digit year seperated by a / like "2002/2004" + } { + set start_year [template::util::date::get_property year $start_date] + set end_year [template::util::date::get_property year $end_date] + + if {![string equal $start_year $end_year]} { + return "$start_year/$end_year" + } + + return $start_year + } + + ad_proc -public get_future_terms_as_options { + } { + get future term info in a list of lists for a html select option widget + } { + return [db_list_of_lists get_future_terms_select {}] + } + }