Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/dotlrn.info 6 Nov 2001 21:46:46 -0000 1.7 +++ openacs-4/packages/dotlrn/dotlrn.info 7 Nov 2001 20:20:55 -0000 1.8 @@ -61,18 +61,26 @@ + + + + + + - + + + + + + - - - @@ -84,18 +92,6 @@ - - - - - - - - - - - - Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-classes-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 6 Nov 2001 21:46:48 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 7 Nov 2001 20:20:55 -0000 1.5 @@ -17,6 +17,8 @@ primary key ); +create view dotlrn_classes_full as select class_key, pretty_name, description, package_id, supertype from dotlrn_classes, dotlrn_community_types where dotlrn_community_types.community_type=dotlrn_classes.class_key; + create table dotlrn_class_instances ( class_instance_id constraint dotlrn_class_i_id_fk references dotlrn_communities(community_id) @@ -28,8 +30,10 @@ term varchar(20) ); +create view dotlrn_class_instances_full as select class_instance_id, class_key, year, term, community_key, pretty_name, description, package_id from dotlrn_class_instances, dotlrn_communities where dotlrn_class_instances.class_instance_id = dotlrn_communities.community_id; + -- -- PL/SQL stuff -- Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 6 Nov 2001 21:46:49 -0000 1.13 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 7 Nov 2001 20:20:56 -0000 1.14 @@ -30,7 +30,7 @@ # Insert the community type db_exec_plsql create_community_type {} } - + ad_proc set_type_package_id { community_type package_id @@ -40,7 +40,7 @@ # Exec the statement, easy db_dml update_package_id {} } - + ad_proc -public new { {-description ""} community_type @@ -61,10 +61,9 @@ } { Update the node ID for the community } { - # Exec the statement, easy db_dml update_package_id {} } - + ad_proc admin_access_p { community_id } { @@ -73,7 +72,7 @@ # HACK FOR NOW!! (ben) FIXIT return 1 } - + ad_proc -public get_url { {-current_node_id ""} {-package_id ""} @@ -97,15 +96,23 @@ # Not sure what to do here yet } - ad_proc -public list_users { + ad_proc -public list_admin_users { community_id + } { + Returns list of admin users + } { + return [list_users -rel_type "dotlrn_admin_rel" $community_id] + } + + ad_proc -public list_users { {-rel_type "dotlrn_member_rel"} + community_id } { Returns the list of users with a membership_id, a user_id, first name, last name, email, and role } { return [db_list_of_lists select_users {}] } - + ad_proc -public member_p { community_id user_id @@ -114,7 +121,7 @@ } { return [db_string select_count_membership {}] } - + ad_proc -public add_user { community_id rel_type @@ -182,8 +189,11 @@ } { returns all communities for a user } { - set list_of_communities [list] - ### HACK HERE !!! (ben) + set return_list [db_list_of_lists select_communities_by_user {}] + + ns_log Notice "return list: $return_list" + + return $return_list } ad_proc -public get_communities_by_user { @@ -197,10 +207,10 @@ db_foreach select_communities {} { lappend list_of_communities [list $community_id $community_type $pretty_name $description [get_url -package_id $package_id]] } - + return $list_of_communities } - + ad_proc -public get_active_communities { community_type } { @@ -216,6 +226,14 @@ return $list_of_communities } + ad_proc -public get_all_communities { + community_type + } { + Returns a list of all communities, and whether or not they are active. + } { + return [db_list_of_lists select_all_communities {}] + } + ad_proc -public get_community_type { } { Returns the community type key depending on the node we're at Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 5 Nov 2001 22:34:23 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 7 Nov 2001 20:20:56 -0000 1.6 @@ -35,8 +35,7 @@ -select rel_id, users.user_id, first_names, last_name, email from registered_users users, dotlrn_community_memberships -where community_id= :community_id and users.user_id = dotlrn_community_memberships.user_id +select rel_id, users.user_id, first_names, last_name, email from registered_users users, dotlrn_member_rels_full where community_id= :community_id and users.user_id = dotlrn_member_rels_full.user_id @@ -79,6 +78,12 @@ + + +select dotlrn_communities.community_id, community_type, community_key, pretty_name from dotlrn_communities, dotlrn_member_rels_full where dotlrn_communities.community_id = dotlrn_member_rels_full.community_id and dotlrn_member_rels_full.user_id = :user_id + + + select dotlrn_communities.community_id as community_id, community_type, pretty_name, description, package_id @@ -88,7 +93,7 @@ and dotlrn_communities.community_id = dotlrn_community_memberships.community_id -\ + select community_id, community_type, pretty_name, description, package_id @@ -97,6 +102,14 @@ + + +select community_id, community_type, pretty_name, description, package_id +from dotlrn_communities +where community_type= :community_type + + + select community_type from dotlrn_community_types where package_id= :package_id Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 6 Nov 2001 21:46:49 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 7 Nov 2001 20:20:56 -0000 1.3 @@ -61,15 +61,22 @@ # This is not templated. OH NO. I am a horrible, horrible, little man. (ben) set return_html "
    \n" + ns_log Notice "DOTLRN - UL" - ns_log Notice "DOTLRN-SHOW: UL" + set communities [dotlrn_community::get_all_communities_by_user $user_id] + # set communities "" - db_foreach select_communities_for_one_user {} { - ns_log Notice "DOTLRN-SHOW: LI" - append return_html "
  • $community_name\n" + ns_log Notice "DOTLRN COMMUNITIES - $communities" + + foreach community $communities { + ns_log Notice "DOTLRN - LI" + set url [lindex $community 1]/[lindex $community 2] + set pretty_name [lindex $community 3] + + append return_html "
  • $pretty_name\n" } - ns_log Notice "DOTLRN-SHOW: /UL" + ns_log Notice "DOTLRN - /UL" append return_html "
" Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-new-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-new.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/admin/class-instance-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-instance-new.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.adp 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,4 @@ + +dotLRN New Class Instance + + Index: openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,44 @@ + + +ad_page_contract { + Create a New Class Instance + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-10-05 +} { + class_key +} + +form create add_class_instance + +element create add_class_instance pretty_name \ + -label "Name" -datatype text -widget text -html { size 60 } + +element create add_class_instance year \ + -label "Year" -datatype text -widget text -html { size 40 } + +element create add_class_instance term \ + -label "Term" -datatype text -widget text -html { size 40 } + +element create add_class_instance description \ + -label "Description" -datatype text -widget textarea -html {rows 5 cols 60 wrap soft} + +element create add_class_instance class_key \ + -label "Class Key" -value $class_key -datatype text -widget hidden + + +if {[form is_valid add_class_instance]} { + template::form get_values add_class_instance class_key pretty_name year term description + + ns_log Notice "got values from form" + + set class_instance_id [dotlrn_class::new_instance -description $description $class_key $pretty_name $term $year] + + ns_log Notice "created class instance: $class_instance_id" + + ad_returnredirect "one-class?class_key=$class_key" + return +} + +ad_return_template + Index: openacs-4/packages/dotlrn/www/admin/class-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/class-new-2.tcl 7 Nov 2001 18:49:41 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/class-new-2.tcl 7 Nov 2001 20:20:56 -0000 1.2 @@ -12,5 +12,5 @@ set class_key [dotlrn_class::new -description $description $class_key $class_pretty_name] -ns_returnredirect ./ +ad_returnredirect "classes" Index: openacs-4/packages/dotlrn/www/admin/classes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/classes.adp 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,12 @@ + +dotLRN Classes + + Index: openacs-4/packages/dotlrn/www/admin/classes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/classes.tcl 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,12 @@ + +ad_page_contract { + Displays dotLRN classes admin page + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { +} + +db_multirow classes select_classes {} + +ad_return_template Index: openacs-4/packages/dotlrn/www/admin/classes.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/classes.xql 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select class_key, pretty_name, description from dotlrn_classes_full + + + + Index: openacs-4/packages/dotlrn/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/index.adp 7 Nov 2001 15:52:19 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/index.adp 7 Nov 2001 20:20:56 -0000 1.2 @@ -1,15 +1,9 @@ - + dotLRN Admin -

dotLRN users

-
-Add a new dotLRN user: -
- - Index: openacs-4/packages/dotlrn/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/index.tcl 7 Nov 2001 15:52:19 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/index.tcl 7 Nov 2001 20:20:56 -0000 1.2 @@ -8,7 +8,4 @@ } { } -# Currently, just present a list of dotLRN users -db_multirow users select_dotlrn_users {} - ad_return_template Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/admin/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/master.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/master.adp 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,26 @@ + +@title@ + + + + + +
+ + + + + +
dotLRNMIT Sloan
+
+ + + + + +

@title@

+ + <%= [eval ad_context_bar $context_bar] %> + +
+ Index: openacs-4/packages/dotlrn/www/admin/one-class.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/one-class.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/one-class.adp 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,12 @@ + +dotLRN Class Instances for @class_key@ + + Index: openacs-4/packages/dotlrn/www/admin/one-class.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/one-class.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/one-class.tcl 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,26 @@ + +ad_page_contract { + Displays single dotLRN class page + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-07 +} { + class_key +} + +# Get information about that class +if {![db_0or1row select_class_info {}]} { + ad_returnredirect "classes" + return +} + +# Get all class instances +set list_of_class_instances [dotlrn_community::get_all_communities $class_key] + +template::multirow create class_instances class_instance_id pretty_name description + +foreach instance $list_of_class_instances { + template::multirow append class_instances [lindex $instance 0] [lindex $instance 2] [lindex $instance 3] +} + +ad_return_template Index: openacs-4/packages/dotlrn/www/admin/one-class.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/one-class.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/one-class.xql 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select pretty_name, description, supertype from dotlrn_classes_full where class_key= :class_key + + + + Index: openacs-4/packages/dotlrn/www/admin/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 7 Nov 2001 15:52:19 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 7 Nov 2001 20:20:56 -0000 1.2 @@ -11,5 +11,5 @@ # Add the user dotlrn::user_add $user_id -ad_returnredirect "./" +ad_returnredirect "users" Index: openacs-4/packages/dotlrn/www/admin/users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/users.adp 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,15 @@ + +dotLRN Admin + +

dotLRN users

+
    + +
  • @users.last_name@, @users.first_names@ + +
+ +
+Add a new dotLRN user: +
+ + Index: openacs-4/packages/dotlrn/www/admin/users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/users.tcl 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,13 @@ + + +ad_page_contract { + Displays main dotLRN admin page + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { +} + +# Currently, just present a list of dotLRN users +db_multirow users select_dotlrn_users {} + Index: openacs-4/packages/dotlrn/www/admin/users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/users.xql 7 Nov 2001 20:20:56 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select first_names, last_name from dotlrn_users, registered_users where dotlrn_users.user_id= registered_users.user_id + + + +