Commit bcaa1112 authored by Kevin Deldycke's avatar Kevin Deldycke

Add description on workflows

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8615 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9a123d3b
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<form action="setProperties" method="POST">
<table>
<tr>
<th align="left">Id</th>
<td>&dtml-id;</td>
</tr>
<tr>
<th align="left">Title</th>
<td><input type="text" name="title" value="&dtml-title;" size="40" /></td>
</tr>
<tr>
<th align="left">Description</th>
<td><textarea name="description" rows="5" cols="80">&dtml-description;</textarea></td>
</tr>
<tr>
<th align="left">'Manager' role bypasses guards</th>
<td>
<dtml-let cb="manager_bypass and 'checked=\'checked\'' or ''">
<input type="checkbox" name="manager_bypass" &dtml-cb; />
</dtml-let>
</td>
</tr>
<tr>
<th align="left" valign="top">Instance creation conditions</th>
<td>
<dtml-with getGuard>
<dtml-var guardForm>
</dtml-with>
</td>
</tr>
</table>
<input type="submit" name="submit" value="Save changes" />
</form>
<dtml-var manage_page_footer>
......@@ -14,6 +14,8 @@
# Optimized rendering of global actions (cache)
from Globals import DTMLFile
from Products.ERP5Type import _dtmldir
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition, StateChangeInfo, ObjectMoved, createExprContext, aq_parent, aq_inner
from Products.DCWorkflow import DCWorkflow
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD, TransitionDefinition
......@@ -28,6 +30,34 @@ from Products.ERP5Type.Utils import convertToMixedCase
from string import join
from zLOG import LOG
# Patch WorkflowUIMixin to add description on workflows
from Products.DCWorkflow.WorkflowUIMixin import WorkflowUIMixin as WorkflowUIMixin_class
from Products.DCWorkflow.Guard import Guard
def WorkflowUIMixin_setProperties( self, title
, description='' # the only addition to WorkflowUIMixin.setProperties
, manager_bypass=0, props=None, REQUEST=None):
"""Sets basic properties.
"""
self.title = str(title)
self.description = str(description)
self.manager_bypass = manager_bypass and 1 or 0
g = Guard()
if g.changeFromProperties(props or REQUEST):
self.creation_guard = g
else:
self.creation_guard = None
if REQUEST is not None:
return self.manage_properties(
REQUEST, manage_tabs_message='Properties changed.')
WorkflowUIMixin_class.setProperties = WorkflowUIMixin_setProperties
WorkflowUIMixin_class.manage_properties = DTMLFile('workflow_properties', _dtmldir)
def DCWorkflowDefinition_listGlobalActions(self, info):
'''
Allows this workflow to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment