[Erp5-report] r8615 - in /erp5/trunk/products/ERP5Type: dtml/ patches/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 19 22:08:08 CEST 2006


Author: kevin
Date: Wed Jul 19 22:07:58 2006
New Revision: 8615

URL: http://svn.erp5.org?rev=8615&view=rev
Log:
Add description on workflows

Added:
    erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml   (with props)
Modified:
    erp5/trunk/products/ERP5Type/patches/DCWorkflow.py

Added: erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml?rev=8615&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml (added)
+++ erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml Wed Jul 19 22:07:58 2006
@@ -1,0 +1,44 @@
+<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>

Propchange: erp5/trunk/products/ERP5Type/dtml/workflow_properties.dtml
------------------------------------------------------------------------------
    svn:executable = *

Modified: erp5/trunk/products/ERP5Type/patches/DCWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/DCWorkflow.py?rev=8615&r1=8614&r2=8615&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/DCWorkflow.py (original)
+++ erp5/trunk/products/ERP5Type/patches/DCWorkflow.py Wed Jul 19 22:07:58 2006
@@ -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
@@ -27,6 +29,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):
     '''




More information about the Erp5-report mailing list