Index: openacs-4/contrib/packages/simulation/lib/cases.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/cases.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/contrib/packages/simulation/lib/cases.tcl 8 Jan 2004 14:24:44 -0000 1.8
+++ openacs-4/contrib/packages/simulation/lib/cases.tcl 12 Jan 2004 13:43:14 -0000 1.9
@@ -19,15 +19,14 @@
pretty_name {
label "Simulation"
orderby upper(w.pretty_name)
- link_url_eval {[export_vars -base [ad_conn package_url]simplay/case { case_id }]}
+ link_url_eval {[export_vars -base [ad_conn package_url]simplay/case { case_id role_id }]}
}
label {
label "Case"
orderby upper(w.pretty_name)
}
- role {
+ role_pretty {
label "Role"
- display_template { Lawyer 1 }
}
status {
label "Status"
@@ -48,7 +47,7 @@
-elements $elements
db_multirow cases select_cases "
- select distinct wc.case_id,
+ select wc.case_id,
sc.label,
w.pretty_name,
case when (select count(*)
@@ -57,6 +56,8 @@
and wcea.enabled_state = 'enabled')=0 then 'Completed'
else 'Active'
end as status,
+ r.role_id,
+ r.pretty_name as role_pretty,
(select count(distinct wa2.action_id)
from workflow_case_enabled_actions wcea2,
workflow_actions wa2,
@@ -70,8 +71,10 @@
from workflow_cases wc,
sim_cases sc,
workflow_case_role_party_map wcrpm,
- workflows w
+ workflows w,
+ workflow_roles r
where wcrpm.party_id = :party_id
+ and r.role_id = wcrpm.role_id
and wc.case_id = wcrpm.case_id
and sc.sim_case_id = wc.object_id
and w.workflow_id = wc.workflow_id
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.11 -r1.12
--- openacs-4/contrib/packages/simulation/lib/messages.tcl 6 Jan 2004 13:05:47 -0000 1.11
+++ openacs-4/contrib/packages/simulation/lib/messages.tcl 12 Jan 2004 13:43:14 -0000 1.12
@@ -11,6 +11,9 @@
case_id {
required_p 0
}
+ limit {
+ default_value {}
+ }
}
# TODO: finish. if case id is nil, check that adminplayer_p is true. if not, fail.
@@ -98,6 +101,7 @@
and w.workflow_id = wc.workflow_id
[ad_decode [exists_and_not_null case_id] 1 "and sm.case_id = :case_id" ""]
order by sm.creation_date desc
+ [ad_decode $limit "" "" "limit $limit"]
" {
set message_url [export_vars -base "[apm_package_url_from_id $package_id]simplay/message" { item_id case_id }]
set creation_date_pretty [lc_time_fmt $creation_date_ansi "%x %X"]
Index: openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-states.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl 12 Jan 2004 11:31:01 -0000 1.2
+++ openacs-4/contrib/packages/simulation/lib/sim-template-states.tcl 12 Jan 2004 13:43:14 -0000 1.3
@@ -80,6 +80,5 @@
set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction down } { return_url [ad_return_url] } }]
}
-
# Get rid of the last down_url
set states:${counter}(down_url) {}
Index: openacs-4/contrib/packages/simulation/lib/sim-template-tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-tasks.adp,v
diff -u -r1.12 -r1.13
--- openacs-4/contrib/packages/simulation/lib/sim-template-tasks.adp 12 Jan 2004 11:33:41 -0000 1.12
+++ openacs-4/contrib/packages/simulation/lib/sim-template-tasks.adp 12 Jan 2004 13:43:14 -0000 1.13
@@ -1,4 +1,2 @@
TODO B (.5h): Allow reordering of roles, tasks.
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.28 -r1.29 --- openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 12 Jan 2004 10:58:37 -0000 1.28 +++ openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 12 Jan 2004 13:43:14 -0000 1.29 @@ -51,6 +51,23 @@ } } +lappend elements down { + sub_class narrow + display_template { +TODO: make sure dev_sims template shows all simulations, including
-those from Simulations in casting list
\ No newline at end of file
+
TODO (1h): Merge the casting_sims list into the dev_sims list
Index: openacs-4/contrib/packages/simulation/www/simplay/about-sim.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/about-sim.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/simulation/www/simplay/about-sim.tcl 9 Jan 2004 14:40:36 -0000 1.1 +++ openacs-4/contrib/packages/simulation/www/simplay/about-sim.tcl 12 Jan 2004 13:43:14 -0000 1.2 @@ -2,6 +2,7 @@ Information about a sim. } { case_id:integer + role_id:integer } set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id] @@ -13,4 +14,4 @@ set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name] set title "About $simulation_name" -set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title] +set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "$simulation_name"] $title] Index: openacs-4/contrib/packages/simulation/www/simplay/case-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/case-admin.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/simulation/www/simplay/case-admin.tcl 8 Jan 2004 14:27:56 -0000 1.1 +++ openacs-4/contrib/packages/simulation/www/simplay/case-admin.tcl 12 Jan 2004 13:43:14 -0000 1.2 @@ -1,11 +1,12 @@ ad_page_contract { This page allows users to choose which group to join. It is only relevant for simulations with casting type of group. } { - {case_id:integer ""} + case_id:integer + role_id:integer } set title "Administer" -set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case CASENAME"] $title] +set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "Case CASENAME"] $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/case.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/case.adp,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/packages/simulation/www/simplay/case.adp 8 Jan 2004 16:02:34 -0000 1.8 +++ openacs-4/contrib/packages/simulation/www/simplay/case.adp 12 Jan 2004 13:43:14 -0000 1.9 @@ -4,10 +4,9 @@+
TODO: how can a player access completed cases?
-TODO: all of simplay should require role_id
\ No newline at end of file +TODO (1h): all of simplay should require role_id
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.16 -r1.17 --- openacs-4/contrib/packages/simulation/www/simplay/message.tcl 8 Jan 2004 16:02:34 -0000 1.16 +++ openacs-4/contrib/packages/simulation/www/simplay/message.tcl 12 Jan 2004 13:43:14 -0000 1.17 @@ -1,10 +1,11 @@ ad_page_contract { Create or edit a message. } { - item_id:optional - case_id:optional - sender_role_id:optional - recipient_role_id:optional,multiple + item_id:integer,optional + case_id:integer + role_id:integer + sender_role_id:integer,optional + recipient_role_id:integer,optional,multiple subject:optional body_text:optional body_mime_type:optional @@ -13,14 +14,14 @@ # 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 context [list [list "." "SimPlay"] [list [export_vars -base case { case_id role_id }] "Case"] $page_title] set package_id [ad_conn package_id] set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id] set from_role_options [list] -foreach role_id [workflow::case::get_user_roles -case_id $case_id] { - lappend from_role_options [list [workflow::role::get_element -role_id $role_id -element pretty_name] $role_id] +foreach one_role_id [workflow::case::get_user_roles -case_id $case_id] { + lappend from_role_options [list [workflow::role::get_element -role_id $one_role_id -element pretty_name] $one_role_id] } # First sender role selected by default @@ -29,15 +30,15 @@ } set all_role_options [list] -foreach role_id [workflow::role::get_ids -workflow_id $workflow_id] { - lappend all_role_options [list [workflow::role::get_element -role_id $role_id -element pretty_name] $role_id] +foreach one_role_id [workflow::role::get_ids -workflow_id $workflow_id] { + lappend all_role_options [list [workflow::role::get_element -role_id $one_role_id -element pretty_name] $one_role_id] } set to_role_options [list] -foreach role_id [workflow::role::get_ids -workflow_id $workflow_id] { +foreach one_role_id [workflow::role::get_ids -workflow_id $workflow_id] { # A role cannot send message to himself - if { ![exists_and_equal sender_role_id $role_id] } { - lappend to_role_options [list [workflow::role::get_element -role_id $role_id -element pretty_name] $role_id] + if { ![exists_and_equal sender_role_id $one_role_id] } { + lappend to_role_options [list [workflow::role::get_element -role_id $one_role_id -element pretty_name] $one_role_id] } } @@ -205,6 +206,6 @@ } } - ad_returnredirect [export_vars -base case { case_id }] + ad_returnredirect [export_vars -base case { case_id role_id }] ad_script_abort } Index: openacs-4/contrib/packages/simulation/www/simplay/messages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/messages.adp,v diff -u -r1.9 -r1.10 --- openacs-4/contrib/packages/simulation/www/simplay/messages.adp 7 Jan 2004 13:12:17 -0000 1.9 +++ openacs-4/contrib/packages/simulation/www/simplay/messages.adp 12 Jan 2004 13:43:14 -0000 1.10 @@ -5,5 +5,6 @@TODO: show sent messages as well +
TODO: automatically create a Notification entry for each user per -role, and show an add/remove link here \ No newline at end of file +role, and show an add/remove link here 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.6 -r1.7 --- openacs-4/contrib/packages/simulation/www/simplay/messages.tcl 8 Jan 2004 16:02:34 -0000 1.6 +++ openacs-4/contrib/packages/simulation/www/simplay/messages.tcl 12 Jan 2004 13:43:14 -0000 1.7 @@ -2,12 +2,13 @@ List of messages for a case } { case_id:integer + role_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 }] "$simulation_name"] $title] +set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "$simulation_name"] $title] set user_id [ad_conn user_id] Index: openacs-4/contrib/packages/simulation/www/simplay/play-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/play-master.adp,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/simulation/www/simplay/play-master.adp 5 Jan 2004 17:05:07 -0000 1.5 +++ openacs-4/contrib/packages/simulation/www/simplay/play-master.adp 12 Jan 2004 13:43:14 -0000 1.6 @@ -7,7 +7,7 @@
- |
TODO B (.5h): Allow reordering of roles, tasks. 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.28 -r1.29 --- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 12 Jan 2004 10:58:37 -0000 1.28 +++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 12 Jan 2004 13:43:14 -0000 1.29 @@ -51,6 +51,23 @@ } } +lappend elements down { + sub_class narrow + display_template { +Name" display_col pretty_name @@ -113,10 +130,10 @@ html { align center } \ display_template " Simulations in Casting-TODO: make sure dev_sims template shows all simulations, including
-those from Simulations in casting list
\ No newline at end of file
+ TODO (1h): Merge the casting_sims list into the dev_sims list Index: openacs-4/packages/simulation/www/simplay/about-sim.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/about-sim.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simulation/www/simplay/about-sim.tcl 9 Jan 2004 14:40:36 -0000 1.1 +++ openacs-4/packages/simulation/www/simplay/about-sim.tcl 12 Jan 2004 13:43:14 -0000 1.2 @@ -2,6 +2,7 @@ Information about a sim. } { case_id:integer + role_id:integer } set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id] @@ -13,4 +14,4 @@ set simulation_name [simulation::template::get_element -workflow_id $workflow_id -element pretty_name] set title "About $simulation_name" -set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "$simulation_name"] $title] +set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "$simulation_name"] $title] Index: openacs-4/packages/simulation/www/simplay/case-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case-admin.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simulation/www/simplay/case-admin.tcl 8 Jan 2004 14:27:56 -0000 1.1 +++ openacs-4/packages/simulation/www/simplay/case-admin.tcl 12 Jan 2004 13:43:14 -0000 1.2 @@ -1,11 +1,12 @@ ad_page_contract { This page allows users to choose which group to join. It is only relevant for simulations with casting type of group. } { - {case_id:integer ""} + case_id:integer + role_id:integer } set title "Administer" -set context [list [list . "SimPlay"] [list [export_vars -base case { case_id }] "Case CASENAME"] $title] +set context [list [list . "SimPlay"] [list [export_vars -base case { case_id role_id }] "Case CASENAME"] $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/case.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/simulation/www/simplay/case.adp 8 Jan 2004 16:02:34 -0000 1.8 +++ openacs-4/packages/simulation/www/simplay/case.adp 12 Jan 2004 13:43:14 -0000 1.9 @@ -4,10 +4,9 @@Recent Messages-TasksIndex: 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.4 -r1.5 --- openacs-4/packages/simulation/www/simplay/case.tcl 8 Jan 2004 16:02:34 -0000 1.4 +++ openacs-4/packages/simulation/www/simplay/case.tcl 12 Jan 2004 13:43:14 -0000 1.5 @@ -1,7 +1,8 @@ ad_page_contract { Simplay home page for a user in one case. } { - case_id:integer + case_id:integer,notnull + role_id:integer,notnull } set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id] @@ -14,3 +15,5 @@ set section_uri [apm_package_url_from_id $package_id]simplay/ set adminplayer_p [permission::permission_p -object_id $package_id -privilege sim_adminplayer] + +set messages_url [export_vars -base messages { case_id role_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.10 -r1.11 --- openacs-4/packages/simulation/www/simplay/control-bar.adp 8 Jan 2004 16:02:34 -0000 1.10 +++ openacs-4/packages/simulation/www/simplay/control-bar.adp 12 Jan 2004 13:43:14 -0000 1.11 @@ -1,6 +1,10 @@ -You are Bernadette -(Plaintiff) (TODO: make this real) - +You are @role.character_title@ +(@role.role_pretty@) + + + ++ Your Options
Contacts
+ |
- |
|