Added transactions attributes for notifications
authorThierry Florac <thierry.florac@onf.fr>
Thu, 02 Jun 2016 15:28:31 +0200
changeset 33 1e27dfd22ee8
parent 32 66baddd786d5
child 34 f907592596bf
Added transactions attributes for notifications
src/pyams_content/workflow/__init__.py
--- a/src/pyams_content/workflow/__init__.py	Thu Jun 02 15:20:41 2016 +0200
+++ b/src/pyams_content/workflow/__init__.py	Thu Jun 02 15:28:31 2016 +0200
@@ -236,6 +236,8 @@
                                history_label=_("Publication request"),
                                next_step=_("content managers authorized to take charge of your content are going to "
                                            "be notified of your request."),
+                               notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                               notify_message=_("A publication request has been submitted for content « {0} »"),
                                order=1)
 
 retired_to_proposed = Transition(transition_id='retired_to_proposed',
@@ -249,6 +251,8 @@
                                  history_label=_("Publication request"),
                                  next_step=_("content managers authorized to take charge of your content are going to "
                                              "be notified of your request."),
+                                 notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                 notify_message=_("A new publication request has been submitted for content « {0} »"),
                                  order=1)
 
 proposed_to_canceled = Transition(transition_id='proposed_to_canceled',
@@ -260,6 +264,8 @@
                                   menu_css_class='fa fa-fw fa-mail-reply',
                                   view_name='wf-cancel-propose.html',
                                   history_label=_("Publication request canceled"),
+                                  notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                  notify_message=_("The publication request for content « {0} » has been cancelled"),
                                   order=2)
 
 canceled_to_draft = Transition(transition_id='canceled_to_draft',
@@ -287,6 +293,8 @@
                                  menu_css_class='fa fa-fw fa-thumbs-o-down',
                                  view_name='wf-refuse.html',
                                  history_label=_("Publication refused"),
+                                 notify={'pyams.Owner'},
+                                 notify_message=_("The publication request for content « {0} » has been refused"),
                                  order=3)
 
 refused_to_draft = Transition(transition_id='refused_to_draft',
@@ -315,6 +323,8 @@
                                    menu_css_class='fa fa-fw fa-thumbs-o-up',
                                    view_name='wf-publish.html',
                                    history_label=_("Content published"),
+                                   notify={'*'},
+                                   notify_message=_("The content « {0} » has been published"),
                                    order=4)
 
 published_to_retiring = Transition(transition_id='published_to_retiring',
@@ -327,6 +337,8 @@
                                    history_label=_("Retire request"),
                                    next_step=_("content managers authorized to take charge of your content are going "
                                                "to be notified of your request."),
+                                   notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                   notify_message=_("A retire request has been submitted for content « {0} »"),
                                    order=7)
 
 retiring_to_published = Transition(transition_id='retiring_to_published',
@@ -338,6 +350,8 @@
                                    menu_css_class='fa fa-fw fa-mail-reply',
                                    view_name='wf-cancel-retiring.html',
                                    history_label=_("Retire request canceled"),
+                                   notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                   notify_message=_("The retiring request for content « {0} » has been cancelled"),
                                    order=8)
 
 retiring_to_retired = Transition(transition_id='retiring_to_retired',
@@ -349,6 +363,8 @@
                                  menu_css_class='fa fa-fw fa-stop',
                                  view_name='wf-retire.html',
                                  history_label=_("Content retired"),
+                                 notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                 notify_message=_("The content « {0} » has been retired"),
                                  order=9)
 
 retired_to_archiving = Transition(transition_id='retired_to_archiving',
@@ -361,6 +377,8 @@
                                   history_label=_("Archive request"),
                                   next_step=_("content managers authorized to take charge of your content are going to "
                                               "be notified of your request."),
+                                  notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                  notify_message=_("An archive request has been submitted for content « {0} »"),
                                   order=10)
 
 archiving_to_retired = Transition(transition_id='archiving_to_retired',
@@ -372,6 +390,8 @@
                                   menu_css_class='fa fa-fw fa-mail-reply',
                                   view_name='wf-cancel-archiving.html',
                                   history_label=_("Archive request canceled"),
+                                  notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                  notify_message=_("The archive request for content « {0} » has been cancelled"),
                                   order=11)
 
 archiving_to_archived = Transition(transition_id='archiving_to_archived',
@@ -384,6 +404,8 @@
                                    menu_css_class='fa fa-fw fa-archive',
                                    view_name='wf-archive.html',
                                    history_label=_("Content archived"),
+                                   notify={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'},
+                                   notify_message=_("The content « {0} » has been archived"),
                                    order=12)
 
 published_to_archived = Transition(transition_id='published_to_archived',