Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.104.2.1 -r1.104.2.2 --- openacs-4/packages/dotlrn/dotlrn.info 12 Dec 2002 00:08:53 -0000 1.104.2.1 +++ openacs-4/packages/dotlrn/dotlrn.info 2 Mar 2003 22:40:18 -0000 1.104.2.2 @@ -402,8 +402,6 @@ - - Index: openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql 9 Aug 2002 18:39:25 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql 2 Mar 2003 22:40:19 -0000 1.4.2.1 @@ -63,7 +63,7 @@ constraint dotlrn_t_start_date_nn not null, end_date date - default (now() + '180 days'::timespan) + default (now() + '180 days'::interval) constraint dotlrn_t_end_date_nn not null ); @@ -161,7 +161,7 @@ select define_function_args ('dotlrn_department__delete', 'department_key'); -create function dotlrn_department__new(varchar,varchar,varchar,varchar,integer,timestamp,integer,varchar,integer) +create function dotlrn_department__new(varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) returns varchar as ' DECLARE p_department_key alias for $1; @@ -217,7 +217,7 @@ select define_function_args('dotlrn_class__delete','class_key'); -create function dotlrn_class__new(varchar,varchar,varchar,varchar,varchar,integer,timestamp,integer,varchar,integer) +create function dotlrn_class__new(varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) returns varchar as ' DECLARE p_class_key alias for $1; @@ -275,7 +275,7 @@ select define_function_args('dotlrn_class_instance__delete','class_instance_id'); -create function dotlrn_class_instance__new(integer,varchar,integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamp,integer,varchar,integer) +create function dotlrn_class_instance__new(integer,varchar,integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) returns integer as ' DECLARE p_class_instance_id alias for $1; Index: openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql 9 Aug 2002 18:39:25 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql 2 Mar 2003 22:40:19 -0000 1.3.2.1 @@ -51,7 +51,7 @@ select define_function_args ('dotlrn_club__delete','club_id'); -create function dotlrn_club__new(integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamp,integer,varchar,integer) +create function dotlrn_club__new(integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) returns integer as ' DECLARE p_club_id alias for $1; Index: openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql 9 Aug 2002 18:39:25 -0000 1.6 +++ openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql 2 Mar 2003 22:40:19 -0000 1.6.2.1 @@ -55,7 +55,7 @@ END; ' language 'plpgsql'; -create function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamp,integer,varchar,integer) +create function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) returns varchar as ' DECLARE p_community_type alias for $1; @@ -86,9 +86,9 @@ p_community_type, p_community_type, v_parent_object_type, - v_unique_name, - v_unique_name, - v_unique_name, + cast(v_unique_name as varchar), + cast(v_unique_name as varchar), + cast(v_unique_name as varchar), ''f'', null, ''acs_group.name'' @@ -158,7 +158,7 @@ select define_function_args('dotlrn_community__new','community_id,parent_community_id,community_type,community_key,pretty_name,description,archived_p;f,portal_id,non_member_portal_id,package_id,join_policy,creation_date,creation_user,creation_ip,context_id'); -create function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamp,integer,varchar,integer) +create function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) returns integer as ' DECLARE p_community_id alias for $1; Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-july-25-2002.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-july-25-2002.sql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-july-25-2002.sql 26 Jul 2002 01:57:35 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-july-25-2002.sql 2 Mar 2003 22:40:19 -0000 1.1.2.1 @@ -16,7 +16,7 @@ constraint dotlrn_t_start_date_nn not null, end_date date - default (now() + '180 days'::timespan) + default (now() + '180 days'::interval) constraint dotlrn_t_end_date_nn not null ); Index: openacs-4/packages/dotlrn/www/admin/class-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/class-postgresql.xql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/dotlrn/www/admin/class-postgresql.xql 22 Jul 2002 16:28:31 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/class-postgresql.xql 2 Mar 2003 22:40:19 -0000 1.1.2.1 @@ -8,8 +8,8 @@ select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year, dotlrn_terms.term_id from dotlrn_terms - where dotlrn_terms.end_date > (now() - 360) - and dotlrn_terms.start_date < (now() + 360) + 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/www/admin/users-bulk-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 9 Aug 2002 18:39:27 -0000 1.7 +++ openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 2 Mar 2003 22:40:19 -0000 1.7.2.1 @@ -38,13 +38,21 @@ doc_body_append "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 { - set fail_p 0 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 + } + # We need to insert the ACS user set password [ad_generate_random_string] @@ -69,7 +77,13 @@ if {![info exists row(guest)]} { set row(guest) f } + + if {![info exists row(id)]} { + set row(id) $row(email) + } + doc_body_append "Creating ser $row(email)...." + # Now we make them a dotLRN user switch -exact $row(access_level) { limited { @@ -90,28 +104,39 @@ # Set the privacy acs_privacy::set_user_read_private_data -user_id $user_id -object_id [dotlrn::get_package_id] -value $inverse_row_guest - doc_body_append "User $row(email) created...." - set message " - You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]. - - Login: $row(email) - Password: $password - " - - # Send note to new user - if [catch {ns_sendmail "$row(email)" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]" "$message"} errmsg] { - doc_body_append "emailing this user failed!" - set fail_p 1 - } else { - doc_body_append "email sent" - } + doc_body_append "creation succeeded...." + 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 { + set message " +You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]. + +Login: $row(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 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 "

