Commit e9a86cad authored by Arnaud Fontaine's avatar Arnaud Fontaine

SQUASH

parent 49fe8284
......@@ -76,11 +76,11 @@ require(['seedrandom'], function(seedrandom) {
Network seeding
---------------
<script src=//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.3.10/seedrandom.min.js>
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.3.10/seedrandom.min.js">
</script>
<!-- Seeds using urandom bits from a server. -->
<script src=//jsonlib.appspot.com/urandom?callback=Math.seedrandom">
<script src="//jsonlib.appspot.com/urandom?callback=Math.seedrandom">
</script>
<!-- Seeds mixing in random.org bits -->
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_title</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InteractionWorkflow_viewVariableList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>InteractionWorkflow_viewVariableList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Variables</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>WorkflowScript</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>WorkflowScript_title</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InteractionWorkflow_viewWorkflowScriptList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>InteractionWorkflow_viewWorkflowScriptList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Interactions</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -618,11 +618,14 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
transition_id_set, trigger_dict = v
for tr_id, tdef in trigger_dict.iteritems():
# Check portal type filter
if portal_type not in tdef.getPortalTypeFilterList():
portal_type_filter_list = tdef.getPortalTypeFilterList()
if (portal_type_filter_list and
portal_type not in tdef.getPortalTypeFilterList()):
continue
# Check portal type group filter
if tdef.getPortalTypeGroupFilterList():
portal_type_group_filter_list = tdef.getPortalTypeGroupFilterList()
if portal_type_group_filter_list:
getPortalGroupedTypeSet = portal_workflow.getPortalObject()._getPortalGroupedTypeSet
if not any(portal_type in getPortalGroupedTypeSet(portal_type_group) for
portal_type_group in tdef.getPortalTypeGroupFilterList()):
......@@ -3495,7 +3498,7 @@ class Base(
# Use meta transition to jump from one state to another
# without existing transitions.
from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition
from Products.Core.Core.InteractionWorkflow import InteractionWorkflow
from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow
portal = self.getPortalObject()
workflow_tool = portal.portal_workflow
worflow_variable_list = []
......
......@@ -260,10 +260,7 @@ class InteractionWorkflow(Workflow):
sci = None
# Update variables.
try:
tdef_exprs = {v.getId(): v for v in tdef.getTransitionVariableValueList()}
except AttributeError:
import pdb; pdb.set_trace()
tdef_exprs = {v.getId(): v for v in tdef.getTransitionVariableValueList()}
status = {}
for vdef in workflow_variable_list:
id_ = vdef.getId()
......
......@@ -41,9 +41,10 @@ class StateError(Exception):
"""
pass
# Prototype of a mixin allowing to have custom storage for matrix
class CustomStorageMatrixMixin(XMLMatrix):
"""
Prototype of a mixin allowing to have custom storage for matrix
"""
def newCellContent(self, cell_id, **kw):
"""
Creates a new content as a matrix box cell.
......@@ -55,7 +56,9 @@ class CustomStorageMatrixMixin(XMLMatrix):
def getCell(self, *kw , **kwd):
return self.newCell(*kw , **kwd)
class State(IdAsReferenceMixin("state_"), XMLObject, CustomStorageMatrixMixin):
class State(IdAsReferenceMixin("state_"),
XMLObject,
CustomStorageMatrixMixin):
"""
A ERP5 State.
"""
......@@ -64,24 +67,23 @@ class State(IdAsReferenceMixin("state_"), XMLObject, CustomStorageMatrixMixin):
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
default_reference = ''
state_type = ()
acquire_permission = []
state_permission_roles_dict = {}
var_values = None
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
var_values = None
# Declarative properties
property_sheets = (
PropertySheet.Base,
PropertySheet.XMLObject,
PropertySheet.CategoryCore,
PropertySheet.DublinCore,
PropertySheet.Reference,
PropertySheet.SortIndex,
PropertySheet.State,)
'Base',
'XMLObject',
'CategoryCore',
'DublinCore',
'Reference',
'SortIndex',
'State',
)
def addPossibleTransition(self, tr_ref):
possible_transition_list = self.getCategoryList()
......
......@@ -47,12 +47,10 @@ class Transition(IdAsReferenceMixin("transition_"), XMLObject, GuardableMixin):
isRADContent = 1
trigger_type = TRIGGER_USER_ACTION #zwj: type is int 0, 1, 2
var_exprs = None # A mapping.
default_reference = ''
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = (
'Base',
'XMLObject',
......
......@@ -642,6 +642,10 @@ def DCWorkflowDefinition_getScriptValueList(self):
return []
def StateDefinition_getDestinationIdList(self):
return self.transitions
def StateDefinition_getDestinationValueList(self):
if self.transitions is not None:
return self.transitions.values()
return []
def StateDefinition_getStateTypeList(self):
return getattr(self, 'type_list', ())
def DCWorkflowDefinition_getPortalType(self):
......@@ -1273,6 +1277,7 @@ StateDefinition.getId = method_getId
StateDefinition.getTitle = method_getTitle
StateDefinition.getDescription = method_getDescription
StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList
StateDefinition.getDestinationValueList = StateDefinition_getDestinationValueList
StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList
StateDefinition.showDict = DCWorkflowDefinition_showDict
StateDefinition.getStateTypeList = StateDefinition_getStateTypeList
......
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