Index: openacs-4/contrib/packages/simulation/lib/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/portfolio.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/contrib/packages/simulation/lib/portfolio.tcl 5 Jan 2004 12:33:41 -0000 1.3
+++ openacs-4/contrib/packages/simulation/lib/portfolio.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -22,10 +22,6 @@
-no_data "There are no documents." \
-actions [list "Upload a document" $upload_url] \
-elements {
- role_name {
- label "Role"
- hide_p {[ad_decode [llength $user_roles] 1 1 0]}
- }
document_title {
label "Document"
link_url_col document_url
Index: openacs-4/contrib/packages/simulation/tcl/template-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/template-procs.tcl,v
diff -u -r1.37 -r1.38
--- openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 8 Jan 2004 15:54:01 -0000 1.37
+++ openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 8 Jan 2004 16:02:34 -0000 1.38
@@ -227,6 +227,21 @@
array set row [array get local_row]
}
+ad_proc -public simulation::template::get_element {
+ {-workflow_id:required}
+ {-element:required}
+} {
+ Return element from a simulation template.
+
+ @param workflow_id ID of simulation template.
+ @param element The name of the element you want.
+
+} {
+
+ get -workflow_id $workflow_id -array row
+ return $row($element)
+}
+
ad_proc -public simulation::template::delete {
{-workflow_id:required}
} {
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.7 -r1.8
--- openacs-4/contrib/packages/simulation/www/simplay/case.adp 5 Jan 2004 11:44:33 -0000 1.7
+++ openacs-4/contrib/packages/simulation/www/simplay/case.adp 8 Jan 2004 16:02:34 -0000 1.8
@@ -2,14 +2,17 @@
@title;noquote@
@context;noquote@
-
Available Tasks
+Recent Messages
-
+
+
+TODO: show only 5 most recent messages in this view
-Incoming Messages
+Tasks
-
+
+
Document Portfolio
Index: openacs-4/contrib/packages/simulation/www/simplay/case.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/case.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/contrib/packages/simulation/www/simplay/case.tcl 5 Jan 2004 14:10:37 -0000 1.3
+++ openacs-4/contrib/packages/simulation/www/simplay/case.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -4,9 +4,10 @@
case_id:integer
}
-set case_name [simulation::case::get_element -case_id $case_id -element label]
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
-set title "Case $case_name"
+set title "$simulation_name"
set context [list [list . "SimPlay"] $title]
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
Index: openacs-4/contrib/packages/simulation/www/simplay/control-bar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/control-bar.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/contrib/packages/simulation/www/simplay/control-bar.adp 8 Jan 2004 14:24:44 -0000 1.9
+++ openacs-4/contrib/packages/simulation/www/simplay/control-bar.adp 8 Jan 2004 16:02:34 -0000 1.10
@@ -1,21 +1,18 @@
-
You are Bernadette (Plaintiff)
+You are Bernadette
+(Plaintiff) (TODO: make this real)
-
-
Your Options
-TODO: Link "about this simulation" to simplay/about-sim?sim_id=
Contactss
Index: openacs-4/contrib/packages/simulation/www/simplay/control-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/control-bar.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/contrib/packages/simulation/www/simplay/control-bar.tcl 7 Jan 2004 14:46:04 -0000 1.9
+++ openacs-4/contrib/packages/simulation/www/simplay/control-bar.tcl 8 Jan 2004 16:02:34 -0000 1.10
@@ -7,6 +7,9 @@
if { ![info exists case_id] } {
set case_id {}
+ set workflow_id {}
+} else {
+ set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
}
if { !$adminplayer_p } {
@@ -15,7 +18,6 @@
set case_home_url [export_vars -base "case" { case_id }]
-
set message_count [db_string message_count_sql "
select count(*)
from sim_messages sm,
@@ -29,7 +31,6 @@
"]
set messages_url [export_vars -base ${section_uri}messages { case_id }]
-
# TODO: decide whether to replace direct sql with this API loop:
# get a list of cases in which the user participates
# for each case, do [workflow::case::get_available_actions -case_id case_id -user_id :user_id ]
@@ -50,16 +51,25 @@
"]
set tasks_url [export_vars -base ${section_uri}tasks { case_id }]
-
-
-
set portfolio_url [export_vars -base ${section_uri}portfolio { case_id }]
+set about_sim_url [export_vars -base ${section_uri}about-sim { case_id }]
+# TODO: exclude records where wcrpm.party_id includes current user
+db_multirow -extend { character_url } roles select_roles "
+ select wcrpm.role_id,
+ wr.pretty_name as role_name,
+ scx.name,
+ scx.title
+ from workflow_case_role_party_map wcrpm,
+ workflow_roles wr,
+ sim_roles sr,
+ sim_charactersx scx
+ where wcrpm.case_id = :case_id
+ and wr.role_id = wcrpm.role_id
+ and sr.role_id = wcrpm.role_id
+ and scx.object_id = sr.character_id
+" {
+ set character_url [simulation::object::url -name $name]
+}
-multirow create roles role_id short_name pretty_name
-foreach role_id [workflow::case::get_user_roles -case_id $case_id] {
- array unset role
- workflow::role::get -role_id $role_id -array role
- multirow append roles $role(role_id) $role(short_name) $role(pretty_name)
-}
Index: openacs-4/contrib/packages/simulation/www/simplay/message.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/message.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/contrib/packages/simulation/www/simplay/message.tcl 8 Jan 2004 15:54:01 -0000 1.15
+++ openacs-4/contrib/packages/simulation/www/simplay/message.tcl 8 Jan 2004 16:02:34 -0000 1.16
@@ -10,6 +10,8 @@
body_mime_type:optional
}
+# TODO: store messages in a folder specific to the case
+
set page_title "Message"
set context [list [list "." "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $page_title]
set package_id [ad_conn package_id]
Index: openacs-4/contrib/packages/simulation/www/simplay/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/messages.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/contrib/packages/simulation/www/simplay/messages.tcl 5 Jan 2004 10:49:59 -0000 1.5
+++ openacs-4/contrib/packages/simulation/www/simplay/messages.tcl 8 Jan 2004 16:02:34 -0000 1.6
@@ -4,7 +4,10 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Messages"
-set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
set user_id [ad_conn user_id]
Index: openacs-4/contrib/packages/simulation/www/simplay/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/portfolio.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/contrib/packages/simulation/www/simplay/portfolio.tcl 8 Jan 2004 14:24:44 -0000 1.3
+++ openacs-4/contrib/packages/simulation/www/simplay/portfolio.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -4,8 +4,12 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Portfolio"
-set context [list [list . "SimPlay"] [list . "SIMNAME/ROLE"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
+
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
Index: openacs-4/contrib/packages/simulation/www/simplay/tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/tasks.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/contrib/packages/simulation/www/simplay/tasks.adp 19 Dec 2003 14:00:39 -0000 1.5
+++ openacs-4/contrib/packages/simulation/www/simplay/tasks.adp 8 Jan 2004 16:02:34 -0000 1.6
@@ -4,4 +4,6 @@
+TODO: make sure to show all completed tasks (one reason is that this
+is the only way to see documents that are part of tasks)
Index: openacs-4/contrib/packages/simulation/www/simplay/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/tasks.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/contrib/packages/simulation/www/simplay/tasks.tcl 19 Dec 2003 14:00:39 -0000 1.4
+++ openacs-4/contrib/packages/simulation/www/simplay/tasks.tcl 8 Jan 2004 16:02:34 -0000 1.5
@@ -4,7 +4,10 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Tasks"
-set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
set user_id [ad_conn user_id]
Index: openacs-4/packages/simulation/lib/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/portfolio.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/lib/portfolio.tcl 5 Jan 2004 12:33:41 -0000 1.3
+++ openacs-4/packages/simulation/lib/portfolio.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -22,10 +22,6 @@
-no_data "There are no documents." \
-actions [list "Upload a document" $upload_url] \
-elements {
- role_name {
- label "Role"
- hide_p {[ad_decode [llength $user_roles] 1 1 0]}
- }
document_title {
label "Document"
link_url_col document_url
Index: openacs-4/packages/simulation/tcl/template-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/template-procs.tcl,v
diff -u -r1.37 -r1.38
--- openacs-4/packages/simulation/tcl/template-procs.tcl 8 Jan 2004 15:54:01 -0000 1.37
+++ openacs-4/packages/simulation/tcl/template-procs.tcl 8 Jan 2004 16:02:34 -0000 1.38
@@ -227,6 +227,21 @@
array set row [array get local_row]
}
+ad_proc -public simulation::template::get_element {
+ {-workflow_id:required}
+ {-element:required}
+} {
+ Return element from a simulation template.
+
+ @param workflow_id ID of simulation template.
+ @param element The name of the element you want.
+
+} {
+
+ get -workflow_id $workflow_id -array row
+ return $row($element)
+}
+
ad_proc -public simulation::template::delete {
{-workflow_id:required}
} {
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.7 -r1.8
--- openacs-4/packages/simulation/www/simplay/case.adp 5 Jan 2004 11:44:33 -0000 1.7
+++ openacs-4/packages/simulation/www/simplay/case.adp 8 Jan 2004 16:02:34 -0000 1.8
@@ -2,14 +2,17 @@
@title;noquote@
@context;noquote@
-Available Tasks
+Recent Messages
-
+
+
+TODO: show only 5 most recent messages in this view
-Incoming Messages
+Tasks
-
+
+
Document Portfolio
Index: openacs-4/packages/simulation/www/simplay/case.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simplay/case.tcl 5 Jan 2004 14:10:37 -0000 1.3
+++ openacs-4/packages/simulation/www/simplay/case.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -4,9 +4,10 @@
case_id:integer
}
-set case_name [simulation::case::get_element -case_id $case_id -element label]
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
-set title "Case $case_name"
+set title "$simulation_name"
set context [list [list . "SimPlay"] $title]
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
Index: openacs-4/packages/simulation/www/simplay/control-bar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/control-bar.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/simulation/www/simplay/control-bar.adp 8 Jan 2004 14:24:44 -0000 1.9
+++ openacs-4/packages/simulation/www/simplay/control-bar.adp 8 Jan 2004 16:02:34 -0000 1.10
@@ -1,21 +1,18 @@
-
You are Bernadette (Plaintiff)
+You are Bernadette
+(Plaintiff) (TODO: make this real)
-
-
Your Options
-TODO: Link "about this simulation" to simplay/about-sim?sim_id=
Contactss
Index: openacs-4/packages/simulation/www/simplay/control-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/control-bar.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/simulation/www/simplay/control-bar.tcl 7 Jan 2004 14:46:04 -0000 1.9
+++ openacs-4/packages/simulation/www/simplay/control-bar.tcl 8 Jan 2004 16:02:34 -0000 1.10
@@ -7,6 +7,9 @@
if { ![info exists case_id] } {
set case_id {}
+ set workflow_id {}
+} else {
+ set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
}
if { !$adminplayer_p } {
@@ -15,7 +18,6 @@
set case_home_url [export_vars -base "case" { case_id }]
-
set message_count [db_string message_count_sql "
select count(*)
from sim_messages sm,
@@ -29,7 +31,6 @@
"]
set messages_url [export_vars -base ${section_uri}messages { case_id }]
-
# TODO: decide whether to replace direct sql with this API loop:
# get a list of cases in which the user participates
# for each case, do [workflow::case::get_available_actions -case_id case_id -user_id :user_id ]
@@ -50,16 +51,25 @@
"]
set tasks_url [export_vars -base ${section_uri}tasks { case_id }]
-
-
-
set portfolio_url [export_vars -base ${section_uri}portfolio { case_id }]
+set about_sim_url [export_vars -base ${section_uri}about-sim { case_id }]
+# TODO: exclude records where wcrpm.party_id includes current user
+db_multirow -extend { character_url } roles select_roles "
+ select wcrpm.role_id,
+ wr.pretty_name as role_name,
+ scx.name,
+ scx.title
+ from workflow_case_role_party_map wcrpm,
+ workflow_roles wr,
+ sim_roles sr,
+ sim_charactersx scx
+ where wcrpm.case_id = :case_id
+ and wr.role_id = wcrpm.role_id
+ and sr.role_id = wcrpm.role_id
+ and scx.object_id = sr.character_id
+" {
+ set character_url [simulation::object::url -name $name]
+}
-multirow create roles role_id short_name pretty_name
-foreach role_id [workflow::case::get_user_roles -case_id $case_id] {
- array unset role
- workflow::role::get -role_id $role_id -array role
- multirow append roles $role(role_id) $role(short_name) $role(pretty_name)
-}
Index: openacs-4/packages/simulation/www/simplay/message.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/message.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/www/simplay/message.tcl 8 Jan 2004 15:54:01 -0000 1.15
+++ openacs-4/packages/simulation/www/simplay/message.tcl 8 Jan 2004 16:02:34 -0000 1.16
@@ -10,6 +10,8 @@
body_mime_type:optional
}
+# TODO: store messages in a folder specific to the case
+
set page_title "Message"
set context [list [list "." "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $page_title]
set package_id [ad_conn package_id]
Index: openacs-4/packages/simulation/www/simplay/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/messages.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/simplay/messages.tcl 5 Jan 2004 10:49:59 -0000 1.5
+++ openacs-4/packages/simulation/www/simplay/messages.tcl 8 Jan 2004 16:02:34 -0000 1.6
@@ -4,7 +4,10 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Messages"
-set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
set user_id [ad_conn user_id]
Index: openacs-4/packages/simulation/www/simplay/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/portfolio.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simplay/portfolio.tcl 8 Jan 2004 14:24:44 -0000 1.3
+++ openacs-4/packages/simulation/www/simplay/portfolio.tcl 8 Jan 2004 16:02:34 -0000 1.4
@@ -4,8 +4,12 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Portfolio"
-set context [list [list . "SimPlay"] [list . "SIMNAME/ROLE"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
+
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
Index: openacs-4/packages/simulation/www/simplay/tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/tasks.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/simplay/tasks.adp 19 Dec 2003 14:00:39 -0000 1.5
+++ openacs-4/packages/simulation/www/simplay/tasks.adp 8 Jan 2004 16:02:34 -0000 1.6
@@ -4,4 +4,6 @@
+TODO: make sure to show all completed tasks (one reason is that this
+is the only way to see documents that are part of tasks)
Index: openacs-4/packages/simulation/www/simplay/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/tasks.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/simulation/www/simplay/tasks.tcl 19 Dec 2003 14:00:39 -0000 1.4
+++ openacs-4/packages/simulation/www/simplay/tasks.tcl 8 Jan 2004 16:02:34 -0000 1.5
@@ -4,7 +4,10 @@
case_id:integer
}
+set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
+set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name]
+
set title "Tasks"
-set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case"] $title]
+set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title]
set user_id [ad_conn user_id]