Commit 30892d15 authored by iv's avatar iv

ERP5Workflow: revert 70b6279f

parent 70b6279f
...@@ -97,6 +97,10 @@ ...@@ -97,6 +97,10 @@
<string>automatic_update</string> <string>automatic_update</string>
<string>Update on every Transition</string> <string>Update on every Transition</string>
</tuple> </tuple>
<tuple>
<string>for_catalog</string>
<string>Available for Catalog</string>
</tuple>
<tuple> <tuple>
<string>variable_expression</string> <string>variable_expression</string>
<string>Expression</string> <string>Expression</string>
......
...@@ -97,6 +97,10 @@ ...@@ -97,6 +97,10 @@
<string>automatic_update</string> <string>automatic_update</string>
<string>Update on every Transition</string> <string>Update on every Transition</string>
</tuple> </tuple>
<tuple>
<string>for_catalog</string>
<string>Available for Catalog</string>
</tuple>
<tuple> <tuple>
<string>variable_expression</string> <string>variable_expression</string>
<string>Expression</string> <string>Expression</string>
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
<string>my_reference</string> <string>my_reference</string>
<string>my_title</string> <string>my_title</string>
<string>my_description</string> <string>my_description</string>
<string>my_for_catalog</string>
<string>my_status_included</string> <string>my_status_included</string>
<string>my_automatic_update</string> <string>my_automatic_update</string>
<string>my_variable_value</string> <string>my_variable_value</string>
......
...@@ -41,6 +41,7 @@ for v, property_dict in ( ...@@ -41,6 +41,7 @@ for v, property_dict in (
}), }),
('portal_type', { ('portal_type', {
'description': 'Portal type (used as filter for worklists)', 'description': 'Portal type (used as filter for worklists)',
'for_catalog': 1,
}), }),
): ):
variable = context.newContent(portal_type='Workflow Variable') variable = context.newContent(portal_type='Workflow Variable')
......
...@@ -97,6 +97,10 @@ ...@@ -97,6 +97,10 @@
<string>automatic_update</string> <string>automatic_update</string>
<string>Update on every Transition</string> <string>Update on every Transition</string>
</tuple> </tuple>
<tuple>
<string>for_catalog</string>
<string>Available for Catalog</string>
</tuple>
<tuple> <tuple>
<string>variable_expression</string> <string>variable_expression</string>
<string>Expression</string> <string>Expression</string>
......
...@@ -469,7 +469,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -469,7 +469,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
variable_reference_list = [] variable_reference_list = []
variable_list = self.objectValues(portal_type='Workflow Variable') variable_list = self.objectValues(portal_type='Workflow Variable')
variable_prop_id_to_show = ['description', 'variable_expression', variable_prop_id_to_show = ['description', 'variable_expression',
'for_status', 'automatic_update'] 'for_catalog', 'for_status', 'automatic_update']
for vdef in variable_list: for vdef in variable_list:
variable_reference_list.append(vdef.getReference()) variable_reference_list.append(vdef.getReference())
variables = SubElement(interaction_workflow, 'variables', attrib=dict(variable_list=str(variable_reference_list), variables = SubElement(interaction_workflow, 'variables', attrib=dict(variable_list=str(variable_reference_list),
......
...@@ -897,7 +897,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -897,7 +897,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
variable_reference_list = [] variable_reference_list = []
variable_list = self.objectValues(portal_type='Workflow Variable') variable_list = self.objectValues(portal_type='Workflow Variable')
variable_prop_id_to_show = ['description', 'variable_expression', variable_prop_id_to_show = ['description', 'variable_expression',
'for_status', 'automatic_update'] 'for_catalog', 'for_status', 'automatic_update']
for vdef in variable_list: for vdef in variable_list:
variable_reference_list.append(vdef.getReference()) variable_reference_list.append(vdef.getReference())
variables = SubElement(workflow, 'variables', attrib=dict(variable_list=str(variable_reference_list), variables = SubElement(workflow, 'variables', attrib=dict(variable_list=str(variable_reference_list),
...@@ -1108,7 +1108,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -1108,7 +1108,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
state_var = self.getStateVariable() state_var = self.getStateVariable()
status = self.getCurrentStatusDict(ob) status = self.getCurrentStatusDict(ob)
for vdef_ref, vdef in self.getVariableValueDict().iteritems(): for vdef_ref, vdef in self.getVariableValueDict().iteritems():
if True: # XXX(WORKFLOW): it seemed that for_catalog was usually set to 1 if vdef.getForCatalog():
variable_expression = vdef.getVariableExpression() variable_expression = vdef.getVariableExpression()
if status.has_key(vdef_ref): if status.has_key(vdef_ref):
value = status[vdef_ref] value = status[vdef_ref]
......
...@@ -108,7 +108,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -108,7 +108,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
res = [] res = []
res.append(self.getParentValue().getStateVariable()) res.append(self.getParentValue().getStateVariable())
for vdef in self.getParentValue().contentValues(portal_type="Workflow Variable"): for vdef in self.getParentValue().contentValues(portal_type="Workflow Variable"):
if True: # XXX(WORKFLOW): it seemed that for_catalog was usually set to 1 if vdef.getForCatalog():
res.append(vdef.getId()) res.append(vdef.getId())
for vdef in self.objectValues(): for vdef in self.objectValues():
res.append(vdef.getId()) res.append(vdef.getId())
...@@ -139,17 +139,16 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -139,17 +139,16 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
variable_id = variable_value.getId() variable_id = variable_value.getId()
workflow_variable_id_list.append(variable_id) workflow_variable_id_list.append(variable_id)
worklist_variable_value = self._getOb(variable_id, None) worklist_variable_value = self._getOb(variable_id, None)
if worklist_variable_value is None and True and variable_id not in default_variable_id_list: # XXX(WORKFLOW): it seemed that for_catalog was usually set to 1 if worklist_variable_value is None and variable_value.getForCatalog() == 1 and variable_id not in default_variable_id_list:
variable_value_ref = variable_value.getReference() variable_value_ref = variable_value.getReference()
worklist_variable_value = self.newContent(portal_type='Worklist Variable') worklist_variable_value = self.newContent(portal_type='Worklist Variable')
worklist_variable_value.setReference(variable_value_ref) worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setVariableExpression(variable_value.getVariableExpression()) worklist_variable_value.setVariableExpression(variable_value.getVariableExpression())
worklist_variable_value.setVariableValue(variable_value.getVariableValue()) worklist_variable_value.setVariableValue(variable_value.getVariableValue())
res.append(worklist_variable_value) res.append(worklist_variable_value)
if worklist_variable_value and worklist_variable_value not in res and True: # XXX(WORKFLOW): it seemed that for_catalog was usually set to 1 if worklist_variable_value and worklist_variable_value not in res and variable_value.getForCatalog() == 1:
res.append(worklist_variable_value) res.append(worklist_variable_value)
if worklist_variable_value in res and False: # XXX(WORKFLOW): it seemed that for_catalog was usually set to 1 if worklist_variable_value in res and variable_value.getForCatalog() == 0:
self._delObject(variable_id) self._delObject(variable_id)
res.remove(worklist_variable_value) res.remove(worklist_variable_value)
......
...@@ -530,6 +530,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -530,6 +530,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if variable_definition.info_guard.expr is not None: if variable_definition.info_guard.expr is not None:
# Here add expression text, convert to expression in getMatchVar. # Here add expression text, convert to expression in getMatchVar.
variable.setGuardExpression(tdef.info_guard.expr.text) variable.setGuardExpression(tdef.info_guard.expr.text)
variable.setForCatalog(variable_definition.for_catalog)
variable.setStatusIncluded(variable_definition.for_status) variable.setStatusIncluded(variable_definition.for_status)
variable.setVariableValue(variable_definition.default_value) variable.setVariableValue(variable_definition.default_value)
variable.setDescription(variable_definition.description) variable.setDescription(variable_definition.description)
......
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