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 -N -r1.66.2.3 -r1.66.2.4 --- openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 17 Mar 2004 11:11:56 -0000 1.66.2.3 +++ openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 17 Mar 2004 12:32:34 -0000 1.66.2.4 @@ -526,6 +526,14 @@ -subject $subject\ -body $body } + + # Sign up the user for email notification of received messages + notification::request::new \ + -type_id [notification::type::get_type_id -short_name [simulation::notification::message::type_short_name]] \ + -user_id $user_id \ + -object_id [ad_conn package_id] \ + -interval_id [notification::get_interval_id -name "instant"] \ + -delivery_method_id [notification::get_delivery_method_id -name "email"] if { $admin_p } { # Notify admin of all activity in the workflow. In particular this includes timed out tasks. @@ -537,13 +545,6 @@ -delivery_method_id [notification::get_delivery_method_id -name "email"] } else { - # Sign up the user for email notification of received messages - notification::request::new \ - -type_id [notification::type::get_type_id -short_name [simulation::notification::message::type_short_name]] \ - -user_id $user_id \ - -object_id [ad_conn package_id] \ - -interval_id [notification::get_interval_id -name "instant"] \ - -delivery_method_id [notification::get_delivery_method_id -name "email"] # Sign up the user for email notification of assigned tasks notification::request::new \ Index: openacs-4/contrib/packages/simulation/www/simplay/notifications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/notifications.tcl,v diff -u -N -r1.1 -r1.1.2.1 --- openacs-4/contrib/packages/simulation/www/simplay/notifications.tcl 26 Jan 2004 15:23:38 -0000 1.1 +++ openacs-4/contrib/packages/simulation/www/simplay/notifications.tcl 17 Mar 2004 12:32:36 -0000 1.1.2.1 @@ -11,21 +11,30 @@ set page_title "Notifications" set context [list [list "." "SimPlay"] [list $case_url $case(label)] $page_title] +set package_id [ad_conn package_id] set user_id [ad_conn user_id] set return_url [ad_return_url] multirow create notifications url label title subscribed_p -foreach type { - workflow_assignee simplay_message -} { +set types {workflow_assignee simplay_message} + +set adminplayer_p [permission::permission_p -object_id $package_id -privilege sim_adminplayer] +if { $adminplayer_p } { + lappend types workflow +} + +foreach type $types { switch $type { workflow_assignee { set pretty_name "all tasks you're assigned to" } simplay_message { set pretty_name "all messages you receive" } + workflow { + set pretty_name "All tasks in the simulation" + } default { error "Unknown type" } 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 -N -r1.66.2.3 -r1.66.2.4 --- openacs-4/packages/simulation/tcl/template-procs.tcl 17 Mar 2004 11:11:56 -0000 1.66.2.3 +++ openacs-4/packages/simulation/tcl/template-procs.tcl 17 Mar 2004 12:32:34 -0000 1.66.2.4 @@ -526,6 +526,14 @@ -subject $subject\ -body $body } + + # Sign up the user for email notification of received messages + notification::request::new \ + -type_id [notification::type::get_type_id -short_name [simulation::notification::message::type_short_name]] \ + -user_id $user_id \ + -object_id [ad_conn package_id] \ + -interval_id [notification::get_interval_id -name "instant"] \ + -delivery_method_id [notification::get_delivery_method_id -name "email"] if { $admin_p } { # Notify admin of all activity in the workflow. In particular this includes timed out tasks. @@ -537,13 +545,6 @@ -delivery_method_id [notification::get_delivery_method_id -name "email"] } else { - # Sign up the user for email notification of received messages - notification::request::new \ - -type_id [notification::type::get_type_id -short_name [simulation::notification::message::type_short_name]] \ - -user_id $user_id \ - -object_id [ad_conn package_id] \ - -interval_id [notification::get_interval_id -name "instant"] \ - -delivery_method_id [notification::get_delivery_method_id -name "email"] # Sign up the user for email notification of assigned tasks notification::request::new \ Index: openacs-4/packages/simulation/www/simplay/notifications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/notifications.tcl,v diff -u -N -r1.1 -r1.1.2.1 --- openacs-4/packages/simulation/www/simplay/notifications.tcl 26 Jan 2004 15:23:38 -0000 1.1 +++ openacs-4/packages/simulation/www/simplay/notifications.tcl 17 Mar 2004 12:32:36 -0000 1.1.2.1 @@ -11,21 +11,30 @@ set page_title "Notifications" set context [list [list "." "SimPlay"] [list $case_url $case(label)] $page_title] +set package_id [ad_conn package_id] set user_id [ad_conn user_id] set return_url [ad_return_url] multirow create notifications url label title subscribed_p -foreach type { - workflow_assignee simplay_message -} { +set types {workflow_assignee simplay_message} + +set adminplayer_p [permission::permission_p -object_id $package_id -privilege sim_adminplayer] +if { $adminplayer_p } { + lappend types workflow +} + +foreach type $types { switch $type { workflow_assignee { set pretty_name "all tasks you're assigned to" } simplay_message { set pretty_name "all messages you receive" } + workflow { + set pretty_name "All tasks in the simulation" + } default { error "Unknown type" }