Index: openacs-4/contrib/packages/simulation/lib/tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/tasks.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/simulation/lib/tasks.adp 16 Dec 2003 14:16:28 -0000 1.1
+++ openacs-4/contrib/packages/simulation/lib/tasks.adp 6 Jan 2004 09:51:25 -0000 1.2
@@ -1 +1,6 @@
-
+
+ This case has been completed.
+
+
+
+
Index: openacs-4/contrib/packages/simulation/lib/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/tasks.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/contrib/packages/simulation/lib/tasks.tcl 5 Jan 2004 15:29:50 -0000 1.7
+++ openacs-4/contrib/packages/simulation/lib/tasks.tcl 6 Jan 2004 09:51:25 -0000 1.8
@@ -17,13 +17,34 @@
unset case_id
}
+if { [exists_and_not_null case_id] } {
+
+ set num_enabled_actions [db_string select_num_enabled_actions {
+ select count(*)
+ from workflow_case_enabled_actions
+ where case_id = :case_id
+ and enabled_state = 'enabled'
+ }]
+
+ set complete_p [expr $num_enabled_actions == 0]
+
+ set user_roles [workflow::case::get_user_roles -case_id $case_id]
+} else {
+ set user_roles [list]
+ set complete_p 0
+}
+
set package_id [ad_conn package_id]
set elements {
name {
link_url_col task_url
label "Task"
}
+ role {
+ label "Role"
+ hide_p {[ad_decode [llength $user_roles] 1 1 0]}
+ }
case_label {
label "Case"
hide_p {[ad_decode [exists_and_not_null case_id] 1 1 0]}
@@ -45,20 +66,21 @@
}
}
-# TODO: make case_name be a combo of simulation name and case #
db_multirow -extend { task_url } tasks select_tasks "
select wcea.enabled_action_id,
wa.pretty_name as name,
wcea.case_id,
sc.label as case_label,
- w.pretty_name as sim_name
+ w.pretty_name as sim_name,
+ wr.pretty_name as role
from workflow_case_enabled_actions wcea,
workflow_case_role_party_map wcrmp,
workflow_actions wa,
party_approved_member_map pamm,
workflow_cases wc,
sim_cases sc,
- workflows w
+ workflows w,
+ workflow_roles wr
where wcea.enabled_state = 'enabled'
and pamm.member_id = :user_id
and wcrmp.party_id = pamm.party_id
@@ -68,6 +90,7 @@
and wc.case_id = wcea.case_id
and sc.sim_case_id = wc.object_id
and w.workflow_id = wc.workflow_id
+ and wr.role_id = wa.assigned_role
[template::list::filter_where_clauses -and -name "tasks"]
order by wa.sort_order
" {
Index: openacs-4/packages/simulation/lib/tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/tasks.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/lib/tasks.adp 16 Dec 2003 14:16:28 -0000 1.1
+++ openacs-4/packages/simulation/lib/tasks.adp 6 Jan 2004 09:51:25 -0000 1.2
@@ -1 +1,6 @@
-
+
+ This case has been completed.
+
+
+
+
Index: openacs-4/packages/simulation/lib/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/tasks.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/simulation/lib/tasks.tcl 5 Jan 2004 15:29:50 -0000 1.7
+++ openacs-4/packages/simulation/lib/tasks.tcl 6 Jan 2004 09:51:25 -0000 1.8
@@ -17,13 +17,34 @@
unset case_id
}
+if { [exists_and_not_null case_id] } {
+
+ set num_enabled_actions [db_string select_num_enabled_actions {
+ select count(*)
+ from workflow_case_enabled_actions
+ where case_id = :case_id
+ and enabled_state = 'enabled'
+ }]
+
+ set complete_p [expr $num_enabled_actions == 0]
+
+ set user_roles [workflow::case::get_user_roles -case_id $case_id]
+} else {
+ set user_roles [list]
+ set complete_p 0
+}
+
set package_id [ad_conn package_id]
set elements {
name {
link_url_col task_url
label "Task"
}
+ role {
+ label "Role"
+ hide_p {[ad_decode [llength $user_roles] 1 1 0]}
+ }
case_label {
label "Case"
hide_p {[ad_decode [exists_and_not_null case_id] 1 1 0]}
@@ -45,20 +66,21 @@
}
}
-# TODO: make case_name be a combo of simulation name and case #
db_multirow -extend { task_url } tasks select_tasks "
select wcea.enabled_action_id,
wa.pretty_name as name,
wcea.case_id,
sc.label as case_label,
- w.pretty_name as sim_name
+ w.pretty_name as sim_name,
+ wr.pretty_name as role
from workflow_case_enabled_actions wcea,
workflow_case_role_party_map wcrmp,
workflow_actions wa,
party_approved_member_map pamm,
workflow_cases wc,
sim_cases sc,
- workflows w
+ workflows w,
+ workflow_roles wr
where wcea.enabled_state = 'enabled'
and pamm.member_id = :user_id
and wcrmp.party_id = pamm.party_id
@@ -68,6 +90,7 @@
and wc.case_id = wcea.case_id
and sc.sim_case_id = wc.object_id
and w.workflow_id = wc.workflow_id
+ and wr.role_id = wa.assigned_role
[template::list::filter_where_clauses -and -name "tasks"]
order by wa.sort_order
" {