--- a/src/pyams_content/shared/common/zmi/workflow.py Mon Sep 11 14:50:56 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/workflow.py Mon Sep 11 14:52:15 2017 +0200
@@ -19,8 +19,7 @@
# import interfaces
from pyams_content.interfaces import PUBLISH_CONTENT_PERMISSION, CREATE_CONTENT_PERMISSION, MANAGE_CONTENT_PERMISSION
from pyams_content.shared.common.interfaces import IWfSharedContent, ISharedTool, ISharedContent
-from pyams_form.interfaces.form import IFormPrefixViewletsManager, IWidgetsPrefixViewletsManager, \
- IFormSuffixViewletsManager
+from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormSuffixViewletsManager
from pyams_security.interfaces import ISecurityManager
from pyams_skin.layer import IPyAMSLayer
from pyams_workflow.interfaces import IWorkflowInfo, IWorkflowTransitionInfo, IWorkflowPublicationInfo, \
@@ -169,8 +168,7 @@
comment = (data.get('comment') or '').strip()
if not comment:
event.form.widgets.errors += (Invalid(_("A comment is required")), )
- if data.get('publication_expiration_date') and not data.get('push_end_date'):
- data['push_end_date'] = data['publication_expiration_date']
+ event.form.widgets['comment'].error = Invalid(_("A comment is required"))
@viewlet_config(name='wf-propose-message', context=IWfSharedContent, layer=IPyAMSLayer, view=PublicationRequestForm,
@@ -275,8 +273,15 @@
event.form.widgets.errors += (Invalid(_("A comment is required")), )
+@viewlet_config(name='wf-refuse-message', context=IWfSharedContent, layer=IPyAMSLayer,
+ view=PublicationRequestRefuseForm, manager=IWidgetsPrefixViewletsManager, weight=20)
+@template_config(template='templates/wf-refuse-propose-message.pt')
+class PublicationRequestRefuseFormMessage(Viewlet):
+ """Publication request refuse form info message"""
+
+
@viewlet_config(name='wf-refuse-operator-warning', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationRequestRefuseForm, manager=IFormPrefixViewletsManager, weight=10)
+ view=PublicationRequestRefuseForm, manager=IWidgetsPrefixViewletsManager, weight=30)
@template_config(template='templates/wf-operator-warning.pt')
class PublicationRequestRefuseFormWarning(Viewlet):
"""Publication request refuse form warning message"""
@@ -288,13 +293,6 @@
return Viewlet.__new__(cls)
-@viewlet_config(name='wf-refuse-message', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationRequestRefuseForm, manager=IWidgetsPrefixViewletsManager, weight=20)
-@template_config(template='templates/wf-refuse-propose-message.pt')
-class PublicationRequestRefuseFormMessage(Viewlet):
- """Publication request refuse form info message"""
-
-
#
# Publish form
#
@@ -353,12 +351,17 @@
data = event.data
if not data.get('publication_effective_date'):
event.form.widgets.errors += (Invalid(_("Publication start date is required")), )
- if data.get('publication_expiration_date') and not data.get('push_end_date'):
- data['push_end_date'] = data['publication_expiration_date']
+
+
+@viewlet_config(name='wf-publish-message', context=IWfSharedContent, layer=IPyAMSLayer,
+ view=PublicationForm, manager=IWidgetsPrefixViewletsManager, weight=20)
+@template_config(template='templates/wf-publish-message.pt')
+class PublicationFormMessage(Viewlet):
+ """Shared content publication form info message"""
@viewlet_config(name='wf-publish-operator-warning', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationForm, manager=IFormPrefixViewletsManager, weight=10)
+ view=PublicationForm, manager=IWidgetsPrefixViewletsManager, weight=30)
@template_config(template='templates/wf-operator-warning.pt')
class PublicationFormWarning(Viewlet):
"""Shared content publication form warning message"""
@@ -370,13 +373,6 @@
return Viewlet.__new__(cls)
-@viewlet_config(name='wf-publish-message', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationForm, manager=IWidgetsPrefixViewletsManager, weight=20)
-@template_config(template='templates/wf-publish-message.pt')
-class PublicationFormMessage(Viewlet):
- """Shared content publication form info message"""
-
-
#
# Publication retire request form
#
@@ -508,8 +504,15 @@
"""Shared content publication retire form, JSON renderer"""
+@viewlet_config(name='wf-retire-message', context=IWfSharedContent, layer=IPyAMSLayer,
+ view=PublicationRetireForm, manager=IWidgetsPrefixViewletsManager, weight=20)
+@template_config(template='templates/wf-retire-message.pt')
+class PublicationRetireFormMessage(Viewlet):
+ """Publication retire form info message"""
+
+
@viewlet_config(name='wf-retire-operator-warning', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationRetireForm, manager=IFormPrefixViewletsManager, weight=10)
+ view=PublicationRetireForm, manager=IWidgetsPrefixViewletsManager, weight=30)
@template_config(template='templates/wf-operator-warning.pt')
class PublicationRetireFormWarning(Viewlet):
"""Publication retire form warning message"""
@@ -521,13 +524,6 @@
return Viewlet.__new__(cls)
-@viewlet_config(name='wf-retire-message', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationRetireForm, manager=IWidgetsPrefixViewletsManager, weight=20)
-@template_config(template='templates/wf-retire-message.pt')
-class PublicationRetireFormMessage(Viewlet):
- """Publication retire form info message"""
-
-
#
# Publication archive request form
#
@@ -647,8 +643,15 @@
"""Shared content publication archive form, JSON renderer"""
+@viewlet_config(name='wf-archive-message', context=IWfSharedContent, layer=IPyAMSLayer,
+ view=PublicationArchiveForm, manager=IWidgetsPrefixViewletsManager, weight=20)
+@template_config(template='templates/wf-archive-message.pt')
+class PublicationArchiveFormMessage(Viewlet):
+ """Publication archive form info message"""
+
+
@viewlet_config(name='wf-archive-operator-warning', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationArchiveForm, manager=IFormPrefixViewletsManager, weight=10)
+ view=PublicationArchiveForm, manager=IWidgetsPrefixViewletsManager, weight=30)
@template_config(template='templates/wf-operator-warning.pt')
class PublicationArchiveFormWarning(Viewlet):
"""Publication archive form warning message"""
@@ -660,13 +663,6 @@
return Viewlet.__new__(cls)
-@viewlet_config(name='wf-archive-message', context=IWfSharedContent, layer=IPyAMSLayer,
- view=PublicationArchiveForm, manager=IWidgetsPrefixViewletsManager, weight=20)
-@template_config(template='templates/wf-archive-message.pt')
-class PublicationArchiveFormMessage(Viewlet):
- """Publication archive form info message"""
-
-
#
# Clone form
#