Index: openacs-4/contrib/packages/simulation/lib/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/messages.tcl,v
diff -u -r1.16 -r1.17
--- openacs-4/contrib/packages/simulation/lib/messages.tcl 12 Mar 2004 15:34:55 -0000 1.16
+++ openacs-4/contrib/packages/simulation/lib/messages.tcl 16 Mar 2004 15:43:41 -0000 1.17
@@ -115,8 +115,34 @@
workflow_cases wc,
sim_cases sc
where cr.revision_id = sm.message_id
- and sm.entry_id is null
and wc.case_id = sm.case_id
+ [ad_decode $role_id "" "" "and (sm.entry_id is null or not (
+ -- The whole expression in the not parenthesis is true if there is an assigned action
+ -- responding to the message in which case the message shouldnt show up in the message list
+
+ -- message is associated with an action that put us in the current state
+ sm.entry_id in (select max(wcl.entry_id)
+ from workflow_case_log wcl,
+ workflow_fsm_actions wfa,
+ workflow_case_fsm wcf,
+ sim_messagesx sm2
+ where wcl.case_id = sm.case_id
+ and wcl.action_id = wfa.action_id
+ and wcf.case_id = wcl.case_id
+ and wfa.new_state = wcf.current_state
+ and sm2.entry_id = wcl.entry_id
+ and sm2.to_role_id = :role_id
+ )
+ and
+ -- There is an assigned action with a recipient being sender of the message
+ exists (select 1
+ from workflow_case_assigned_actions wcaa,
+ sim_task_recipients str
+ where wcaa.case_id = sm.case_id
+ and wcaa.role_id = :role_id
+ and str.task_id = wcaa.action_id
+ and str.recipient = sm.from_role_id)
+ ))"]
[ad_decode $role_id "" "" "and (sm.to_role_id = :role_id or sm.from_role_id = :role_id)"]
and wc.case_id = sm.case_id
and sc.sim_case_id = wc.object_id
Index: openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-tasks.tcl,v
diff -u -r1.41 -r1.42
--- openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 15 Mar 2004 17:22:18 -0000 1.41
+++ openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 16 Mar 2004 15:43:41 -0000 1.42
@@ -68,14 +68,6 @@
}
}
-lappend elements copy {
- hide_p {[ad_decode $display_mode edit 0 1]}
- sub_class narrow
- link_url_col copy_url
- display_template {
-
- }
-}
lappend elements name {
label "
Name"
@@ -95,6 +87,15 @@
link_url_col assigned_role_edit_url
}
+lappend elements copy {
+ hide_p {[ad_decode $display_mode edit 0 1]}
+ sub_class narrow
+ link_url_col copy_url
+ display_template {
+
+ }
+}
+
lappend elements delete {
sub_class narrow
hide_p {[ad_decode $display_mode edit 0 1]}
Index: openacs-4/contrib/packages/simulation/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/index.adp,v
diff -u -r1.30 -r1.31
--- openacs-4/contrib/packages/simulation/www/index.adp 15 Jan 2004 14:56:26 -0000 1.30
+++ openacs-4/contrib/packages/simulation/www/index.adp 16 Mar 2004 15:43:41 -0000 1.31
@@ -32,7 +32,7 @@
- Log in to see your active cases.
+ Log in to see your active cases.
Join a Simulation
Index: openacs-4/contrib/packages/simulation/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/index.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/contrib/packages/simulation/www/index.tcl 12 Mar 2004 12:07:20 -0000 1.14
+++ openacs-4/contrib/packages/simulation/www/index.tcl 16 Mar 2004 15:43:41 -0000 1.15
@@ -11,6 +11,8 @@
set context ""
set user_id [auth::get_user_id]
+set login_url [ad_get_login_url -return]
+
set citybuild_p [permission::permission_p -object_id $package_id -privilege sim_object_create]
set simbuild_p [permission::permission_p -object_id $package_id -privilege sim_template_read]
set siminst_p [permission::permission_p -object_id $package_id -privilege sim_inst]
Index: openacs-4/contrib/packages/simulation/www/simplay/case.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/case.adp,v
diff -u -r1.11 -r1.12
--- openacs-4/contrib/packages/simulation/www/simplay/case.adp 30 Jan 2004 12:13:37 -0000 1.11
+++ openacs-4/contrib/packages/simulation/www/simplay/case.adp 16 Mar 2004 15:43:42 -0000 1.12
@@ -4,15 +4,15 @@
Recent Messages
-
+
Tasks
-
+
Index: openacs-4/contrib/packages/simulation/www/simplay/task-detail.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/task-detail.adp,v
diff -u -r1.10 -r1.11
--- openacs-4/contrib/packages/simulation/www/simplay/task-detail.adp 4 Mar 2004 12:09:44 -0000 1.10
+++ openacs-4/contrib/packages/simulation/www/simplay/task-detail.adp 16 Mar 2004 15:43:42 -0000 1.11
@@ -31,4 +31,12 @@
@documents_pre_form;noquote@
+
+
+ NOTE: To attach a document to your message you need to upload a document to your
+ portfolio before writing the message.
+
+
+
Index: openacs-4/contrib/packages/simulation/www/simplay/task-detail.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/task-detail.tcl,v
diff -u -r1.22 -r1.23
--- openacs-4/contrib/packages/simulation/www/simplay/task-detail.tcl 12 Mar 2004 15:49:43 -0000 1.22
+++ openacs-4/contrib/packages/simulation/www/simplay/task-detail.tcl 16 Mar 2004 15:43:42 -0000 1.23
@@ -38,6 +38,9 @@
}
if { ![info exists body] } {
+ # If this is a message task (with recipients) and its recipients have previously executed a message task
+ # that put us in the current state then we consider this a response and we prepopulate the message
+ # subject and body with text from the message being responded to.
if {[db_0or1row select_triggering_message_id {
select sm.from_role_id,
sm.to_role_id,
@@ -51,11 +54,19 @@
and sm.entry_id = (select max(wcl.entry_id)
from workflow_case_log wcl,
workflow_fsm_actions wfa,
- workflow_case_fsm wcf
+ workflow_case_fsm wcf,
+ sim_messagesx sm2
where wcl.case_id = sm.case_id
and wcl.action_id = wfa.action_id
and wcf.case_id = wcl.case_id
- and wfa.new_state = wcf.current_state)
+ and wfa.new_state = wcf.current_state
+ and sm2.entry_id = wcl.entry_id
+ and sm2.to_role_id = :role_id
+ and sm2.from_role_id in (select recipient
+ from sim_task_recipients
+ where task_id = :action_id
+ )
+ )
and sm.case_id = :case_id
}] } {
set subject "Re: $subject"
@@ -125,6 +136,8 @@
set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "Case"] [list [export_vars -base tasks { case_id role_id }] "Tasks"] $page_title]
set documents_pre_form ""
+set document_upload_url [export_vars -base document-upload {case_id role_id {return_url {[ad_return_url]}}}]
+
if { ![empty_string_p $action(recipients)] } {
# We have recipient roles - use message form
Index: openacs-4/packages/simulation/lib/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/messages.tcl,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/simulation/lib/messages.tcl 12 Mar 2004 15:34:55 -0000 1.16
+++ openacs-4/packages/simulation/lib/messages.tcl 16 Mar 2004 15:43:41 -0000 1.17
@@ -115,8 +115,34 @@
workflow_cases wc,
sim_cases sc
where cr.revision_id = sm.message_id
- and sm.entry_id is null
and wc.case_id = sm.case_id
+ [ad_decode $role_id "" "" "and (sm.entry_id is null or not (
+ -- The whole expression in the not parenthesis is true if there is an assigned action
+ -- responding to the message in which case the message shouldnt show up in the message list
+
+ -- message is associated with an action that put us in the current state
+ sm.entry_id in (select max(wcl.entry_id)
+ from workflow_case_log wcl,
+ workflow_fsm_actions wfa,
+ workflow_case_fsm wcf,
+ sim_messagesx sm2
+ where wcl.case_id = sm.case_id
+ and wcl.action_id = wfa.action_id
+ and wcf.case_id = wcl.case_id
+ and wfa.new_state = wcf.current_state
+ and sm2.entry_id = wcl.entry_id
+ and sm2.to_role_id = :role_id
+ )
+ and
+ -- There is an assigned action with a recipient being sender of the message
+ exists (select 1
+ from workflow_case_assigned_actions wcaa,
+ sim_task_recipients str
+ where wcaa.case_id = sm.case_id
+ and wcaa.role_id = :role_id
+ and str.task_id = wcaa.action_id
+ and str.recipient = sm.from_role_id)
+ ))"]
[ad_decode $role_id "" "" "and (sm.to_role_id = :role_id or sm.from_role_id = :role_id)"]
and wc.case_id = sm.case_id
and sc.sim_case_id = wc.object_id
Index: openacs-4/packages/simulation/lib/sim-template-tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-tasks.tcl,v
diff -u -r1.41 -r1.42
--- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 15 Mar 2004 17:22:18 -0000 1.41
+++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 16 Mar 2004 15:43:41 -0000 1.42
@@ -68,14 +68,6 @@
}
}
-lappend elements copy {
- hide_p {[ad_decode $display_mode edit 0 1]}
- sub_class narrow
- link_url_col copy_url
- display_template {
-
- }
-}
lappend elements name {
label "
Name"
@@ -95,6 +87,15 @@
link_url_col assigned_role_edit_url
}
+lappend elements copy {
+ hide_p {[ad_decode $display_mode edit 0 1]}
+ sub_class narrow
+ link_url_col copy_url
+ display_template {
+
+ }
+}
+
lappend elements delete {
sub_class narrow
hide_p {[ad_decode $display_mode edit 0 1]}
Index: openacs-4/packages/simulation/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.adp,v
diff -u -r1.30 -r1.31
--- openacs-4/packages/simulation/www/index.adp 15 Jan 2004 14:56:26 -0000 1.30
+++ openacs-4/packages/simulation/www/index.adp 16 Mar 2004 15:43:41 -0000 1.31
@@ -32,7 +32,7 @@
- Log in to see your active cases.
+ Log in to see your active cases.
Join a Simulation
Index: openacs-4/packages/simulation/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/simulation/www/index.tcl 12 Mar 2004 12:07:20 -0000 1.14
+++ openacs-4/packages/simulation/www/index.tcl 16 Mar 2004 15:43:41 -0000 1.15
@@ -11,6 +11,8 @@
set context ""
set user_id [auth::get_user_id]
+set login_url [ad_get_login_url -return]
+
set citybuild_p [permission::permission_p -object_id $package_id -privilege sim_object_create]
set simbuild_p [permission::permission_p -object_id $package_id -privilege sim_template_read]
set siminst_p [permission::permission_p -object_id $package_id -privilege sim_inst]
Index: openacs-4/packages/simulation/www/simplay/case.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case.adp,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/simulation/www/simplay/case.adp 30 Jan 2004 12:13:37 -0000 1.11
+++ openacs-4/packages/simulation/www/simplay/case.adp 16 Mar 2004 15:43:42 -0000 1.12
@@ -4,15 +4,15 @@
Recent Messages
-
+
Tasks
-
+
Index: openacs-4/packages/simulation/www/simplay/task-detail.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/task-detail.adp,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/simulation/www/simplay/task-detail.adp 4 Mar 2004 12:09:44 -0000 1.10
+++ openacs-4/packages/simulation/www/simplay/task-detail.adp 16 Mar 2004 15:43:42 -0000 1.11
@@ -31,4 +31,12 @@
@documents_pre_form;noquote@
+
+
+ NOTE: To attach a document to your message you need to upload a document to your
+ portfolio before writing the message.
+
+
+
Index: openacs-4/packages/simulation/www/simplay/task-detail.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/task-detail.tcl,v
diff -u -r1.22 -r1.23
--- openacs-4/packages/simulation/www/simplay/task-detail.tcl 12 Mar 2004 15:49:43 -0000 1.22
+++ openacs-4/packages/simulation/www/simplay/task-detail.tcl 16 Mar 2004 15:43:42 -0000 1.23
@@ -38,6 +38,9 @@
}
if { ![info exists body] } {
+ # If this is a message task (with recipients) and its recipients have previously executed a message task
+ # that put us in the current state then we consider this a response and we prepopulate the message
+ # subject and body with text from the message being responded to.
if {[db_0or1row select_triggering_message_id {
select sm.from_role_id,
sm.to_role_id,
@@ -51,11 +54,19 @@
and sm.entry_id = (select max(wcl.entry_id)
from workflow_case_log wcl,
workflow_fsm_actions wfa,
- workflow_case_fsm wcf
+ workflow_case_fsm wcf,
+ sim_messagesx sm2
where wcl.case_id = sm.case_id
and wcl.action_id = wfa.action_id
and wcf.case_id = wcl.case_id
- and wfa.new_state = wcf.current_state)
+ and wfa.new_state = wcf.current_state
+ and sm2.entry_id = wcl.entry_id
+ and sm2.to_role_id = :role_id
+ and sm2.from_role_id in (select recipient
+ from sim_task_recipients
+ where task_id = :action_id
+ )
+ )
and sm.case_id = :case_id
}] } {
set subject "Re: $subject"
@@ -125,6 +136,8 @@
set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "Case"] [list [export_vars -base tasks { case_id role_id }] "Tasks"] $page_title]
set documents_pre_form ""
+set document_upload_url [export_vars -base document-upload {case_id role_id {return_url {[ad_return_url]}}}]
+
if { ![empty_string_p $action(recipients)] } {
# We have recipient roles - use message form