Index: openacs-4/packages/dotlrn/dotlrn.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v
diff -u -N -r1.63 -r1.64
--- openacs-4/packages/dotlrn/dotlrn.info 11 Mar 2002 17:08:16 -0000 1.63
+++ openacs-4/packages/dotlrn/dotlrn.info 11 Mar 2002 21:24:54 -0000 1.64
@@ -244,6 +244,9 @@
+
+
+
Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp,v
diff -u -N -r1.13 -r1.14
--- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 8 Mar 2002 21:52:11 -0000 1.13
+++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 11 Mar 2002 21:24:54 -0000 1.14
@@ -1,5 +1,5 @@
Index: openacs-4/packages/dotlrn/www/manage-memberships-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/manage-memberships-oracle.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/manage-memberships-oracle.xql 11 Mar 2002 21:24:54 -0000 1.1
@@ -0,0 +1,211 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select count(*)
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_member_rels_full.community_id = dotlrn_class_instances_full.class_instance_id
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select acs_rel_roles.pretty_name
+ from acs_rel_roles
+ where acs_rel_roles.role = (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = dotlrn_member_rels_full.rel_type)) as role,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_member_rels_full.community_id = dotlrn_class_instances_full.class_instance_id
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select acs_rel_roles.pretty_name
+ from acs_rel_roles
+ where acs_rel_roles.role = (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = dotlrn_member_rels_full.rel_type)) as role,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_class_instances_full.department_key = :member_department_key
+ and dotlrn_member_rels_full.community_id = dotlrn_class_instances_full.class_instance_id
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select acs_rel_roles.pretty_name
+ from acs_rel_roles
+ where acs_rel_roles.role = (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = dotlrn_member_rels_full.rel_type)) as role,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_class_instances_full.term_id = :member_term_id
+ and dotlrn_member_rels_full.community_id = dotlrn_class_instances_full.class_instance_id
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select acs_rel_roles.pretty_name
+ from acs_rel_roles
+ where acs_rel_roles.role = (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = dotlrn_member_rels_full.rel_type)) as role,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_class_instances_full.department_key = :member_department_key
+ and dotlrn_class_instances_full.term_id = :member_term_id
+ and dotlrn_member_rels_full.community_id = dotlrn_class_instances_full.class_instance_id
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_clubs_full.*,
+ (select acs_rel_roles.pretty_name
+ from acs_rel_roles
+ where acs_rel_roles.role = (select acs_rel_types.role_two
+ from acs_rel_types
+ where acs_rel_types.rel_type = dotlrn_member_rels_full.rel_type)) as role,
+ acs_permission.permission_p(dotlrn_clubs_full.club_id, :user_id, 'admin') as admin_p
+ from dotlrn_clubs_full,
+ dotlrn_member_rels_full
+ where dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_member_rels_full.community_id = dotlrn_clubs_full.club_id
+ order by dotlrn_clubs_full.pretty_name,
+ dotlrn_clubs_full.community_key
+
+
+
+
+
+ select count(*)
+ from dotlrn_class_instances_full
+ where not 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_class_instances_full.class_instance_id)
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full
+ where not 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_class_instances_full.class_instance_id)
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.department_key = :non_member_department_key
+ and not 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_class_instances_full.class_instance_id)
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.term_id = :non_member_term_id
+ and not 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_class_instances_full.class_instance_id)
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ acs_permission.permission_p(dotlrn_class_instances_full.class_instance_id, :user_id, 'admin') as admin_p
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.department_key = :non_member_department_key
+ and dotlrn_class_instances_full.term_id = :non_member_term_id
+ and not 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_class_instances_full.class_instance_id)
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_clubs_full.*,
+ acs_permission.permission_p(dotlrn_clubs_full.club_id, :user_id, 'admin') as admin_p
+ from dotlrn_clubs_full
+ where not 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_clubs_full.club_id)
+ order by dotlrn_clubs_full.pretty_name,
+ dotlrn_clubs_full.community_key
+
+
+
+
Index: openacs-4/packages/dotlrn/www/manage-memberships.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/manage-memberships.adp,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/manage-memberships.adp 11 Mar 2002 21:24:54 -0000 1.1
@@ -0,0 +1,167 @@
+
+
+
+Manage Memberships
+Manage Memberships
+
+Add/Drop Memberships
+
+
+
+
+ Your current memberships
+
+
+
+
+ <%= [ad_parameter classes_pretty_plural] %>
+
+
+
+
+ <%= [ad_parameter departments_pretty_name] %>:
+ |
+
+ Term:
+ |
+
+
+
+
+
+
+ <%= [ad_parameter classes_pretty_name] %> |
+ Term |
+ Role |
+ Actions |
+
+
+
+
+ @member_classes.pretty_name@ |
+ @member_classes.term_name@ @member_classes.term_year@ |
+ @member_classes.role@ |
+ [ ] |
+
+
+
+
+
+ No classes
+
+
+
+
+
+
+ <%= [ad_parameter clubs_pretty_plural] %>
+
+
+
+
+ <%= [ad_parameter clubs_pretty_name] %> |
+ Role |
+ Actions |
+
+
+
+
+ @member_clubs.pretty_name@ |
+ @member_clubs.role@ |
+ [ ] |
+
+
+
+
+
+
+ No <%= [ad_parameter clubs_pretty_plural] %>
+
+
+
+
+
+
+
+ Join a group
+
+
+
+
+ <%= [ad_parameter classes_pretty_plural] %>
+
+
+
+
+ <%= [ad_parameter departments_pretty_name] %>:
+ |
+
+ Term:
+ |
+
+
+
+
+
+
+ <%= [ad_parameter classes_pretty_name] %> |
+ Term |
+ Actions |
+
+
+
+
+ @non_member_classes.pretty_name@ |
+ @non_member_classes.term_name@ @non_member_classes.term_year@ |
+ [ ] |
+
+
+
+
+
+ No classes
+
+
+
+
+
+
+ <%= [ad_parameter clubs_pretty_plural] %>
+
+
+
+
+
+
+ No <%= [ad_parameter clubs_pretty_plural] %>
+
+
+
Index: openacs-4/packages/dotlrn/www/manage-memberships.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/manage-memberships.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/manage-memberships.tcl 11 Mar 2002 21:24:54 -0000 1.1
@@ -0,0 +1,153 @@
+#
+# Copyright (C) 2001, 2002 OpenForce, Inc.
+#
+# This file is part of dotLRN.
+#
+# dotLRN is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+
+# dotlrn/www/manage-memberships.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-03-08
+ @version $Id: manage-memberships.tcl,v 1.1 2002/03/11 21:24:54 yon Exp $
+} -query {
+ {member_department_key ""}
+ {non_member_department_key ""}
+ {member_term_id -1}
+ {non_member_term_id -1}
+} -properties {
+}
+
+set user_id [ad_conn user_id]
+
+set departments [db_list_of_lists select_departments_for_select_widget {
+ select dotlrn_departments_full.pretty_name,
+ dotlrn_departments_full.department_key
+ from dotlrn_departments_full
+ order by dotlrn_departments_full.pretty_name,
+ dotlrn_departments_full.department_key
+}]
+set departments [linsert $departments 0 {All ""}]
+
+set terms [db_list_of_lists select_terms_for_select_widget {
+ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year,
+ dotlrn_terms.term_id
+ from dotlrn_terms
+ order by dotlrn_terms.start_date,
+ dotlrn_terms.end_date
+}]
+set terms [linsert $terms 0 {All -1}]
+
+form create member_form
+
+element create member_form member_department_key \
+ -label "Department" \
+ -datatype text \
+ -widget select \
+ -options $departments \
+ -html {onChange document.member_form.submit()} \
+ -value $member_department_key
+
+element create member_form member_term_id \
+ -label "Term" \
+ -datatype integer \
+ -widget select \
+ -options $terms \
+ -html {onChange document.member_form.submit()} \
+ -value $member_term_id
+
+element create member_form non_member_department_key \
+ -label "Department" \
+ -datatype text \
+ -widget hidden \
+ -value $non_member_department_key
+
+element create member_form non_member_term_id \
+ -label "Term" \
+ -datatype text \
+ -widget hidden \
+ -value $non_member_term_id
+
+if {[form is_valid member_form]} {
+ form get_values member_form \
+ member_department_key member_term_id \
+ non_member_department_key non_member_term_id
+}
+
+set member_query "select_member_classes"
+
+if {![empty_string_p $member_department_key]} {
+ append member_query "_by_department"
+}
+
+if {$member_term_id != -1} {
+ append member_query "_by_term"
+}
+
+set n_member_classes [db_string select_n_member_classes {}]
+db_multirow member_classes $member_query {}
+db_multirow member_clubs select_member_clubs {}
+
+form create non_member_form
+
+element create non_member_form non_member_department_key \
+ -label "Department" \
+ -datatype text \
+ -widget select \
+ -options $departments \
+ -html {onChange document.non_member_form.submit()} \
+ -value $non_member_department_key
+
+element create non_member_form non_member_term_id \
+ -label "Term" \
+ -datatype integer \
+ -widget select \
+ -options $terms \
+ -html {onChange document.non_member_form.submit()} \
+ -value $non_member_term_id
+
+element create non_member_form member_department_key \
+ -label "Department" \
+ -datatype text \
+ -widget hidden \
+ -value $member_department_key
+
+element create non_member_form member_term_id \
+ -label "Term" \
+ -datatype text \
+ -widget hidden \
+ -value $member_term_id
+
+if {[form is_valid non_member_form]} {
+ form get_values non_member_form \
+ non_member_department_key non_member_term_id \
+ member_department_key member_term_id
+}
+
+set non_member_query "select_non_member_classes"
+
+if {![empty_string_p $non_member_department_key]} {
+ append non_member_query "_by_department"
+}
+
+if {$non_member_term_id != -1} {
+ append non_member_query "_by_term"
+}
+
+set n_non_member_classes [db_string select_n_non_member_classes {}]
+db_multirow non_member_classes $non_member_query {}
+db_multirow non_member_clubs select_non_member_clubs {}
+
+set referer [ns_urlencode "/dotlrn/manage-memberships?[export_vars {member_department_key member_term_id non_member_department_key non_member_term_id}]"]
+
+ad_return_template