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.21 -r1.22 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 19 Jan 2002 18:32:00 -0000 1.21 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 19 Jan 2002 22:54:20 -0000 1.22 @@ -259,6 +259,11 @@ party_id in parties.party_id%TYPE ) return char; + function admin_p ( + community_id in dotlrn_communities.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char; + function url ( community_id in dotlrn_communities.community_id%TYPE ) return varchar2; @@ -349,6 +354,24 @@ return 't'; end; + function admin_p ( + community_id in dotlrn_communities.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char + is + v_rv char(1); + begin + select decode( + acs_permission.permission_p(community_id, party_id, 'dotlrn_admin_community'), + 'f', + acs_permission.permission_p(community_id, party_id, 'admin'), + 't' + ) into v_rv + from dual; + + return v_rv; + end; + function url ( community_id in dotlrn_communities.community_id%TYPE ) return varchar2 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.45 -r1.46 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 19 Jan 2002 18:32:00 -0000 1.45 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 19 Jan 2002 22:54:20 -0000 1.46 @@ -288,26 +288,34 @@ } { Returns a pretty version of the rel_type } { - set pretty_name [db_string select_pretty_name "select pretty_name from acs_object_types where object_type=:rel_type"] + set pretty_name [db_string select_pretty_name "select pretty_name from acs_object_types where object_type = :rel_type"] return $pretty_name } ad_proc -public get_role_pretty_name { {-role:required} } { - Returns teh pretty version of the role + Returns the 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 + Returns the pretty version of the role } { return [db_string select_role_pretty_name {} -default ""] } + ad_proc -public get_role_pretty_name_from_rel_id { + {-rel_id:required} + } { + Returns the 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} @@ -624,10 +632,14 @@ } ad_proc -public get_portal_template_id { - community_id + {community_id ""} } { get the id of the portal template for a community } { + if {[empty_string_p $community_id]} { + set community_id [get_community_id] + } + return [db_string select_portal_template_id {} -default ""] } 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.21 -r1.22 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 19 Jan 2002 18:32:00 -0000 1.21 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 19 Jan 2002 22:54:20 -0000 1.22 @@ -53,6 +53,18 @@ + + + select pretty_name + from acs_rel_roles + where role = (select acs_rel_types.role_two + from acs_rel_types, + acs_rels + where acs_rel_types.rel_type = acs_rels.rel_type + and acs_rels.rel_id = :rel_id) + + + select segment_id from rel_segments where group_id= :community_id and rel_type= :rel_type Index: openacs-4/packages/dotlrn/www/all-communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/all-communities.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/all-communities.adp 15 Jan 2002 22:23:41 -0000 1.1 +++ openacs-4/packages/dotlrn/www/all-communities.adp 19 Jan 2002 22:54:20 -0000 1.2 @@ -5,5 +5,5 @@

- +
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/applet-add.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/applet-remove.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/applets-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets-chunk.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/applets-chunk.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,25 @@ + +

Active Applets

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

+ +

Applets To Add

+
    + +
  • + @all_applets.applet_pretty_name@ - [ + + add + + ] +
  • +
    +
+
Index: openacs-4/packages/dotlrn/www/applets-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets-chunk.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/applets-chunk.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,36 @@ +ad_page_contract { + Community Applets + + @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) + @creation-date 2001-10-05 + @version $Id: applets-chunk.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { +} -properties { +} + +set community_id [dotlrn_community::get_community_id] + +set user_id [ad_conn user_id] + +# Get active applets +set list_of_active_applets [dotlrn_community::list_applets -community_id $community_id] + +template::multirow create active_applets applet_key applet_pretty_name + +foreach applet_key $list_of_active_applets { + 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] + +template::multirow create all_applets applet_key applet_pretty_name + +foreach applet_key $list_of_applets { + if {[lsearch $list_of_active_applets $applet_key] == -1} { + template::multirow append all_applets $applet_key [dotlrn_community::applet_call $applet_key GetPrettyName] + } +} + +ad_return_template Index: openacs-4/packages/dotlrn/www/applets.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/applets.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,5 @@ + +Manage Applets +@context_bar@ + + Index: openacs-4/packages/dotlrn/www/applets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/applets.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + Manage the Applets for this community + + @author yon (yon@openforce.net) + @creation-date 2002-01-19 + @version $Id: applets.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { +} -properties { +} + +set context_bar {{"one-community-admin" Admin} {Manage Applets}} + +ad_return_template Index: openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/communities-chunk-oracle.xql 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,102 @@ + + + + oracle8.1.6 + + + + select count(*) + from dotlrn_communities_not_closed dotlrn_communities + + + + + + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_communities.package_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + (select count(*) + from dual + where exists (select 1 + from dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p + from dotlrn_communities_not_closed dotlrn_communities + order by dotlrn_communities.community_type, dotlrn_communities.pretty_name + + + + + + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_communities.package_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + (select count(*) + from dual + where exists (select 1 + from dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p + from dotlrn_active_comms_not_closed dotlrn_communities + order by dotlrn_communities.community_type, dotlrn_communities.pretty_name + + + + + + select count(*) + from dotlrn_communities_not_closed dotlrn_communities + where dotlrn_communities.community_type = :community_type + + + + + + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_communities.package_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + (select count(*) + from dual + where exists (select 1 + from dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p + from dotlrn_communities_not_closed dotlrn_communities + where dotlrn_communities.community_type = :community_type + order by dotlrn_communities.pretty_name + + + + + + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_communities.package_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + (select count(*) + from dual + where exists (select 1 + from dotlrn_member_rels_full + where dotlrn_member_rels_full.user_id = :user_id + and dotlrn_member_rels_full.community_id = dotlrn_communities.community_id)) as member_p, + decode(acs_permission.permission_p(:user_id, dotlrn_communities.community_id, 'admin'),'f',0,1) as admin_p + from dotlrn_active_comms_not_closed dotlrn_communities + where dotlrn_communities.community_type = :community_type + order by dotlrn_communities.pretty_name + + + Index: openacs-4/packages/dotlrn/www/communities-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/communities-chunk.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,28 @@ + +

Communities@title@

+ +

@filter_bar@

+ + + + + + + + + + +
@communities.pretty_name@ + + () + + + () + + + + (admin) + +
+
+
Index: openacs-4/packages/dotlrn/www/communities-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/communities-chunk.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,45 @@ +# dotlrn/www/communities.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Dec 07, 2001 + @version $Id: communities-chunk.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { + {filter "select_active_communities"} +} -properties { + n_communities:onevalue + communities:multirow +} + +if {![info exists community_type]} { + set community_type "" +} + +if {![info exists referer]} { + set referer "./" +} + +set user_id [ad_conn user_id] + +if {![empty_string_p $community_type]} { + set n_communities [db_string select_all_communities_count_by_type {}] +} else { + set n_communities [db_string select_all_communities_count {}] +} + +set filter_bar [ad_dimensional { + {filter "Status:" select_active_communities + { + {select_active_communities active {}} + {select_communities "+inactive" {}} + } + } +}] + +if {![empty_string_p $community_type]} { + append filter "_by_type" +} + +db_multirow communities $filter {} + +ad_return_template Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/communities-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/communities.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/communities.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-applet-add.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-applet-remove.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-applets.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-applets.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-applets.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-type.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/community-type.adp 11 Dec 2001 00:45:15 -0000 1.1 +++ openacs-4/packages/dotlrn/www/community-type.adp 19 Jan 2002 22:54:20 -0000 1.2 @@ -17,7 +17,7 @@

