Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
ccf2d7c0
Commit
ccf2d7c0
authored
Sep 23, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worklist.py: add setProperties which is required in unit test; improve function getVarMatch.
parent
63d75bf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
10 deletions
+43
-10
product/ERP5Workflow/Document/Worklist.py
product/ERP5Workflow/Document/Worklist.py
+43
-10
No files found.
product/ERP5Workflow/Document/Worklist.py
View file @
ccf2d7c0
...
...
@@ -112,7 +112,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def getVarMatchKeys(self):
key_list = []
if self.getMatchedPortalType is not None:
if self.getMatchedPortalType
()
is not None:
key_list.append('
portal_type
')
if self.getMatchedSimulationState() is not None:
key_list.append('
simulation_state
')
...
...
@@ -128,28 +128,26 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
matches = None
matches_ref_list = []
if id == '
portal_type
':
v = ''.join(self.matched_portal_type)
if tales_re.match(v).group(1):
matches = Expression(v)
else:
v = [ var.strip() for var in self.matched_portal_type ]
v = self.getMatchedPortalTypeList()
if v is not None:
matches = tuple(v)
el
if id in ['
validation_state
', '
simulation_state
']:
if id in ['
validation_state
', '
simulation_state
']:
if id == '
validation_state
':
matches_id_list = self.getMatchedValidationStateList()
elif id == '
simulation_state
':
matches_id_list = self.getMatchedSimulationStateList()
for state_id in matches_id_list:
if hasattr(self.getParent(), state_id):
matches_ref_list.append(self.getParent()._getOb(state_id).getReference())
matches = tuple(matches_ref_list)
el
if id == '
causality_state
':
if id == '
causality_state
':
matches_id = self.getMatchedCausalityState()
if matches_id is None:
matches_id = ''
matches_ref_list.append(matches_id)
matches = tuple(matches_ref_list)
if matches is not []:
if matches is not []
and matches is not None
:
if not isinstance(matches, (tuple, Expression)):
# Old version, convert it.
matches = tuple(matches)
...
...
@@ -162,3 +160,38 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
if isinstance(values, Expression):
return values.text
return '
;
'.join(values)
def setProperties(self, description,
actbox_name='', actbox_url='', actbox_category='
global
',
actbox_icon='', props=None, REQUEST=None):
if props is None:
props = REQUEST
self.description = str(description)
LOG(" ***** props in worklist is '
%
s
'"%props, 0, 0)
for k in props:
# in new worklist, use properties to set value.
v = props.get(k)
if v:
if k == '
guard_expr
':
self.setExpression(v)
elif k == '
variable_portal_type
':
self.setMatchedPortalTypeList(v)
elif k == '
variable_validation_state
':
self.setMatchedValidationState('
state_
'+v)
elif k == '
variable_base_category_id
':
self.setActboxCategory(v)
elif k == '
guard_roles
':
r = [ var.strip() for var in v.split('
;
') ]
self.setRoleList(r)
else:
LOG(" dynamic variable is not supported yet.",0," Worklist.py")
self.actbox_name = str(actbox_name)
self.actbox_url = str(actbox_url)
self.actbox_category = str(actbox_category)
self.actbox_icon = str(actbox_icon)
g = Guard()
if g.changeFromProperties(props or REQUEST):
self.guard = g
else:
self.guard = None
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment