Commit 917fae11 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

patches: remove States patch

Now this is defined from new workflows, we no longer need the
DCWorkflow version
parent 26fd8818
......@@ -48,8 +48,6 @@ from Products.ERP5Type.patches import sqltest
from Products.ERP5Type.patches import sqlvar
from Products.ERP5Type.patches import ProductContext
from Products.ERP5Type.patches import PropertiedUser
if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import States
from Products.ERP5Type.patches import FSZSQLMethod
from Products.ERP5Type.patches import ActionInformation
from Products.ERP5Type.patches import ActionProviderBase
......
<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="50" /></td>
</tr>
<tr>
<th align="left" valign="top">Description</th>
<td><textarea name="description" rows="6" cols="35">&dtml-description;</textarea></td>
</tr>
<tr>
<th align="left" valign="top">Possible Transitions</th>
<td>
<dtml-in getAvailableTransitionIds sort>
<dtml-let checked="_['sequence-item'] in transitions and 'checked' or ' '">
<input type="checkbox" name="transitions:list"
value="&dtml-sequence-item;" &dtml-checked; /> &dtml-sequence-item;
<dtml-let t_title="getTransitionTitle(_['sequence-item'])">
<dtml-if t_title>(&dtml-t_title;)</dtml-if>
</dtml-let>
</dtml-let>
<br />
<dtml-else>
<em>No transitions defined.</em>
</dtml-in>
</select>
</td>
</tr>
<!-- Patched by yo -->
<tr>
<th align="left" valign="top">State Types</th>
<td>
<dtml-in getAvailableTypeList>
<dtml-let checked="_['sequence-item'] in type_list and 'checked' or ' '">
<input type="checkbox" name="type_list:list"
value="&dtml-sequence-item;" &dtml-checked; /> &dtml-sequence-item;
</dtml-let>
<br />
<dtml-else>
<em>No types defined.</em>
</dtml-in>
</select>
</td>
</tr>
<!-- End of patch -->
</table>
<input type="submit" name="submit" value="Save changes" />
</form>
<dtml-var manage_page_footer>
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
# State types patch for DCWorkflow
from Products.DCWorkflow.States import StateDefinition
from Products.ERP5Type.Globals import DTMLFile
from Products.ERP5Type import _dtmldir
_properties_form = DTMLFile('state_properties', _dtmldir)
def getAvailableTypeList(self):
"""This is a method specific to ERP5. This returns a list of state types, which are used for portal methods.
"""
return (
'draft_order',
'planned_order',
'future_inventory',
'reserved_inventory',
'transit_inventory',
'current_inventory',
)
def setProperties(self, title='', transitions=(), REQUEST=None, description='', type_list=()):
'''
'''
self.title = str(title)
self.description = str(description)
self.transitions = tuple(map(str, transitions))
# This is patched by yo.
self.type_list = tuple(type_list)
if REQUEST is not None:
return self.manage_properties(REQUEST, 'Properties changed.')
StateDefinition._properties_form = _properties_form
StateDefinition.getAvailableTypeList = getAvailableTypeList
StateDefinition.setProperties = setProperties
StateDefinition.type_list = ()
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