- +

Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add-2.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add-3.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-user-add.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community-users.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-users.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/configure.tcl 1 Dec 2001 23:16:27 -0000 1.3 +++ openacs-4/packages/dotlrn/www/configure.tcl 19 Jan 2002 22:54:20 -0000 1.4 @@ -4,8 +4,10 @@ @author Ben Adida (ben@openforce.net) @author Arjun Sanyal (arjun@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-10-24 -} { + @version $Id$ +} -query { } # Check if this is a community type level thing @@ -17,7 +19,6 @@ # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] - if {[ad_parameter community_level_p] == 1} { # This is a community # What community type are we at? @@ -43,16 +44,12 @@ # If there is no portal_id, this user is either a guest or something else if {[empty_string_p $portal_id]} { - # do something - ad_returnredirect "/." + ad_returnredirect "./" } else { set rendered_page [portal::configure $portal_id "index"] set name [portal::get_name $portal_id] } } ad_return_template - - - Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/deregister.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/member-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add-2.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,15 @@ + +dotLRN Admin: Add a User to a Community + +You're adding @first_names@ @last_name@ (@email@):

+ +

+ + Role: + + +
Index: openacs-4/packages/dotlrn/www/member-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add-2.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,36 @@ +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: member-add-2.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { + user_id +} -properties { + roles:multirow +} + +set community_id [dotlrn_community::get_community_id] + +dotlrn::require_user_admin_community $community_id + +# Get user information +db_1row select_user_info { + select first_names, + last_name, + email + from dotlrn_users + where user_id = :user_id +} + +# Depending on the community_type, we have allowable rel_types +set rel_types [dotlrn_community::get_allowed_rel_types -community_id $community_id] + +template::multirow create roles rel_type pretty_name + +foreach rel_type $rel_types { + 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/member-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add-3.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add-3.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,17 @@ + +ad_page_contract { + Add the new user + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { + user_id + rel_type +} + +set community_id [dotlrn_community::get_community_id] + +# Add the relation +dotlrn_community::add_user -rel_type $rel_type $community_id $user_id + +ad_returnredirect "one-community-admin?class_instance_id=$community_id" Index: openacs-4/packages/dotlrn/www/member-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,10 @@ + +dotLRN Admin: Add a User to a Community +@context_bar@ + +The results of your search are: + Index: openacs-4/packages/dotlrn/www/member-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,19 @@ +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: member-add.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { + search_text +} + +set community_id [dotlrn_community::get_community_id] + +# Just search +db_multirow users select_users {} + +set context_bar {{one-community-admin Admin} "New User"} + +ad_return_template Index: openacs-4/packages/dotlrn/www/member-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/member-add.xql 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +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) + + + Index: openacs-4/packages/dotlrn/www/members-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/members-chunk.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,17 @@ +

Users

+
Index: openacs-4/packages/dotlrn/www/members-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/members-chunk.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,31 @@ +# dotlrn/www/members-chunk.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Jan 08, 2002 + @version $Id: members-chunk.tcl,v 1.1 2002/01/19 22:54:20 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/members.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/members.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,5 @@ + +Manage Membership +@context_bar@ + + Index: openacs-4/packages/dotlrn/www/members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/members.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,13 @@ +# dotlrn/www/members.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Jan 19, 2002 + @version $Id: members.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { +} -properties { +} + +set context_bar {{"one-community-admin" Admin} {Manage Members}} + +ad_return_template Index: openacs-4/packages/dotlrn/www/my-communities-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/my-communities-oracle.xql 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,29 @@ + + + + oracle8.1.6 + + + + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_communities.package_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + (select pretty_name + from acs_rel_roles + where role = (select acs_rel_types.role_two + from acs_rel_types, + acs_rels + where acs_rel_types.rel_type = acs_rels.rel_type + and acs_rels.rel_id = dotlrn_member_rels_full.rel_id)) as role, + decode(dotlrn_community.admin_p(dotlrn_communities.community_id, dotlrn_member_rels_full.user_id),'f',0,1) as admin_p + 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 + order by dotlrn_communities.community_type, dotlrn_communities.pretty_name + + + Index: openacs-4/packages/dotlrn/www/my-communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/my-communities.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,20 @@ +# dotlrn/www/my-communities.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Dec 07, 2001 + @version $Id: my-communities.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { +} -properties { + communities:multirow +} + +set user_id [ad_maybe_redirect_for_registration] + +if {![info exists referer]} { + set referer "my-communities" +} + +db_multirow communities select_my_communities {} + +ad_return_template Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/one-community-admin-users.tcl'. Fisheye: No comparison available. Pass `N' to diff? 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.8 -r1.9 --- openacs-4/packages/dotlrn/www/one-community-admin.adp 12 Jan 2002 09:27:16 -0000 1.8 +++ openacs-4/packages/dotlrn/www/one-community-admin.adp 19 Jan 2002 22:54:20 -0000 1.9 @@ -1,18 +1,43 @@ - + Admin: @pretty_name@ @context_bar@ -

