Index: openacs-4/packages/rules/www/add-action.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-action.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/rules/www/add-action.tcl 20 Dec 2004 19:38:43 -0000 1.6 +++ openacs-4/packages/rules/www/add-action.tcl 21 Dec 2004 21:55:14 -0000 1.7 @@ -26,7 +26,7 @@ lappend results [list $pretty_name $community_id] } } - lappend results [list "to website" -1] + lappend results [list "to website" 0] Index: openacs-4/packages/rules/www/add-action.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-action.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/rules/www/add-action.xql 16 Dec 2004 18:47:07 -0000 1.1 +++ openacs-4/packages/rules/www/add-action.xql 21 Dec 2004 21:55:15 -0000 1.2 @@ -4,7 +4,7 @@ oracle8.1.6 - select community_id,pretty_name from dotlrn_communities_all + select group_id as community_id,group_name as pretty_name from groups \ No newline at end of file Index: openacs-4/packages/rules/www/admin-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/admin-request.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/admin-request.tcl 20 Dec 2004 20:39:14 -0000 1.3 +++ openacs-4/packages/rules/www/admin-request.tcl 21 Dec 2004 21:55:15 -0000 1.4 @@ -20,7 +20,7 @@ set context [list [list "$return_url?rule_id=$rule" "Rule Properties"] "$rule_name"] set communities_list [list] lappend communities_list [list "All" "all"] -lappend communities_list [list "System" "-1"] +lappend communities_list [list "System" "0"] lappend rules_list [list "All" "all"] db_foreach community {select community_id,pretty_name from dotlrn_communities_all} { @@ -165,7 +165,7 @@ group_id { label "Group Name" display_template { - < if @requests.group_id@ eq -1> + < if @requests.group_id@ eq 0> System @requests.group_name@ Index: openacs-4/packages/rules/www/approve-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/approve-users.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rules/www/approve-users.tcl 20 Dec 2004 19:38:43 -0000 1.2 +++ openacs-4/packages/rules/www/approve-users.tcl 21 Dec 2004 21:55:15 -0000 1.3 @@ -17,7 +17,7 @@ for { set i 0} { $i < $rules_count } { incr i } { set r_id [lindex $rha_id $i] set group_id [db_string community { *SQL* }] - if { $group_id != -1 } { + if { $group_id != 0 } { set user_id [db_string user { *SQL* }] set today [db_string today { *SQL* }] if {![dotlrn::user_is_community_member_p -user_id $user_id -community_id $group_id]} { Index: openacs-4/packages/rules/www/one-rule-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/one-rule-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rules/www/one-rule-oracle.xql 9 Dec 2004 20:11:25 -0000 1.2 +++ openacs-4/packages/rules/www/one-rule-oracle.xql 21 Dec 2004 21:55:15 -0000 1.3 @@ -15,8 +15,8 @@ select - ra.rule_id,ra.group_id,ra.notify_p,ra.active_p,ra.rule_action_id,ra.action_type, (select pretty_name from dotlrn_communities_all where - community_id=ra.group_id) as name + ra.rule_id,ra.group_id,ra.notify_p,ra.active_p,ra.rule_action_id,ra.action_type, (select group_name as pretty_name from groups where + group_id=ra.group_id) as name from rules r,rules_actions ra where ra.rule_id=r.rule_id and ra.rule_id=:rule_id Index: openacs-4/packages/rules/www/one-rule.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/one-rule.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/rules/www/one-rule.tcl 20 Dec 2004 19:38:43 -0000 1.9 +++ openacs-4/packages/rules/www/one-rule.tcl 21 Dec 2004 21:55:15 -0000 1.10 @@ -126,9 +126,9 @@ } Index: openacs-4/packages/rules/www/process-response-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/process-response-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/rules/www/process-response-oracle.xql 17 Dec 2004 16:59:20 -0000 1.6 +++ openacs-4/packages/rules/www/process-response-oracle.xql 21 Dec 2004 21:55:15 -0000 1.7 @@ -32,7 +32,7 @@ - select pretty_name from dotlrn_communities_all where community_id=:group_id + select group_name as pretty_name from groups where group_id=:group_id Index: openacs-4/packages/rules/www/process-response.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/process-response.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/rules/www/process-response.tcl 20 Dec 2004 20:39:14 -0000 1.10 +++ openacs-4/packages/rules/www/process-response.tcl 21 Dec 2004 21:55:15 -0000 1.11 @@ -31,15 +31,16 @@ if { $perform_actions == 1 } { db_foreach action { *SQL* } { set rha_id [db_nextval rha_seq] - set community_name [db_string name { *SQL* } -default System] + set community_name [db_string name { *SQL* } -default Website] set today [db_string date { *SQL* }] set username [db_string username { *SQL* }] if { $action_type == 1} { - if { $group_id > -1 } { - append message "
  • You have joined the $community_name community." - append notif_text "The user user has joined the $community_name community." - if {![dotlrn::user_is_community_member_p -user_id $user_id -community_id $group_id]} { - dotlrn_community::add_user $group_id $user_id + if { $group_id != 0 } { + append message "
  • You have joined the $community_name group." + append notif_text "The user user has joined the $community_name group." + + if {![group::member_p -user_id $user_id -group_id $group_id]} { + group::add_member -group_id $group_id -user_id $user_id } db_transaction { db_dml add_history { *SQL* } @@ -67,8 +68,10 @@ ad_script_abort } set user_id $user_new_info(user_id) + if { [apm_package_installed_p dotlrn] } { dotlrn_privacy::set_user_guest_p -user_id $user_id -value "t" dotlrn::user_add -can_browse -user_id $user_id + } db_transaction { db_dml add_history_system { *SQL* } } Index: openacs-4/packages/rules/www/single-rule-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/single-rule-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rules/www/single-rule-add.tcl 20 Dec 2004 20:02:55 -0000 1.2 +++ openacs-4/packages/rules/www/single-rule-add.tcl 21 Dec 2004 21:55:15 -0000 1.3 @@ -17,7 +17,7 @@ set default_action 1 set default_active "y" -set default_group "-1" +set default_group "0" set default_answer 0 set exp_trigger "" set context [list "Single Rule Properties"] @@ -39,7 +39,7 @@ db_foreach communities { *SQL* } { lappend communities [list $pretty_name $community_id] } - lappend communities [list "to website" -1] + lappend communities [list "to website" 0] set actions { {"Add Automatically" 1} {"Add to waiting list " 2}} Index: openacs-4/packages/rules/www/single-rule.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/single-rule.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rules/www/single-rule.tcl 20 Dec 2004 20:39:14 -0000 1.2 +++ openacs-4/packages/rules/www/single-rule.tcl 21 Dec 2004 21:55:15 -0000 1.3 @@ -87,7 +87,7 @@ group_id { label "Result" display_template { - + to website Index: openacs-4/packages/rules/www/admin/admin-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/admin/Attic/admin-request.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/rules/www/admin/admin-request.tcl 20 Dec 2004 20:39:14 -0000 1.6 +++ openacs-4/packages/rules/www/admin/admin-request.tcl 21 Dec 2004 21:55:15 -0000 1.7 @@ -14,7 +14,7 @@ set communities_list [list] set rules_list [list] lappend communities_list [list "All" "all"] -lappend communities_list [list "System" "-1"] +lappend communities_list [list "System" "0"] lappend rules_list [list "All" "all"] db_foreach community {select community_id,pretty_name from dotlrn_communities_all} { @@ -168,7 +168,7 @@ group_id { label "Group Name" display_template { - < if @requests.group_id@ eq -1> + < if @requests.group_id@ eq 0> to websyte @requests.group_name@ Index: openacs-4/packages/rules/www/admin/approve-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/admin/Attic/approve-users.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/admin/approve-users.tcl 10 Dec 2004 17:34:28 -0000 1.3 +++ openacs-4/packages/rules/www/admin/approve-users.tcl 21 Dec 2004 21:55:15 -0000 1.4 @@ -15,7 +15,7 @@ for { set i 0} { $i < $rules_count } { incr i } { set r_id [lindex $rha_id $i] set group_id [db_string community { select group_id from rule_history_actions where rha_id=:r_id}] - if { $group_id != -1 } { + if { $group_id != 0 } { set user_id [db_string user { select user_id from rule_history_actions where rha_id=:r_id}] set today [db_string today { select to_date (sysdate,'YYYY-MM-DD') from dual}] if {![dotlrn::user_is_community_member_p -user_id $user_id -community_id $group_id]} {