| |
13 |
13 |
::twt::do_request "/dotlrn/admin/term-new" |
| |
14 |
14 |
form find ~n add_term |
| |
15 |
15 |
field find ~n "term_name" |
| |
16 |
16 |
|
| |
17 |
17 |
field fill "$term_name" |
| |
18 |
18 |
# Start date |
| |
19 |
19 |
::twt::multiple_select_value start_date.month $start_month |
| |
20 |
20 |
::twt::multiple_select_value start_date.day "1" |
| |
21 |
21 |
field find ~n "start_date.year" |
| |
22 |
22 |
field fill $start_year |
| |
23 |
23 |
# End date |
| |
24 |
24 |
::twt::multiple_select_value end_date.month $end_month |
| |
25 |
25 |
::twt::multiple_select_value end_date.day "1" |
| |
26 |
26 |
field find ~n "end_date.year" |
| |
27 |
27 |
field fill $end_year |
| |
28 |
28 |
form submit |
| |
29 |
29 |
} |
| |
30 |
30 |
|
| |
31 |
31 |
ad_proc ::twt::dotlrn::setup_terms { server_url } { |
| |
32 |
32 |
|
| |
33 |
|
add_term $server_url "Fall" "9" "2003" "1" "2004" |
| |
34 |
33 |
add_term $server_url "Spring" "1" "2004" "7" "2004" |
| |
35 |
34 |
add_term $server_url "Fall" "9" "2004" "1" "2005" |
| |
|
35 |
add_term $server_url "Spring" "1" "2005" "7" "2005" |
| |
36 |
36 |
} |
| |
37 |
37 |
|
| |
38 |
38 |
ad_proc ::twt::dotlrn::current_term_pretty_name {} { |
| |
39 |
|
return "Fall 2003/2004" |
| |
|
39 |
return "Spring 2004" |
| |
40 |
40 |
} |
| |
41 |
41 |
|
| |
42 |
42 |
ad_proc ::twt::dotlrn::current_term_id {} { |
| |
43 |
43 |
::twt::do_request [class_admin_url] |
| |
44 |
44 |
|
| |
45 |
45 |
form find ~n term_form |
| |
46 |
46 |
field find ~n term_id |
| |
47 |
47 |
# Term pretty names are not I18N so this will work in different locales |
| |
48 |
48 |
field select [current_term_pretty_name] |
| |
49 |
49 |
array set term_select_field [field current] |
| |
50 |
50 |
set term_id $term_select_field(value) |
| |
51 |
51 |
|
| |
52 |
52 |
return $term_id |
| |
53 |
53 |
} |
| |
54 |
54 |
|
| |
55 |
55 |
ad_proc ::twt::dotlrn::class_admin_url { |
| |
56 |
56 |
{-term_id "-1"} |
| |
57 |
57 |
} { |
| |
58 |
58 |
return "/dotlrn/admin/term?term_id=$term_id" |
| |
59 |
59 |
} |