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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/sql/oracle/assessment-actions-insert.sql 4 Feb 2005 18:10:01 -0000 1.1 @@ -0,0 +1,67 @@ +-- Assessment Package +-- @author Anny Flores (annyflores@viaro.net) Viaro Networks (www.viaro.net) +-- @creation-date 2005-02-03 + + +------------------------------------------------ +-- Default Actions +------------------------------------------------ + +--- REGISTER USER + +insert into as_actions (action_id,name,description,tcl_code) values (1,'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 [ad_verify_and_get_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" +ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$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', +'Last Name of the User'); +insert into as_action_params (parameter_id, action_id,type, varname, description) values (3,1,'n','email' +,'Email of the User'); +insert into as_action_params (parameter_id, action_id,type, varname, description) values (4,1,'n','user_name', +'User name of the User'); + +--- REGISTER USER TO EVENT + +insert into as_actions (action_id,name,description,tcl_code) values (2,'Event Registration','Register user to event',' +set user_id [ad_conn user_id] +events::registration::new -event_id $event_id -user_id $user_id'); + +insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (5,2,'q','event_id', +'Event to add the user', 'select event_id,event_id from acs_events'); + +--- REGISTER USER TO DOTLRN AND ADD USER TO COMMUNITY + +insert into as_actions (action_id,name,description,tcl_code) values (3,'Add to Community','Add user to a community',' +set user_id [ad_conn user_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'); + + +insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (6,3,'q','community_id', +'Community to add the user', 'select pretty_name,community_id from dotlrn_communities'); Index: openacs-4/packages/assessment/sql/oracle/assessment-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/assessment-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/sql/oracle/assessment-create.sql 30 Jan 2005 14:16:14 -0000 1.3 +++ openacs-4/packages/assessment/sql/oracle/assessment-create.sql 4 Feb 2005 18:09:43 -0000 1.4 @@ -12,4 +12,5 @@ @ assessment-types-create.sql @ assessment-checks-create.sql @ assessment-actions-create.sql -@ assessment-checks-package-create.sql \ No newline at end of file +@ assessment-checks-package-create.sql +@ assessment-actions-insert.sql \ No newline at end of file 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-insert.sql 4 Feb 2005 18:09:30 -0000 1.1 @@ -0,0 +1,67 @@ +-- Assessment Package +-- @author Anny Flores (annyflores@viaro.net) Viaro Networks (www.viaro.net) +-- @creation-date 2005-02-03 + + +------------------------------------------------ +-- Default Actions +------------------------------------------------ + +--- REGISTER USER + +insert into as_actions (action_id,name,description,tcl_code) values (1,'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 [ad_verify_and_get_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" +ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$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', +'Last Name of the User'); +insert into as_action_params (parameter_id, action_id,type, varname, description) values (3,1,'n','email' +,'Email of the User'); +insert into as_action_params (parameter_id, action_id,type, varname, description) values (4,1,'n','user_name', +'User name of the User'); + +--- REGISTER USER TO EVENT + +insert into as_actions (action_id,name,description,tcl_code) values (2,'Event Registration','Register user to event',' +set user_id [ad_conn user_id] +events::registration::new -event_id $event_id -user_id $user_id'); + +insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (5,2,'q','event_id', +'Event to add the user', 'select event_id,event_id from acs_events'); + +--- REGISTER USER TO DOTLRN AND ADD USER TO COMMUNITY + +insert into as_actions (action_id,name,description,tcl_code) values (3,'Add to Community','Add user to a community',' +set user_id [ad_conn user_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'); + + +insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (6,3,'q','community_id', +'Community to add the user', 'select pretty_name,community_id from dotlrn_communities'); Index: openacs-4/packages/assessment/sql/postgresql/assessment-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-create.sql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/assessment/sql/postgresql/assessment-create.sql 28 Jan 2005 20:36:56 -0000 1.16 +++ openacs-4/packages/assessment/sql/postgresql/assessment-create.sql 4 Feb 2005 18:09:09 -0000 1.17 @@ -12,4 +12,4 @@ \i assessment-types-create.sql \i assessment-checks-create.sql \i assessment-actions-create.sql - +\i assessment-actions-insert.sql Index: openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d5-0.10d6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d5-0.10d6.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d5-0.10d6.sql 29 Jan 2005 11:12:57 -0000 1.1 +++ openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d5-0.10d6.sql 4 Feb 2005 18:09:09 -0000 1.2 @@ -7,4 +7,5 @@ -- @cvs-id $Id$ -- -alter table as_inter_item_checks add column assessment_id integer; \ No newline at end of file +alter table as_inter_item_checks add column assessment_id integer; +\i ../assessment-actions-insert.sql \ No newline at end of file