Index: openacs-4/packages/rules/www/add-action.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-action.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/add-action.adp 8 Dec 2004 21:21:25 -0000 1.3 +++ openacs-4/packages/rules/www/add-action.adp 9 Dec 2004 20:11:25 -0000 1.4 @@ -7,5 +7,6 @@ if (destination) location.href = destination; } + @context@ \ No newline at end of file Index: openacs-4/packages/rules/www/add-rule.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-rule.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/add-rule.tcl 8 Dec 2004 22:19:49 -0000 1.3 +++ openacs-4/packages/rules/www/add-rule.tcl 9 Dec 2004 20:11:25 -0000 1.4 @@ -6,6 +6,7 @@ Add new rule related to an Assessment } { rule_id:optional + return_url:optional } -properties { context } @@ -15,7 +16,7 @@ set context [list "Add rule"] set assessments [rules::rule::get_assessments] -ad_form -name add_rule -form { +ad_form -name add_rule -export { return_url } -form { rule_id:key { rule_name:text(text) {label "Rule Name"} @@ -37,5 +38,6 @@ } -edit_data { db_dml update_rule { update rules set rule_name=:rule_name, active_p=:active_p, asm_id=:asm_id where rule_id=:rule_id } } -after_submit { - ad_returnredirect "index" + + ad_returnredirect $return_url } Index: openacs-4/packages/rules/www/add-trigger-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-trigger-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/rules/www/add-trigger-oracle.xql 3 Dec 2004 17:56:02 -0000 1.1 +++ openacs-4/packages/rules/www/add-trigger-oracle.xql 9 Dec 2004 20:11:25 -0000 1.2 @@ -4,10 +4,12 @@ oracle8.1.6 - select question_id as qs_id, question_text as description - from survey_questions - where section_id = (select section_id from survey_sections where - survey_id=(select asm_id from rules where rule_id=:rule_id)) + select sq.question_id as qs_id, sq.question_text as description + from survey_questions sq where sq.section_id in (select section_id from survey_sections where + survey_id = (select asm_id as survey_id from rules where rule_id=:rule_id)) and sq.question_id not + in (select qs_id from rules_triggers where rule_id=:rule_id) and (select + count(choice_id) from survey_question_choices where question_id = sq.question_id) > 0 + Index: openacs-4/packages/rules/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/index.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/rules/www/index.adp 8 Dec 2004 21:21:25 -0000 1.4 +++ openacs-4/packages/rules/www/index.adp 9 Dec 2004 20:11:25 -0000 1.5 @@ -3,8 +3,10 @@ Index: openacs-4/packages/rules/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/index.tcl 8 Dec 2004 22:20:13 -0000 1.3 +++ openacs-4/packages/rules/www/index.tcl 9 Dec 2004 20:11:25 -0000 1.4 @@ -24,13 +24,13 @@ label "Rule Name" display_template { - @all_rules.rule_name@ + @all_rules.rule_name@ } } asm_name { - label "Related Questionnarie" + label "Related Questionnaire" link_url_eval {../survey/admin/one?survey_id=$asm_id} } active_p { @@ -47,7 +47,7 @@ rule_id { label "Notifications" display_template { - Notify user + Notify user } } 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.1 -r1.2 --- openacs-4/packages/rules/www/one-rule-oracle.xql 3 Dec 2004 17:57:03 -0000 1.1 +++ openacs-4/packages/rules/www/one-rule-oracle.xql 9 Dec 2004 20:11:25 -0000 1.2 @@ -23,10 +23,13 @@ - select question_id as qs_id, question_text as description - from survey_questions - where section_id = (select section_id from survey_sections where - survey_id=(select asm_id from rules where rule_id=:rule_id)) + select sq.question_id as qs_id, sq.question_text as description + from survey_questions sq + where sq.section_id = (select section_id from survey_sections where + survey_id=(select asm_id from rules where rule_id=:rule_id)) and sq.question_id not + in (select qs_id from rules_triggers where rule_id=:rule_id) and (select + count(choice_id) from survey_question_choices where question_id = + sq.question_id) > 0 Index: openacs-4/packages/rules/www/one-rule.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/one-rule.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/one-rule.adp 8 Dec 2004 22:30:56 -0000 1.3 +++ openacs-4/packages/rules/www/one-rule.adp 9 Dec 2004 20:11:25 -0000 1.4 @@ -33,7 +33,7 @@
-

@rule_name@

+

@rule_name@

Related Questionnarie: @assessment_related@
State:@state@ 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.5 -r1.6 --- openacs-4/packages/rules/www/one-rule.tcl 8 Dec 2004 22:32:01 -0000 1.5 +++ openacs-4/packages/rules/www/one-rule.tcl 9 Dec 2004 20:11:25 -0000 1.6 @@ -48,10 +48,11 @@ <% set q_id @rule_triggers.qs_id@ db_multirow answers answers {select choice_id as result_id, label as value from survey_question_choices where question_id = :q_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.1 -r1.2 --- openacs-4/packages/rules/www/process-response-oracle.xql 3 Dec 2004 17:57:14 -0000 1.1 +++ openacs-4/packages/rules/www/process-response-oracle.xql 9 Dec 2004 20:11:25 -0000 1.2 @@ -3,7 +3,7 @@ oracle8.1.6 - select * from survey_questions where section_id=(select section_id + select * from survey_questions where section_id in (select section_id from survey_sections ss where ss.survey_id=:survey_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.3 -r1.4 --- openacs-4/packages/rules/www/process-response.tcl 8 Dec 2004 21:21:25 -0000 1.3 +++ openacs-4/packages/rules/www/process-response.tcl 9 Dec 2004 20:11:25 -0000 1.4 @@ -14,8 +14,12 @@ set rest "" set message "" set notif_text "" + db_foreach rules_related {select * from rules where asm_id=:survey_id} { db_foreach rule_triggers { select * from rules_triggers where rule_id=:rule_id } { + #ad_return_complaint 1 "$qs_id $response_id" + #ad_script_abort + set answer [db_string answer { select choice_id from survey_question_responses where question_id=:qs_id and response_id=:response_id}] if { $answer == $result_id } { set perform_actions 1 @@ -25,15 +29,19 @@ } if { $perform_actions == 1 } { db_foreach action { select * from rules_actions where rule_id=:rule_id} { + # ad_return_complaint 1 "$action_type" +# ad_script_abort 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}] + 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." + dotlrn_community::add_user $group_id $user_id db_transaction { @@ -43,14 +51,24 @@ } 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 has been sent to the administrator of the group." + set today [db_string date "select sysdate from dual"] 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')} } - } elseif {$action_type == 3 } { - set user_info [db_string student_id {select number_answer from survey_question_responses where question_id = (:qs_id+1) and response_id = :response_id}] + } elseif { $action_type == 3 } { + set s_id "" + db_foreach questions { *SQL* } { + if { $question_text == "student_id"} { + set s_id $question_id + } + } +# ad_return_complaint 1 "$s_id" +# ad_script_abort + + set user_info [db_string student_id {select number_answer from survey_question_responses where question_id = :s_id and response_id = :response_id}] 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] @@ -71,6 +89,7 @@ } } + } } Index: openacs-4/packages/rules/www/admin/admin-request.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/admin/Attic/admin-request.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/rules/www/admin/admin-request.adp 8 Dec 2004 21:21:25 -0000 1.3 +++ openacs-4/packages/rules/www/admin/admin-request.adp 9 Dec 2004 20:11:25 -0000 1.4 @@ -4,31 +4,41 @@ function get_interval() { interval=document.interval.date.value; - destination = "admin-request?community=@default_community@&state=@default_state@&interval="+interval; + destination = "admin-request?community=@default_community@&state=@default_state@&rule=@default_rule@&interval="+interval; if (destination) location.href = destination; } + +
  • - Add New Rule Waiting Lists + Add New Rule Waiting + Lists Add new Questionnaire