- -

+ 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.9 -r1.10 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 12 Jan 2002 09:27:16 -0000 1.9 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 19 Jan 2002 22:54:20 -0000 1.10 @@ -7,28 +7,26 @@ @version $Id$ } -query { } -properties { + dotlrn_admin_p:onevalue + dotlrn_admin_url:onevalue community_id:onevalue community_type:onevalue pretty_name:onevalue description:onevalue - portal_template_id:onevalue - users:multirow + subgroups:multirow } set community_id [dotlrn_community::get_community_id] -# Permissions dotlrn::require_user_admin_community $community_id +set dotlrn_admin_p [dotlrn::admin_p] +set dotlrn_admin_url "[dotlrn::get_url]/admin" + db_1row select_community_info {} -# 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_pretty_rel_type [lindex $user 1]] [lindex $user 2] [lindex $user 3] [lindex $user 4] [lindex $user 5] +db_multirow subgroups select_subgroups_count { + select 1 from dual where 1 = 0 } set context_bar {Admin} 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.4 -r1.5 --- openacs-4/packages/dotlrn/www/one-community-admin.xql 10 Jan 2002 19:30:18 -0000 1.4 +++ openacs-4/packages/dotlrn/www/one-community-admin.xql 19 Jan 2002 22:54:20 -0000 1.5 @@ -5,8 +5,7 @@ select community_type, pretty_name, - description, - portal_template_id + description from dotlrn_communities where community_id = :community_id Index: openacs-4/packages/dotlrn/www/one-community-portal-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-portal-template.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/one-community-portal-template.tcl 11 Dec 2001 00:45:15 -0000 1.3 +++ openacs-4/packages/dotlrn/www/one-community-portal-template.tcl 19 Jan 2002 22:54:20 -0000 1.4 @@ -4,11 +4,12 @@ @author Arjun Sanyal (arjun@openforce.net) @version $Id$ -} { - portal_id:naturalnum,notnull - return_url:notnull +} -query { + {referer "one-community-admin"} } -set rendered_page [portal::template_configure $portal_id $return_url] +set portal_id [dotlrn_community::get_portal_template_id] +set rendered_page [portal::template_configure $portal_id $referer] + ad_return_template 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.14 -r1.15 --- openacs-4/packages/dotlrn/www/one-community-type.adp 15 Jan 2002 22:23:41 -0000 1.14 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 19 Jan 2002 22:54:20 -0000 1.15 @@ -17,5 +17,5 @@

- +
Index: openacs-4/packages/dotlrn/www/preferences.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/preferences.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/preferences.adp 10 Nov 2001 18:03:23 -0000 1.1 +++ openacs-4/packages/dotlrn/www/preferences.adp 19 Jan 2002 22:54:20 -0000 1.2 @@ -1,4 +1,18 @@ -dotLRN Preferences +@title@ - + + +

