Index: openacs-4/etc/install/tcl/acs-lang-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/acs-lang-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/etc/install/tcl/acs-lang-procs.tcl 22 Oct 2003 09:51:55 -0000 1.2 +++ openacs-4/etc/install/tcl/acs-lang-procs.tcl 22 Oct 2003 13:16:00 -0000 1.3 @@ -34,7 +34,16 @@ ::twt::do_request /acs-lang form find locale - field find ~n site_wide_locale - ::twt::multiple_select_value $locale + ::twt::multiple_select_value site_wide_locale $locale form submit } + +ad_proc ::twt::acs_lang::check_no_keys { } { + Check in the current request body for occurences of #package_key.message_key# + which might be message keys that a developer forgot to let go through a lang::util::localize + call to be converted into text. +} { + if { [regexp {#[a-zA-Z0-9_.-]+\.[a-zA-Z0-9_.-]+#} [response body] message_key] } { + ::twt::log_warning "Found \"$message_key\" on page [response url] and might be a message key that needs a lang::util::localize call" + } +} Index: openacs-4/etc/install/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/class-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/etc/install/tcl/class-procs.tcl 12 Oct 2003 01:10:13 -0000 1.4 +++ openacs-4/etc/install/tcl/class-procs.tcl 22 Oct 2003 13:16:00 -0000 1.5 @@ -66,34 +66,34 @@ # Member management for the class follow_members_link - + # Add all students - add_members [::twt::user::get_users student] "Student" + add_members [::twt::user::get_users student] dotlrn_student_rel # Add a random professor - add_member [::twt::user::get_random_users professor 1] "Professor" + add_member [::twt::user::get_random_users professor 1] dotlrn_instructor_rel - # Add two random staff + # Add two staff in random roles (one of Teaching Assistant, Course Admin, or Course Assistant) set admin_users [::twt::user::get_random_users staff 2] - set admin_labels [list "Course Assistant" "Teaching Assistant"] + set admin_rels [list dotlrn_ta_rel dotlrn_cadmin_rel dotlrn_ca_rel] set admin_counter 0 for { set admin_counter 0 } \ { [expr $admin_counter < 2 && $admin_counter < [llength $admin_users]] } \ { incr admin_counter } { - set admin_label [::twt::get_random_items_from_list $admin_labels 1] - add_member [lindex $admin_users $admin_counter] $admin_label + set admin_rel [::twt::get_random_items_from_list $admin_rels 1] + add_member [lindex $admin_users $admin_counter] $admin_rel } } } -ad_proc ::twt::class::add_members { email_list role } { +ad_proc ::twt::class::add_members { email_list rel_type } { foreach email $email_list { - add_member $email $role + add_member $email $rel_type } } -ad_proc ::twt::class::add_member { email role } { +ad_proc ::twt::class::add_member { email rel_type } { if { [empty_string_p $email] } { return @@ -108,11 +108,9 @@ # Pick the user (there should be only one) link follow ~u member-add-2 - # add as student (default) + # pick relationship type to class (role) form find ~a "member-add-3" - - field find ~n rel_type - field select $role + ::twt::multiple_select_value rel_type $rel_type form submit } @@ -131,8 +129,7 @@ form find ~n add_subcomm field fill $name ~n pretty_name field fill $description ~n description - field find ~n join_policy - field select $policy + ::twt::multiple_select_value join_policy $policy form submit } } @@ -146,7 +143,8 @@ set pretty_name "Project Group $letter" lappend property_list $pretty_name lappend property_list "Workspace for people working in $pretty_name" - lappend property_list "Needs Approval" + # Other possible values: open, closed + lappend property_list "needs approval" } return $property_list Index: openacs-4/etc/install/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/dotlrn-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/etc/install/tcl/dotlrn-procs.tcl 12 Oct 2003 08:31:28 -0000 1.5 +++ openacs-4/etc/install/tcl/dotlrn-procs.tcl 22 Oct 2003 13:16:00 -0000 1.6 @@ -15,23 +15,23 @@ field fill "$term_name" # Start date - field select $start_month - field select "01" + ::twt::multiple_select_value start_date.month $start_month + ::twt::multiple_select_value start_date.day "1" field find ~n "start_date.year" field fill $start_year # End date - field select $end_month - field select "01" + ::twt::multiple_select_value end_date.month $end_month + ::twt::multiple_select_value end_date.day "1" field find ~n "end_date.year" field fill $end_year form submit } ad_proc ::twt::dotlrn::setup_terms { server_url } { - add_term $server_url "Fall" "September" "2003" "January" "2004" - add_term $server_url "Spring" "January" "2004" "July" "2004" - add_term $server_url "Fall" "September" "2004" "January" "2005" + add_term $server_url "Fall" "9" "2003" "1" "2004" + add_term $server_url "Spring" "1" "2004" "7" "2004" + add_term $server_url "Fall" "9" "2004" "1" "2005" } ad_proc ::twt::dotlrn::current_term_pretty_name {} { @@ -43,6 +43,7 @@ form find ~n term_form field find ~n term_id + # Term pretty names are not I18N so this will work in different locales field select [current_term_pretty_name] array set term_select_field [field current] set term_id $term_select_field(value) @@ -95,6 +96,7 @@ form find ~n add_class field find ~n "form:id" + # Department pretty names are not I18N so this will work in different locales field select "$department_pretty_name" field find ~n "pretty_name" field fill $pretty_name @@ -145,6 +147,7 @@ ::twt::do_request $link form find ~n "add_class_instance" field find + # Term pretty names are not I18N so this will work in different locales field select $term_name field find ~n pretty_name array set name_field [field current] @@ -156,10 +159,10 @@ ad_proc ::twt::dotlrn::setup_communities { server_url } { - add_community $server_url "Tennis Club" "Community for the university tennis club with tournaments and other events, also helps you find people to play with." "Open" - add_community $server_url "Business Alumni Class of 1997" "Alumni community for the Business Administration graduates from the class of 1997." "Closed" - add_community $server_url "Business Administration Program" "Community for all students following the Business Administration Program" "Closed" - add_community $server_url "Star Trek Fan Club" "Community for die-hard fans of Star Trek" "Needs Approval" + add_community $server_url "Tennis Club" "Community for the university tennis club with tournaments and other events, also helps you find people to play with." "open" + add_community $server_url "Business Alumni Class of 1997" "Alumni community for the Business Administration graduates from the class of 1997." "closed" + add_community $server_url "Business Administration Program" "Community for all students following the Business Administration Program" "closed" + add_community $server_url "Star Trek Fan Club" "Community for die-hard fans of Star Trek" "needs approval" } ad_proc ::twt::dotlrn::add_community { server_url name description policy } { @@ -172,8 +175,7 @@ field fill $name field find ~n description field fill $description - field find ~n join_policy - field select $policy + ::twt::multiple_select_value join_policy $policy form submit } Index: openacs-4/etc/install/tcl/twt-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/twt-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/etc/install/tcl/twt-procs.tcl 22 Oct 2003 09:51:55 -0000 1.5 +++ openacs-4/etc/install/tcl/twt-procs.tcl 22 Oct 2003 13:16:00 -0000 1.6 @@ -22,6 +22,11 @@ puts "${script_name}: $message" } +ad_proc ::twt::log_warning { message } { + set script_name [file tail [info script]] + puts "${script_name}: WARNING - $message" +} + ad_proc ::twt::do_request { page_url } { Takes a a url and invokes tclwebtest::do_request. Will retry the request a number of times if it fails because of a socket @@ -60,6 +65,8 @@ # $retry_max times. Propagate the error while retaining the stack trace error "::tclwebtest::do_request threw error $errmsg with errorInfo $errorInfo" } + + ::twt::acs_lang::check_no_keys } ad_proc ::twt::get_url_list { page_url link_url_pattern } { @@ -209,11 +216,13 @@ } } -ad_proc ::twt::multiple_select_value { value } { +ad_proc ::twt::multiple_select_value { name value } { Selects the option with the given value in the current form widget (workaround since I can only get tclwebtest to select based on label). } { + field find ~n $name + array set current_field [field current] set field_choices $current_field(choices) set index 0 @@ -223,6 +232,6 @@ } incr index } - + ::tclwebtest::field_select -index $index } Index: openacs-4/etc/install/tcl/user-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/user-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/etc/install/tcl/user-procs.tcl 22 Oct 2003 09:51:55 -0000 1.6 +++ openacs-4/etc/install/tcl/user-procs.tcl 22 Oct 2003 13:16:00 -0000 1.7 @@ -92,12 +92,9 @@ form submit form find ~n add_user - field find ~n type - ::twt::multiple_select_value $type - field find ~n can_browse_p - ::twt::multiple_select_value $full_access - field find ~n read_private_data_p - ::twt::multiple_select_value $guest + ::twt::multiple_select_value type $type + ::twt::multiple_select_value can_browse_p $full_access + ::twt::multiple_select_value read_private_data_p $guest form submit }