Index: openacs-4/packages/dotlrn-admin/dotlrn-admin.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/dotlrn-admin.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/dotlrn-admin.info 20 Aug 2004 14:44:20 -0000 1.1
@@ -0,0 +1,24 @@
+
+
+
+
+ dotLRN Admin
+ dotlrn Admins
+ f
+ t
+
+
+ Andrew Grumet
+ .LRN-wide admin pages. Initially created as a singleton with automount at /dotlrn/dotlrn-admin. These can be changed if and when .LRN supports multiple instances.
+ Contains pages and scripts for configuring .LRN --- managing users, departments, terms, classes and so on.
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/tcl/dotlrn-admin-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/tcl/dotlrn-admin-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/tcl/dotlrn-admin-procs.tcl 20 Aug 2004 14:44:21 -0000 1.1
@@ -0,0 +1,5 @@
+namespace eval dotlrn_admin {
+ ad_proc -public mount_point {} {} {
+ return dotlrn-admin
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/dotlrn-admin/www/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/index.vuh 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,8 @@
+# This is a temporary navigational workaround. The admin pages used
+# to live directly in the dotlrn package and a lot of existing
+# navigation still assumes that.
+set return_url [dotlrn::get_url]/[ad_conn path_info]
+if { [string length [ad_conn query]] > 0 } {
+ append return_url ?[ad_conn query]
+}
+ad_returnredirect $return_url
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,38 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.dotLRN_Admin#
+@context_bar@
+
+#dotlrn.lt_The_results_of_your_s#
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/add-instructor-2.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date Jan 10, 2002
+ @version $Id: add-instructor-2.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ community_id:integer,notnull
+ {search_text ""}
+ {referer ""}
+} -properties {
+ users:multirow
+}
+
+set context_bar [list [_ dotlrn.Add_a_Professor]]
+
+# LARS 2003-10-21: We should probably limit this in some way, so you can't get 30000 hits.
+
+db_multirow users select_users {}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor-2.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ select user_id,
+ first_names,
+ last_name,
+ email
+ from registered_users
+ where lower(last_name) like lower('%' || :search_text || '%')
+ or lower(email) like lower('%' || :search_text || '%')
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/add-instructor-3.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date Jan 10, 2002
+ @version $Id: add-instructor-3.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id:integer,notnull
+ community_id:integer,notnull
+ {referer ""}
+}
+
+set is_dotlrn_user [db_string is_dotlrn_user {}]
+
+# if the user isn't already a dotLRN user make him so
+if {!${is_dotlrn_user}} {
+ dotlrn::user_add -user_id $user_id -type professor -can_browse
+ dotlrn_privacy::set_user_is_non_guest -user_id $user_id -value t
+}
+
+# Add the relation
+dotlrn_community::add_user -rel_type dotlrn_instructor_rel $community_id $user_id
+
+ad_returnredirect $referer
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor-3.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ select count(*)
+ from dual
+ where exists (select 1
+ from dotlrn_users
+ where user_id = :user_id)
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,35 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.dotLRN_Admin#
+@context_bar@
+
+#dotlrn.Add_a_Professor#
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/add-instructor.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/add-instructor.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/add-instructor.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/add-instructor.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date Jan 10, 2002
+ @version $Id: add-instructor.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ community_id:integer,notnull
+ {referer "./"}
+}
+
+set context_bar [list [_ dotlrn.Add_a_Professor]]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,24 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Add_A_Member#
+#dotlrn.Add_A_Member#
+
Index: openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Search for a new user for dotLRN
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @author Hector Amado (hr_amado@galileo.edu)
+ @creation-date 2004-07-02
+ @cvs-id $Id: admin-add-2.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id
+ {referer "dotlrn-admins"}
+} -properties {
+
+}
+
+
+# Get user information
+db_1row select_user_info {
+ select first_names,
+ last_name,
+ email
+ from dotlrn_users
+ where user_id = :user_id
+}
+
+# See if the user is already in the dotlrn-admin
+set member_p [group::member_p -group_name "dotlrn-admin" -user_id $user_id ]
+
+set group_id [db_string group_id_from_name "
+ select group_id from groups where group_name='dotlrn-admin'" -default ""]
+
+if {!$member_p} {
+ if {![empty_string_p $group_id] } {
+ group::add_member -group_id $group_id -user_id $user_id
+ }
+}
+
+template::forward dotlrn-admins
+
Index: openacs-4/packages/dotlrn-admin/www/admin/admin-add-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ 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-admin/www/admin/admin-add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ select user_id,
+ first_names,
+ last_name,
+ email
+ from dotlrn_users
+ where lower(last_name) like lower('%' || :search_text || '%')
+ or lower(first_names) 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-admin/www/admin/admin-add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,41 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Add_A_Member#
+@context_bar@
+
+
+ #dotlrn.there_are_no_users_matching#
+
+
+
+#dotlrn.lt_The_results_of_your_s#
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/admin-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-add.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Search for a new user for dotLRN
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @author Hector Amado (hr_amado@galileo.edu)
+ @creation-date 2004-07-02
+ @cvs-id $Id: admin-add.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ search_text
+ {referer "dotlrn-admins"}
+}
+
+set search_text [string trim $search_text]
+set community_id [dotlrn_community::get_community_id]
+
+# Just search
+db_multirow users select_users {}
+
+set context_bar [list [list "dotlrn-admins" [_ dotlrn.Admin]] [_ dotlrn.New_User]]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+ad_maybe_redirect_for_registration
+ad_page_contract {
+ Remove dotLRN Administrators
+
+ @author Hector Amado (hr_amado@galileo.edu)
+ @creation-date 2004-07-02
+ @cvs-id $Id: admin-remove.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} {
+ user_id
+}
+
+set group_id [db_string group_id_from_name "
+ select group_id from groups where group_name='dotlrn-admin'" -default ""]
+ if {![empty_string_p $group_id] } {
+ group::remove_member -group_id $group_id -user_id $user_id
+ }
+
+template::forward dotlrn-admins
+
Index: openacs-4/packages/dotlrn-admin/www/admin/archived-communities-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/archived-communities-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/archived-communities-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,58 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select child.community_id,
+ child.pretty_name,
+ child.description,
+ dotlrn_community.url(child.community_id) as url,
+ parent.community_id as parent_community_id,
+ parent.pretty_name as parent_pretty_name,
+ case when parent.community_id is null then null
+ else dotlrn_community.url(parent.community_id) end
+ as parent_url,
+ class.term_name,
+ class.term_year,
+ parent_class.term_name as parent_term_name,
+ parent_class.term_year as parent_term_year,
+ to_char(o.creation_date, 'Mon YYYY') as creation_date,
+ to_char(o.last_modified, 'Mon YYYY') as last_modified
+ from dotlrn_communities_all child,
+ dotlrn_communities_all parent,
+ (select i.class_instance_id,
+ t.term_name,
+ t.term_year
+ from dotlrn_class_instances i,
+ dotlrn_terms t
+ where t.term_id = i.term_id) class,
+ (select i.class_instance_id,
+ t.term_name,
+ t.term_year
+ from dotlrn_class_instances i,
+ dotlrn_terms t
+ where t.term_id = i.term_id) parent_class,
+ acs_objects o
+ where child.archived_p = 't'
+ and child.parent_community_id = parent.community_id(+)
+ and child.community_id = class.class_instance_id(+)
+ and child.parent_community_id = parent_class.class_instance_id(+)
+ and o.object_id = child.community_id
+ order by child.pretty_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/archived-communities-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/archived-communities-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/archived-communities-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,57 @@
+
+
+
+ postgres7.2
+
+
+
+
+ select child.community_id,
+ child.pretty_name,
+ child.description,
+ dotlrn_community__url(child.community_id) as url,
+ parent.community_id as parent_community_id,
+ parent.pretty_name as parent_pretty_name,
+ case when parent.community_id is null then null
+ else dotlrn_community__url(parent.community_id) end
+ as parent_url,
+ class.term_name,
+ class.term_year,
+ parent_class.term_name as parent_term_name,
+ parent_class.term_year as parent_term_year,
+ to_char(o.creation_date, 'Mon YYYY') as creation_date,
+ to_char(o.last_modified, 'Mon YYYY') as last_modified
+ from dotlrn_communities_all child left outer join
+ dotlrn_communities_all parent using (community_id),
+ dotlrn_communities_all child left outer join
+ (select i.class_instance_id,
+ t.term_name,
+ t.term_year
+ from dotlrn_class_instances i,
+ dotlrn_terms t
+ where t.term_id = i.term_id) class using (class_instance_id),
+ dotlrn_communities_all child left outer join
+ (select i.class_instance_id,
+ t.term_name,
+ t.term_year
+ from dotlrn_class_instances i,
+ dotlrn_terms t
+ where t.term_id = i.term_id) parent_class using (class_instance_id),
+ acs_objects o
+ where child.archived_p = 't'
+ and o.object_id = child.community_id
+ order by child.pretty_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/archived-communities.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/archived-communities.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/archived-communities.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,61 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+#dotlrn.Note_the_term_column#
+
+
+ #dotlrn.Parent# |
+ #dotlrn.Name# |
+ #dotlrn.Description# |
+ #dotlrn.Term# |
+ #dotlrn.Created# |
+ #dotlrn.Unarchive# |
+
+
+
+
+
+
+
+
+ @archived_comms.parent_pretty_name@
+ |
+
+ @archived_comms.pretty_name@ |
+ @archived_comms.description@ |
+
+ @archived_comms.term_name@ @archived_comms.term_year@
+ <% # look for a parent term if no child term is found %>
+ @archived_comms.parent_term_name@ @archived_comms.parent_term_year@
+ |
+ @archived_comms.creation_date@ |
+ #dotlrn.unarchive# |
+
+
+
+
+
+ #dotlrn.no_arhived_groups#
+
Index: openacs-4/packages/dotlrn-admin/www/admin/archived-communities.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/archived-communities.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/archived-communities.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ displays archived communities
+
+ @author arjun (arjun@openforce.net)
+ @version $Id: archived-communities.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+ archived_comms:multirow
+}
+
+set groups_pretty_plural "[parameter::get -localize -parameter class_instances_pretty_plural] / [parameter::get -localize -parameter clubs_pretty_plural]"
+
+set title "[_ dotlrn.archived_groups]"
+set context_bar [list $title]
+
+db_multirow -extend { unarchive_url } archived_comms select_archived_comms {} {
+ set description [ad_quotehtml $description]
+ set unarchive_url "unarchive?community_id=$community_id"
+}
+
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/browse-toggle.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/browse-toggle.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/browse-toggle.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/browse-toggle.tcl
+
+ad_page_contract {
+ @author Caroline Meeks (caroline@meekshome.com)
+ @creation-date November 19, 2002
+ @version $Id: browse-toggle.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id
+ can_browse_p
+ {referer "users"}
+}
+
+
+#update can_browse_p
+dotlrn::set_can_browse -user_id $user_id -can_browse\=$can_browse_p
+
+util_memoize_flush_regexp $user_id
+ad_returnredirect $referer
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-edit.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-edit.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ edit a class
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-03-14
+ @version $Id: class-edit.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ class_key:notnull
+ {referer classes}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+if {![db_0or1row select_class_info {}]} {
+ ad_return_complaint 1 "[_ dotlrn.Invalid] class_key $class_key"
+ ad_script_abort
+}
+
+set title "[_ dotlrn.Edit] [parameter::get -localize -parameter classes_pretty_name] $pretty_name"
+set context_bar [list [list classes [parameter::get -localize -parameter classes_pretty_plural]] [_ dotlrn.Edit]]
+
+form create edit_class
+
+element create edit_class class_key \
+ -label "[_ dotlrn.lt_Class_Key_a_short_nam]" \
+ -datatype text \
+ -widget hidden \
+ -value $class_key
+
+element create edit_class pretty_name \
+ -label [_ dotlrn.Name] \
+ -datatype text \
+ -widget text \
+ -html {size 60 maxlength 100}
+
+element create edit_class description \
+ -label [_ dotlrn.Description] \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -optional
+
+element create edit_class referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_request edit_class]} {
+ element set_properties edit_class pretty_name -value $pretty_name
+ element set_properties edit_class description -value $description
+}
+
+if {[form is_valid edit_class]} {
+ form get_values edit_class \
+ class_key pretty_name description referer
+
+ db_dml update_community_type {}
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-edit.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ select pretty_name,
+ description
+ from dotlrn_classes_full
+ where class_key = :class_key
+
+
+
+
+
+ update dotlrn_community_types
+ set pretty_name = :pretty_name,
+ description = :description
+ where community_type = :class_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year as term,
+ dotlrn_terms.term_id
+ from dotlrn_terms
+ where dotlrn_terms.end_date > sysdate
+ order by dotlrn_terms.start_date
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year as term,
+ dotlrn_terms.term_id
+ from dotlrn_terms
+ where dotlrn_terms.end_date > now()
+ order by dotlrn_terms.start_date
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,26 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.new_class_of_type_class_name#
+@context_bar@
+add_class_instance.term
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,114 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Create a New Class Instance
+
+ @author Ben Adida (ben@openforce.net)
+ @creation-date 2001-10-05
+ @version $Id: class-instance-new.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ class_key:notnull
+ {referer ""}
+}
+
+if {![db_0or1row select_class_info {}]} {
+ set class_name ""
+ set class_description ""
+}
+
+form create add_class_instance
+
+element create add_class_instance term \
+ -label [_ dotlrn.Term] \
+ -datatype integer \
+ -widget select \
+ -options [db_list_of_lists select_terms_for_select_widget {}]
+
+element create add_class_instance pretty_name \
+ -label [_ dotlrn.Name] \
+ -datatype text \
+ -widget text \
+ -html {size 60} \
+ -value $class_name \
+ -optional
+
+element create add_class_instance description \
+ -label [_ dotlrn.Description] \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -value $class_description \
+ -optional
+
+element create add_class_instance join_policy \
+ -label "[_ dotlrn.Join_Policy]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.Open] open] [list "[_ dotlrn.Needs_Approval]" "needs approval"] [list [_ dotlrn.Closed] closed]]
+
+element create add_class_instance class_key \
+ -label "[parameter::get -localize -parameter classes_pretty_name] [_ dotlrn.Key]" \
+ -datatype text \
+ -widget hidden \
+ -value $class_key
+
+element create add_class_instance add_instructor \
+ -label "[_ dotlrn.Add_Professor]" \
+ -datatype text \
+ -widget radio \
+ -options [list [list [_ dotlrn.Yes] 1] [list [_ dotlrn.No] 0]] \
+ -value 1
+
+element create add_class_instance referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid add_class_instance]} {
+ form get_values add_class_instance \
+ class_key term pretty_name description join_policy add_instructor referer
+
+ set class_instance_id [dotlrn_class::new_instance \
+ -class_key $class_key \
+ -term_id $term \
+ -pretty_name $pretty_name \
+ -description $description \
+ -join_policy $join_policy \
+ ]
+
+ if {[empty_string_p $referer]} {
+ set referer "class?class_key=$class_key"
+ }
+
+ if {${add_instructor}} {
+ ad_returnredirect "add-instructor?community_id=$class_instance_id&referer=$referer"
+ ad_script_abort
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+# Used by en_US version of new_class_instance message
+set class_instances_pretty_name [parameter::get -localize -parameter class_instances_pretty_name]
+
+set context_bar [list \
+ [list classes [parameter::get -localize -parameter classes_pretty_plural]] \
+ [list "class?class_key=$class_key" $class_name] \
+ [_ dotlrn.new_class_instance]]
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select pretty_name as class_name,
+ description as class_description
+ from dotlrn_classes_full
+ where class_key = :class_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,26 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+add_class.department_key
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,78 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Create a New Class - input form
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-08-20
+ @version $Id: class-new.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {department_key ""}
+ {referer classes}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+# Used in en_US title
+set classes_pretty_name [parameter::get -localize -parameter classes_pretty_name]
+set title "[_ dotlrn.new_class_1]"
+set context_bar [list [list classes [parameter::get -localize -parameter classes_pretty_plural]] [_ dotlrn.new_class_navbar_name]]
+
+form create add_class
+
+element create add_class department_key \
+ -label [parameter::get -localize -parameter departments_pretty_name] \
+ -datatype text \
+ -widget select \
+ -options [dotlrn_department::select_as_list] \
+ -value $department_key
+
+element create add_class pretty_name \
+ -label [_ dotlrn.Name] \
+ -datatype text \
+ -widget text \
+ -html {size 60 maxlength 100}
+
+element create add_class description \
+ -label [_ dotlrn.Description] \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -optional
+
+element create add_class referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid add_class]} {
+ form get_values add_class \
+ department_key pretty_name description referer
+
+ set class_key [dotlrn_class::new \
+ -department_key $department_key \
+ -pretty_name $pretty_name \
+ -description $description]
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/class-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year,
+ dotlrn_terms.term_id
+ from dotlrn_terms
+ where dotlrn_terms.end_date > (sysdate - 360)
+ and dotlrn_terms.start_date < (sysdate + 360)
+ order by dotlrn_terms.start_date,
+ dotlrn_terms.end_date
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year,
+ dotlrn_terms.term_id
+ from dotlrn_terms
+ where dotlrn_terms.end_date > (cast(current_timestamp as date) - 360)
+ and dotlrn_terms.start_date < (cast(current_timestamp as date) + 360)
+ order by dotlrn_terms.start_date,
+ dotlrn_terms.end_date
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,130 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@pretty_name@
+@context_bar@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #dotlrn.term#:
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/class.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays single dotLRN class page
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-11-07
+ @version $Id: class.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ class_key:notnull
+ {term_id -1}
+} -properties {
+ pretty_name:onevalue
+ description:onevalue
+ class_instances:multirow
+ can_instantiate:onevalue
+}
+
+# Get information about that class
+if {![db_0or1row select_class_info {}]} {
+ ad_returnredirect classes
+ ad_script_abort
+}
+
+set description [ad_quotehtml $description]
+
+set terms [db_list_of_lists select_terms_for_select_widget {}]
+set terms [linsert $terms 0 {All -1}]
+
+form create term_form
+
+element create term_form term_id \
+ -label [_ dotlrn.Term] \
+ -datatype integer \
+ -widget select \
+ -options $terms \
+ -html {onChange document.term_form.submit()} \
+ -value $term_id
+
+element create term_form class_key \
+ -label "[_ dotlrn.Class_Key]" \
+ -datatype text \
+ -widget hidden \
+ -value $class_key
+
+if {[form is_valid term_form]} {
+ form get_values term_form term_id class_key
+}
+
+set query select_class_instances
+if {$term_id == -1} {
+ set query select_all_class_instances
+}
+
+db_multirow class_instances $query {}
+
+set can_instantiate [dotlrn_class::can_instantiate]
+
+set context_bar [list [list classes [parameter::get -localize -parameter classes_pretty_plural]] $pretty_name]
+set referer "[ns_conn url]?[ns_conn query]"
+
+# Used by some en_US messages on the adp page
+set classes_pretty_name [parameter::get -localize -parameter classes_pretty_name]
+set class_instances_pretty_name [parameter::get -localize -parameter class_instances_pretty_name]
+set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/class.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/class.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+ select pretty_name,
+ description,
+ supertype
+ from dotlrn_classes_full
+ where class_key = :class_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.class_key = :class_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.class_key = :class_key
+ and dotlrn_class_instances_full.term_id = :term_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,110 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= [parameter::get -localize -parameter departments_pretty_name] %>:
+
+ |
+
+
+
+
+
+
+
+
+ <%= [parameter::get -localize -parameter departments_pretty_name] %> |
+ #dotlrn.class_name# |
+ <%= [parameter::get -localize -parameter class_instances_pretty_plural] %> |
+ #dotlrn.Actions# |
+
+
+
+
+
+
+
+
+
+
+
+ @classes.department_name@ |
+ @classes.pretty_name@ |
+ @classes.n_instances@ |
+
+
+
+ [
+ #dotlrn.new_class_instance#
+ ]
+
+
+ |
+
+
+
+
+
+
+
+ #dotlrn.no_classes#
+ |
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays dotLRN classes admin page
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-11-04
+ @version $Id: classes-chunk.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ classes:multirow
+}
+
+if {![exists_and_not_null department_key]} {
+ set department_key ""
+}
+
+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 [list [_ dotlrn.All] ""]]
+
+form create department_form
+
+element create department_form department_key \
+ -label [_ dotlrn.Department] \
+ -datatype text \
+ -widget select \
+ -options $departments \
+ -html {onChange document.department_form.submit()} \
+ -value $department_key
+
+if {[form is_valid department_form]} {
+ form get_values department_form department_key
+}
+
+if {![exists_and_not_null referer]} {
+ set referer "classes?[export_vars department_key]"
+}
+
+set query select_classes
+if {![empty_string_p $department_key]} {
+ set query select_classes_by_department
+}
+
+db_multirow classes $query {}
+
+set can_create [dotlrn_class::can_create]
+set can_instantiate [dotlrn_class::can_instantiate]
+
+# Used in the en_US versions of some of the messages in the adp
+set classes_pretty_name [parameter::get -localize -parameter classes_pretty_name]
+set classes_pretty_plural [parameter::get -localize -parameter classes_pretty_plural]
+set class_instances_pretty_name [parameter::get -localize -parameter class_instances_pretty_name]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+ select dotlrn_classes_full.class_key,
+ dotlrn_classes_full.pretty_name,
+ dotlrn_classes_full.description,
+ dotlrn_classes_full.department_key,
+ dotlrn_departments_full.pretty_name as department_name,
+ (select count(*)
+ from dotlrn_class_instances, dotlrn_communities_all
+ where dotlrn_class_instances.class_key = dotlrn_classes_full.class_key
+ and dotlrn_class_instances.class_instance_id = dotlrn_communities_all.community_id
+ and dotlrn_communities_all.archived_p = 'f') as n_instances
+ from dotlrn_classes_full,
+ dotlrn_departments_full
+ where dotlrn_classes_full.department_key = dotlrn_departments_full.department_key
+ order by lower(dotlrn_departments_full.pretty_name),
+ lower(dotlrn_classes_full.pretty_name),
+ dotlrn_classes_full.class_key
+
+
+
+
+
+
+ select dotlrn_classes_full.class_key,
+ dotlrn_classes_full.pretty_name,
+ dotlrn_classes_full.description,
+ dotlrn_classes_full.department_key,
+ dotlrn_departments_full.pretty_name as department_name,
+ (select count(*)
+ from dotlrn_class_instances, dotlrn_communities_all
+ where dotlrn_class_instances.class_key = dotlrn_classes_full.class_key
+ and dotlrn_class_instances.class_instance_id = dotlrn_communities_all.community_id
+ and dotlrn_communities_all.archived_p = 'f') as n_instances
+ from dotlrn_classes_full,
+ dotlrn_departments_full
+ where dotlrn_classes_full.department_key = :department_key
+ and dotlrn_classes_full.department_key = dotlrn_departments_full.department_key
+ order by lower(dotlrn_classes_full.pretty_name), dotlrn_classes_full.class_key
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/classes.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/classes.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/classes.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/classes.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays dotLRN classes admin page
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-11-04
+ @version $Id: classes.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+set title [parameter::get -localize -parameter classes_pretty_plural]
+set context_bar $title
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/club-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,26 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+add_club.pretty_name
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/club-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,74 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ create a new club - input form
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-12-03
+ @version $Id: club-new.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {referer "clubs"}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+form create add_club
+
+element create add_club pretty_name \
+ -label "[_ dotlrn.Name]" \
+ -datatype text \
+ -widget text \
+ -html {size 60 maxlength 100}
+
+element create add_club description \
+ -label "[_ dotlrn.Description]" \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -optional
+
+element create add_club join_policy \
+ -label "[_ dotlrn.Join_Policy]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.Open] open] [list "[_ dotlrn.Needs_Approval]" "needs approval"] [list [_ dotlrn.Closed] closed]]
+
+element create add_club referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid add_club]} {
+ form get_values add_club \
+ pretty_name description join_policy referer
+
+ set key [dotlrn_club::new \
+ -description $description \
+ -pretty_name $pretty_name \
+ -join_policy $join_policy]
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+set clubs_pretty_name [parameter::get -localize -parameter clubs_pretty_name]
+set title "[_ dotlrn.new_community]"
+set context_bar [list [list clubs [parameter::get -localize -parameter clubs_pretty_plural]] $title]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/club-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_communities.pretty_name,
+ dotlrn_communities.description,
+ dotlrn_community.url(:club_id) as url
+ from dotlrn_communities
+ where dotlrn_communities.community_id = :club_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/club-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_communities.pretty_name,
+ dotlrn_communities.description,
+ dotlrn_community__url(:club_id) as url
+ from dotlrn_communities
+ where dotlrn_communities.community_id = :club_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/club.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,29 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@pretty_name@
+@context_bar@
+
+@pretty_name@ - @description@
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/club.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/club.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/club.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/club.tcl
+
+ad_page_contract {
+ displays single dotLRN club page
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-12-03
+ @version $Id: club.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ club_id:naturalnum,notnull
+} -errors {
+ club_id:naturalnum,notnull {must provide a valid club_id}
+} -properties {
+ context_bar:onevalue
+ pretty_name:onevalue
+ description:onevalue
+}
+
+db_1row select_club {}
+
+set description [ad_quotehtml $description]
+
+set context_bar [list [list clubs [parameter::get -localize -parameter clubs_pretty_plural]] $pretty_name]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/clubs.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/clubs.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/clubs.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,100 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
+
+
+
+
+
+ #dotlrn.community_header_name# |
+ #dotlrn.Description# |
+ #dotlrn.Members# |
+ #dotlrn.Actions# |
+
+
+
+
+
+
+
+
+
+
+
+
+ @clubs.pretty_name@ |
+ @clubs.description@ |
+ @clubs.n_members@ |
+
+
+
+ #dotlrn.administer_link#
+
+
+ |
+
+
+
+
+
+
+
+
+ #dotlrn.no_communities#
+ |
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/clubs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/clubs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/clubs.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/clubs.tcl
+
+ad_page_contract {
+ displays dotLRN clubs admin page
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-12-03
+ @version $Id: clubs.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+ clubs:multirow
+}
+
+set title [parameter::get -localize -parameter clubs_pretty_plural]
+set context_bar [list $title]
+
+db_multirow clubs select_clubs {} {
+ set description [ad_quotehtml $description]
+}
+
+# Some of the en_US messages in the adp use these variables
+set clubs_pretty_name [parameter::get -localize -parameter clubs_pretty_name]
+set clubs_pretty_plural [parameter::get -localize -parameter clubs_pretty_plural]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/clubs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/clubs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/clubs.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ select dotlrn_clubs_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_clubs_full.club_id) as n_members
+ from dotlrn_clubs_full
+ order by dotlrn_clubs_full.pretty_name,
+ dotlrn_clubs_full.description
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/cockpit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/cockpit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/cockpit.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,209 @@
+
+<% set user_id [ad_maybe_redirect_for_registration] %>
+<% permission::require_permission -object_id $user_id -privilege admin %>
+#dotlrn.Administration_Cockpit#
+
+
+
+
+#dotlrn.Total_count# @count@
+ |
+
+
+@admin_pretty_name@
+
+Packages
+
+Site Structure
+
+
+
+ |
+
+
+Documentation
+
+User Managment
+
+User Monitoring
+
+System Monitor
+
+
+
+ |
+
+
+ |
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,117 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Figure out if ds and monitoring exists and lists the active users
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.d)
+ @creation-date 2004-08-09
+ @version $Id: cockpit.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+}
+
+set admin_pretty_name [parameter::get -localize -parameter dotlrn_admin_pretty_name]
+
+# Does Developer support exists
+set ds_exists_p 0
+set ds_url "/ds/"
+
+if { [site_node::exists_p -url "/ds"] } {
+ set ds_exists_p 1
+} else {
+ set url [site_node::get_package_url -package_key "acs-developer-support"]
+ if { $url != "" } {
+ set ds_exists_p 1
+ }
+}
+
+# Does monitoring exists
+set monitor_exists_p 0
+set monitor_url "/monitor/"
+
+if { [site_node::exists_p -url "/monitor"] } {
+ set monitor_exists_p 1
+} else {
+ set monitor_url [site_node::get_package_url -package_key "monitoring"]
+ if { $monitor_url != "" } {
+ set monitor_exists_p 1
+ }
+}
+
+# Who is currently online
+set whos_online_interval [whos_online::interval]
+
+template::list::create \
+ -name online_users \
+ -multirow online_users \
+ -elements {
+ name {
+ label "[_ dotlrn.Name]"
+ html { align left }
+ link_url_col url
+ }
+ online_time_pretty {
+ label "[_ dotlrn.Minutes]"
+ html { align right }
+ }
+ username {
+ label "[_ dotlrn.Email_1]"
+ link_url_col email
+ html { align left nowrap }
+ }
+ user_id {
+ label "[_ dotlrn.User_ID_1]"
+ link_url_col id_url
+ html { align right }
+ }
+ }
+
+
+set users [list]
+
+set count 0
+
+foreach user_id [whos_online::user_ids] {
+ acs_user::get -user_id $user_id -array user
+
+ set first_request_minutes [expr [whos_online::seconds_since_first_request $user_id] / 60]
+ lappend users [list \
+ "$user(first_names) $user(last_name)" \
+ [acs_community_member_url -user_id $user_id] \
+ "$first_request_minutes" \
+ "$user(username)" \
+ "mailto:$user(email)" \
+ "$user(user_id)" \
+ "/acs-admin/users/one?user_id=$user(user_id)" ]
+ incr count
+}
+
+
+set users [lsort -index 0 $users]
+
+multirow create online_users name url online_time_pretty username email user_id id_url
+
+foreach elm $users {
+ multirow append online_users \
+ [lindex $elm 0] \
+ [lindex $elm 1] \
+ [lindex $elm 2] \
+ [lindex $elm 3] \
+ [lindex $elm 4] \
+ [lindex $elm 5] \
+ [lindex $elm 6]
+}
+
+ad_return_template
\ No newline at end of file
Index: openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,31 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.lt_Add_community_name_Me#
+@context_bar@
+
+#dotlrn.Note#
+
+#dotlrn.lt_This_action_will_take_1#
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,117 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+ad_page_contract {
+ Add a members of one community to another
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-10
+ @param source_community_id The community_id for the source community. The members of the source community will be added to the target community the user selects.
+ @param referer The url for the administration page of the source community.
+ @version $Id: community-members-add-to-community.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ source_community_id:integer
+ referer
+} -properties {
+ context_bar:onevalue
+}
+
+
+set community_name [db_string select_community_info {}]
+set users [dotlrn_community::list_users $source_community_id]
+
+set context_bar [list [list $referer $community_name] "[_ dotlrn.lt_Add_Members_to_Anothe]"]
+
+form create select_community
+
+element create select_community source_community_id \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $source_community_id
+
+element create select_community referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+set communities [db_list_of_lists select_all_communities {
+ select dotlrn_communities.pretty_name,
+ dotlrn_communities.community_id
+ from dotlrn_communities
+ where dotlrn_communities.portal_id is not NULL
+ order by dotlrn_communities.pretty_name,
+ dotlrn_communities.community_id
+}]
+
+if {[llength $communities]} {
+ element create select_community community_id \
+ -label "[_ dotlrn.Add_users_to]" \
+ -datatype text \
+ -widget select \
+ -options "{{} {}} $communities"
+} else {
+ element create select_community community_id \
+ -label "[_ dotlrn.No_groups_to_add_to]" \
+ -datatype text \
+ -widget hidden \
+ -value ""
+}
+
+if {[form is_valid select_community]} {
+ form get_values select_community \
+ source_community_id community_id
+
+ if {![empty_string_p $community_id]} {
+ db_transaction {
+ foreach user $users {
+ set user_id [ns_set get $user user_id]
+ if {![dotlrn_community::member_p $community_id $user_id]} {
+ # now we know user isn't an approved member of the new community
+ if {![dotlrn_community::member_pending_p -community_id $community_id -user_id $user_id]} {
+
+ # they aren't awaiting approval either, so we can go ahead and create them
+ if {[catch {
+ # There is still a danger that a double
+ # click will cause a failure.
+ dotlrn_community::add_user $community_id $user_id
+ } errmsg]} {
+ if {[dotlrn_community::member_p $community_id $user_id]} {
+ # assume this was a double click
+ ad_returnredirect $referer
+ ad_script_abort
+ } else {
+ ns_log Error "community-members-add-to_community.tcl failed: $errmsg"
+ ReturnHeaders
+ ad_return_error "[_ dotlrn.lt_Error_adding_user_to_]" "[_ dotlrn.lt_An_error_occured_whil]"
+ }
+ }
+ } else {
+ # they are already there and awaiting approval, so just approve them.
+ dotlrn_community::membership_approve -user_id $user_id -community_id $community_id
+ }
+ }
+ }
+ }
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+set estimated_number_of_seconds [expr [llength $users] * 3]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select pretty_name
+ from dotlrn_communities
+ where community_id = :source_community_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-delete.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-delete.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,33 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@context_bar@
+
+@title@
+
+#dotlrn.lt_Are_you_sure_you_want# @pretty_name@?
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ delete an empty department
+
+ @author arjun (arjun@openforce.net)
+ @version $Id: department-delete.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {referer "departments"}
+ {department_key:notnull}
+ {pretty_name:notnull}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+set departments_pretty_name [parameter::get -localize -parameter departments_pretty_name]
+set title "[_ dotlrn.Delete_Empty]"
+set context_bar [list [list departments [parameter::get -localize -parameter departments_pretty_plural]] Delete]
+
+form create delete_department
+
+# this is lame, but the button hack is not ready yet
+set yes_label "[_ dotlrn.Yes_delete] $pretty_name"
+set no_label "[_ dotlrn.No_dont_delete_it]"
+
+element create delete_department no_button \
+ -label $no_label \
+ -datatype text \
+ -widget submit \
+ -value "1"
+
+element create delete_department yes_button \
+ -label $yes_label \
+ -datatype text \
+ -widget submit
+
+element create delete_department department_key \
+ -datatype text \
+ -widget hidden \
+ -value $department_key
+
+element create delete_department pretty_name \
+ -datatype text \
+ -widget hidden \
+ -value $pretty_name
+
+element create delete_department referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid delete_department]} {
+ form get_values delete_department department_key pretty_name referer no_button yes_button
+
+ if {[string equal $yes_button $yes_label]} {
+
+ db_transaction {
+ set subcomm_id [dotlrn_department::delete \
+ -department_key $department_key
+ ]
+ }
+ }
+
+ ad_returnredirect "$referer"
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-edit.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-edit.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,93 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ edit a department
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-03-14
+ @version $Id: department-edit.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ department_key:notnull
+ {referer "departments"}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+if {![db_0or1row select_department_info {}]} {
+ ad_return_complaint 1 "[_ dotlrn.Invalid] department_key $department_key"
+ ad_script_abort
+}
+
+set title "[_ dotlrn.Edit] [parameter::get -localize -parameter departments_pretty_name] $pretty_name"
+set context_bar [list [list departments [parameter::get -localize -parameter departments_pretty_plural]] [_ dotlrn.Edit]]
+
+form create edit_department
+
+element create edit_department department_key \
+ -label "[parameter::get -localize -parameter departments_pretty_name] [_ dotlrn.lt_Key_a_short_name_no_s]" \
+ -datatype text \
+ -widget hidden \
+ -value $department_key
+
+element create edit_department pretty_name \
+ -label "[_ dotlrn.Name]" \
+ -datatype text \
+ -widget text \
+ -html {size 60 maxlength 100}
+
+element create edit_department description \
+ -label "[_ dotlrn.Description]" \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -optional
+
+element create edit_department external_url \
+ -label "[_ dotlrn.External_URL]" \
+ -datatype text \
+ -widget text \
+ -html {size 60} \
+ -optional
+
+element create edit_department referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_request edit_department]} {
+ element set_properties edit_department pretty_name -value $pretty_name
+ element set_properties edit_department description -value $description
+ element set_properties edit_department external_url -value $external_url
+}
+
+if {[form is_valid edit_department]} {
+ form get_values edit_department \
+ department_key pretty_name description external_url referer
+
+ db_transaction {
+ db_dml update_department {}
+ db_dml update_community_type {}
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-edit.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ select pretty_name,
+ description,
+ external_url
+ from dotlrn_departments_full
+ where department_key = :department_key
+
+
+
+
+
+ update dotlrn_departments
+ set external_url = :external_url
+ where department_key = :department_key
+
+
+
+
+
+ update dotlrn_community_types
+ set pretty_name = :pretty_name,
+ description = :description
+ where community_type = :department_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+add_department.pretty_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ create a new department
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-01-20
+ @version $Id: department-new.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {referer "departments"}
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+}
+
+set title "[_ dotlrn.New] [parameter::get -localize -parameter departments_pretty_name]"
+set context_bar [list [list departments [parameter::get -localize -parameter departments_pretty_plural]] [_ dotlrn.New]]
+
+form create add_department
+
+element create add_department pretty_name \
+ -label "[_ dotlrn.Name]" \
+ -datatype text \
+ -widget text \
+ -html {size 60 maxlength 100}
+
+element create add_department description \
+ -label "[_ dotlrn.Description]" \
+ -datatype text \
+ -widget textarea \
+ -html {rows 5 cols 60 wrap soft} \
+ -optional
+
+element create add_department external_url \
+ -label "[_ dotlrn.External_URL]" \
+ -datatype text \
+ -widget text \
+ -html {size 60} \
+ -optional
+
+element create add_department referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid add_department]} {
+ form get_values add_department \
+ pretty_name description external_url referer
+
+ set department_key [dotlrn_department::new \
+ -pretty_name $pretty_name \
+ -description $description \
+ -external_url $external_url]
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,58 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@pretty_name@
+@context_bar@
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/department.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays single dotLRN class page
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-11-07
+ @version $Id: department.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {department_key ""}
+} -properties {
+ pretty_name:onevalue
+ external_url:onevalue
+ description:onevalue
+ classes:multirow
+}
+
+if {[empty_string_p $department_key]} {
+ ad_returnredirect "[dotlrn::get_admin_url]/classes"
+ ad_script_abort
+}
+
+# Get information about that class
+if {![db_0or1row select_departments_info {}]} {
+ ad_returnredirect departments
+ ad_script_abort
+}
+
+set description [ad_quotehtml $description]
+
+set context_bar [list [list departments [parameter::get -localize -parameter departments_pretty_plural]] $pretty_name]
+set referer "[ns_conn url]?[ns_conn query]"
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/department.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/department.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ select pretty_name,
+ description,
+ external_url
+ from dotlrn_departments_full
+ where department_key = :department_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/departments.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/departments.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/departments.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,108 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/departments.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/departments.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/departments.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays dotLRN departments admin page
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-20
+ @version $Id: departments.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+ departments:multirow
+}
+
+set title [parameter::get -localize -parameter departments_pretty_plural]
+set context_bar [parameter::get -localize -parameter departments_pretty_plural]
+set referer departments
+set can_create [dotlrn_class::can_create]
+set departments_pretty_name [parameter::get -localize -parameter departments_pretty_name]
+set departments_pretty_plural [parameter::get -localize -parameter departments_pretty_plural]
+set classes_pretty_name [parameter::get -localize -parameter classes_pretty_name]
+
+db_multirow departments select_departments {}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/departments.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/departments.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/departments.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select department_key,
+ pretty_name,
+ (select count(*)
+ from dotlrn_classes
+ where department_key = dotlrn_departments_full.department_key) as n_classes
+ from dotlrn_departments_full
+ order by pretty_name,
+ department_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admin-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admin-master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admin-master.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,30 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+ @title@
+ 1
+ @focus;noquote@
+ @context;noquote@
+ @context_bar;noquote@
+ @doc_type;noquote@
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,45 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Administrators#
+@context_bar@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays Administrators dotLRN admin page
+
+ @author Hector Amado (hr_amado@galileo.edu)
+ @creation-date 2004-06-28
+ @cvs-id $Id: dotlrn-admins.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+}
+
+set context_bar "[_ dotlrn.Administrators]"
+set referer [ns_conn url]
+
+set dotlrn_admins_group [db_string group_id_from_name "
+ select group_id from groups where group_name='dotlrn-admin'" -default ""]
+
+set admin_id [ad_verify_and_get_user_id]
+
+set elements [list user \
+ [list label "User" \
+ link_url_col user_url ] \
+ remove \
+ [list label "Remove" \
+ link_url_col remove_url \
+ display_template { } \
+ sub_class narrow ] \
+ ]
+
+set multirow_name dotlrn_admins
+set actions ""
+
+template::list::create \
+ -name dotlrn_admins \
+ -multirow $multirow_name \
+ -actions $actions \
+ -no_data "No dotlrn-admins." \
+ -elements $elements
+
+db_multirow \
+ -extend {
+ user
+ remove_url
+ user_url
+ no_auto_remove
+ } dotlrn_admins dotlrn_admins_select {} {
+ append user $last_name ", " $first_names " (" $email " )"
+ set remove_url [export_vars -base "admin-remove" {user_id}]
+ set user_url [export_vars -base "user" {user_id}]
+ if { $user_id == $admin_id } {
+ set no_auto_remove 0
+ } else {
+ set no_auto_remove 1
+ }
+ }
Index: openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/dotlrn-admins.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ select
+ registered_users.user_id,
+ registered_users.last_name,
+ registered_users.first_names,
+ registered_users.email
+ from
+ registered_users,
+ group_member_map
+ where
+ registered_users.user_id = group_member_map.member_id
+ AND
+ group_member_map.group_id = :dotlrn_admins_group
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,56 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.lt_Edit_Pre-approved_Ema#
+{#dotlrn.lt_Edit_Pre-approved_Ema#}
+
+
+ #dotlrn.lt_Email_suffixes_listed#
+
+
+
+ #dotlrn.the_format_of_email_domains#
+ *@openforce.net,*@dotlrn.openforce.net
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/edit-preapproved-emails.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,51 @@
+#
+# 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/admin/edit-preapproved-emails.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-03-05
+ @version $Id: edit-preapproved-emails.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {referer [dotlrn::get_admin_url]}
+} -properties {
+ context_bar:onevalue
+}
+
+form create edit_emails
+
+element create edit_emails emails \
+ -label "[_ dotlrn.lt_Pre-approved_Email_Se]" \
+ -datatype text \
+ -widget text \
+ -html {size 50} \
+ -value [parameter::get -parameter auto_dotlrn_user_email_patterns]
+
+element create edit_emails referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid edit_emails]} {
+ form get_values edit_emails \
+ emails referer
+
+ parameter::set_value -parameter auto_dotlrn_user_email_patterns -value $emails
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/guest-toggle.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/guest-toggle.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/guest-toggle.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/site-wide-admin-toggle.tcl
+
+ad_page_contract {
+ @author Caroline Meeks (caroline@meekshome.com)
+ @creation-date November 19, 2002
+ @version $Id: guest-toggle.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id
+ guest_p
+ {referer "users"}
+}
+
+# Update permissions
+dotlrn_privacy::set_user_guest_p \
+ -user_id $user_id \
+ -value $guest_p
+
+
+util_memoize_flush_regexp $user_id
+ad_returnredirect $referer
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/index.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,51 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+
+
+@admin_pretty_name@
+@context_bar@
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/index.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays main dotLRN admin page
+
+ @author Ben Adida (ben@openforce.net)
+ @creation-date 2001-11-04
+}
+
+set oacs_site_wide_admin_p [acs_user::site_wide_admin_p]
+
+set admin_pretty_name [parameter::get -localize -parameter dotlrn_admin_pretty_name]
+set context_bar {}
+
+# Some en_US messages reuse these configurable pretty names
+set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural]
+set clubs_pretty_plural [parameter::get -localize -parameter clubs_pretty_plural]
+
+set parameters_url [export_vars -base /shared/parameters { { package_id {[dotlrn::get_package_id]} } { return_url [ad_return_url] } }]
+
+set parameters_d_url [export_vars -base /shared/parameters { { package_id {[apm_package_id_from_key dotlrn-portlet]} } { return_url [ad_return_url] } }]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/need-term-note.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/need-term-note.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/need-term-note.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,23 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.you_need_to_create_terms_to_create_classes#
+
Index: openacs-4/packages/dotlrn-admin/www/admin/need-term-note.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/need-term-note.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/need-term-note.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,5 @@
+
+# Used by the en_US version of the message in the adp file
+set terms_url "terms"
+set terms_pretty_plural [_ dotlrn.terms]
+set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural]
Index: openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,63 @@
+ad_page_contract {
+ Updates the users password if password_1 matches password_2
+
+ @cvs-id $Id: password-update-2.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} {
+ user_id:integer,notnull
+ password_1:notnull
+ password_2:notnull
+ {return_url ""}
+
+} -validate {
+ confirm_password -requires {password_2:notnull} {
+ if {[empty_string_p $password_2]} {
+ ad_complain "[_ dotlrn.lt_You_need_to_confirm_t]"
+ }
+ }
+ new_password_match -requires {password_1:notnull password_2:notnull confirm_password} {
+ if {![string equal $password_1 $password_2]} {
+ ad_complain "[_ dotlrn.lt_Your_passwords_dont_m]"
+ }
+ }
+}
+
+ad_change_password $user_id $password_1
+
+
+set system_owner [ad_system_owner]
+set system_name [ad_system_name]
+
+set subject "[_ dotlrn.lt_Your_password_on_syst]"
+set change_password_url "[ad_url]/user/password-update?[export_vars {user_id {password_old $password_1}}]"
+set body "[_ dotlrn.lt_Please_follow_the_fol]"
+
+set email [acs_user::get_element -user_id $user_id -element email]
+
+# Send email
+if [catch {ns_sendmail $email $system_owner $subject $body} errmsg] {
+ ns_log Error "[_ dotlrn.lt_Error_sending_email_t]" $errmsg
+ ad_return_error \
+ "[_ dotlrn.Error_sending_mail]" \
+ "[_ dotlrn.lt_There_was_an_error_se]"
+} else {
+
+ set system_name [ad_system_name]
+ set admin_subject "[_ dotlrn.lt_The_following_email_w]"
+ set admin_message "[_ dotlrn.lt_The_following_email_w_1]"
+
+
+ if [catch {ns_sendmail $system_owner $system_owner $admin_subject $admin_message} errmsg] {
+
+ ns_log Error "Error sending email from password-update-2.tcl" $errmsg
+ ad_return_error \
+ "[_ dotlrn.Error_sending_mail]" \
+ "[_ dotlrn.lt_There_was_an_error_se_1]"
+ }
+}
+
+
+if {[empty_string_p $return_url]} {
+ set return_url "user?user_id=$user_id"
+}
+
+ad_returnredirect $return_url
Index: openacs-4/packages/dotlrn-admin/www/admin/password-update.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/password-update.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/password-update.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,29 @@
+
+#dotlrn.Update_Password#
+@context_bar@
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/password-update.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/password-update.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/password-update.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,18 @@
+ad_page_contract {
+ Let's the admin change a user's password.
+
+
+ @version $Id: password-update.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} {
+ {user_id:integer}
+ {return_url ""}
+ {password_old ""}
+}
+
+db_1row user_information {}
+
+set context_bar [list [list users Users] [list "user.tcl?user_id=$user_id" "$first_names $last_name"] "[_ dotlrn.Update_Password]"]
+
+set site_link [ad_site_home_link]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/password-update.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/password-update.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/password-update.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+ select first_names,
+ last_name,
+ email,
+ url
+ from cc_users
+ where user_id = :user_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/portal-templates.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/portal-templates.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/portal-templates.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,45 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/portal-templates.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/portal-templates.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/portal-templates.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays dotLRN portal templates admin page
+
+ @author arjun (arjun@openforce.net)
+ @version $Id: portal-templates.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ title:onevalue
+ context_bar:onevalue
+ departments:multirow
+}
+
+set title [_ dotlrn.Templates]
+set context_bar $title
+set url "[portal::mount_point]admin"
+set referer [ad_conn url]
+
+db_multirow templates select_portal_templates {} {
+ set name [lang::util::localize $name]
+}
+
Index: openacs-4/packages/dotlrn-admin/www/admin/portal-templates.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/portal-templates.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/portal-templates.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select dptm.portal_id, p.name
+ from portals p, dotlrn_portal_types_map dptm
+ where p.portal_id = dptm.portal_id
+ order by p.name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/site-wide-admin-toggle.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date Jan 12, 2002
+ @version $Id: site-wide-admin-toggle.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id
+ value
+ {referer "users"}
+}
+
+if { ![acs_user::site_wide_admin_p] } {
+ ns_log notice "user has tried to site-wide-admin-toggle without permission"
+ ad_return_forbidden \
+ "Permission Denied" \
+ "
+ You don't have permission to see this page.
+
"
+}
+
+if {[string equal $value "grant"] == 1} {
+ ad_permission_grant $user_id [acs_magic_object "security_context_root"] "admin"
+} elseif {[string equal $value "revoke"] == 1} {
+ ad_permission_revoke $user_id [acs_magic_object "security_context_root"] "admin"
+}
+
+util_memoize_flush_regexp $user_id
+ad_returnredirect $referer
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term-edit.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Edit_Term#
+@context_bar@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,76 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+
+ edit a term
+
+ @author yon (yon@openforce.net)
+ @author Don Baccus (dhogaza@pacifier.com)
+
+ @creation-date 2002-03-14
+ @version $Id: term-edit.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+
+} -query {
+ term_id:integer,notnull
+} -properties {
+ context_bar:onevalue
+}
+
+if {![db_0or1row select_term_info {}]} {
+ ad_return_complaint 1 "[_ dotlrn.Invalid] term_key $term_id"
+ ad_script_abort
+}
+
+set referer "term?[export_vars {term_id}]"
+set context_bar [list [list terms [_ dotlrn.Terms]] [list $referer "$term_name $term_year"] [_ dotlrn.Edit]]
+
+ad_form -name edit_term -export term_pretty_name -select_query_name select_term_info -form {
+
+ term_id:key
+
+ {term_name:text {label "Term (e.g. Spring, Fall)"}
+ {html {size 30}}}
+
+ {term_year:text {label "Year (e.g. 2003, 2003/2004)"}
+ {html {size 9 maxlength 9}}}
+
+ {start_date:date {label "Start Date"}
+ {format {MONTH DD YYYY}}}
+
+ {end_date:date {label "End Date"}
+ {format {MONTH DD YYYY}}}
+
+} -validate {
+ {start_date
+ { [template::util::date::compare $start_date $end_date] <= 0 }
+ "The term must start before it ends"
+ }
+} -edit_data {
+
+ dotlrn_term::edit \
+ -term_id $term_id \
+ -term_name $term_name \
+ -term_year [string trim $term_year] \
+ -start_date $start_date \
+ -end_date $end_date
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term-edit.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ select term_name,
+ term_year,
+ to_char(start_date, 'YYYY MM DD') as start_date,
+ to_char(end_date, 'YYYY MM DD') as end_date
+ from dotlrn_terms
+ where term_id = :term_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,29 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.New_Term#
+@context_bar@
+add_term.term_name
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ create a new term - input form
+
+ @author yon (yon@openforce.net)
+ @creation-date 2001-12-13
+ @version $Id: term-new.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {referer "terms"}
+} -properties {
+ context_bar:onevalue
+}
+
+ad_form -name add_term -export referer -form {
+
+ {term_name:text {label "Term (e.g. Spring, Fall)"} {maxlength 20}
+ {html {size 30}}}
+
+ {start_date:date
+ {label "Start Date"}
+ {format {MONTH DD YYYY}}}
+
+ {end_date:date
+ {label "End Date"}
+ {format {MONTH DD YYYY}}}
+} -validate {
+ {start_date
+ { [template::util::date::compare $start_date $end_date] <= 0 }
+ "The term must start before it ends"
+ }
+} -on_submit {
+
+ set term_year [dotlrn_term::start_end_dates_to_term_year \
+ -start_date $start_date \
+ -end_date $end_date
+ ]
+
+# error [string bytelength $term_name]
+
+ dotlrn_term::new \
+ -term_name $term_name \
+ -term_year $term_year \
+ -start_date $start_date \
+ -end_date $end_date
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+set context_bar [list [list terms [_ dotlrn.Terms]] [_ dotlrn.New]]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,134 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@title@
+@context_bar@
+
+
+
+
+ -
+ #dotlrn.Name#
+ @term_name@
+
+
+ -
+ #dotlrn.Year#
+ @term_year@
+
+
+ -
+ #dotlrn.Start_date#
+ @start_date@
+
+
+ -
+ #dotlrn.End_date#
+ @end_date@
+
+
+
+
+ -
+ #dotlrn.Edit# #dotlrn.term_properties#
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= [parameter::get -localize -parameter departments_pretty_name] %>:
+
+ |
+
+
+ #dotlrn.term#:
+
+ |
+
+
+
+
+
+
+
+ <%= [parameter::get -localize -parameter departments_pretty_name] %> |
+ <%= [parameter::get -localize -parameter classes_pretty_name] %> |
+
+ #dotlrn.term# |
+
+ <%= [parameter::get -localize -parameter class_instances_pretty_name] %> |
+ #dotlrn.members# |
+ #dotlrn.actions# |
+
+
+
+
+
+
+
+
+
+
+
+
+ @classes.department_name@ |
+ @classes.class_name@ |
+
+ @classes.term_name@ @classes.term_year@ |
+
+ @classes.pretty_name@ |
+ @classes.n_members@ |
+
+
+
+ #dotlrn.administer_link#
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #dotlrn.no_class_instances#
+ |
+ |
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/term.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,122 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays class instances of a term
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-03-07
+ @version $Id: term.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ term_id:integer,notnull
+ {department_key ""}
+} -properties {
+ classes:multirow
+}
+
+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 ""}]
+
+form create department_form
+
+element create department_form department_key \
+ -label "[_ dotlrn.Department]" \
+ -datatype text \
+ -widget select \
+ -options $departments \
+ -html {onChange document.department_form.submit()} \
+ -value $department_key
+
+element create department_form term_id \
+ -label "[_ dotlrn.Term_ID]" \
+ -datatype integer \
+ -widget hidden \
+ -value $term_id
+
+if {[form is_valid department_form]} {
+ form get_values department_form department_key term_id
+}
+
+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 term_form
+
+element create term_form term_id \
+ -label "[_ dotlrn.Term]" \
+ -datatype integer \
+ -widget select \
+ -options $terms \
+ -html {onChange document.term_form.submit()} \
+ -value $term_id
+
+element create term_form department_key \
+ -label "[_ dotlrn.Department]" \
+ -datatype text \
+ -widget hidden \
+ -value $department_key
+
+if {[form is_valid term_form]} {
+ form get_values term_form term_id department_key
+
+ if {$term_id != -1} {
+ ad_returnredirect "term?[export_vars {term_id department_key}]"
+ }
+}
+
+if {![exists_and_not_null referer]} {
+ set referer "terms"
+}
+
+set query "select_classes"
+if {$term_id == -1} {
+ set query "select_all_classes"
+}
+if {![empty_string_p $department_key]} {
+ append query "_by_department"
+}
+
+db_multirow classes $query {}
+
+if {$term_id == -1} {
+ set title "[_ dotlrn.All_Terms]"
+ set context_bar [list [list terms [_ dotlrn.Terms]] "[_ dotlrn.All_Terms]"]
+} else {
+ if {[db_0or1row select_term_info {}]} {
+ set title "$term_name $term_year ($start_date - $end_date)"
+ set context_bar [list [list terms [_ dotlrn.Terms]] "$term_name $term_year"]
+ } else {
+ set title "[_ dotlrn.Unknown_Term]"
+ set context_bar [list [list terms [_ dotlrn.Terms]] "[_ dotlrn.Unknown_Term]"]
+ }
+}
+
+# Used by the en_US version of the no_class_instances message in the adp
+set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/term.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/term.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+ select term_name,
+ term_year,
+ to_char(start_date, 'Mon DD YYYY') as start_date,
+ to_char(end_date, 'Mon DD YYYY') as end_date
+ from dotlrn_terms
+ where term_id = :term_id
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.term_id = :term_id
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.class_name,
+ dotlrn_class_instances_full.class_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.term_id = :term_id
+ and dotlrn_class_instances_full.department_key = :department_key
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.class_name,
+ dotlrn_class_instances_full.class_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.class_name,
+ dotlrn_class_instances_full.class_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ (select count(*)
+ from dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members
+ from dotlrn_class_instances_full
+ where dotlrn_class_instances_full.department_key = :department_key
+ order by dotlrn_class_instances_full.department_name,
+ dotlrn_class_instances_full.department_key,
+ dotlrn_class_instances_full.class_name,
+ dotlrn_class_instances_full.class_key,
+ dotlrn_class_instances_full.pretty_name,
+ dotlrn_class_instances_full.community_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/terms.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/terms.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/terms.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,96 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Terms#
+@context_bar@
+
+
+
+
+
+
+
+
+
+ #dotlrn.Term# |
+ #dotlrn.Start_Date# |
+ #dotlrn.End_Date# |
+ #dotlrn.Classes# |
+
+
+
+
+
+
+
+
+
+
+
+
+ @terms.term_name@ @terms.term_year@ |
+ @terms.start_date_pretty@ |
+ @terms.end_date_pretty@ |
+ @terms.n_classes@ |
+
+
+
+
+
+
+
+
+ #dotlrn.No_Terms#
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/terms.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/terms.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/terms.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/terms.tcl
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date Dec 13, 2001
+ @version $Id: terms.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ context_bar:onevalue
+ terms:multirow
+}
+
+set context_bar "[_ dotlrn.Terms]"
+
+db_multirow -extend { start_date_pretty end_date_pretty } terms select_terms {} {
+ set start_date_pretty [lc_time_fmt $start_date_ansi "%q"]
+ set end_date_pretty [lc_time_fmt $end_date_ansi "%q"]
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/terms.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/terms.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/terms.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ select dotlrn_terms.term_id,
+ dotlrn_terms.term_name,
+ dotlrn_terms.term_year,
+ to_char(dotlrn_terms.start_date, 'YYYY-MM-DD') as start_date_ansi,
+ to_char(dotlrn_terms.end_date, 'YYYY-MM-DD') as end_date_ansi,
+ (select count(*)
+ from dotlrn_class_instances
+ where dotlrn_class_instances.term_id = dotlrn_terms.term_id) as n_classes
+ from dotlrn_terms
+ order by dotlrn_terms.start_date
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Unarchive a Community
+
+ @author Nima Mazloumi
+ @creation-date 2004-04-25
+ @version $Id: unarchive.tcl
+} -query {
+ {community_id ""}
+ {referer "."}
+}
+
+if { [exists_and_not_null community_id] } {
+ set is_archived_p [db_0or1row select_is_archived "select archived_p from dotlrn_communities_all where community_id = :community_id"]
+ if { $is_archived_p } {
+ ns_log Notice "Unarchiving $community_id"
+ dotlrn_community::unarchive -community_id $community_id
+ } else {
+ ad_return -code error "community must be archived to get unarchived"
+ }
+} else {
+ ad_return -code error "community id expected to unarchive a community"
+}
+ad_returnredirect $referer
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_users.id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_users.type,
+ dotlrn_privacy.guest_p(:user_id) as guest_p
+ from dotlrn_users
+ where dotlrn_users.user_id = :user_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_users.id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_users.type,
+ dotlrn_privacy__guest_p(:user_id) as guest_p
+ from dotlrn_users
+ where dotlrn_users.user_id = :user_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit-verify.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit-verify.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit-verify.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Edit_a_User#
+@context_bar@
+
+#dotlrn.Youre_editing# @first_names@ @last_name@.
+
+
+
+#dotlrn.lt_Youre_asking_to_chang#
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Edit_a_User#
+@context_bar@
+
+#dotlrn.Youre_editing# @first_names@ @last_name@.
+
+#dotlrn.Note_if_you_make#
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,105 @@
+
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Edit a dotLRN user
+
+ @author Ben Adida (ben@openforce.net)
+ @author yon (yon@openforce.net)
+ @creation-date 2001-12-10
+ @version $Id: user-edit.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {return_url "[dotlrn::get_admin_url]/users"}
+ user_id
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.Edit]]
+set dotlrn_package_id [dotlrn::get_package_id]
+
+db_1row select_user_info {}
+set can_browse_p [dotlrn::user_can_browse_p -user_id $user_id]
+
+form create edit_user
+
+element create edit_user user_id \
+ -label "[_ dotlrn.User_ID_1]" \
+ -datatype integer \
+ -widget hidden \
+ -value $user_id
+
+element create edit_user id \
+ -label [_ dotlrn.ID_1] \
+ -datatype text \
+ -widget text \
+ -html {size 30} \
+ -value $id \
+ -optional
+
+element create edit_user type \
+ -label "[_ dotlrn.User_Type]" \
+ -datatype text \
+ -widget select \
+ -options [dotlrn::get_user_types_as_options] \
+ -value $type
+
+element create edit_user can_browse_p \
+ -label "[_ dotlrn.Access_Level]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.Full] 1] [list [_ dotlrn.Limited] 0]] \
+ -value $can_browse_p
+
+element create edit_user guest_p \
+ -label "[_ dotlrn.Guest_1]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.No] f] [list [_ dotlrn.Yes] t]] \
+ -value $guest_p
+
+element create edit_user return_url \
+ -label "[_ dotlrn.Return_URL]" \
+ -datatype text \
+ -widget hidden \
+ -value $return_url
+
+if {[form is_valid edit_user]} {
+ form get_values edit_user \
+ user_id id type can_browse_p guest_p return_url
+
+ db_transaction {
+ # remove the user
+ dotlrn::user_remove -user_id $user_id
+
+ # add the user
+ dotlrn::user_add \
+ -id $id \
+ -type $type \
+ -can_browse\=$can_browse_p \
+ -user_id $user_id
+
+ # Update permissions
+ dotlrn_privacy::set_user_guest_p \
+ -user_id $user_id \
+ -value $guest_p
+ }
+
+ # redirect
+ ad_returnredirect $return_url
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-edit.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ update dotlrn_user_profile_rels
+ set id = :id
+ where rel_id = (select rel_id
+ from dotlrn_users
+ where user_id = :user_id)
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-new-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-new-2.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,32 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Add_a_User#
+@context_bar@
+
+#dotlrn.Youve_chosen_to_add# @first_names@ @last_name@.
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,140 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Create a dotLRN user
+
+ @author Ben Adida (ben@openforce.net)
+ @creation-date 2001-11-04
+ @version $Id: user-new-2.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ user_id
+ {referer "[dotlrn::get_admin_url]/users"}
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.New]]
+
+db_1row select_user_info {
+ select email,
+ first_names,
+ last_name
+ from registered_users
+ where user_id = :user_id
+}
+
+form create add_user
+
+element create add_user user_id \
+ -label "[_ dotlrn.User_ID_1]" \
+ -datatype integer \
+ -widget hidden \
+ -value $user_id
+
+element create add_user id \
+ -label [_ dotlrn.ID_1] \
+ -datatype text \
+ -widget text \
+ -html {size 30} \
+ -value $email \
+ -optional
+
+element create add_user type \
+ -label "[_ dotlrn.User_Type]" \
+ -datatype text \
+ -widget select \
+ -options [dotlrn::get_user_types_as_options]
+
+element create add_user can_browse_p \
+ -label "[_ dotlrn.Access_Level]" \
+ -datatype text \
+ -widget select \
+ -options [list [list "[_ dotlrn.Full_Access]" 1] [list "[_ dotlrn.Limited_Access]" 0]]
+
+element create add_user guest_p \
+ -label "[_ dotlrn.Guest_1]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.No] f] [list [_ dotlrn.Yes] t]]
+
+element create add_user referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+
+if {[form is_valid add_user]} {
+
+ form get_values add_user \
+ user_id id type can_browse_p guest_p referer
+
+ set subject "Your [ad_system_name] membership has been approved"
+ set message "Your [ad_system_name] membership has been approved. Please return to [ad_url] to log into [ad_system_name]."
+
+ set email_from [ad_parameter -package_id [ad_acs_kernel_id] SystemOwner]
+
+ db_transaction {
+
+ dotlrn::user_add \
+ -id $id \
+ -type $type \
+ -can_browse\=$can_browse_p \
+ -user_id $user_id
+
+ dotlrn_privacy::set_user_guest_p \
+ -user_id $user_id \
+ -value $guest_p
+ }
+
+
+ if [catch {ns_sendmail $email $email_from $subject $message} errmsg] {
+
+ ns_log Error "Error sending email from user-new-2.tcl" $errmsg
+ ad_return_error \
+ "Error sending mail" \
+ "There was an error sending email to $email."
+ } else {
+
+ set admin_subject "The following email was just sent from [ad_system_name]"
+
+ set admin_message "The following email was just sent from [ad_system_name]
+
+Sent by: $email_from
+Sent to: $email
+Subject: $subject
+Message: $message"
+
+
+ if [catch {ns_sendmail $email_from $email_from $admin_subject $admin_message} errmsg] {
+
+ ns_log Error "Error sending email from user-new-2.tcl" $errmsg
+ ad_return_error \
+ "Error sending mail" \
+ "There was an error sending email to $email."
+ }
+
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.New]]
+
+ad_return_template
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-new.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Add_a_User#
+@context_bar@
+
+#dotlrn.lt_The_results_of_your_s#
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-new.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Search for a new user for dotLRN
+
+ @author Ben Adida (ben@openforce.net)
+ @creation-date 2001-11-04
+} -query {
+ {referer "users"}
+ search_text
+}
+
+# Just search
+db_multirow users select_users {}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.New]]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-new.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-new.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ select user_id,
+ first_names,
+ last_name,
+ email
+ from registered_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_users)
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke-error.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke-error.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke-error.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,17 @@
+
+#dotlrn.lt_Error_Nuking_first_na#
+@context_bar@
+
+#dotlrn.Sorry#
+
+
+
+#dotlrn.lt_Well_we_tried_to_nuke#
+
+
+
+@error_msg@
+
+
+
+#dotlrn.lt_Return_to_where_you_w#
Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ acs.remove_user(:user_id);
+ end;
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+
+ postgresql7.1
+
+
+
+ select acs__remove_user(:user_id);
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,11 @@
+
+#dotlrn.lt_Nuke_first_names_last#
+@context_bar@
+
+#dotlrn.Confirmation#
+
+
+
+#dotlrn.lt_Please_confirm_that_y#
+
+
\ No newline at end of file
Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,54 @@
+ad_page_contract {
+
+ Try to delete a pending user from the database.
+
+ @author Andrew Grumet (aegrumet@alum.mit.edu)
+ @creation-date 2002-08-08
+ @version $Id: user-nuke.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} {
+ user_id:integer,notnull
+ {referer "[dotlrn::get_admin_url]/users"}
+}
+
+db_1row select_user_info {
+ select email,
+ first_names,
+ last_name
+ from cc_users
+ where user_id = :user_id
+}
+
+form create confirm_delete
+
+element create confirm_delete user_id \
+ -label "[_ dotlrn.User_ID_1]" \
+ -datatype integer \
+ -widget hidden \
+ -value $user_id
+
+element create confirm_delete confirmed_p \
+ -label "[_ dotlrn.Are_you_sure]" \
+ -datatype text \
+ -widget radio \
+ -options [list [list [_ dotlrn.No] f] [list [_ dotlrn.Yes] t]] \
+ -value f
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.Nuke]]
+
+if [form is_valid confirm_delete] {
+ form get_values confirm_delete user_id confirmed_p
+ if [string equal $confirmed_p t] {
+ if [catch { dotlrn::remove_user_completely -user_id $user_id } errMsg ] {
+ set error_msg $errMsg
+ ad_return_template user-nuke-error
+ } else {
+ # Nuke was successful.
+ ad_returnredirect $referer
+ ad_script_abort
+ }
+ } else {
+ # Nuke cancelled
+ ad_returnredirect $referer
+ ad_script_abort
+ }
+}
Index: openacs-4/packages/dotlrn-admin/www/admin/user-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,78 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_users.*, guest_p
+ from dotlrn_users, dotlrn_guest_status
+ where dotlrn_users.user_id = :user_id
+ and dotlrn_guest_status.user_id(+) = dotlrn_users.user_id
+
+
+
+
+
+ select cr_items.live_revision as revision_id,
+ nvl(cr_revisions.title, 'view this portrait') as portrait_title
+ from acs_rels,
+ cr_items,
+ cr_revisions
+ where acs_rels.object_id_two = cr_items.item_id
+ and cr_items.live_revision = cr_revisions.revision_id
+ and acs_rels.object_id_one = :user_id
+ and acs_rels.rel_type = 'user_portrait_rel'
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.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.*,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_clubs_full,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.community_id = dotlrn_clubs_full.club_id
+ order by dotlrn_clubs_full.pretty_name,
+ dotlrn_clubs_full.community_key
+
+
+
+
+
+ select dotlrn_communities.*,
+ dotlrn_community.url(dotlrn_communities.community_id) as url,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_communities,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.community_id = dotlrn_communities.community_id
+ and dotlrn_communities.community_type = 'dotlrn_community'
+ order by dotlrn_communities.pretty_name,
+ dotlrn_communities.community_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,78 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_users.*, guest_p
+ from dotlrn_users left outer join dotlrn_guest_status
+ on dotlrn_guest_status.user_id = dotlrn_users.user_id
+ where dotlrn_users.user_id = :user_id
+
+
+
+
+
+ select cr_items.live_revision as revision_id,
+ coalesce(cr_revisions.title, 'view this portrait') as portrait_title
+ from acs_rels,
+ cr_items,
+ cr_revisions
+ where acs_rels.object_id_two = cr_items.item_id
+ and cr_items.live_revision = cr_revisions.revision_id
+ and acs_rels.object_id_one = :user_id
+ and acs_rels.rel_type = 'user_portrait_rel'
+
+
+
+
+
+ select dotlrn_class_instances_full.*,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_class_instances_full,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.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.*,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_clubs_full,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.community_id = dotlrn_clubs_full.club_id
+ order by dotlrn_clubs_full.pretty_name,
+ dotlrn_clubs_full.community_key
+
+
+
+
+
+ select dotlrn_communities.*,
+ dotlrn_community__url(dotlrn_communities.community_id) as url,
+ dotlrn_member_rels_approved.rel_type,
+ dotlrn_member_rels_approved.role,
+ '' as role_pretty_name
+ from dotlrn_communities,
+ dotlrn_member_rels_approved
+ where dotlrn_member_rels_approved.user_id = :user_id
+ and dotlrn_member_rels_approved.community_id = dotlrn_communities.community_id
+ and dotlrn_communities.community_type = 'dotlrn_community'
+ order by dotlrn_communities.pretty_name,
+ dotlrn_communities.community_key
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,201 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+@first_names@ @last_name@
+@context_bar@
+
+#dotlrn.General_Information#
+
+
+
+ -
+ #dotlrn.Person_name#
+ @first_names@ @last_name@
+
+ [ #dotlrn.Edit# ]
+
+
+
+ -
+ #dotlrn.Email#
+ @email@
+
+ [ #dotlrn.Edit# ]
+
+
+
+ -
+ #dotlrn.Screen_name#
+ @screen_name@
+
+ [ #dotlrn.Edit# ]
+
+
+
+ -
+ #dotlrn.User_ID#
+ @user_id@
+
+
+ -
+ #dotlrn.Registration_date#
+ @registration_date@
+
+
+
+ -
+ #dotlrn.Last_Visit#
+ @last_visit@
+
+
+
+ -
+ #dotlrn.lt_Last_Visit_None_#: @remove_user_url;noquote@
+
+
+
+
+ -
+ #dotlrn.Portrait# @portrait_title@
+
+
+
+ -
+ #dotlrn.Member_state#
+ @member_state@
+
+ @change_state_links;noquote@
+
+
+
+
+
+#dotlrn.dotLRN_Information#
+
+
+
+
+
+ -
+ #dotlrn.User_type#
+ <%= [lang::util::localize @pretty_type@] %>
+
+
+ -
+ #dotlrn.Access_level#
+ #dotlrn.Full# [ #dotlrn.Limited# ]#dotlrn.Limited# [ #dotlrn.Full# ]
+
+
+ -
+ #dotlrn.Guest#
+ #dotlrn.Yes# [ #dotlrn.No# ]#dotlrn.No# [ #dotlrn.Yes# ]
+
+
+ -
+ #dotlrn.ID#
+ #dotlrn.ltnone_set_upgt#@id@
+
+
+
+
+ -
+ #dotlrn.Edit# #dotlrn.lt_dotLRN_properties_for#
+
+
+
+
+
+
+ #dotlrn.class_memberships#
+
+
+
+
+
+
+
+ #dotlrn.community_memberships#
+
+
+
+
+
+
+
+ #dotlrn.subcommunity_memberships#
+
+
+
+
+
+
+
+
+
+
+
+ #dotlrn.add_to_dotlrn#
+
+
+#dotlrn.lt_This_user_is_currentl#.
+
+
+
+
+#dotlrn.lt_Administrative_Action#
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,108 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ One user view by a dotLRN admin
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-03-13
+ @version $Id: user.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} {
+ user_id:integer,notnull
+} -properties {
+ context_bar:onevalue
+ first_names:onevalue
+ last_name:onevalue
+ email:onevalue
+ screen_name:onevalue
+ user_id:onevalue
+ registration_date:onevalue
+ last_visit:onevalue
+ export_edit_vars:onevalue
+ portrait_p:onevalue
+ portrait_title:onevalue
+ change_state_links:onevalue
+ return_url:onevalue
+ dotlrn_user_p:onevalue
+ member_classes:multirow
+ member_clubs:multirow
+}
+
+set oacs_site_wide_admin_p [acs_user::site_wide_admin_p]
+
+set return_url "[ad_parameter -package_id [ad_acs_kernel_id] CommunityMemberAdminURL]?user_id=$user_id"
+set export_edit_vars "user_id=$user_id&return_url=$return_url"
+
+set dotlrn_url [dotlrn::get_url]
+set root_object_id [acs_magic_object security_context_root]
+if {![db_0or1row select_user_info {}]} {
+ ad_return_complaint 1 "[_ dotlrn.couldnt_find_user_id [list user_id $user_id]]"
+ ad_script_abort
+}
+if {[empty_string_p $screen_name]} {
+ set screen_name "<[_ dotlrn.none_set_up]>"
+}
+set registration_date [lc_time_fmt $registration_date "%q"]
+if {![empty_string_p $last_visit]} {
+ set last_visit [lc_time_fmt $last_visit "%q"]
+}
+
+set dotlrn_package_id [dotlrn::get_package_id]
+set dotlrn_user_p 0
+if {[db_0or1row select_dotlrn_user_info {}]} {
+ set dotlrn_user_p 1
+}
+set can_browse_p [dotlrn::user_can_browse_p -user_id $user_id]
+
+set portrait_p 0
+if {[ad_parameter "show_portrait_p" dotlrn] && [db_0or1row select_portrait_info {}]} {
+ set portrait_p 1
+}
+
+set change_state_links "\[[join [ad_registration_finite_state_machine_admin_links $member_state $email_verified_p $user_id $return_url] " | "]\]"
+
+db_multirow member_classes select_member_classes {} {
+ set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $class_instance_id -rel_type $rel_type]
+}
+db_multirow member_clubs select_member_clubs {} {
+ set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $club_id -rel_type $rel_type]
+}
+db_multirow member_subgroups select_member_subgroups {} {
+ set role_pretty_name [dotlrn_community::get_role_pretty_name -community_id $community_id -rel_type $rel_type]
+}
+
+set site_wide_admin_p [permission::permission_p \
+ -party_id $user_id \
+ -object_id [acs_magic_object "security_context_root"] \
+ -privilege admin \
+ ]
+
+set context_bar [list [list users [_ dotlrn.Users]] "$first_names $last_name"]
+
+set dual_approve_return_url [ns_urlencode [dotlrn::get_admin_url]/user-new-2?user_id=$user_id&referer=$return_url]
+
+set approve_user_url "/acs-admin/users/member-state-change?user_id=$user_id&member_state=approved&return_url=$dual_approve_return_url"
+
+set remove_user_url "\[Nuke\]"
+
+# Used in some en_US messages in the adp file
+set class_instances_pretty_name [parameter::get -localize -parameter class_instances_pretty_name]
+set clubs_pretty_name [parameter::get -localize -parameter clubs_pretty_name]
+set subcommunities_pretty_name [parameter::get -localize -parameter subcommunities_pretty_name]
+
+set dual_approve_return_url [ns_urlencode [dotlrn::get_admin_url]/user-new-2?user_id=$user_id&referer=$return_url]
+
+ad_return_template
Index: openacs-4/packages/dotlrn-admin/www/admin/user.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/user.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ select first_names,
+ last_name,
+ email,
+ screen_name,
+ creation_date as registration_date,
+ creation_ip,
+ last_visit,
+ member_state,
+ email_verified_p
+ from cc_users
+ where user_id = :user_id
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,34 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Add_Users_to_Group#
+@context_bar@
+
+
+#dotlrn.Note#
+#dotlrn.lt_This_action_will_take# <%= [expr [llength $users] * 3] %> #dotlrn.seconds#
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,109 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Add a set of users to a community
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-10
+ @version $Id: users-add-to-community.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ users
+ {referer "users-search"}
+} -properties {
+ context_bar:onevalue
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [list users-search [_ dotlrn.User_Search]] [_ dotlrn.Add_Users_to_Group]]
+
+form create select_community
+
+element create select_community users \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $users
+
+element create select_community referer \
+ -label "[_ dotlrn.Referer]" \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+set communities [db_list_of_lists select_all_communities {
+ select dotlrn_communities.pretty_name,
+ dotlrn_communities.community_id
+ from dotlrn_communities
+ where dotlrn_communities.portal_id is not NULL
+ order by dotlrn_communities.pretty_name,
+ dotlrn_communities.community_id
+}]
+
+if {[llength $communities]} {
+ element create select_community community_id \
+ -label "[_ dotlrn.Add_users_to]" \
+ -datatype text \
+ -widget select \
+ -options "{{} {}} $communities"
+} else {
+ element create select_community community_id \
+ -label "[_ dotlrn.No_groups_to_add_to]" \
+ -datatype text \
+ -widget hidden \
+ -value ""
+}
+
+if {[form is_valid select_community]} {
+ form get_values select_community \
+ users community_id
+
+ if {![empty_string_p $community_id]} {
+ db_transaction {
+ foreach user $users {
+ dotlrn_community::add_user $community_id $user
+ }
+ }
+
+ # Now notify the users that they've been added to the community.
+
+ set sender_email [cc_email_from_party [ad_conn user_id]]
+ foreach {community} $communities {
+ if { $community_id == [lindex $community 1] } {
+ set community_name [lindex $community 0]
+ break
+ }
+ }
+
+ set subject "You have been added to the \"$community_name\" community at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]"
+ set message "To visit the community's home page, point your browser at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL],
+log in, and click on the \"$community_name\" link in the \"Groups\" portlet.
+"
+
+ spam::send \
+ -recepients $users \
+ -from $sender_email \
+ -real_from $sender_email \
+ -subject $subject \
+ -message $message \
+ -message_values [list]
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,168 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Process the upload
+
+ @author ben (ben@openforce.net)
+ @creation-date 2002-03-05
+ @version $Id: users-bulk-upload-2.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+}
+
+# get location of the file
+set file_location [ns_queryget users_csv_file.tmpfile]
+
+# Prepare stuff
+set headers {first_names last_name email}
+
+set admin_user_id [ad_verify_and_get_user_id]
+set admin_email [db_string select_admin_email {
+ select email
+ from parties
+ where party_id = :admin_user_id
+}]
+
+doc_body_append "[_ dotlrn.Bulk_Uploading]"
+
+set list_of_user_ids [list]
+set list_of_addresses_and_passwords [list]
+
+# Do the stuff
+# We can't do this too generically, so we'll just do the CSV stuff right here
+db_transaction {
+
+ oacs_util::csv_foreach -file $file_location -array_name row {
+
+ # First make sure the required data is there
+ if { ![info exists row(email)] || ![info exists row(first_names)] || ![info exists row(last_name)] } {
+ doc_body_append "
Datafile must include at least the email, first_names and last_name fields
"
+ db_abort_transaction
+ return
+ }
+
+ # We need to insert the ACS user
+ set password [ad_generate_random_string]
+
+ # Check if this user already exists
+ set user_id [cc_lookup_email_user $row(email)]
+ if {![empty_string_p $user_id]} {
+ doc_body_append [_ dotlrn.user_email_already_exists [list user_email $row(email)]]
+ lappend list_of_user_ids $user_id
+ } else {
+
+ set user_id [db_nextval acs_object_id_seq]
+
+ auth::create_user \
+ -user_id $user_id \
+ -username "" \
+ -email $row(email) \
+ -first_names $row(first_names) \
+ -last_name $row(last_name) \
+ -password $password
+
+
+ lappend list_of_user_ids $user_id
+
+ if {![info exists row(type)]} {
+ set row(type) student
+ }
+
+ if {![info exists row(access_level)]} {
+ set row(access_level) full
+ }
+
+ if {![info exists row(guest)]} {
+ set row(guest) f
+ }
+
+ if {![info exists row(id)]} {
+ set row(id) $row(email)
+ }
+
+ doc_body_append "Creating user $row(email)...."
+
+ # Now we make them a dotLRN user
+ switch -exact $row(access_level) {
+ limited {
+ dotlrn::user_add -user_id $user_id -id $row(id) -type $row(type)
+ }
+ full -
+ default {
+ dotlrn::user_add -user_id $user_id -id $row(id) -type $row(type) -can_browse
+ }
+ }
+
+ # Set the privacy
+ dotlrn_privacy::set_user_guest_p -user_id $user_id -value $row(guest)
+
+ doc_body_append [_ dotlrn.user_email_created [list user_email $row(email)]]
+ set msg_subst_list [list system_name [ad_system_name] \
+ system_url [ad_parameter SystemUrl] \
+ user_email $row(email) \
+ user_password $password]
+ set message [_ dotlrn.user_add_confirm_email_body $msg_subst_list]
+ set subject [_ dotlrn.user_add_confirm_email_subject $msg_subst_list]
+
+ # Send note to new user
+ if [catch {ns_sendmail "$row(email)" "$admin_email" "$subject" "$message"} errmsg] {
+ doc_body_append "[_ dotlrn.lt_emailing_this_user_fa]"
+ set fail_p 1
+ } else {
+ doc_body_append "[_ dotlrn.email_sent]"
+ }
+
+ lappend list_of_addresses_and_passwords $row(email) $password
+ }
+
+ doc_body_append "
"
+
+ }
+} on_error {
+ doc_body_append "
The database choked while trying to create the last user in the list above!
The transaction has been aborted, no users have been entered, and no e-mail notifications have been sent.
"
+ ad_script_abort
+}
+
+set fail_p 0
+
+doc_body_append "
Sending email notifications to users...
"
+
+foreach {email password} $list_of_addresses_and_passwords {
+ if { ![string equal $password ""] } {
+ set message "
+You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL].
+
+Login: $email
+Password: $password
+"
+ # Send note to new user
+ if [catch {ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]" "$message"} errmsg] {
+ doc_body_append "emailing \"$email\" failed!
"
+ set fail_p 1
+ } else {
+ doc_body_append "email sent to \"$email\"
"
+ }
+ }
+}
+
+if {$fail_p} {
+ doc_body_append "
[_ dotlrn.lt_Some_of_the_emails_fa]
"
+}
+
+doc_body_append "
"
+doc_body_append "[_ dotlrn.or_return_to] [_ dotlrn.User_Management]."
Index: openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,108 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Users_Bulk_Upload#
+@context_bar@
+
+#dotlrn.lt_Here_you_can_create_s#
+
+
+
+#dotlrn.Be_sure# #dotlrn.lt_to_use_vaild_email_ad#
+
+
+
+
+#dotlrn.CSV_File_Format#
+
+
+
+ #dotlrn.First_Line#
+
+
+
+ #dotlrn.first_line_of_file_must_be#
+
+
+ first_names,last_name,email,id,type,access_level,guest
+
+
+
+
+
+
+
+
+ #dotlrn.Fields#
+
+
+ - first_names - #dotlrn.required#
+
- last_name - #dotlrn.required#
+
- email - #dotlrn.required#
+
- id - #dotlrn.optional_defaults_to# email #dotlrn.lt_a_secondary#
+
- type - #dotlrn.required# #dotlrn.must_have_values#
+
+ - professor
+
- student
+
- admin
+
- external
+
+ - access_level - #dotlrn.optional_defaults_to# full -
+ #dotlrn.must_have_values# full, limited
+
- guest - #dotlrn.optional_defaults_to# guest -
+ #dotlrn.must_have_values# t, f
+
+
+
+
+
+
+ #dotlrn.Example_File#
+
+
+ first_names,last_name,email,id,type,access_level,guest
+ Joe,Student,joe@_somewhere_.net,123-456-7890,student,full,f
+ Albert,Einstein,al@_school_.edu,al,professor,full,f
+ Systems,Hacker,syshacker@_company_.com,,admin,,,
+ Intersted,Onlooker,onlooker@_somewhere_.net,,external,,limited,t
+
+
+
+
+
+
+#dotlrn.lt_Note_you_will_have_th#
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Display the page for bulk uploading of a bunch of users
+
+ @author ben (ben@openforce.net)
+ @creation-date 2002-03-05
+ @version $Id: users-bulk-upload.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.Bulk_Upload]]
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,87 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy.guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission.permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and (
+ lower(dotlrn_users.last_name) like lower('%' || :search_text || '%')
+ or lower(dotlrn_users.first_names) like lower('%' || :search_text || '%')
+ or lower(dotlrn_users.email) like lower('%' || :search_text || '%')
+ )
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and (
+ lower(persons.last_name) like lower('%' || :search_text || '%')
+ or lower(persons.first_names) like lower('%' || :search_text || '%')
+ or lower(parties.email) like lower('%' || :search_text || '%')
+ )
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and (
+ lower(persons.last_name) like lower('%' || :search_text || '%')
+ or lower(persons.first_names) like lower('%' || :search_text || '%')
+ or lower(parties.email) like lower('%' || :search_text || '%')
+ )
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,87 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy__guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission__permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and (
+ lower(dotlrn_users.last_name) like lower('%' || :search_text || '%')
+ or lower(dotlrn_users.first_names) like lower('%' || :search_text || '%')
+ or lower(dotlrn_users.email) like lower('%' || :search_text || '%')
+ )
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and (
+ lower(persons.last_name) like lower('%' || :search_text || '%')
+ or lower(persons.first_names) like lower('%' || :search_text || '%')
+ or lower(parties.email) like lower('%' || :search_text || '%')
+ )
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and (
+ lower(persons.last_name) like lower('%' || :search_text || '%')
+ or lower(persons.first_names) like lower('%' || :search_text || '%')
+ or lower(parties.email) like lower('%' || :search_text || '%')
+ )
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,40 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,91 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-30
+ @version $Id: users-chunk-large.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {search_text ""}
+} -properties {
+ user_id:onevalue
+ users:multirow
+}
+
+if {![exists_and_not_null type]} {
+ set type admin
+}
+
+if {![exists_and_not_null referer]} {
+ set referer "[dotlrn::get_admin_url]/users"
+}
+
+set user_id [ad_conn user_id]
+
+form create user_search
+
+element create user_search search_text \
+ -label [_ dotlrn.Search] \
+ -datatype text \
+ -widget text \
+ -value $search_text
+
+element create user_search type \
+ -label [_ dotlrn.Type] \
+ -datatype text \
+ -widget hidden \
+ -value $type
+
+element create user_search referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid user_search]} {
+ form get_values user_search search_text referer
+
+ set user_id [ad_conn user_id]
+ set dotlrn_package_id [dotlrn::get_package_id]
+ set root_object_id [acs_magic_object security_context_root]
+ set i 1
+
+ if {[string equal $type deactivated] == 1} {
+ db_multirow users select_deactivated_users {} {
+ set users:${i}(access_level) Limited
+ incr i
+ }
+ } elseif {[string equal $type pending] == 1} {
+ db_multirow users select_non_dotlrn_users {} {
+ set users:${i}(access_level) N/A
+ incr i
+ }
+ } else {
+ db_multirow users select_dotlrn_users {} {
+ if {[dotlrn::user_can_browse_p -user_id $user_id]} {
+ set users:${i}(access_level) Full
+ } else {
+ set users:${i}(access_level) Limited
+ }
+ incr i
+ }
+ }
+} else {
+ multirow create users dummy
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,142 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy.guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission.permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and upper(substr(dotlrn_users.last_name, 1, 1)) = :section
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy.guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission.permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and upper(substr(dotlrn_users.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and upper(substr(persons.last_name, 1, 1)) = :section
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'approved'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and upper(substr(person.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and upper(substr(persons.last_name, 1, 1)) = :section
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and upper(substr(person.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,142 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy__guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission__permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and upper(substr(dotlrn_users.last_name, 1, 1)) = :section
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy__guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission__permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ and upper(substr(dotlrn_users.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and upper(substr(persons.last_name, 1, 1)) = :section
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'approved'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ and upper(substr(person.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and upper(substr(persons.last_name, 1, 1)) = :section
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ and upper(substr(person.last_name, 1, 1)) not in ('[join $dimension_list "\', \'"]')
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,25 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+@control_bar;noquote@
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-30
+ @version $Id: users-chunk-medium.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {section A}
+} -properties {
+ user_id:onevalue
+ control_bar:onevalue
+ users:multirow
+}
+
+set user_id [ad_conn user_id]
+set dotlrn_package_id [dotlrn::get_package_id]
+set root_object_id [acs_magic_object security_context_root]
+
+if {![exists_and_not_null type]} {
+ set type admin
+}
+
+if {![exists_and_not_null referer]} {
+ set referer "[dotlrn::get_admin_url]/users"
+}
+
+set dimension_list {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
+foreach dimension $dimension_list {
+ lappend dimensions [list $dimension $dimension {}]
+}
+lappend dimensions [list Other Other {}]
+
+set control_bar [portal::dimensional -no_bars [list [list section {} $section $dimensions]]]
+
+set i 1
+if {[string equal $type deactivated] == 1} {
+ set query select_deactivated_users
+ if {[string match Other $section]} {
+ append query "_other"
+ }
+ db_multirow users $query {} {
+ set users:${i}(access_level) Limited
+ incr i
+ }
+} elseif {[string equal $type pending] == 1} {
+ set query select_non_dotlrn_users
+ if {[string match Other $section]} {
+ append query "_other"
+ }
+ db_multirow users $query {} {
+ set users:${i}(access_level) N/A
+ incr i
+ }
+} else {
+ set query select_dotlrn_users
+ if {[string match Other $section]} {
+ append query "_other"
+ }
+ db_multirow users $query {} {
+ if {[dotlrn::user_can_browse_p -user_id $user_id]} {
+ set users:${i}(access_level) Full
+ } else {
+ set users:${i}(access_level) Limited
+ }
+ incr i
+ }
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,72 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy.guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission.permission_p(:root_object_id, dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p, member_state
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission.permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs.magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,73 @@
+
+
+
+ postgresql7.1
+
+
+
+ select dotlrn_users.user_id,
+ dotlrn_users.first_names,
+ dotlrn_users.last_name,
+ dotlrn_users.email,
+ dotlrn_privacy__guest_p(dotlrn_users.user_id) as guest_p,
+ acs_permission__permission_p(:root_object_id,dotlrn_users.user_id, 'admin') as site_wide_admin_p
+ from dotlrn_users
+ where dotlrn_users.type = :type
+ order by dotlrn_users.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p,
+ member_state
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and member_state not in ('banned','deleted','rejected')
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and users.email_verified_p = 't'
+ and not exists (select 1
+ from acs_rels a,
+ dotlrn_user_types
+ where a.object_id_one = dotlrn_user_types.group_id
+ and a.object_id_two = acs_rels.object_id_two)
+ order by persons.last_name
+
+
+
+
+
+ select users.user_id,
+ persons.first_names,
+ persons.last_name,
+ parties.email,
+ 'f' as guest_p,
+ acs_permission__permission_p(:root_object_id, users.user_id, 'admin') as site_wide_admin_p
+ from parties,
+ users,
+ persons,
+ acs_rels,
+ membership_rels
+ where parties.party_id = users.user_id
+ and users.user_id = persons.person_id
+ and persons.person_id = acs_rels.object_id_two
+ and acs_rels.object_id_one = acs__magic_object_id('registered_users')
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+ order by persons.last_name
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,21 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-30
+ @version $Id: users-chunk-small.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+} -properties {
+ user_id:onevalue
+ users:multirow
+}
+
+set user_id [ad_conn user_id]
+set dotlrn_package_id [dotlrn::get_package_id]
+set root_object_id [acs_magic_object security_context_root]
+
+if {![exists_and_not_null type]} {
+ set type admin
+}
+
+if {![exists_and_not_null referer]} {
+ set referer "[dotlrn::get_admin_url]/users"
+}
+
+# Currently, just present a list of dotLRN users
+set i 1
+if {[string equal $type deactivated] == 1} {
+ db_multirow users select_deactivated_users {} {
+ set users:${i}(access_level) Limited
+ incr i
+ }
+} elseif {[string equal $type pending] == 1} {
+ db_multirow users select_non_dotlrn_users {} {
+ set users:${i}(access_level) N/A
+ incr i
+ }
+} else {
+ db_multirow users select_dotlrn_users {} {
+ if {[dotlrn::user_can_browse_p -user_id $user_id]} {
+ set users:${i}(access_level) Full
+ } else {
+ set users:${i}(access_level) Limited
+ }
+ incr i
+ }
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,124 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.
+ #
+
+%>
+
+<%
+ # The structure of this table is determined by the type of user we
+ # are displaying. It doesn't make much sense to display access
+ # level, guest status, and admin status for pending users. Instead we
+ # will offer links to common actions.
+
+ # Note: There is some redundant logic inside the table and in
+ # other files that display access and guest status fields as N/A
+ # for pending users. Previous to the change, this page was
+ # displaying "Limited" and "Yes", respectively, which are wrong
+ # and confused our site administrator.
+ # The N/A logic is a failsafe in case these columns come back for
+ # some reason. aegrumet@mit.edu 2002-08-08.
+
+%>
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-30
+ @version $Id: users-chunk.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {section ""}
+} -properties {
+ user_id:onevalue
+}
+
+set oacs_site_wide_admin_p [acs_user::site_wide_admin_p]
+set user_id [ad_conn user_id]
+
+if {![exists_and_not_null referer]} {
+ set referer "[dotlrn::get_admin_url]/users"
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,32 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Deactivate_Users#
+@context_bar@
+
+
+ #dotlrn.lt_Are_you_sure_you_want#
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-deactivate.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/users-deactivate.tcl
+
+ad_page_contract {
+ Deactivate a set of users.
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-14
+ @version $Id: users-deactivate.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ users
+ {referer "users-search"}
+} -properties {
+ context_bar:onevalue
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [list users-search [_ dotlrn.User_Search]] [_ dotlrn.Deactivate_Users]]
+
+form create confirm_deactivate
+
+element create confirm_deactivate users \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $users
+
+if {[form is_valid confirm_deactivate]} {
+ form get_values confirm_deactivate \
+ users
+
+ foreach user $users {
+ acs_user::ban -user_id $user
+ }
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-delete.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-delete.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,32 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Nuke_Users#
+@context_bar@
+
+
+ #dotlrn.lt_Are_you_sure_you_want_nuke_users#
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-delete.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/users-delete.tcl
+
+ad_page_contract {
+ Nuke a set of users.
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-14
+ @version $Id: users-delete.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ users
+ {referer "users-search"}
+} -properties {
+ context_bar:onevalue
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [list users-search [_ dotlrn.User_Search]] [_ dotlrn.Nuke_Users]]
+
+form create confirm_delete
+
+element create confirm_delete users \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $users
+
+element create confirm_delete referer \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid confirm_delete]} {
+ form get_values confirm_delete \
+ users
+
+ dotlrn::remove_users_completely -users $users
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-oracle.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select count(*)
+ from (select acs_rels.object_id_two
+ from acs_rels, membership_rels
+ where acs_rels.object_id_one = (select acs.magic_object_id('registered_users') from dual)
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state
+ not in ('banned','deleted','rejected')
+ minus
+ select acs_rels.object_id_two
+ from acs_rels, dotlrn_user_types
+ where acs_rels.object_id_one = dotlrn_user_types.group_id)
+
+
+
+
+
+ select count(*)
+ from persons,
+ acs_rels,
+ membership_rels
+ where acs_rels.object_id_one = (select acs.magic_object_id('registered_users') from dual)
+ and acs_rels.object_id_two = persons.person_id
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-postgresql.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,36 @@
+
+
+
+ postgresql7.1
+
+
+
+ select count(*)
+ from (select acs_rels.object_id_two
+ from acs_rels, membership_rels
+ where acs_rels.object_id_one = (select acs__magic_object_id('registered_users') from dual)
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state
+ not in ('banned','deleted','rejected')
+ and acs_rels.object_id_two not in (
+ select acs_rels.object_id_two
+ from acs_rels,
+ dotlrn_user_types
+ where acs_rels.object_id_one = dotlrn_user_types.group_id)) as foo
+
+
+
+
+
+ select count(*)
+ from persons,
+ acs_rels,
+ membership_rels
+ where acs_rels.object_id_one = (select acs__magic_object_id('registered_users') from dual)
+ and acs_rels.object_id_two = persons.person_id
+ and acs_rels.rel_id = membership_rels.rel_id
+ and membership_rels.member_state = 'banned'
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-search.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-search.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-search.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,100 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Users_Search#
+@context_bar;noquote@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #dotlrn.lt_Your_search_returned_#
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,270 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Replicate User Management Page
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-10
+ @version $Id: users-search.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {type "any"}
+ {can_browse_p "any"}
+ {guest_p "any"}
+ {join_criteria "and"}
+ {n_users 0}
+ {action "none"}
+} -properties {
+ context_bar:onevalue
+ is_request:onevalue
+ n_users:onevalue
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.User_Search]]
+
+set package_id [ad_conn package_id]
+
+form create user_search_results
+
+element create user_search_results selected_users \
+ -label " " \
+ -datatype text \
+ -widget checkbox
+
+element create user_search_results search_action \
+ -label "[_ dotlrn.Action]" \
+ -datatype text \
+ -widget radio \
+ -options [list \
+ [list [_ dotlrn.None] none] \
+ [list [_ dotlrn.Spam_] spam] \
+ [list [_ dotlrn.Add_to_group_] add_to_community] \
+ [list [_ dotlrn.Deactivate_] deactivate] \
+ [list [_ dotlrn.Nuke_] delete] \
+ ] \
+ -value $action
+
+if {[form is_valid user_search_results]} {
+ form get_values user_search_results search_action
+
+ set selected_users [element get_values user_search_results selected_users]
+
+ switch -exact $search_action {
+ "spam" {
+ ad_returnredirect "users-spam?[export_vars {{users $selected_users}}]"
+ }
+ "add_to_community" {
+ ad_returnredirect "users-add-to-community?[export_vars {{users $selected_users}}]"
+ }
+ "deactivate" {
+ ad_returnredirect "users-deactivate?[export_vars {{users $selected_users}}]"
+ }
+ "delete" {
+ ad_returnredirect "users-delete?[export_vars {{users $selected_users}}]"
+ }
+ }
+}
+
+form create user_search
+
+element create user_search name \
+ -label "[_ dotlrn.Name__Email]" \
+ -datatype text \
+ -widget text \
+ -html {size 30} \
+ -optional
+
+element create user_search id \
+ -label "[_ dotlrn.ID_1]" \
+ -datatype text \
+ -widget text \
+ -html {size 10} \
+ -optional
+
+element create user_search type \
+ -label "[_ dotlrn.Type]" \
+ -datatype text \
+ -widget select \
+ -options "[list [_ dotlrn.Any] any] [dotlrn::get_user_types_as_options]" \
+ -value $type
+
+element create user_search can_browse_p \
+ -label "[_ dotlrn.Access_Level]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.Any] any] [list [_ dotlrn.Limited] 0] [list [_ dotlrn.Full] 1]] \
+ -value $can_browse_p
+
+element create user_search guest_p \
+ -label "[_ dotlrn.Guest_1]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.Any] any] [list [_ dotlrn.Yes] t] [list [_ dotlrn.No] f]] \
+ -value $guest_p
+
+element create user_search role \
+ -label "[_ dotlrn.Role]" \
+ -datatype text \
+ -widget checkbox \
+ -options [dotlrn_community::get_all_roles_as_options] \
+ -optional
+
+element create user_search last_visit_greater \
+ -label "[_ dotlrn.lt_Last_Visit_Over_in_da]" \
+ -datatype text \
+ -widget text \
+ -html {size 10} \
+ -optional
+
+element create user_search last_visit_less \
+ -label "[_ dotlrn.lt_Last_Visit_Within_in_]" \
+ -datatype text \
+ -widget text \
+ -html {size 10} \
+ -optional
+
+element create user_search join_criteria \
+ -label "[_ dotlrn.lt_Join_the_above_criter_1]" \
+ -datatype text \
+ -widget select \
+ -options [list [list [_ dotlrn.And] and] [list [_ dotlrn.Or] or]] \
+ -value $join_criteria
+
+set is_request [form is_request user_search]
+
+if {[form is_valid user_search]} {
+ form get_values user_search \
+ id type can_browse_p guest_p last_visit_greater last_visit_less name join_criteria
+
+ if {([string equal "and" $join_criteria] == 0) && ([string equal "or" $join_criteria] == 0)} {
+ ad_return_error \
+ "[_ dotlrn.lt_There_was_a_bug_in_th]" \
+ "[_ dotlrn.lt_There_was_a_bug_in_th_1]"
+ }
+
+ set context_bar [list [list users [_ dotlrn.Users]] [list users-search [_ dotlrn.User_Search]] [_ dotlrn.Results]]
+
+ set tables [list "dotlrn_users"]
+ set cols [list \
+ "distinct dotlrn_users.user_id" \
+ "dotlrn_users.id" \
+ "dotlrn_users.first_names" \
+ "dotlrn_users.last_name" \
+ "dotlrn_users.email" \
+ "dotlrn_users.type" \
+ ]
+ set wheres [list]
+
+ if {![empty_string_p $name]} {
+ lappend wheres "(lower(dotlrn_users.last_name) like lower('%' || :name || '%') or lower(dotlrn_users.first_names) like lower('%' || :name || '%') or lower(dotlrn_users.email) like lower('%' || :name || '%'))"
+ }
+
+ if {![empty_string_p $id]} {
+ lappend wheres "(lower(dotlrn_users.id) like lower('%' || :id || '%'))"
+ }
+
+ if {![empty_string_p $type]} {
+ if {[string equal "any" $type] == 1} {
+ lappend wheres "dotlrn_users.type in (\'[join [dotlrn::get_user_types] \',\']\')"
+ } else {
+ lappend wheres "dotlrn_users.type = :type"
+ }
+ }
+
+ switch -exact $can_browse_p {
+ any {}
+ 1 {
+ lappend wheres "exists (select 1 from acs_permissions where object_id = :package_id and grantee_id = dotlrn_users.user_id and privilege = 'dotlrn_browse')"
+ }
+ 0 {
+ lappend wheres "not exists (select 1 from acs_permissions where object_id = :package_id and grantee_id = dotlrn_users.user_id and privilege = 'dotlrn_browse')"
+ }
+ }
+
+ switch -exact $guest_p {
+ any {}
+ t {
+ lappend wheres "exists (select 1 from dotlrn_guest_status where dotlrn_guest_status.user_id = dotlrn_users.user_id and guest_p = 't')"
+ }
+ f {
+ lappend wheres "exists (select 1 from dotlrn_guest_status where dotlrn_guest_status.user_id = dotlrn_users.user_id and guest_p = 'f')"
+ }
+ }
+
+ if {![empty_string_p $last_visit_greater]} {
+ if {[lsearch -exact $tables "users"] == -1} {
+ lappend tables "users"
+ }
+ lappend wheres "(dotlrn_users.user_id = users.user_id and users.last_visit <= (sysdate - :last_visit_greater))"
+ }
+
+ if {![empty_string_p $last_visit_less]} {
+ if {[lsearch -exact $tables "users"] == -1} {
+ lappend tables "users"
+ }
+ lappend wheres "(dotlrn_users.user_id = users.user_id and users.last_visit >= (sysdate - :last_visit_less))"
+ }
+
+ set role_list [element get_values user_search role]
+ set role_list_length [llength $role_list]
+
+ if {$role_list_length} {
+ if {[lsearch -exact $tables "acs_rels"] == -1} {
+ lappend tables "acs_rels"
+ }
+ set in_clause "(dotlrn_users.user_id = acs_rels.object_id_two and acs_rels.rel_type in ("
+
+ set in_elements [list]
+ for {set i 0} {$i < $role_list_length} {incr i} {
+ set in_element__${i} [lindex $role_list $i]
+ lappend in_elements ":in_element__${i}"
+ }
+
+ append in_clause [join $in_elements ", "]
+ append in_clause "))"
+
+ lappend wheres $in_clause
+ }
+
+ set sql "select "
+ append sql [join $cols ", "]
+
+ append sql " from "
+ append sql [join $tables ", "]
+
+ if {[llength $wheres]} {
+ append sql " where "
+ append sql [join $wheres " $join_criteria "]
+ append sql "order by last_name, first_names"
+ }
+
+ set referer [ns_conn url]
+ set selected_users_options [list]
+ set selected_users_values [list]
+ db_foreach select_users $sql {
+ lappend selected_users_options [list "$last_name, $first_names ($email)" $user_id]
+ lappend selected_users_values $user_id
+ }
+
+ element set_properties user_search_results selected_users \
+ -options $selected_users_options \
+ -values $selected_users_values
+
+ set n_users [llength $selected_users_values]
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-spam.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-spam.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-spam.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,30 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Spam_Users#
+@context_bar@
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users-spam.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-spam.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users-spam.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,102 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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/admin/users-spam.tcl
+
+ad_page_contract {
+ Spam a set of users.
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-02-14
+ @version $Id: users-spam.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ users
+ {referer "users-search"}
+} -properties {
+ context_bar:onevalue
+}
+
+set context_bar [list [list users [_ dotlrn.Users]] [list users-search [_ dotlrn.User_Search]] [_ dotlrn.Spam_Users]]
+
+set sender_id [ad_conn user_id]
+
+db_1row select_sender_info {
+ select parties.email as sender_email,
+ persons.first_names as sender_first_names,
+ persons.last_name as sender_last_name
+ from parties,
+ persons
+ where parties.party_id = :sender_id
+ and persons.person_id = :sender_id
+}
+
+form create spam_message
+
+element create spam_message users \
+ -label " " \
+ -datatype text \
+ -widget hidden \
+ -value $users
+
+element create spam_message from \
+ -label [_ dotlrn.From] \
+ -datatype text \
+ -widget text \
+ -html {size 60} \
+ -value $sender_email
+
+element create spam_message subject \
+ -label [_ dotlrn.Subject] \
+ -datatype text \
+ -widget text \
+ -html {size 60}
+
+element create spam_message message \
+ -label [_ dotlrn.Message] \
+ -datatype text \
+ -widget textarea \
+ -html {rows 10 cols 80 wrap soft}
+
+element create spam_message referer \
+ -label [_ dotlrn.Referer] \
+ -datatype text \
+ -widget hidden \
+ -value $referer
+
+if {[form is_valid spam_message]} {
+ form get_values spam_message \
+ users from subject message referer
+
+ # YON: should redirect and close the connection here so that the user
+ # doesn't have to wait for the emails to get sent out.
+
+ set message_values [list]
+ lappend message_values [list {} $from]
+
+ spam::send \
+ -recepients $users \
+ -from $from \
+ -real_from $sender_email \
+ -subject $subject \
+ -message $message \
+ -message_values $message_values
+
+ ad_returnredirect $referer
+ ad_script_abort
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users.adp 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,62 @@
+<%
+
+ #
+ # Copyright (C) 2001, 2002 MIT
+ #
+ # 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.Users#
+@context_bar;noquote@
+
+<% set referer "[dotlrn::get_admin_url]/users" %>
+
+[
+ #dotlrn.Create_A_New_User#
+ |
+ #dotlrn.Search_Users#
+ |
+ #dotlrn.Bulk_Upload#
+]
+
+
+
+
+
+
+
+
+
+@control_bar;noquote@
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users.tcl 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,67 @@
+#
+# Copyright (C) 2001, 2002 MIT
+#
+# 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.
+#
+
+ad_page_contract {
+ Displays the admin users page
+
+ @author yon (yon@openforce.net)
+ @creation-date 2002-01-30
+ @version $Id: users.tcl,v 1.1 2004/08/20 14:44:22 andrewg Exp $
+} -query {
+ {type "pending"}
+} -properties {
+ context_bar:onevalue
+ control_bar:onevalue
+ n_users:onevalue
+}
+
+set context_bar [_ dotlrn.Users]
+
+set dotlrn_roles [db_list_of_lists select_dotlrn_roles {
+ select dotlrn_user_types.type,
+ dotlrn_user_types.pretty_name || ' (' || (select count(*)
+ from dotlrn_users
+ where dotlrn_users.type = dotlrn_user_types.type) || ')',
+ ''
+ from dotlrn_user_types
+ order by dotlrn_user_types.pretty_name
+}]
+
+# The roles are stored as message keys in the database so we need to localize them
+# on the fly here
+set dotlrn_roles_localized [list]
+foreach role_pair $dotlrn_roles {
+ lappend dotlrn_roles_localized [list [lindex $role_pair 0] [lang::util::localize [lindex $role_pair 1]]]
+}
+
+set n_pending_users [db_string select_non_dotlrn_users_count {}]
+lappend dotlrn_roles_localized [list pending "[_ dotlrn.Pending] ($n_pending_users)" {}]
+
+set n_deactivated_users [db_string select_deactivated_users_count {}]
+lappend dotlrn_roles_localized [list deactivated "[_ dotlrn.Deactivated] ($n_deactivated_users)" {}]
+
+set control_bar [ad_dimensional [list [list type "[_ dotlrn.User_Type]:" $type $dotlrn_roles_localized]]]
+
+if {[string equal $type "deactivated"] == 1} {
+ set n_users $n_deactivated_users
+} elseif {[string equal $type "pending"] == 1} {
+ set n_users $n_pending_users
+} else {
+ set n_users [db_string select_dotlrn_users_count {}]
+}
+
+ad_return_template
+
Index: openacs-4/packages/dotlrn-admin/www/admin/users.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-admin/www/admin/users.xql 20 Aug 2004 14:44:22 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select count(*)
+ from dotlrn_users
+ where dotlrn_users.type = :type
+
+
+
+