Commit 3bcb3ef5 authored by wenjie.zheng's avatar wenjie.zheng

Workflow and Base: Fix new line marker from code mirror.

parent d8c7e3f9
...@@ -109,7 +109,7 @@ _MARKER = [] ...@@ -109,7 +109,7 @@ _MARKER = []
global registered_workflow_method_set global registered_workflow_method_set
wildcard_interaction_method_id_match = re.compile(r'[[.?*+{(\\]').search wildcard_interaction_method_id_match = re.compile(r'[[.?*+{(\\]').search
workflow_method_registry = [] # XXX A set() would be better but would require a hash in WorkflowMethod class workflow_method_registry = [] # XXX A set() would be better but would require a hash in WorkflowMethod class
erp5workflow_method_registry =[] erp5workflow_method_registry = []
def resetRegisteredWorkflowMethod(portal_type=None): def resetRegisteredWorkflowMethod(portal_type=None):
""" """
...@@ -213,12 +213,9 @@ class ERP5WorkflowMethod(Method): ...@@ -213,12 +213,9 @@ class ERP5WorkflowMethod(Method):
valid_list = [] valid_list = []
for transition_id in transition_list: for transition_id in transition_list:
if wf5_module._getOb(wf_id).isERP5WorkflowMethodSupported(instance, wf5_module._getOb(wf_id)._getOb(transition_id)): if wf5_module._getOb(wf_id).isERP5WorkflowMethodSupported(instance, wf5_module._getOb(wf_id)._getOb(transition_id)):
#if wf5_module._getOb(wf_id)._getOb(transition_id) in instance.getCategoryStateValue().getDestinationValueList():
valid_list.append(transition_id) valid_list.append(transition_id)
once_transition_key = once_transition_dict.get((wf_id, transition_id)) once_transition_key = once_transition_dict.get((wf_id, transition_id))
transactional_variable[once_transition_key] = 1 transactional_variable[once_transition_key] = 1
#else: ### don't do anything if no supported
#raise UnsupportedWorkflowMethod(instance, wf_id, transition_id)
if valid_list: if valid_list:
valid_transition_item_list.append((wf_id, valid_list)) valid_transition_item_list.append((wf_id, valid_list))
...@@ -660,8 +657,8 @@ def getClassPropertyList(klass): ...@@ -660,8 +657,8 @@ def getClassPropertyList(klass):
return ps_list return ps_list
def intializePortalTypeERP5WorkflowMethod(ptype_klass, portal_ERP5Workflow): def intializePortalTypeERP5WorkflowMethod(ptype_klass, portal_ERP5Workflow):
### this function will be used in /product/ERP5Type/dynamic/lazy_class.py ### this function will be used in /product/ERP5Type/dynamic/lazy_class.py
### in generatePortalTypeAccessors() ### in generatePortalTypeAccessors()
wf5_module = aq_inner(portal_ERP5Workflow) wf5_module = aq_inner(portal_ERP5Workflow)
portal_type = portal_ERP5Workflow.getPortalObject().getDefaultModule(portal_type="portal_types") portal_type = portal_ERP5Workflow.getPortalObject().getDefaultModule(portal_type="portal_types")
pt = portal_type._getOb(ptype_klass.__name__) pt = portal_type._getOb(ptype_klass.__name__)
......
...@@ -52,10 +52,6 @@ class Workflow(XMLObject): ...@@ -52,10 +52,6 @@ class Workflow(XMLObject):
add_permission = Permissions.AddPortalContent add_permission = Permissions.AddPortalContent
isPortalContent = 1 isPortalContent = 1
isRADContent = 1 isRADContent = 1
### register the variable given by "base category value"
#state_var = 'state'
### In DCworkflow; state/transition can be registered inside workflow
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
...@@ -151,12 +147,10 @@ class Workflow(XMLObject): ...@@ -151,12 +147,10 @@ class Workflow(XMLObject):
return 1 return 1
return 0 return 0
### get workflow state from base category value:
def _getERP5WorkflowStateOf(self, ob): def _getERP5WorkflowStateOf(self, ob):
bc_id = self.getStateBaseCategory() bc_id = self.getStateBaseCategory()
state_path = ob.getCategoryList() state_path = ob.getCategoryList()
state_path = state_path[0].lstrip("%s/"%bc_id) state_path = state_path[0].lstrip("%s/"%bc_id)
###
if state_path is not None: if state_path is not None:
sdef = self.restrictedTraverse(state_path) sdef = self.restrictedTraverse(state_path)
else: sdef = None else: sdef = None
......
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