Commit 39ac8423 authored by iv's avatar iv

ERP5Workflow: rename getXXX to getGuardXXX (properties defined in Guard property sheet)

parent 37040ea8
......@@ -94,10 +94,10 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
return res
def getGuard(self):
if self.getRoleList() is None and\
self.getPermissionList() is None and\
self.getGroupList() is None and\
self.getExpression() is None and\
if self.getGuardRole() is None and\
self.getGuardPermission() is None and\
self.getGuardGroup() is None and\
self.getGuardExpression() is None and\
self.guard is None:
return Guard().__of__(self)
elif self.guard is None:
......@@ -106,11 +106,11 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
def generateGuard(self):
self.guard = Guard()
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
if self.getGuardRole() is not None:
self.guard.roles = self.getGuardRole()
if self.getGuardPermission() is not None:
self.guard.permissions = self.getGuardPermission()
if self.getGuardGroup() is not None:
self.guard.groups = self.getGuardGroup()
if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getGuardExpression())
......@@ -430,7 +430,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
property_value = tuple(property_value)
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
elif property_id == 'expr':
property_value = tdef.getExpression()
property_value = tdef.getGuardExpression()
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
# no-property definded action box configuration
elif property_id in ['actbox_name', 'actbox_url', 'actbox_category', 'trigger_type']:
......
......@@ -99,11 +99,11 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
def generateGuard(self):
if self.guard is None:
self.guard = Guard()
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
if self.getGuardRole() is not None:
self.guard.roles = self.getGuardRole()
if self.getGuardPermission() is not None:
self.guard.permissions = self.getGuardPermission()
if self.getGuardGroup() is not None:
self.guard.groups = self.getGuardGroup()
if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getGuardExpression())
......@@ -850,13 +850,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for property_id in sorted(transition_prop_id_to_show):
if property_id in ('roles', 'groups', 'permissions', 'expr',):
if property_id == 'roles':
property_value = tdef.getRoleList()
property_value = tdef.getGuardRole()
if property_id == 'groups':
property_value = tdef.getGroupList()
property_value = tdef.getGuardGroup()
if property_id == 'permissions':
property_value = tdef.getPermissionList()
property_value = tdef.getGuardPermission()
if property_id == 'expr':
property_value = tdef.getExpression()
property_value = tdef.getGuardExpression()
if property_value is None or property_value == [] or property_value == ():
property_value = ''
elif property_id != 'expr':
......@@ -949,13 +949,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# show guard configuration:
if property_id in ('roles', 'groups', 'permissions', 'expr',):
if property_id == 'roles':
property_value = qdef.getRoleList()
property_value = qdef.getGuardRole()
if property_id == 'groups':
property_value = qdef.getGroupList()
property_value = qdef.getGuardGroup()
if property_id == 'permissions':
property_value = qdef.getPermissionList()
property_value = qdef.getGuardPermission()
if property_id == 'expr':
property_value = qdef.getExpression()
property_value = qdef.getGuardExpression()
if property_value is not None:
property_value = tuple(property_value)
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
......
......@@ -72,10 +72,10 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
return res
def getInfoGuard(self):
if self.getRoleList() is None and\
self.getPermissionList() is None and\
self.getGroupList() is None and\
self.getExpression() is None and\
if self.getGuardRole() is None and\
self.getGuardPermission() is None and\
self.getGuardGroup() is None and\
self.getGuardExpression() is None and\
self.info_guard is None:
return Guard().__of__(self)
elif self.info_guard is None:
......@@ -84,11 +84,11 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
def generateInfoGuard(self):
self.info_guard = Guard()
if self.getRoleList() is not None:
self.info_guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.info_guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.info_guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.info_guard.expr = Expression(self.getExpression())
if self.getGuardRole() is not None:
self.info_guard.roles = self.getGuardRole()
if self.getGuardPermission() is not None:
self.info_guard.permissions = self.getGuardPermission()
if self.getGuardGroup() is not None:
self.info_guard.groups = self.getGuardGroup()
if self.getGuardExpression() is not None:
self.info_guard.expr = Expression(self.getGuardExpression())
......@@ -84,10 +84,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
return res
def getGuard(self):
if self.getRoleList() is None and\
self.getPermissionList() is None and\
self.getGroupList() is None and\
self.getExpression() is None and\
if self.getGuardRole() is None and\
self.getGuardPermission() is None and\
self.getGuardGroup() is None and\
self.getGuardExpression() is None and\
self.guard is None:
return Guard().__of__(self)
elif self.guard is None:
......@@ -96,14 +96,14 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def generateGuard(self):
self.guard = Guard()
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
if self.getGuardRole() is not None:
self.guard.roles = self.getGuardRole()
if self.getGuardPermission() is not None:
self.guard.permissions = self.getGuardPermission()
if self.getGuardGroup() is not None:
self.guard.groups = self.getGuardGroup()
if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getGuardExpression())
def getAvailableCatalogVars(self):
res = []
......
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