Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
63f1674c
Commit
63f1674c
authored
Mar 23, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow.py: load ERP5 worklist.
parent
a19e00b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+17
-11
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
63f1674c
...
@@ -362,9 +362,10 @@ class Workflow(XMLObject):
...
@@ -362,9 +362,10 @@ class Workflow(XMLObject):
(worklist id as key) and which value is a dict composed of
(worklist id as key) and which value is a dict composed of
variable matches.
variable matches.
"""
"""
if
not
self
.
objec
tValues
(
portal_type
=
'Worklist'
):
if
not
self
.
conten
tValues
(
portal_type
=
'Worklist'
):
return
None
return
None
### zwj: for DC workflow
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
def
getPortalTypeListForWorkflow
(
workflow_id
):
def
getPortalTypeListForWorkflow
(
workflow_id
):
workflow_tool
=
portal
.
portal_workflow
workflow_tool
=
portal
.
portal_workflow
...
@@ -384,12 +385,14 @@ class Workflow(XMLObject):
...
@@ -384,12 +385,14 @@ class Workflow(XMLObject):
variable_match_dict
=
{}
variable_match_dict
=
{}
security_manager
=
getSecurityManager
()
security_manager
=
getSecurityManager
()
workflow_id
=
self
.
id
workflow_id
=
self
.
id
workflow_title
=
self
.
title
workflow_title
=
self
.
getTitle
()
for
worklist_id
,
worklist_definition
in
self
.
worklists
.
items
():
for
worklist_definition
in
self
.
objectValues
(
portal_type
=
'Worklist'
):
worklist_id
=
worklist_definition
.
getId
()
action_box_name
=
worklist_definition
.
actbox_name
action_box_name
=
worklist_definition
.
actbox_name
guard
=
worklist_definition
.
g
uard
guard
=
worklist_definition
.
g
etGuard
()
if
action_box_name
:
if
action_box_name
:
variable_match
=
{}
variable_match
=
{}
for
key
in
worklist_definition
.
getVarMatchKeys
():
for
key
in
worklist_definition
.
getVarMatchKeys
():
var
=
worklist_definition
.
getVarMatch
(
key
)
var
=
worklist_definition
.
getVarMatch
(
key
)
if
isinstance
(
var
,
Expression
):
if
isinstance
(
var
,
Expression
):
...
@@ -400,6 +403,7 @@ class Workflow(XMLObject):
...
@@ -400,6 +403,7 @@ class Workflow(XMLObject):
else
:
else
:
evaluated_value
=
[
x
%
info
for
x
in
var
]
evaluated_value
=
[
x
%
info
for
x
in
var
]
variable_match
[
key
]
=
evaluated_value
variable_match
[
key
]
=
evaluated_value
if
'portal_type'
in
variable_match
and
len
(
variable_match
[
'portal_type'
]):
if
'portal_type'
in
variable_match
and
len
(
variable_match
[
'portal_type'
]):
portal_type_intersection
=
set
(
variable_match
[
'portal_type'
])
\
portal_type_intersection
=
set
(
variable_match
[
'portal_type'
])
\
.
intersection
(
portal_type_list
)
.
intersection
(
portal_type_list
)
...
@@ -425,18 +429,20 @@ class Workflow(XMLObject):
...
@@ -425,18 +429,20 @@ class Workflow(XMLObject):
variable_match
.
setdefault
(
SECURITY_PARAMETER_ID
,
())
variable_match
.
setdefault
(
SECURITY_PARAMETER_ID
,
())
format_data
.
_push
(
dict
((
k
,
(
'&%s:list='
%
k
).
join
(
v
))
for
\
format_data
.
_push
(
dict
((
k
,
(
'&%s:list='
%
k
).
join
(
v
))
for
\
k
,
v
in
variable_match
.
iteritems
()))
k
,
v
in
variable_match
.
iteritems
()))
variable_match
[
WORKLIST_METADATA_KEY
]
=
{
'format_data'
:
format_data
,
variable_match
[
WORKLIST_METADATA_KEY
]
=
{
'worklist_title'
:
action_box_name
,
'name'
:
worklist_definition
.
actbox_name
%
fmt_data
,
'worklist_id'
:
worklist_id
,
'url'
:
'%s/%s'
%
(
str
(
portal_url
),
str
(
worklist_definition
.
actbox_url
)
%
fmt_data
),
'workflow_title'
:
workflow_title
,
'worklist_id'
:
worklist_id
,
'workflow_id'
:
workflow_id
,
'workflow_title'
:
self
.
getTitle
(),
'action_box_url'
:
worklist_definition
.
actbox_url
,
'workflow_id'
:
self
.
getId
(),
'action_box_category'
:
worklist_definition
.
actbox_category
}
'permissions'
:
(),
# Predetermined.
'category'
:
worklist_definition
.
actbox_category
}
variable_match_dict
[
worklist_id
]
=
variable_match
variable_match_dict
[
worklist_id
]
=
variable_match
if
len
(
variable_match_dict
)
==
0
:
if
len
(
variable_match_dict
)
==
0
:
return
None
return
None
return
variable_match_dict
return
variable_match_dict
# ============================================================================
security
.
declarePrivate
(
'getInfoFor'
)
security
.
declarePrivate
(
'getInfoFor'
)
def
getInfoFor
(
self
,
ob
,
name
,
default
):
def
getInfoFor
(
self
,
ob
,
name
,
default
):
...
...
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