Index: openacs-4/packages/simulation/lib/messages.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/messages.tcl,v diff -u -r1.21.2.4 -r1.21.2.5 --- openacs-4/packages/simulation/lib/messages.tcl 2 Nov 2006 10:44:12 -0000 1.21.2.4 +++ openacs-4/packages/simulation/lib/messages.tcl 19 Dec 2006 15:34:02 -0000 1.21.2.5 @@ -178,15 +178,17 @@ "sm.to_role_id = :role_id or sm.from_role_id = :role_id"] )"] and [ad_decode $deleted_p 1 "" "not"] exists ( - select 1 from sim_messages_trash st where st.message_id = sm.message_id) + select 1 from sim_messages_trash st where st.message_id = sm.message_id + [ad_decode $case_id "" "" "and st.case_id = :case_id"] + [ad_decode $role_id "" "" "and st.role_id = :role_id"]) and wc.case_id = sm.case_id and sc.sim_case_id = wc.object_id and w.workflow_id = wc.workflow_id [ad_decode $case_id "" "" "and wc.case_id = :case_id"] [ad_decode $user_id "" "" "and exists (select 1 from workflow_case_role_user_map where case_id = wc.case_id and ( - [ad_decode $direction "in" "sm.to_role_id = role_id" \ - "out" "sm.from_role_id = role_id" \ - "sm.to_role_id = role_id or sm.from_role_id = role_id"] + [ad_decode $direction "in" "sm.to_role_id = :role_id" \ + "out" "sm.from_role_id = :role_id" \ + "sm.to_role_id = :role_id or sm.from_role_id = :role_id"] ) and user_id = :user_id)"] order by sm.creation_date desc [ad_decode $limit "" "" "limit $limit"] Index: openacs-4/packages/simulation/lib/sim-template-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-roles.tcl,v diff -u -r1.14.2.2 -r1.14.2.3 --- openacs-4/packages/simulation/lib/sim-template-roles.tcl 2 Nov 2006 10:44:12 -0000 1.14.2.2 +++ openacs-4/packages/simulation/lib/sim-template-roles.tcl 19 Dec 2006 15:34:02 -0000 1.14.2.3 @@ -91,17 +91,20 @@ select wr.role_id, wr.pretty_name, wr.sort_order, - ci.name as character_name + sc.title as character_name, + ci.name as character_url from workflow_roles wr, sim_roles sr left join cr_items ci on (sr.character_id = ci.item_id) + join sim_charactersx sc on (ci.item_id = sc.item_id + and ci.live_revision = sc.object_id) where wr.workflow_id = :workflow_id and wr.role_id = sr.role_id order by wr.sort_order " { incr counter set edit_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/role-edit" { role_id }] - set char_url [ad_decode $character_name "" "" "[apm_package_url_from_id $package_id]object/${character_name}"] + set char_url [ad_decode $character_name "" "" "[apm_package_url_from_id $package_id]object/${character_url}"] set delete_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/role-delete" { role_id { return_url [ad_return_url] } }] if { $counter > 1 } {