+ You don't have permission to admin this Rule. "
+ ad_script_abort
+
+
+}
+
+
+ set rules_count [llength $rha_id]
+ 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 } {
+ 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]} {
+ dotlrn_community::add_user $group_id $user_id
+ }
+
+ db_transaction {
+
+ db_dml add_history { }
+ }
+
+ }
+}
+
+ ad_returnredirect "admin-request?interval=$interval&community=$community&specific_date=$specific_date&rule=$rule&state=$state"
Index: openacs-4/packages/rules/www/change-actions-result.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-actions-result.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/rules/www/change-actions-result.tcl 10 Dec 2004 17:34:27 -0000 1.2
+++ openacs-4/packages/rules/www/change-actions-result.tcl 16 Dec 2004 18:44:41 -0000 1.3
@@ -30,6 +30,6 @@
db_transaction {
- db_dml update_action_result { update rules_actions set group_id=:res where rule_action_id=:action_id}
+ db_dml update_action_result { *SQL* }
}
ad_returnredirect "one-rule?rule_id=$rule_id&res=$res"
\ No newline at end of file
Index: openacs-4/packages/rules/www/change-actions-result.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-actions-result.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/rules/www/change-actions-result.xql 16 Dec 2004 18:47:07 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+
+ update rules_actions set group_id=:res where
+ rule_action_id=:action_id
+
+
+
Index: openacs-4/packages/rules/www/change-trigger-qs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-trigger-qs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/rules/www/change-trigger-qs.tcl 3 Dec 2004 17:56:36 -0000 1.1
+++ openacs-4/packages/rules/www/change-trigger-qs.tcl 16 Dec 2004 18:44:41 -0000 1.2
@@ -13,6 +13,6 @@
db_transaction {
- db_dml update_trigger { update rules_triggers set qs_id=:qs where rule_id=:rule_id and rule_def_id=:trigger_id}
+ db_dml update_trigger { *SQL* }
}
ad_returnredirect "one-rule?rule_id=$rule_id&trigger=$trigger_id&qs=$qs"
\ No newline at end of file
Index: openacs-4/packages/rules/www/change-trigger-qs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-trigger-qs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/rules/www/change-trigger-qs.xql 16 Dec 2004 18:47:07 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+
+
+
+ update rules_triggers set qs_id=:qs where rule_id=:rule_id and rule_def_id=:trigger_id
+
+
+
Index: openacs-4/packages/rules/www/change-trigger-result.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-trigger-result.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/rules/www/change-trigger-result.tcl 3 Dec 2004 17:56:44 -0000 1.1
+++ openacs-4/packages/rules/www/change-trigger-result.tcl 16 Dec 2004 18:44:41 -0000 1.2
@@ -13,6 +13,6 @@
db_transaction {
- db_dml update_trigger_result { update rules_triggers set result_id=:res where rule_id=:rule_id and rule_def_id=:trigger_id}
+ db_dml update_trigger_result { *SQL* }
}
ad_returnredirect "one-rule?rule_id=$rule_id&res=$res"
\ No newline at end of file
Index: openacs-4/packages/rules/www/change-trigger-result.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/change-trigger-result.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/rules/www/change-trigger-result.xql 16 Dec 2004 18:47:07 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+
+
+
+update rules_triggers set result_id=:res where rule_id=:rule_id and rule_def_id=:trigger_id
+
+
+
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.4 -r1.5
--- openacs-4/packages/rules/www/process-response-oracle.xql 10 Dec 2004 17:34:27 -0000 1.4
+++ openacs-4/packages/rules/www/process-response-oracle.xql 16 Dec 2004 18:44:41 -0000 1.5
@@ -2,9 +2,71 @@
oracle8.1.6
-
- select * from survey_questions where section_id in (select section_id
- from survey_sections ss where ss.survey_id=:survey_id)
-
+
+ select * from survey_questions where section_id in (select section_id
+ from survey_sections ss where ss.survey_id=:survey_id)
+
+
+
+
+ select * from rules where asm_id=:survey_id
+
+
+
+
+ select result_id,rule_def_id, qs_id, active_p, rule_id from rules_triggers where rule_id=:rule_id
+
+
+
+
+ select choice_id from survey_question_responses where question_id=:qs_id and response_id=:response_id
+
+
+
+
+ select * from rules_actions where rule_id=:rule_id
+
+
+
+
+
+ select pretty_name from dotlrn_communities_all where community_id=:group_id
+
+
+
+
+ select to_date(sysdate,'YYYY-MM-DD') from dual
+
+
+
+
+ select p.first_names || ' ' || p.last_name as name from persons p where p.person_id = :user_id
+
+
+
+
+ select number_answer from survey_question_responses where question_id = :s_id and response_id = :response_id
+
+
+
+
+ insert into rule_history_actions (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p) values (:rha_id,:group_id,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),to_date(:today,'YYYY-MM-DD'),'y')
+
+
+
+
+
+ insert into rule_history_actions
+ (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p)
+ values
+ (:rha_id,:group_id,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),'','n')
+
+
+
+
+ insert into rule_history_actions (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p) values (:rha_id,-1,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),to_date(:today,'YYYY-MM-DD'),'y')
+
+
+
\ No newline at end of file
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.7 -r1.8
--- openacs-4/packages/rules/www/process-response.tcl 10 Dec 2004 17:34:27 -0000 1.7
+++ openacs-4/packages/rules/www/process-response.tcl 16 Dec 2004 18:44:41 -0000 1.8
@@ -15,39 +15,39 @@
set message ""
set notif_text ""
-db_foreach rules_related { select * from rules where asm_id=:survey_id } {
+db_foreach rules_related { *SQL* } {
if { $active_p == "y"} {
- db_foreach rule_triggers {select result_id,rule_def_id, qs_id, active_p, rule_id from rules_triggers where rule_id=:rule_id } {
+ db_foreach rule_triggers { *SQL* } {
if { $active_p == "y" } {
- set answer [db_string answer { select choice_id from survey_question_responses where question_id=:qs_id and response_id=:response_id}]
+ set answer [db_string answer { *SQL* }]
if { $answer == $result_id } {
set perform_actions 1
} else {
set perform_actions 0
}
if { $perform_actions == 1 } {
- db_foreach action { select * from rules_actions where rule_id=:rule_id} {
+ db_foreach action { *SQL* } {
set rha_id [db_nextval rha_seq]
- set community_name [db_string name {select pretty_name from dotlrn_communities_all where community_id=:group_id} -default System]
- set today [db_string date "select to_date(sysdate,'YYYY-MM-DD') from dual"]
- set username [db_string name {select p.first_names || ' ' || p.last_name as name from persons p where p.person_id = :user_id}]
+ set community_name [db_string name { *SQL* } -default System]
+ set today [db_string date { *SQL* }]
+ set username [db_string username { *SQL* }]
if { $action_type == 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
}
db_transaction {
- db_dml add_history { insert into rule_history_actions (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p) values (:rha_id,:group_id,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),to_date(:today,'YYYY-MM-DD'),'y')}
+ db_dml add_history { *SQL* }
}
} elseif { $action_type == 2 } {
append message "
Your request to join $community_name has been sent to the administrator of the group."
append notif_text "The user $username requested to join $community_name."
- set today [db_string date "select sysdate from dual"]
+ set today [db_string date { *SQL* }]
db_transaction {
- db_dml add_history { insert into rule_history_actions (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p) values (:rha_id,:group_id,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),'','n')}
+ db_dml add_history_wait { *SQL* }
}
} elseif { $action_type == 3 } {
set s_id ""
@@ -56,7 +56,7 @@
set s_id $question_id
}
}
- set user_info [db_string student_id {select number_answer from survey_question_responses where question_id = :s_id and response_id = :response_id}]
+ set user_info [db_string student_id { *SQL* }]
array set user_new_info [auth::create_user -username $user_info -email $user_info@viaro.net -first_names $user_info -last_name $user_info -password $user_info]
append message "
You have joined the System
@@ -74,7 +74,7 @@
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 { insert into rule_history_actions (rha_id,group_id,user_id,rule_action_id,request_date,processing_date,approved_p) values (:rha_id,-1,:user_id,:rule_action_id,to_date(:today,'YYYY-MM-DD'),to_date(:today,'YYYY-MM-DD'),'y')}
+ db_dml add_history_system { *SQL* }
}
}
}
Index: openacs-4/packages/rules/www/unsubscribe.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/unsubscribe.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/rules/www/unsubscribe.tcl 3 Dec 2004 17:57:45 -0000 1.1
+++ openacs-4/packages/rules/www/unsubscribe.tcl 16 Dec 2004 18:44:41 -0000 1.2
@@ -13,7 +13,7 @@
for { set i 0} { $i < $request_count } { incr i } {
db_transaction {
set r_id [lindex $request_id $i]
- db_dml remove_notify { delete from notification_requests where request_id=:r_id }
+ db_dml remove_notify { *SQL* }
}
}