Index: openacs-4/packages/assessment/assessment.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v
diff -u -r1.50 -r1.51
--- openacs-4/packages/assessment/assessment.info 10 Oct 2009 22:38:09 -0000 1.50
+++ openacs-4/packages/assessment/assessment.info 2 Dec 2013 08:56:13 -0000 1.51
@@ -7,7 +7,7 @@
f
f
-
+
Eduardo Perez Ureta
Assessment package that will replace the surveys
quizz, complex survey, poll and other data collection packages
@@ -18,7 +18,7 @@
0
#assessment.Assessment#
-
+
Index: openacs-4/packages/assessment/sql/oracle/assessment-actions-insert.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/assessment-actions-insert.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/sql/oracle/assessment-actions-insert.sql 4 Feb 2005 21:02:15 -0000 1.3
+++ openacs-4/packages/assessment/sql/oracle/assessment-actions-insert.sql 2 Dec 2013 08:56:13 -0000 1.4
@@ -33,7 +33,7 @@
Thank you,
$administration_name"
-ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"');
+acs_mail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"');
insert into as_action_params (parameter_id, action_id,type, varname, description) values (1,1,'n','first_names',
Index: openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql 15 May 2007 20:14:16 -0000 1.7
+++ openacs-4/packages/assessment/sql/oracle/assessment-actions-package-create.sql 2 Dec 2013 08:56:13 -0000 1.8
@@ -144,7 +144,7 @@
(you may change your password after you log in)
Thank you,
$administration_name"
-ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"',
+acs_mail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"',
context_id => context_id,
creation_user => creation_user
);
@@ -196,7 +196,7 @@
db_1row select_user_info { select email, first_names, last_name from registered_users where user_id = :user_id}
-if [catch {ns_sendmail $email $email_from $subject $message} errmsg] {
+if [catch {acs_mail_lite::send -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] {
ad_return_error \
"Error sending mail" \
"There was an error sending email to $email."
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql 13 Mar 2005 22:08:45 -0000 1.2
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql 2 Dec 2013 08:56:13 -0000 1.3
@@ -102,7 +102,7 @@
(you may change your password after you log in)
Thank you,
$administration_name"
-ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"'',
+acs_mail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"'',
new__context_id,
new__creation_user
);
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 21 Feb 2013 14:39:06 -0000 1.12
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 2 Dec 2013 08:56:13 -0000 1.13
@@ -188,7 +188,7 @@
(you may change your password after you log in)
Thank you,
$administration_name"
-ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"',
+acs_sendmail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"',
new__package_id,
new__creation_user,
new__package_id
@@ -238,7 +238,7 @@
db_1row select_user_info { select email, first_names, last_name from registered_users where user_id = :user_id}
-if [catch {ns_sendmail $email $email_from $subject $message} errmsg] {
+if [catch {acs_mail_lite::send -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] {
ad_return_error \
"Error sending mail" \
"There was an error sending email to $email."
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql 13 Mar 2005 22:08:45 -0000 1.4
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql 2 Dec 2013 08:56:13 -0000 1.5
@@ -33,9 +33,8 @@
Thank you,
$administration_name"
-ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"');
+acs_mail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"');
-
insert into as_action_params (parameter_id, action_id,type, varname, description) values (1,1,'n','first_names',
'First Names of the User');
insert into as_action_params (parameter_id, action_id,type, varname, description) values (2,1,'n','last_name',
Index: openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.23d3-0.23d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.23d3-0.23d4.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.23d3-0.23d4.sql 2 Dec 2013 08:56:13 -0000 1.1
@@ -0,0 +1,101 @@
+
+
+create or replace function as_action__default_actions (integer,integer,integer)
+returns integer as $$
+declare
+ new__context_id alias for $1;
+ new__creation_user alias for $2;
+ new__package_id alias for $3;
+ v_action_id integer;
+ v_parameter_id integer;
+begin
+
+
+ v_action_id := as_action__new (
+ null,
+ 'Register User',
+ 'Register new users',
+ 'set password [ad_generate_random_string]
+db_transaction {
+array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password]
+}
+set admin_user_id [as::actions::get_admin_user_id]
+set administration_name [db_string admin_name "select first_names || '' '' || last_name from
+persons where person_id = :admin_user_id"]
+set system_name [ad_system_name]
+set system_url [ad_parameter -package_id [ad_acs_kernel_id] SystemURL ""].
+set admin_email [db_string unused "select email from parties where party_id = :admin_user_id"]
+set message "$first_names $last_name,
+You have been added as a user to $system_name
+at $system_url
+Login information:
+Email: $email
+Password: $password
+(you may change your password after you log in)
+Thank you,
+$administration_name"
+acs_sendmail_lite::send -to_addr "$email" -from_addr "$admin_email" -subject "You have been added as a user to [ad_system_name] at [ad_url]" -body "$message"',
+ new__package_id,
+ new__creation_user,
+ new__package_id
+ );
+
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,'n','first_names','First Names of the User');
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,'n','last_name','Last Name of the User');
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,'n','email','Email of the User');
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,'n','user_name','User name of the User');
+
+v_action_id:= as_action__new (
+ null,
+ 'Event Registration',
+ 'Register user to event',
+ 'set user_id [ad_conn user_id]
+events::registration::new -event_id $event_id -user_id $user_id',
+ new__package_id,
+ new__creation_user,
+ new__package_id
+ );
+
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,'q','event_id','Event to add the user', 'select event_id,event_id from acs_events');
+
+v_action_id:= as_action__new (
+ null,
+ 'Add to Community',
+ 'Add user to a community',
+ 'set user_id [ad_conn user_id]
+if { [exists_and_not_null subject_id] } {
+ set user_id $subject_id
+}
+dotlrn_privacy::set_user_guest_p -user_id $user_id -value "t"
+dotlrn::user_add -can_browse -user_id $user_id
+dotlrn_community::add_user_to_community -community_id $community_id -user_id $user_id
+
+set community_name [db_string get_community_name { select pretty_name from dotlrn_communities where community_id = :community_id}]
+
+set subject "Your $community_name membership has been approved"
+set message "Your $community_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_1row select_user_info { select email, first_names, last_name from registered_users where user_id = :user_id}
+
+if [catch {acs_mail_lite::send -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] {
+ ad_return_error \
+ "Error sending mail" \
+ "There was an error sending email to $email."
+}',
+ new__package_id,
+ new__creation_user,
+ new__package_id
+ );
+
+v_parameter_id:= nextval('as_action_params_parameter_id');
+insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,'q','community_id','Community to add the user', 'select pretty_name,community_id from dotlrn_communities where community_id in (select object_id from acs_permissions_all where grantee_id=:user_id)');
+
+ return v_action_id;
+end; $$ language 'plpgsql';