Some of the emails failed. Those users had random passwords generated for them, however. The best way to proceed is to have these users log in and ask them to click on 'I have forgotten my password'.

" } Index: openacs-4/packages/forums-portlet/www/forums-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums-portlet/www/Attic/forums-portlet-postgresql.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/forums-portlet/www/forums-portlet-postgresql.xql 21 Jul 2002 21:26:35 -0000 1.2 +++ openacs-4/packages/forums-portlet/www/forums-portlet-postgresql.xql 2 Mar 2003 22:40:19 -0000 1.2.2.1 @@ -12,7 +12,7 @@ where site_nodes.object_id = forums_forums.package_id) as url, forums_forums.forum_id, forums_forums.name, - case when last_modified > (now() - 1) then 't' else 'f' end as new_p + case when last_modified > (cast(current_timestamp as date)- 1) then 't' else 'f' end as new_p from forums_forums_enabled forums_forums, acs_objects where acs_objects.object_id = forums_forums.forum_id and Index: openacs-4/packages/new-portal/sql/postgresql/api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/api-create.sql,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/new-portal/sql/postgresql/api-create.sql 9 Aug 2002 20:56:28 -0000 1.10 +++ openacs-4/packages/new-portal/sql/postgresql/api-create.sql 2 Mar 2003 22:40:19 -0000 1.10.2.1 @@ -25,7 +25,7 @@ select define_function_args('portal_page__new','page_id,pretty_name,portal_id,layout_id,object_type;portal_page,creation_date,creation_user,creation_ip,context_id'); -create function portal_page__new (integer,varchar,integer,integer,varchar,timestamp,integer,varchar,integer) +create function portal_page__new (integer,varchar,integer,integer,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_page_id alias for $1; @@ -128,7 +128,7 @@ select define_function_args('portal__new','portal_id,name,theme_id,layout_id,template_id,default_page_name,object_type;portal,creation_date,creation_user,creation_ip,context_id'); -create function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,timestamp,integer,varchar,integer) +create function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_portal_id alias for $1; @@ -303,7 +303,7 @@ select define_function_args('portal_element_theme__new','theme_id,name,description,filename,resource_dir,object_type;portal_element_theme,creation_date,creation_user,creation_ip,context_id'); -create function portal_element_theme__new (integer,varchar,varchar,varchar,varchar,varchar,timestamp,integer,varchar,integer) +create function portal_element_theme__new (integer,varchar,varchar,varchar,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_theme_id alias for $1; @@ -378,7 +378,7 @@ select define_function_args('portal_layout__new','layout_id,name,description,filename,resource_dir,object_type;portal_layout,creation_date,creation_user,creation_ip,context_id'); -create function portal_layout__new (integer,varchar,varchar,varchar,varchar,varchar,timestamp,integer,varchar,integer) +create function portal_layout__new (integer,varchar,varchar,varchar,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_layout_id alias for $1; @@ -485,7 +485,7 @@ select define_function_args('portal_datasource__new','datasource_id,name,description,object_type;portal_datasource,creation_date,creation_user,creation_ip,context_id'); -create function portal_datasource__new (integer,varchar,varchar,varchar,timestamp,integer,varchar,integer) +create function portal_datasource__new (integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_datasource_id alias for $1; -- default null Index: openacs-4/packages/profile-provider/sql/postgresql/profiled-group-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/profile-provider/sql/postgresql/profiled-group-create.sql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/profile-provider/sql/postgresql/profiled-group-create.sql 29 Mar 2002 16:53:02 -0000 1.1 +++ openacs-4/packages/profile-provider/sql/postgresql/profiled-group-create.sql 2 Mar 2003 22:40:20 -0000 1.1.2.1 @@ -34,7 +34,7 @@ select define_function_args ('profiled_group__new','group_id,profile_provider,group_name,join_policy,email,url,object_type;profiled_group,creation_date,creation_user,creation_ip'); -create function profiled_group__new(integer,integer,varchar,varchar,varchar,varchar,varchar,timestamp,integer,varchar) +create function profiled_group__new(integer,integer,varchar,varchar,varchar,varchar,varchar,timestamptz,integer,varchar) returns integer as ' DECLARE p_group_id alias for $1; Index: openacs-4/packages/profile-provider/sql/postgresql/profiled-group-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/profile-provider/sql/postgresql/profiled-group-drop.sql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/profile-provider/sql/postgresql/profiled-group-drop.sql 29 Mar 2002 16:53:02 -0000 1.1 +++ openacs-4/packages/profile-provider/sql/postgresql/profiled-group-drop.sql 2 Mar 2003 22:40:20 -0000 1.1.2.1 @@ -5,7 +5,7 @@ -- @version $Id$ -- -drop function profiled_group__new(integer,integer,varchar,varchar,varchar,varchar,varchar,timestamp,integer,varchar); +drop function profiled_group__new(integer,integer,varchar,varchar,varchar,varchar,varchar,timestamptz,integer,varchar); drop function profiled_group__delete(integer); Index: openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql 2 Mar 2003 22:40:20 -0000 1.2.2.1 @@ -81,7 +81,7 @@ -- drop function static_portal_content_item__new ( - integer, varchar, varchar, varchar, timestamp, integer,varchar, integer + integer, varchar, varchar, varchar, timestamptz, integer,varchar, integer ) ; drop function static_portal_content_item__delete ( integer); Index: openacs-4/packages/static-portlet/sql/postgresql/static-core.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-core.sql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-core.sql 9 Aug 2002 18:39:33 -0000 1.3 +++ openacs-4/packages/static-portlet/sql/postgresql/static-core.sql 2 Mar 2003 22:40:20 -0000 1.3.2.1 @@ -104,7 +104,7 @@ varchar, -- pretty_name in static_portal_content.pretty_name%TYPE default null, varchar, -- content in static_portal_content.content%TYPE default null, varchar, -- object_type in acs_objects.object_type%TYPE default [static_portal_content], - timestamp, -- creation_date in acs_objects.creation_date%TYPE default sysdate, + timestamptz, -- creation_date in acs_objects.creation_date%TYPE default sysdate, integer, -- creation_user in acs_objects.creation_user%TYPE default null, varchar, -- creation_ip in acs_objects.creation_ip%TYPE default null, integer -- context_id in acs_objects.context_id%TYPE default null