Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 10 Jan 2002 00:08:39 -0000 1.18 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 10 Jan 2002 19:30:17 -0000 1.19 @@ -16,10 +16,10 @@ references group_types (group_type) constraint dotlrn_community_types_pk primary key, - pretty_name varchar(100) + pretty_name varchar2(100) constraint dotlrn_ct_pretty_name_nn not null, - description varchar(4000), + description varchar2(4000), package_id constraint dotlrn_ct_package_id_fk references apm_packages (package_id), supertype constraint dotlrn_ct_supertype_fk @@ -34,15 +34,15 @@ community_type not null constraint dotlrn_c_community_type_fk references dotlrn_community_types (community_type), - community_key varchar(100) + community_key varchar2(100) constraint dotlrn_c_community_key_nn not null constraint dotlrn_c_community_key_un unique, - pretty_name varchar(100) + pretty_name varchar2(100) constraint dotlrn_c_pretty_name_nn not null, - description varchar(4000), + description varchar2(4000), active_start_date date, active_end_date date, portal_id constraint dotlrn_c_portal_id_fk Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-community-memberships-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 17 Dec 2001 23:02:55 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 10 Jan 2002 19:30:17 -0000 1.6 @@ -6,17 +6,21 @@ -- -- for Oracle 8/8i. (We're guessing 9i works, too). -- --- ben@openforce.net --- started November 6th, 2001 +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date November 6th, 2001 +-- @version $Id$ -- - create table dotlrn_member_rels ( - rel_id integer not null - constraint dlrn_mem_fk references membership_rels(rel_id) - constraint dlrn_mem_pk primary key, - portal_id integer - constraint dlrn_mem_portal_id_fk references portals(portal_id) + rel_id integer + constraint dlrn_mem_fk + references membership_rels (rel_id) + constraint dlrn_mem_pk + primary key, + portal_id integer + constraint dlrn_mem_portal_id_fk + references portals (portal_id) ); create or replace view dotlrn_member_rels_full @@ -31,9 +35,11 @@ where dotlrn_member_rels.rel_id = acs_rels.rel_id; create table dotlrn_admin_rels ( - rel_id integer not null - constraint dlrn_adm_fk references dotlrn_member_rels(rel_id) - constraint dlrn_adm_pk primary key + rel_id integer + constraint dlrn_adm_fk + references dotlrn_member_rels (rel_id) + constraint dlrn_adm_pk + primary key ); create or replace view dotlrn_admin_rels_full @@ -55,120 +61,144 @@ -- create table dotlrn_student_rels ( - rel_id integer not null - constraint dlrn_stud_fk references dotlrn_member_rels(rel_id) - constraint dlrn_stud_pk primary key + rel_id integer + constraint dlrn_stud_fk + references dotlrn_member_rels (rel_id) + constraint dlrn_stud_pk + primary key ); -create view dotlrn_student_rels_full as select acs_rels.rel_id as rel_id, object_id_one as community_id, object_id_two as user_id, rel_type from dotlrn_student_rels, acs_rels where dotlrn_student_rels.rel_id = acs_rels.rel_id; +create or replace view dotlrn_student_rels_full +as + select acs_rels.rel_id as rel_id, + object_id_one as community_id, + object_id_two as user_id, + rel_type + from dotlrn_student_rels, + acs_rels + where dotlrn_student_rels.rel_id = acs_rels.rel_id; - create table dotlrn_ta_rels ( - rel_id integer not null - constraint dlrn_ta_fk references dotlrn_admin_rels(rel_id) - constraint dlrn_ta_pk primary key + rel_id integer + constraint dlrn_ta_fk + references dotlrn_admin_rels (rel_id) + constraint dlrn_ta_pk + primary key ); -create view dotlrn_ta_rels_full as select acs_rels.rel_id as rel_id, object_id_two as community_id, object_id_two as user_id, rel_type from dotlrn_ta_rels, acs_rels where dotlrn_ta_rels.rel_id = acs_rels.rel_id; +create or replace view dotlrn_ta_rels_full +as + select acs_rels.rel_id as rel_id, + object_id_two as community_id, + object_id_two as user_id, + rel_type + from dotlrn_ta_rels, + acs_rels + where dotlrn_ta_rels.rel_id = acs_rels.rel_id; - create table dotlrn_instructor_rels ( - rel_id integer not null - constraint dlrn_instruct_fk references dotlrn_admin_rels(rel_id) - constraint dlrn_instruct_pk primary key + rel_id integer + constraint dlrn_instruct_fk references dotlrn_admin_rels(rel_id) + constraint dlrn_instruct_pk primary key ); -create view dotlrn_instructor_rels_full as select acs_rels.rel_id as rel_id, object_id_two as community_id, object_id_two as user_id, rel_type from dotlrn_instructor_rels, acs_rels where dotlrn_instructor_rels.rel_id = acs_rels.rel_id; +create view dotlrn_instructor_rels_full +as + select acs_rels.rel_id as rel_id, + object_id_two as community_id, + object_id_two as user_id, + rel_type + from dotlrn_instructor_rels, + acs_rels + where dotlrn_instructor_rels.rel_id = acs_rels.rel_id; - -- -- Object Types and Attributes -- declare - foo integer; + foo integer; begin - acs_rel_type.create_type ( - rel_type => 'dotlrn_member_rel', - supertype => 'membership_rel', - pretty_name => 'dotLRN Community Membership', - pretty_plural => 'dotLRN Community Memberships', - package_name => 'dotlrn_member_rel', - table_name => 'dotlrn_member_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_community', role_one => NULL, - min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, - min_n_rels_two => 0, max_n_rels_two => NULL - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_member_rel', + supertype => 'membership_rel', + pretty_name => 'dotLRN Community Membership', + pretty_plural => 'dotLRN Community Memberships', + package_name => 'dotlrn_member_rel', + table_name => 'dotlrn_member_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_community', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'member', + min_n_rels_two => 0, max_n_rels_two => null + ); - acs_rel_type.create_type ( - rel_type => 'dotlrn_admin_rel', - supertype => 'dotlrn_member_rel', - pretty_name => 'dotLRN Admin Community Membership', - pretty_plural => 'dotLRN Admin Community Memberships', - package_name => 'dotlrn_admin_rel', - table_name => 'dotlrn_admin_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_community', role_one => NULL, - min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, - min_n_rels_two => 0, max_n_rels_two => NULL - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_admin_rel', + supertype => 'dotlrn_member_rel', + pretty_name => 'dotLRN Admin Community Membership', + pretty_plural => 'dotLRN Admin Community Memberships', + package_name => 'dotlrn_admin_rel', + table_name => 'dotlrn_admin_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_community', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'admin', + min_n_rels_two => 0, max_n_rels_two => null + ); - acs_rel_type.create_type ( - rel_type => 'dotlrn_student_rel', - supertype => 'dotlrn_member_rel', - pretty_name => 'dotLRN Student Community Membership', - pretty_plural => 'dotLRN Student Community Memberships', - package_name => 'dotlrn_student_rel', - table_name => 'dotlrn_student_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => NULL, - min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, - min_n_rels_two => 0, max_n_rels_two => NULL - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_student_rel', + supertype => 'dotlrn_member_rel', + pretty_name => 'dotLRN Student Community Membership', + pretty_plural => 'dotLRN Student Community Memberships', + package_name => 'dotlrn_student_rel', + table_name => 'dotlrn_student_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'student', + min_n_rels_two => 0, max_n_rels_two => null + ); - acs_rel_type.create_type ( - rel_type => 'dotlrn_ta_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN TA Community Membership', - pretty_plural => 'dotLRN TA Community Memberships', - package_name => 'dotlrn_ta_rel', - table_name => 'dotlrn_ta_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => NULL, - min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, - min_n_rels_two => 0, max_n_rels_two => NULL - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_ta_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN TA Community Membership', + pretty_plural => 'dotLRN TA Community Memberships', + package_name => 'dotlrn_ta_rel', + table_name => 'dotlrn_ta_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'teaching_assistant', + min_n_rels_two => 0, max_n_rels_two => null + ); - acs_rel_type.create_type ( - rel_type => 'dotlrn_instructor_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN Instructor Community Membership', - pretty_plural => 'dotLRN Instructor Community Memberships', - package_name => 'dotlrn_instructor_rel', - table_name => 'dotlrn_instructor_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => NULL, - min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, - min_n_rels_two => 0, max_n_rels_two => NULL - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_instructor_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Instructor Community Membership', + pretty_plural => 'dotLRN Instructor Community Memberships', + package_name => 'dotlrn_instructor_rel', + table_name => 'dotlrn_instructor_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'instructor', + min_n_rels_two => 0, max_n_rels_two => null + ); - -- - -- and now for the attributes - -- - foo:= acs_attribute.create_attribute ( - object_type => 'dotlrn_member_rel', - attribute_name => 'portal_id', - datatype => 'integer', - pretty_name => 'Page ID', - pretty_plural => 'Page IDs' - ); - + -- + -- and now for the attributes + -- + foo:= acs_attribute.create_attribute ( + object_type => 'dotlrn_member_rel', + attribute_name => 'portal_id', + datatype => 'integer', + pretty_name => 'Page ID', + pretty_plural => 'Page IDs' + ); end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 11 Dec 2001 00:27:59 -0000 1.7 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 10 Jan 2002 19:30:17 -0000 1.8 @@ -18,116 +18,140 @@ -- not an object, there's really no use for it -- this is just so other, non-university systems can set up their own user types create table dotlrn_user_types ( - type_id integer not null - constraint dlrn_user_type_pk primary key, - type varchar(200) not null - constraint dlrn_user_type_un unique + type_id integer not null + constraint dlrn_user_type_pk primary key, + type varchar2(200) not null + constraint dlrn_user_type_un unique ); create table dotlrn_user_rels ( - rel_id integer not null - constraint dlrn_user_rel_fk references membership_rels(rel_id) - constraint dlrn_user_rel_pk primary key, - type_id integer not null - constraint dlrn_user_rel_type_fk references dotlrn_user_types(type_id) + rel_id integer not null + constraint dlrn_user_rel_fk references membership_rels(rel_id) + constraint dlrn_user_rel_pk primary key, + type_id integer not null + constraint dlrn_user_rel_type_fk references dotlrn_user_types(type_id) ); create table dotlrn_full_user_rels ( - rel_id integer not null - constraint dlrn_full_user_rel_fk references dotlrn_user_rels(rel_id) - constraint dlrn_full_user_rel_pk primary key, - theme_id integer - constraint dlrn_full_user_theme_fk references portal_element_themes(theme_id), - portal_id integer not null - constraint dlrn_full_user_portal_fk references portals(portal_id) + rel_id integer not null + constraint dlrn_full_user_rel_fk references dotlrn_user_rels(rel_id) + constraint dlrn_full_user_rel_pk primary key, + theme_id integer + constraint dlrn_full_user_theme_fk references portal_element_themes(theme_id), + portal_id integer not null + constraint dlrn_full_user_portal_fk references portals(portal_id) ); -- the user group declare - foo integer; + foo integer; begin - foo:= acs_group.new ( - group_id => NULL, - object_type => 'group', - creation_date => sysdate, - group_name => 'dotLRN Users' - ); + foo:= acs_group.new ( + group_id => null, + object_type => 'group', + creation_date => sysdate, + group_name => 'dotLRN Users' + ); end; / show errors - create or replace function dotlrn_get_group_id return integer is - p_group_id integer; + p_group_id integer; begin - select max(group_id) into p_group_id from groups where group_name= 'dotLRN Users'; + select max(group_id) into p_group_id + from groups + where group_name = 'dotLRN Users'; - return p_group_id; + return p_group_id; end; / show errors -create view dotlrn_users as select acs_rels.rel_id, registered_users.user_id, first_names, last_name, email, dotlrn_user_types.type_id, type -from dotlrn_user_rels, acs_rels, registered_users, dotlrn_user_types where -acs_rels.object_id_two = registered_users.user_id and -acs_rels.object_id_one = dotlrn_get_group_id() and -acs_rels.rel_id = dotlrn_user_rels.rel_id and -dotlrn_user_rels.type_id= dotlrn_user_types.type_id; +create view dotlrn_users +as + select acs_rels.rel_id, + registered_users.user_id, + first_names, + last_name, + email, + dotlrn_user_types.type_id, + type + from dotlrn_user_rels, + acs_rels, + registered_users, + dotlrn_user_types + where acs_rels.object_id_two = registered_users.user_id + and acs_rels.object_id_one = dotlrn_get_group_id() + and acs_rels.rel_id = dotlrn_user_rels.rel_id + and dotlrn_user_rels.type_id = dotlrn_user_types.type_id; -create view dotlrn_full_users as select acs_rels.rel_id, registered_users.user_id, first_names, last_name, email, dotlrn_user_types.type_id, type, portal_id, theme_id -from dotlrn_user_rels, dotlrn_full_user_rels, acs_rels, registered_users, dotlrn_user_types where -acs_rels.object_id_two = registered_users.user_id and -acs_rels.object_id_one = dotlrn_get_group_id() and -acs_rels.rel_id = dotlrn_user_rels.rel_id and -dotlrn_user_rels.rel_id = dotlrn_full_user_rels.rel_id and -dotlrn_user_types.type_id = dotlrn_user_rels.type_id; +create view dotlrn_full_users +as + select acs_rels.rel_id, + registered_users.user_id, + first_names, + last_name, + email, + dotlrn_user_types.type_id, + type, + portal_id, + theme_id + from dotlrn_user_rels, + dotlrn_full_user_rels, + acs_rels, + registered_users, + dotlrn_user_types + where acs_rels.object_id_two = registered_users.user_id + and acs_rels.object_id_one = dotlrn_get_group_id() + and acs_rels.rel_id = dotlrn_user_rels.rel_id + and dotlrn_user_rels.rel_id = dotlrn_full_user_rels.rel_id + and dotlrn_user_types.type_id = dotlrn_user_rels.type_id; -- The packages declare - v_group_id integer; - foo integer; + v_group_id integer; + foo integer; begin - acs_rel_type.create_type ( - rel_type => 'dotlrn_user_rel', - supertype => 'membership_rel', - pretty_name => 'dotLRN User Membership', - pretty_plural => 'dotLRN User Memberships', - package_name => 'dotlrn_user_rel', - table_name => 'dotlrn_user_rels', - id_column => 'rel_id', - object_type_one => 'group', role_one => NULL, min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, min_n_rels_two => 0, max_n_rels_two => 1 - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_user_rel', + supertype => 'membership_rel', + pretty_name => 'dotLRN User Membership', + pretty_plural => 'dotLRN User Memberships', + package_name => 'dotlrn_user_rel', + table_name => 'dotlrn_user_rels', + id_column => 'rel_id', + object_type_one => 'group', role_one => null, min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => null, min_n_rels_two => 0, max_n_rels_two => 1 + ); - acs_rel_type.create_type ( - rel_type => 'dotlrn_full_user_rel', - supertype => 'dotlrn_user_rel', - pretty_name => 'dotLRN Full User Membership', - pretty_plural => 'dotLRN Full User Memberships', - package_name => 'dotlrn_full_user_rel', - table_name => 'dotlrn_full_user_rels', - id_column => 'rel_id', - object_type_one => 'group', role_one => NULL, min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'user', role_two => NULL, min_n_rels_two => 0, max_n_rels_two => 1 - ); + acs_rel_type.create_type ( + rel_type => 'dotlrn_full_user_rel', + supertype => 'dotlrn_user_rel', + pretty_name => 'dotLRN Full User Membership', + pretty_plural => 'dotLRN Full User Memberships', + package_name => 'dotlrn_full_user_rel', + table_name => 'dotlrn_full_user_rels', + id_column => 'rel_id', + object_type_one => 'group', role_one => null, min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => null, min_n_rels_two => 0, max_n_rels_two => 1 + ); - v_group_id:= dotlrn_get_group_id(); + v_group_id:= dotlrn_get_group_id(); - -- Now we create the rel segments! - foo:= rel_segment.new ( - segment_name => 'dotLRN Users', - group_id => v_group_id, - rel_type => 'dotlrn_user_rel' - ); + -- Now we create the rel segments! + foo:= rel_segment.new ( + segment_name => 'dotLRN Users', + group_id => v_group_id, + rel_type => 'dotlrn_user_rel' + ); - foo:= rel_segment.new ( - segment_name => 'dotLRN Full Access Users', - group_id => v_group_id, - rel_type => 'dotlrn_full_user_rel' - ); - + foo:= rel_segment.new ( + segment_name => 'dotLRN Full Access Users', + group_id => v_group_id, + rel_type => 'dotlrn_full_user_rel' + ); end; / show errors - Index: openacs-4/packages/dotlrn/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/class-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn/tcl/class-procs.tcl 17 Dec 2001 23:02:55 -0000 1.19 +++ openacs-4/packages/dotlrn/tcl/class-procs.tcl 10 Jan 2002 19:30:17 -0000 1.20 @@ -89,9 +89,10 @@ } ad_proc -public new_instance { - {-description ""} {-class_type:required} {-term_id:required} + {-pretty_name ""} + {-description ""} {-join_policy "needs approval"} } { Creates a new instance of a class for a particular term and year, @@ -107,7 +108,9 @@ ns_set put $extra_vars class_key $class_type ns_set put $extra_vars join_policy $join_policy - set pretty_name "[dotlrn_community::get_community_type_name $class_type]; $term $year" + if {[empty_string_p $pretty_name]} { + set pretty_name "[dotlrn_community::get_community_type_name $class_type]; $term $year" + } db_transaction { # Create the community Index: openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 17 Dec 2001 23:02:56 -0000 1.6 +++ openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 10 Jan 2002 19:30:17 -0000 1.7 @@ -82,4 +82,14 @@ connect by object_type = prior supertype + + + + select object_type + from acs_object_types + where supertype = 'dotlrn_community' + start with object_type = :community_type + connect by object_type = prior supertype + + 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.43 -r1.44 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 10 Jan 2002 00:11:38 -0000 1.43 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 10 Jan 2002 19:30:17 -0000 1.44 @@ -258,27 +258,19 @@ } ad_proc -public get_allowed_rel_types { - { -community_type "" } - { -community_id "" } + {-community_type ""} + {-community_id ""} } { if {[empty_string_p $community_type]} { set community_type [get_toplevel_community_type_from_community_id $community_id] } if {$community_type == "dotlrn_class_instance"} { - return { - {dotlrn_student_rel Student} - {dotlrn_ta_rel TA} - {dotlrn_instructor_rel Instructor} - {dotlrn_admin_rel Admin} - } + return {dotlrn_student_rel dotlrn_ta_rel dotlrn_instructor_rel dotlrn_admin_rel} } if {$community_type == "dotlrn_club"} { - return { - {dotlrn_member_rel Member} - {dotlrn_admin_rel Admin} - } + return {dotlrn_member_rel dotlrn_admin_rel} } return {} @@ -293,6 +285,22 @@ return $pretty_name } + ad_proc -public get_role_pretty_name { + {-role:required} + } { + Returns teh pretty version of the role + } { + return [db_string select_role_pretty_name {} -default ""] + } + + ad_proc -public get_role_pretty_name_from_rel_type { + {-rel_type:required} + } { + Returns teh pretty version of the role + } { + return [db_string select_role_pretty_name {} -default ""] + } + ad_proc -public get_rel_segment_id { {-community_id:required} {-rel_type:required} @@ -500,6 +508,15 @@ return [db_list_of_lists select_all_communities {}] } + ad_proc -public get_toplevel_community_type { + {-community_type:required} + } { + returns the toplevel community_type which is the ancestor of this + community_type + } { + return [db_string select_community_type {}] + } + ad_proc -public get_toplevel_community_type_from_community_id { community_id } { 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.19 -r1.20 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 10 Jan 2002 00:11:38 -0000 1.19 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 10 Jan 2002 19:30:17 -0000 1.20 @@ -35,17 +35,45 @@ + + + select pretty_name + from acs_rel_roles + where role = :role + + + + + + select pretty_name + from acs_rel_roles + where role = (select role_two + from acs_rel_types + where rel_type = :rel_type) + + + select segment_id from rel_segments where group_id= :community_id and rel_type= :rel_type - - -select rel_id, rel_type, 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 order by rel_type - - + + + select rel_id, + rel_type, + 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 + order by rel_type + + Index: openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 10 Jan 2002 00:11:38 -0000 1.13 +++ openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 10 Jan 2002 19:30:17 -0000 1.14 @@ -7,12 +7,12 @@ # ad_library { - + Procs for initializing basic dotLRN - + @author ben@openforce.net @creation-date 2001-08-18 - + } # We check to see if dotLRN has been installed, and if so, if permissions 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.10 -r1.11 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 11 Dec 2001 00:45:15 -0000 1.10 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 10 Jan 2002 19:30:17 -0000 1.11 @@ -76,7 +76,9 @@ } if {[dotlrn::user_can_browse_p $user_id]} { - append return_html "

  • Subscribe to a new class" + append return_html "

    \n" + append return_html "
  • Subscribe to a new class
  • \n" + append return_html "
  • Subscribe to a new club
  • \n" } append return_html "" Index: openacs-4/packages/dotlrn/www/communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/communities.adp 11 Dec 2001 00:45:15 -0000 1.2 +++ openacs-4/packages/dotlrn/www/communities.adp 10 Jan 2002 19:30:18 -0000 1.3 @@ -1,15 +1,15 @@ -

    Communities

    +

    Communities@title@

    @communities.pretty_name@ - (register) + () - (deregister) + () Index: openacs-4/packages/dotlrn/www/communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/communities.tcl 11 Dec 2001 00:45:15 -0000 1.2 +++ openacs-4/packages/dotlrn/www/communities.tcl 10 Jan 2002 19:30:18 -0000 1.3 @@ -5,6 +5,7 @@ @creation-date Dec 07, 2001 @version $Id$ } -query { + {referer "./"} } -properties { communities:multirow } Index: openacs-4/packages/dotlrn/www/community-applet-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applet-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-applet-add.tcl 10 Jan 2002 00:11:38 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-applet-add.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,23 +1,24 @@ - ad_page_contract { Add an applet to a community @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-08 -} { + @version $Id$ +} -query { applet_key + {referer "one-community-admin"} } set community_id [dotlrn_community::get_community_id] # Check access if {![dotlrn_community::admin_access_p $community_id]} { - ns_returnredirect / - return + ad_returnredirect / + ad_script_abort } # Add the applet dotlrn_community::add_applet_to_community $community_id $applet_key -# Get back to where you once belonged -ns_returnredirect community-applets?community_id=$community_id +ad_returnredirect $referer Index: openacs-4/packages/dotlrn/www/community-applets.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applets.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/community-applets.adp 28 Nov 2001 00:11:48 -0000 1.2 +++ openacs-4/packages/dotlrn/www/community-applets.adp 10 Jan 2002 19:30:18 -0000 1.3 @@ -1,22 +1,25 @@ - -@context_bar@ -dotLRN Community Admin: @pretty_name@ - -Here you can do all sorts of administrative stuff. - -

    - +

    Active Applets

      - -
    • @active_applets.applet_pretty_name@ - (cannot be removed yet) + +
    • @active_applets.applet_pretty_name@ - (cannot be removed)
    + -

    + +

    +

    Applets to Add

      - -
    • @all_applets.applet_pretty_name@ - [add] + +
    • + @all_applets.applet_pretty_name@ - [ + + add + + ] +
    + Index: openacs-4/packages/dotlrn/www/community-applets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-applets.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/community-applets.tcl 10 Jan 2002 00:11:38 -0000 1.4 +++ openacs-4/packages/dotlrn/www/community-applets.tcl 10 Jan 2002 19:30:18 -0000 1.5 @@ -1,20 +1,18 @@ - - ad_page_contract { Community Applets @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-05 -} { + @version $Id$ +} -query { +} -properties { } set community_id [dotlrn_community::get_community_id] set user_id [ad_conn user_id] -# Load some community type info -db_1row select_community_info {} - # Get active applets set list_of_active_applets [dotlrn_community::list_applets -community_id $community_id] @@ -24,7 +22,6 @@ template::multirow append active_applets $applet_key [dotlrn_community::applet_call $applet_key GetPrettyName] } - # List all applets set list_of_applets [dotlrn_community::list_applets] @@ -36,6 +33,4 @@ } } -set context_bar {{one-community-admin Admin} Applets} - ad_return_template Index: openacs-4/packages/dotlrn/www/community-deregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-deregister.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/community-deregister.tcl 9 Oct 2001 15:02:49 -0000 1.1 +++ openacs-4/packages/dotlrn/www/community-deregister.tcl 10 Jan 2002 19:30:18 -0000 1.2 @@ -1,17 +1,23 @@ - ad_page_contract { deregister @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-06 -} { + @version $Id$ +} -query { + {referer "./"} + {community_id ""} } ad_maybe_redirect_for_registration set user_id [ad_conn user_id] -set community_id [dotlrn_community::get_community_id] +if {[empty_string_p $community_id]} { + set community_id [dotlrn_community::get_community_id] +} + dotlrn_community::remove_user $community_id $user_id -ns_returnredirect ./ +ns_returnredirect $referer Index: openacs-4/packages/dotlrn/www/community-register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-register.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-register.tcl 8 Dec 2001 01:22:40 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-register.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -2,15 +2,22 @@ register @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-06 -} { + @version $Id$ +} -query { + {referer "./"} + {community_id ""} } ad_maybe_redirect_for_registration set user_id [ad_conn user_id] -set community_id [dotlrn_community::get_community_id] +if {[empty_string_p $community_id]} { + set community_id [dotlrn_community::get_community_id] +} + dotlrn_community::add_user $community_id $user_id -ad_returnredirect ./ +ad_returnredirect $referer Index: openacs-4/packages/dotlrn/www/community-types.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-types.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/community-types.adp 11 Dec 2001 00:45:15 -0000 1.2 +++ openacs-4/packages/dotlrn/www/community-types.adp 10 Jan 2002 19:30:18 -0000 1.3 @@ -1,5 +1,5 @@ -

    Community Types

    +

    Community Types@title@

    Index: openacs-4/packages/dotlrn/www/community-user-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add-2.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-user-add-2.adp 28 Nov 2001 00:11:48 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-user-add-2.adp 10 Jan 2002 19:30:18 -0000 1.4 @@ -3,14 +3,13 @@ You're adding @first_names@ @last_name@ (@email@):

    -
    - -Role: - + Role: + - - - + + + Index: openacs-4/packages/dotlrn/www/community-user-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/community-user-add-2.tcl 11 Dec 2001 00:27:59 -0000 1.4 +++ openacs-4/packages/dotlrn/www/community-user-add-2.tcl 10 Jan 2002 19:30:18 -0000 1.5 @@ -1,11 +1,14 @@ - ad_page_contract { Search for a new user for dotLRN @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-11-04 -} { + @version $Id$ +} -query { user_id +} -properties { + roles:multirow } set community_id [dotlrn_community::get_community_id] @@ -19,7 +22,8 @@ template::multirow create roles rel_type pretty_name foreach rel_type $rel_types { - template::multirow append roles [lindex $rel_type 0] [lindex $rel_type 1] + ns_log notice "XXX: $rel_type [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type $rel_type]" + template::multirow append roles $rel_type [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type $rel_type] } ad_return_template Index: openacs-4/packages/dotlrn/www/community-user-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/community-user-add.adp 29 Nov 2001 06:05:37 -0000 1.4 +++ openacs-4/packages/dotlrn/www/community-user-add.adp 10 Jan 2002 19:30:18 -0000 1.5 @@ -5,9 +5,6 @@ The results of your search are:

    - - - Index: openacs-4/packages/dotlrn/www/community-user-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-user-add.tcl 29 Nov 2001 06:05:37 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-user-add.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,10 +1,11 @@ - ad_page_contract { Search for a new user for dotLRN @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-11-04 -} { + @version $Id$ +} -query { search_text } @@ -14,4 +15,5 @@ db_multirow users select_users {} set context_bar {{one-community-admin Admin} "New User"} + ad_return_template Index: openacs-4/packages/dotlrn/www/community-user-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-user-add.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/community-user-add.xql 11 Dec 2001 00:27:59 -0000 1.3 +++ openacs-4/packages/dotlrn/www/community-user-add.xql 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,11 +1,18 @@ - - - -select user_id, first_names, last_name, email from dotlrn_users where lower(last_name) like lower('%' || :search_text || '%') or lower(email) like lower('%' || :search_text || '%') and user_id not in (select user_id from dotlrn_member_rels_full where community_id= :community_id) - - - + + + select user_id, + first_names, + last_name, + email + from dotlrn_users + where lower(last_name) like lower('%' || :search_text || '%') + or lower(email) like lower('%' || :search_text || '%') + and user_id not in (select user_id + from dotlrn_member_rels_full + where community_id = :community_id) + + Index: openacs-4/packages/dotlrn/www/community-users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-users.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-users.adp 10 Jan 2002 19:30:18 -0000 1.1 @@ -0,0 +1,17 @@ +

    Users

    +
    Index: openacs-4/packages/dotlrn/www/community-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-users.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-users.tcl 10 Jan 2002 19:30:18 -0000 1.1 @@ -0,0 +1,25 @@ +# dotlrn/www/community-users.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Jan 08, 2002 + @version $Id: community-users.tcl,v 1.1 2002/01/10 19:30:18 yon Exp $ +} -query { +} -properties { +} + +set community_id [dotlrn_community::get_community_id] + +# Permissions +dotlrn::require_user_admin_community $community_id + +# Get all users for this community, including role +set list_of_users [dotlrn_community::list_users $community_id] + +template::multirow create users rel_id rel_type user_id first_names last_name email + +foreach user $list_of_users { + template::multirow append users [lindex $user 0] [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type [lindex $user 1]] [lindex $user 2] [lindex $user 3] [lindex $user 4] [lindex $user 5] +} + +ad_return_template Index: openacs-4/packages/dotlrn/www/community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/community.adp 11 Dec 2001 00:45:15 -0000 1.1 +++ openacs-4/packages/dotlrn/www/community.adp 10 Jan 2002 19:30:18 -0000 1.2 @@ -2,7 +2,7 @@ @context_bar@dotLRN Community: @pretty_name@ -You are registered! You may deregister if you'd like. +You are registered! You may drop membership if you'd like.

    Configure this page. Admin this community. Index: openacs-4/packages/dotlrn/www/deregister.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/deregister.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/deregister.adp 10 Jan 2002 19:30:18 -0000 1.1 @@ -0,0 +1 @@ + leave@label@ Index: openacs-4/packages/dotlrn/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/index.adp 17 Dec 2001 23:02:56 -0000 1.11 +++ openacs-4/packages/dotlrn/www/index.adp 10 Jan 2002 19:30:18 -0000 1.12 @@ -1,12 +1,16 @@ dotLRN +[ + + customize - Visit dotLRN Administration.
    + | + dotLRN Admin
    +
    +] -Configure this page. +

    -

    - @rendered_page@ Index: openacs-4/packages/dotlrn/www/one-community-admin-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin-users.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-admin-users.tcl 7 Nov 2001 22:22:56 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-admin-users.tcl 10 Jan 2002 19:30:18 -0000 1.2 @@ -1,5 +1,3 @@ - - ad_page_contract { Admin the admin users of a community Index: openacs-4/packages/dotlrn/www/one-community-admin.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/one-community-admin.adp 6 Dec 2001 21:12:23 -0000 1.6 +++ openacs-4/packages/dotlrn/www/one-community-admin.adp 10 Jan 2002 19:30:18 -0000 1.7 @@ -1,22 +1,18 @@ -dotLRN Community Admin +Admin @context_bar@ -

    Applets

    -manage applets -

    + +

    -

    Users

    -
      - -
    • @users.last_name@, @users.first_names@ (@users.email@), @users.rel_type@ - -

      + +

      -
    • Add a user: -
    - -

    Portal Template

    -manage the portal template +

    +

    Portal Template

    + + manage the portal template + +

    Index: openacs-4/packages/dotlrn/www/one-community-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 28 Nov 2001 00:11:48 -0000 1.6 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 10 Jan 2002 19:30:18 -0000 1.7 @@ -1,18 +1,19 @@ - ad_page_contract { Displays single dotLRN community page for admin @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-11-27 -} { + @version $Id$ +} -query { +} -properties { } set community_id [dotlrn_community::get_community_id] # Permissions dotlrn::require_user_admin_community $community_id -# Get information about that class db_1row select_community_info {} # Get all users for this community, including role Index: openacs-4/packages/dotlrn/www/one-community-admin.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/one-community-admin.xql 27 Nov 2001 23:32:03 -0000 1.3 +++ openacs-4/packages/dotlrn/www/one-community-admin.xql 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,11 +1,14 @@ - - - -select community_type, pretty_name, description, portal_template_id from dotlrn_communities where community_id= :community_id - - - + + + select community_type, + pretty_name, + description, + portal_template_id + from dotlrn_communities + where community_id = :community_id + + Index: openacs-4/packages/dotlrn/www/one-community-not-member.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-not-member.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/one-community-not-member.adp 9 Nov 2001 15:24:57 -0000 1.3 +++ openacs-4/packages/dotlrn/www/one-community-not-member.adp 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,9 +1,13 @@ @context_bar@ -dotLRN Community: @pretty_name@ +@pretty_name@ -You are not a member of this community. Would you like to register? +[ + + + +] -

    +

    @rendered_page@ Index: openacs-4/packages/dotlrn/www/one-community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/one-community-type.adp 8 Dec 2001 01:22:40 -0000 1.12 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 10 Jan 2002 19:30:18 -0000 1.13 @@ -1,6 +1,6 @@ @context_bar@ -dotLRN: @pretty_name@ +@title@

    @@ -11,13 +11,11 @@

    - +

    - +
    - -

    Index: openacs-4/packages/dotlrn/www/one-community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 8 Dec 2001 01:22:40 -0000 1.8 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 10 Jan 2002 19:30:18 -0000 1.9 @@ -4,8 +4,18 @@ @author Ben Adida (ben@openforce.net) @author yon (yon@openforce.net) @creation-date 2001-10-04 + @version $Id$ } -query { } -properties { + context_bar:onevalue + pretty_name:onevalue + description:onevalue + supertype:onevalue + community_type:onevalue + ancestor_type:onevalue + community_type_title:onevalue + communities_title:onevalue + title:onevalue } # Check that this is a community type @@ -16,12 +26,31 @@ set user_id [ad_conn user_id] +set context_bar {View} + # What community type are we at? set community_type [dotlrn_community::get_community_type] +set ancestor_type [dotlrn_community::get_toplevel_community_type -community_type $community_type] # Load some community type info db_1row select_community_type_info {} -set context_bar {View} +if {[string equal ${community_type} "dotlrn_class_instance"] != 0} { + set community_type_title "Classes" + set communities_title "Class Instances" + set title "Classes" +} elseif {[string equal ${community_type} "dotlrn_club"] != 0} { + set community_type_title "Clubs" + set communities_title "Clubs" + set title "Clubs" +} elseif {[string equal ${ancestor_type} "dotlrn_class_instance"] != 0} { + set community_type_title "Classes" + set communities_title "Class Instances" + set title $pretty_name +} else { + set community_type_title "Community Types" + set communities_title "Communities" + set title "Community Type" +} ad_return_template Index: openacs-4/packages/dotlrn/www/one-community-type.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-type.xql 6 Oct 2001 18:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-type.xql 10 Jan 2002 19:30:18 -0000 1.2 @@ -1,11 +1,13 @@ - - - -select pretty_name, description, supertype from dotlrn_community_types where community_type= :community_type - - - + + + select pretty_name, + description, + supertype + from dotlrn_community_types + where community_type = :community_type + + Index: openacs-4/packages/dotlrn/www/one-community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/one-community.adp 28 Nov 2001 00:11:48 -0000 1.6 +++ openacs-4/packages/dotlrn/www/one-community.adp 10 Jan 2002 19:30:18 -0000 1.7 @@ -1,11 +1,19 @@ @context_bar@ -dotLRN Community: @pretty_name@ +@pretty_name@ -You are registered! You may deregister if you'd like. -

    -Configure this page. -Admin this community. -

    +[ + + + | + customize + + | + admin + + +] +

    + @rendered_page@ Index: openacs-4/packages/dotlrn/www/one-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/one-community.tcl 17 Dec 2001 23:02:56 -0000 1.11 +++ openacs-4/packages/dotlrn/www/one-community.tcl 10 Jan 2002 19:30:18 -0000 1.12 @@ -2,14 +2,17 @@ Displays a community @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-04 -} { + @version $Id$ +} -query { +} -properties { } # Check that this is a community type if {[ad_parameter community_level_p] != 1} { ns_returnredirect "./" - return + ad_script_abort } set user_id [ad_conn user_id] Index: openacs-4/packages/dotlrn/www/one-community.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community.xql 7 Oct 2001 19:21:08 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community.xql 10 Jan 2002 19:30:18 -0000 1.2 @@ -1,11 +1,11 @@ - - - -select pretty_name from dotlrn_communities where community_id = :community_id - - - + + + select pretty_name + from dotlrn_communities + where community_id = :community_id + + Index: openacs-4/packages/dotlrn/www/register.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/register.adp 10 Jan 2002 19:30:18 -0000 1.1 @@ -0,0 +1 @@ + join@label@ Index: openacs-4/packages/dotlrn/www/student-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/student-list.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/student-list.adp 9 Nov 2001 03:56:43 -0000 1.2 +++ openacs-4/packages/dotlrn/www/student-list.adp 10 Jan 2002 19:30:18 -0000 1.3 @@ -2,7 +2,7 @@ @pretty_name@ - Student List
      - -
    • @students.last_name@, @students.first_names@ (@students.email@), @students.role@ + +
    • @students.last_name@, @students.first_names@ (@students.email@), @students.role@
    Index: openacs-4/packages/dotlrn/www/student-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/student-list.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/student-list.tcl 9 Nov 2001 03:56:43 -0000 1.3 +++ openacs-4/packages/dotlrn/www/student-list.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -1,4 +1,3 @@ - ad_page_contract { Displays a community student list @@ -26,7 +25,7 @@ template::multirow create students user_id first_names last_name email role foreach student $list_of_students { - template::multirow append students [lindex $student 2] [lindex $student 3] [lindex $student 4] [lindex $student 5] [dotlrn_community::get_pretty_rel_type [lindex $student 1]] + template::multirow append students [lindex $student 2] [lindex $student 3] [lindex $student 4] [lindex $student 5] [dotlrn_community::get_role_pretty_name_from_rel_type -rel_type [lindex $student 1]] } ad_return_template 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 -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 17 Dec 2001 23:02:56 -0000 1.7 +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 10 Jan 2002 19:30:18 -0000 1.8 @@ -14,6 +14,9 @@ element create add_class_instance term \ -label "Term" -datatype integer -widget select -options [db_list_of_lists select_terms_for_select_widget {}] +element create add_class_instance name \ + -label "Name" -datatype text -widget text -html {size 50} -optional + element create add_class_instance description \ -label "Description" -datatype text -widget textarea -html {rows 5 cols 60 wrap soft} -optional @@ -27,9 +30,15 @@ -label "Referer" -value $referer -datatype text -widget hidden if {[form is_valid add_class_instance]} { - template::form get_values add_class_instance term description join_policy class_key referer + template::form get_values add_class_instance class_key term name description join_policy referer - set class_instance_id [dotlrn_class::new_instance -description $description -class_type $class_key -term_id $term -join_policy $join_policy] + set class_instance_id [dotlrn_class::new_instance \ + -class_type $class_key \ + -term_id $term \ + -pretty_name $name \ + -description $description \ + -join_policy $join_policy \ + ] if {[empty_string_p $referer]} { set referer "one-class?class_key=$class_key" Index: openacs-4/packages/dotlrn/www/admin/class-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-new.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/admin/class-new.tcl 10 Dec 2001 22:48:57 -0000 1.3 +++ openacs-4/packages/dotlrn/www/admin/class-new.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -6,7 +6,7 @@ @creation-date 2001-08-20 @version $Id$ } -query { - {referer ""} + {referer "classes"} } form create add_class @@ -28,10 +28,6 @@ set class_key [dotlrn_class::new -class_key $class_key -pretty_name $name -description $description] - if {[empty_string_p $referer]} { - set referer "classes" - } - ad_returnredirect $referer ad_script_abort } Index: openacs-4/packages/dotlrn/www/admin/club-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/club-new.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/admin/club-new.tcl 11 Dec 2001 00:45:16 -0000 1.3 +++ openacs-4/packages/dotlrn/www/admin/club-new.tcl 10 Jan 2002 19:30:18 -0000 1.4 @@ -5,7 +5,7 @@ @creation-date 2001-12-03 @version $Id$ } -query { - {referer ""} + {referer "clubs"} } -properties { context_bar:onevalue } @@ -32,10 +32,6 @@ set key [dotlrn_club::new -description $description -key $club_key -pretty_name $name -join_policy $join_policy] - if {[empty_string_p $referer]} { - set referer "clubs" - } - ad_returnredirect $referer ad_script_abort } 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 -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/admin/one-class.adp 17 Dec 2001 23:02:56 -0000 1.6 +++ openacs-4/packages/dotlrn/www/admin/one-class.adp 10 Jan 2002 19:30:18 -0000 1.7 @@ -1,5 +1,5 @@ -@pretty_name@ (@class_key@) +@pretty_name@ @context_bar@

    Index: openacs-4/packages/dotlrn/www/admin/term-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term-new.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/term-new.tcl 17 Dec 2001 23:02:56 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/term-new.tcl 10 Jan 2002 19:30:18 -0000 1.2 @@ -5,7 +5,7 @@ @creation-date 2001-12-13 @version $Id$ } -query { - {referer ""} + {referer "terms"} } -properties { context_bar:onevalue } @@ -32,10 +32,6 @@ dotlrn_term::new -term_name $term_name -term_year $term_year -start_date $start_date -end_date $end_date - if {[empty_string_p $referer]} { - set referer "terms" - } - ad_returnredirect $referer ad_script_abort } Index: openacs-4/packages/dotlrn/www/admin/user-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-edit.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/user-edit.adp 11 Dec 2001 16:14:13 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/user-edit.adp 10 Jan 2002 19:30:18 -0000 1.3 @@ -6,6 +6,3 @@

    - - - Index: openacs-4/packages/dotlrn/www/admin/user-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/user-edit.tcl 17 Dec 2001 23:02:56 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/user-edit.tcl 10 Jan 2002 19:30:18 -0000 1.3 @@ -3,7 +3,9 @@ Edit a User @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-12-10 + @version $Id$ } { user_id } @@ -38,7 +40,11 @@ if {[form is_valid verif_edit_user]} { template::form get_values verif_edit_user user_id type_id rel_type read_private_data_p - set rel_id [db_string select_rel_id "select rel_id from dotlrn_users where user_id=:user_id"] + set rel_id [db_string select_rel_id { + select rel_id + from dotlrn_users + where user_id = :user_id + }] db_transaction { # remove the user @@ -61,10 +67,25 @@ # Do something set new_rel_type $rel_type - db_1row select_limited_user_info "select first_names,last_name,object_type as old_rel_type from dotlrn_users, acs_objects where dotlrn_users.user_id= :user_id and dotlrn_users.rel_id= acs_objects.object_id" - set old_rel_type [db_string select_rel_type "select 'dotlrn_full_user_rel' from dual where exists (select 1 from dotlrn_full_users where user_id=:user_id)" -default "dotlrn_user_rel"] + db_1row select_limited_user_info { + select first_names, + last_name, + object_type as old_rel_type + from dotlrn_users, + acs_objects + where dotlrn_users.user_id = :user_id + and dotlrn_users.rel_id = acs_objects.object_id + } + set old_rel_type [db_string select_rel_type { + select 'dotlrn_full_user_rel' + from dual + where exists (select 1 + from dotlrn_full_users + where user_id = :user_id) + } -default "dotlrn_user_rel"] + if {$new_rel_type == $old_rel_type} { # Simply update things db_transaction { 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 -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/admin/users.xql 10 Dec 2001 23:58:31 -0000 1.4 +++ openacs-4/packages/dotlrn/www/admin/users.xql 10 Jan 2002 19:30:18 -0000 1.5 @@ -1,11 +1,17 @@ - - - -select first_names, last_name, email, type, case when theme_id is NULL then 1 else 0 end as limited_access_p, acs_permission__permission_p(:dotlrn_package_id, user_id, 'read_private_data') as read_private_data_p from dotlrn_users left join dotlrn_full_user_rels on dotlrn_users.rel_id= dotlrn_full_user_rels.rel_id order by last_name - - - + + + select first_names, + last_name, + email, + type, + case when theme_id is null then 1 else 0 end as limited_access_p, + acs_permission__permission_p(:dotlrn_package_id, user_id, 'read_private_data') as read_private_data_p + from dotlrn_users + left join dotlrn_full_user_rels on dotlrn_users.rel_id = dotlrn_full_user_rels.rel_id + order by last_name + +