+ +
+ +
Index: openacs-4/packages/dotlrn/www/preferences.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/preferences.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/preferences.tcl 13 Nov 2001 17:57:30 -0000 1.2 +++ openacs-4/packages/dotlrn/www/preferences.tcl 19 Jan 2002 22:54:20 -0000 1.3 @@ -1,31 +1,24 @@ +# dotlrn/www/preferences.tcl ad_page_contract { Preferences for dotLRN @author Ben Adida (ben@openforce.net) + @author yon (yon@openforce.net) @creation-date 2001-11-10 -} { + @version $Id$ +} -query { +} -properties { + title:onevalue + admin_p:onevalue + admin_url:onevalue } # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] -form create preferences +set title "Preferences" +set admin_p [dotlrn::admin_p] +set admin_url "[dotlrn::get_url]/admin" -element create preferences theme_id \ - -label "Portal Theme" -datatype text -widget select \ - -options [concat {{{(don't override)} {}}} [db_list_of_lists select_themes "select name,theme_id from portal_element_themes"]] - -if {[form is_valid preferences]} { - template::form get_values preferences theme_id - - dotlrn::set_user_theme $user_id $theme_id - ad_returnredirect "./" - return -} else { - db_1row select_prefs {} - - element set_properties preferences theme_id -set_value $theme_id -} - ad_return_template Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/preferences.xql'. 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/register.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/user-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/user-add.adp 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,5 @@ + +Add A User +@context_bar@ + + Index: openacs-4/packages/dotlrn/www/user-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/user-add.tcl 19 Jan 2002 22:54:20 -0000 1.1 @@ -0,0 +1,77 @@ +# dotlrn/www/user-add.tcl + +ad_page_contract { + Adding a user by an administrator + + @author yon (yon@openforce.net) + @creation-date Jan 19, 2002 + @cvs-id $Id: user-add.tcl,v 1.1 2002/01/19 22:54:20 yon Exp $ +} -query { + {referer "members"} + {type_id "1"} + {rel_type "dotlrn_full_user_rel"} + {read_private_data_p "t"} +} -properties { + context_bar:onevalue +} + +set user_id [ad_maybe_redirect_for_registration] + +if {![dotlrn::admin_p -user_id $user_id]} { + ad_returnredirect "not-allowed" + ad_script_abort +} + +set context_bar {{"one-community-admin" Admin} {Add User}} + +set target_user_id [db_nextval acs_object_id_seq] + +form create add_user + +element create add_user target_user_id \ + -label "User ID" -value $target_user_id -datatype integer -widget hidden + +element create add_user email \ + -label "Email" -datatype text -widget text -html {size 50} \ + -validate { + {expr (([util_email_valid_p $value] == 1) && ([util_email_unique_p $value] == 1))} + {E-mail address must be valid and unique} + } + +element create add_user first_names \ + -label "First Names" -datatype text -widget text -html {size 50} + +element create add_user last_name \ + -label "Last Name" -datatype text -widget text -html {size 50} + +element create add_user referer \ + -label "Referer" -value $referer -datatype text -widget hidden + +element create add_user rel_type \ + -label "Rel Type" -value $rel_type -datatype text -widget hidden + +element create add_user type_id \ + -label "Type ID" -value $type_id -datatype text -widget hidden + +element create add_user read_private_data_p \ + -label "Can Read Private Data" -value $read_private_data_p -datatype text -widget hidden + +if {[form is_valid add_user]} { + template::form get_values add_user target_user_id email first_names last_name referer rel_type type_id read_private_data_p + + db_transaction { + # create the ACS user + set target_user_id [ad_user_new $email $first_names $last_name [ad_generate_random_string] "" "" "" "t" "approved" $target_user_id] + + # make the user a dotLRN user + dotlrn::user_add -rel_type $rel_type -user_id $target_user_id -type_id $type_id + + # can this user read private data? + acs_privacy::set_user_read_private_data -user_id $target_user_id -object_id [dotlrn::get_package_id] -value $read_private_data_p + } + + ad_returnredirect "member-add-2?user_id=$target_user_id" + ad_script_abort +} + +ad_return_template