Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
49de5527
Commit
49de5527
authored
Apr 16, 2021
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: ERP5Workflow: Worklist is a Predicate.
parent
0ff01552
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1202 additions
and
848 deletions
+1202
-848
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
...em/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
+2
-5
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
...ort_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
+4
-4
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_getCriterionPropertyItemList.py
..._skins/erp5_core/Worklist_getCriterionPropertyItemList.py
+13
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_getCriterionPropertyItemList.xml
...skins/erp5_core/Worklist_getCriterionPropertyItemList.xml
+62
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view.xml
...SkinTemplateItem/portal_skins/erp5_core/Worklist_view.xml
+27
-6
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/listbox.xml
...lateItem/portal_skins/erp5_core/Worklist_view/listbox.xml
+464
-41
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/listbox_identity.xml
...portal_skins/erp5_core/Worklist_view/listbox_identity.xml
+298
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_action_type.xml
...m/portal_skins/erp5_core/Worklist_view/my_action_type.xml
+13
-6
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_action_type2.xml
.../portal_skins/erp5_core/Worklist_view/my_action_type2.xml
+8
-45
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_criterion_property_list.xml
...ns/erp5_core/Worklist_view/my_criterion_property_list.xml
+271
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_causality_state_list.xml
...p5_core/Worklist_view/my_matched_causality_state_list.xml
+0
-126
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_simulation_state_list.xml
...5_core/Worklist_view/my_matched_simulation_state_list.xml
+0
-126
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_validation_state_list.xml
...5_core/Worklist_view/my_matched_validation_state_list.xml
+0
-126
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist.xml
...ertySheetTemplateItem/portal_property_sheets/Worklist.xml
+0
-66
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_causality_state_property.xml
...erty_sheets/Worklist/matched_causality_state_property.xml
+0
-46
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_portal_type_property.xml
...property_sheets/Worklist/matched_portal_type_property.xml
+0
-48
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_simulation_state_property.xml
...rty_sheets/Worklist/matched_simulation_state_property.xml
+0
-48
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_validation_state_property.xml
...rty_sheets/Worklist/matched_validation_state_property.xml
+0
-48
product/ERP5/bootstrap/erp5_property_sheets/bt/template_property_sheet_id_list
...p/erp5_property_sheets/bt/template_property_sheet_id_list
+1
-2
product/ERP5Type/Core/Workflow.py
product/ERP5Type/Core/Workflow.py
+2
-17
product/ERP5Type/Core/Worklist.py
product/ERP5Type/Core/Worklist.py
+20
-56
product/ERP5Type/Tool/PropertySheetTool.py
product/ERP5Type/Tool/PropertySheetTool.py
+1
-1
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+4
-1
product/ERP5Type/mixin/guardable.py
product/ERP5Type/mixin/guardable.py
+10
-12
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+2
-18
No files found.
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
View file @
49de5527
...
@@ -4,8 +4,6 @@ It includes some copy / paste of code from DCWorkflow. Refactoring
...
@@ -4,8 +4,6 @@ It includes some copy / paste of code from DCWorkflow. Refactoring
needed through DCWorkflow API extension.
needed through DCWorkflow API extension.
"""
"""
kw
=
{}
# Try to access the workflow defined by the action
# Try to access the workflow defined by the action
try
:
try
:
workflow_tool
=
context
.
portal_workflow
workflow_tool
=
context
.
portal_workflow
...
@@ -15,9 +13,8 @@ except AttributeError:
...
@@ -15,9 +13,8 @@ except AttributeError:
# If this is a worklist action, read the worklist definition
# If this is a worklist action, read the worklist definition
worklist
=
workflow
.
getWorklistValueByReference
(
action
[
'worklist_id'
])
worklist
=
workflow
.
getWorklistValueByReference
(
action
[
'worklist_id'
])
for
varkey
in
worklist
.
getVarMatchKeys
():
kw
=
worklist
.
getIdentityCriterionDict
()
kw
[
varkey
]
=
worklist
.
getVarMatch
(
varkey
)
# Automatically filter workflists per portal type
# Automatically filter workflists per portal type
# so that the same state can be used for different
# so that the same state can be used for different
# worklists and they are not merged
# worklists and they are not merged
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
View file @
49de5527
...
@@ -13,9 +13,10 @@ workflow = portal.portal_workflow.ticket_workflow
...
@@ -13,9 +13,10 @@ workflow = portal.portal_workflow.ticket_workflow
workflow_state_var
=
workflow
.
variables
.
getStateVar
()
workflow_state_var
=
workflow
.
variables
.
getStateVar
()
for
worklist
in
workflow
.
worklists
.
objectValues
():
for
worklist
in
workflow
.
worklists
.
objectValues
():
identity_criterion_dict
=
worklist
.
getIdentityCriterionDict
()
if
portal_type
\
if
portal_type
\
and
'portal_type'
in
worklist
.
get
VarMatchKeys
()
\
and
'portal_type'
in
worklist
.
get
CriterionPropertyList
()
\
and
portal_type
not
in
worklist
.
getVarMatch
(
'portal_type'
):
and
portal_type
not
in
identity_criterion_dict
.
get
(
'portal_type'
):
continue
continue
query_list
=
[{
query_list
=
[{
...
@@ -27,8 +28,7 @@ for worklist in workflow.worklists.objectValues():
...
@@ -27,8 +28,7 @@ for worklist in workflow.worklists.objectValues():
'value'
:
role
,
}
for
role
in
worklist
.
getGuardRoleList
()]
'value'
:
role
,
}
for
role
in
worklist
.
getGuardRoleList
()]
}]
}]
for
key
in
worklist
.
getVarMatchKeys
():
for
key
,
value
in
identity_criterion_dict
.
iteritems
():
value
=
worklist
.
getVarMatch
(
key
)
if
key
==
workflow_state_var
:
if
key
==
workflow_state_var
:
# instead of having {'validation_state': 'draft'}, we want to have
# instead of having {'validation_state': 'draft'}, we want to have
# {'translated_validation_state_title': 'Brouillon'}
# {'translated_validation_state_title': 'Brouillon'}
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_getCriterionPropertyItemList.py
0 → 100644
View file @
49de5527
workflow
=
context
.
getParentValue
()
state_variable
=
workflow
.
getStateVariable
()
from
Products.ERP5Type.Tool.WorkflowTool
import
SECURITY_PARAMETER_ID
item_list
=
[(
state_variable
,
state_variable
),
(
SECURITY_PARAMETER_ID
,
SECURITY_PARAMETER_ID
)]
for
variable
in
workflow
.
getVariableValueList
():
if
variable
.
isForCatalog
():
variable_reference
=
variable
.
getReference
()
item_list
.
append
((
variable_reference
,
variable_reference
))
return
item_list
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_getCriterionPropertyItemList.xml
0 → 100644
View file @
49de5527
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Worklist_getCriterionPropertyItemList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view.xml
View file @
49de5527
...
@@ -35,7 +35,24 @@
...
@@ -35,7 +35,24 @@
</item>
</item>
<item>
<item>
<key>
<string>
action
</string>
</key>
<key>
<string>
action
</string>
</key>
<value>
<string>
Base_edit
</string>
</value>
<value>
<string>
Predicate_edit
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list>
<string>
membership_criterion_category_list
</string>
<string>
membership_criterion_document_list
</string>
</list>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
encoding
</string>
</key>
<key>
<string>
encoding
</string>
</key>
...
@@ -80,7 +97,9 @@
...
@@ -80,7 +97,9 @@
<item>
<item>
<key>
<string>
hidden
</string>
</key>
<key>
<string>
hidden
</string>
</key>
<value>
<value>
<list/>
<list>
<string>
listbox_identity
</string>
</list>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -90,14 +109,12 @@
...
@@ -90,14 +109,12 @@
<string>
my_id
</string>
<string>
my_id
</string>
<string>
my_reference
</string>
<string>
my_reference
</string>
<string>
my_title
</string>
<string>
my_title
</string>
<string>
my_criterion_property_list
</string>
<string>
my_description
</string>
<string>
my_description
</string>
<string>
my_matched_portal_type_list
</string>
<string>
my_matched_simulation_state_list
</string>
<string>
my_matched_validation_state_list
</string>
<string>
my_matched_causality_state_list
</string>
<string>
my_action_name
</string>
<string>
my_action_name
</string>
<string>
my_action
</string>
<string>
my_action
</string>
<string>
my_icon
</string>
<string>
my_icon
</string>
<string>
my_action_type2
</string>
<string>
my_action_type
</string>
<string>
my_action_type
</string>
</list>
</list>
</value>
</value>
...
@@ -152,6 +169,10 @@
...
@@ -152,6 +169,10 @@
<key>
<string>
update_action
</string>
</key>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/listbox.xml
View file @
49de5527
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/listbox_identity.xml
0 → 100644
View file @
49de5527
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_action_type.xml
View file @
49de5527
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
<key>
<string>
delegated_list
</string>
</key>
<key>
<string>
delegated_list
</string>
</key>
<value>
<value>
<list>
<list>
<string>
description
</string>
<string>
title
</string>
<string>
title
</string>
</list>
</list>
</value>
</value>
...
@@ -42,6 +41,10 @@
...
@@ -42,6 +41,10 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -57,6 +60,10 @@
...
@@ -57,6 +60,10 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -64,18 +71,18 @@
...
@@ -64,18 +71,18 @@
<key>
<string>
values
</string>
</key>
<key>
<string>
values
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The category of the transition displayed in Action Box.
</string>
</value>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_
string_field
</string>
</value>
<value>
<string>
my_
category
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Display in Action Box Category
</string>
</value>
<value>
<string>
Display in Action Box Category
</string>
</value>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_
matched_portal_type_list
.xml
→
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_
action_type2
.xml
View file @
49de5527
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
<key>
<string>
delegated_list
</string>
</key>
<key>
<string>
delegated_list
</string>
</key>
<value>
<value>
<list>
<list>
<string>
items
</string>
<string>
description
</string>
<string>
title
</string>
<string>
title
</string>
</list>
</list>
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
matched_portal_type_list
</string>
</value>
<value>
<string>
my_
action_type2
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
message_values
</string>
</key>
<key>
<string>
message_values
</string>
</key>
...
@@ -42,10 +42,6 @@
...
@@ -42,10 +42,6 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -61,20 +57,6 @@
...
@@ -61,20 +57,6 @@
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -82,27 +64,21 @@
...
@@ -82,27 +64,21 @@
<key>
<string>
values
</string>
</key>
<key>
<string>
values
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The category of the transition displayed in Action Box.
</string>
</value>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_
parallel_list
_field
</string>
</value>
<value>
<string>
my_
string
_field
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Cataloged Portal Type Matches
</string>
</value>
<value>
<string>
Display in Action Box Category
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</value>
</value>
...
@@ -110,17 +86,4 @@
...
@@ -110,17 +86,4 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(x.getId(), x.getId()) for x in here.getPortalObject().portal_types.objectValues()]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_criterion_property_list.xml
0 → 100644
View file @
49de5527
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_causality_state_list.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_matched_causality_state_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_parallel_list_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Matched Causality State
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_simulation_state_list.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_matched_simulation_state_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_parallel_list_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Matched Simulation State
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Worklist_view/my_matched_validation_state_list.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_matched_validation_state_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_parallel_list_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Matched Validation State
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(x.getTitle(), x.getReference()) for x in here.getParent().objectValues(portal_type=\'State\')]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Worklist
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_causality_state_property.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
matched_causality_state
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
matched_causality_state_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: []
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_portal_type_property.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
matched_portal_type_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: []
</string>
</value>
</item>
<item>
<key>
<string>
storage_id
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_simulation_state_property.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
matched_simulation_state_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: []
</string>
</value>
</item>
<item>
<key>
<string>
storage_id
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Worklist/matched_validation_state_property.xml
deleted
100644 → 0
View file @
0ff01552
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
matched_validation_state_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: []
</string>
</value>
</item>
<item>
<key>
<string>
storage_id
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/bt/template_property_sheet_id_list
View file @
49de5527
...
@@ -193,5 +193,4 @@ XMLObject
...
@@ -193,5 +193,4 @@ XMLObject
AttributeBlacklistedConstraint
AttributeBlacklistedConstraint
CaptchaPreference
CaptchaPreference
GeographicalPoint
GeographicalPoint
Interaction
Interaction
Worklist
\ No newline at end of file
\ No newline at end of file
product/ERP5Type/Core/Workflow.py
View file @
49de5527
...
@@ -510,21 +510,7 @@ class Workflow(XMLObject):
...
@@ -510,21 +510,7 @@ class Workflow(XMLObject):
action_box_name
=
worklist_definition
.
getActionName
()
action_box_name
=
worklist_definition
.
getActionName
()
guard_role_list
=
worklist_definition
.
getGuardRoleList
()
guard_role_list
=
worklist_definition
.
getGuardRoleList
()
if
action_box_name
:
if
action_box_name
:
variable_match
=
{}
variable_match
=
worklist_definition
.
getIdentityCriterionDict
()
for
key
in
worklist_definition
.
getVarMatchKeys
():
var
=
worklist_definition
.
getVarMatch
(
key
)
if
isinstance
(
var
,
Expression
):
if
state_change_information
is
None
:
state_change_information
=
StateChangeInfo
(
portal
,
self
,
kwargs
=
info
.
__dict__
.
copy
())
if
expression_context
is
None
:
expression_context
=
createExpressionContext
(
state_change_information
)
evaluated_value
=
var
(
expression_context
)
if
isinstance
(
evaluated_value
,
(
str
,
int
,
long
)):
evaluated_value
=
[
str
(
evaluated_value
)]
else
:
evaluated_value
=
[
x
%
info
for
x
in
var
]
variable_match
[
key
]
=
evaluated_value
portal_type_match
=
variable_match
.
get
(
'portal_type'
)
portal_type_match
=
variable_match
.
get
(
'portal_type'
)
if
portal_type_match
:
if
portal_type_match
:
# in case the current workflow is not associated with portal_types
# in case the current workflow is not associated with portal_types
...
@@ -540,8 +526,7 @@ class Workflow(XMLObject):
...
@@ -540,8 +526,7 @@ class Workflow(XMLObject):
not
check_guard
or
not
check_guard
or
worklist_definition
.
checkGuard
(
security_manager
,
worklist_definition
.
checkGuard
(
security_manager
,
self
,
self
,
portal
,
portal
)
check_roles
=
False
)
):
):
format_data
=
TemplateDict
()
format_data
=
TemplateDict
()
format_data
.
_push
(
info
)
format_data
.
_push
(
info
)
...
...
product/ERP5Type/Core/Worklist.py
View file @
49de5527
...
@@ -35,10 +35,12 @@ from Products.ERP5Type import Permissions
...
@@ -35,10 +35,12 @@ from Products.ERP5Type import Permissions
from
Products.ERP5Type.id_as_reference
import
IdAsReferenceMixin
from
Products.ERP5Type.id_as_reference
import
IdAsReferenceMixin
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.mixin.guardable
import
GuardableMixin
from
Products.ERP5Type.mixin.guardable
import
GuardableMixin
from
Products.ERP5Type.Core.Predicate
import
Predicate
from
Products.ERP5Type.Utils
import
deprecated
tales_re
=
re
.
compile
(
r'(\
w+:)?(.*)
')
tales_re
=
re
.
compile
(
r'(\
w+:)?(.*)
')
class Worklist(IdAsReferenceMixin("worklist_"),
XMLObject, GuardableMixin
):
class Worklist(IdAsReferenceMixin("worklist_"),
GuardableMixin, Predicate
):
"""
"""
A ERP5 Worklist.
A ERP5 Worklist.
Four Variable: portal_type; simulation_state; validation_state; causality_state
Four Variable: portal_type; simulation_state; validation_state; causality_state
...
@@ -59,9 +61,9 @@ class Worklist(IdAsReferenceMixin("worklist_"), XMLObject, GuardableMixin):
...
@@ -59,9 +61,9 @@ class Worklist(IdAsReferenceMixin("worklist_"), XMLObject, GuardableMixin):
'
DublinCore
',
'
DublinCore
',
'
Reference
',
'
Reference
',
'
Comment
',
'
Comment
',
'
Worklist
',
'
Guard
',
'
Guard
',
'
ActionInformation
',
'
ActionInformation
',
'
Predicate
',
)
)
security.declareProtected(Permissions.AccessContentsInformation,
security.declareProtected(Permissions.AccessContentsInformation,
...
@@ -124,69 +126,31 @@ class Worklist(IdAsReferenceMixin("worklist_"), XMLObject, GuardableMixin):
...
@@ -124,69 +126,31 @@ class Worklist(IdAsReferenceMixin("worklist_"), XMLObject, GuardableMixin):
workflow_variable_id_list.append(worklist_variable_value.getId())
workflow_variable_id_list.append(worklist_variable_value.getId())
return res
return res
security.declareProtected(Permissions.AccessContentsInformation,
'
getVariableMatchDict
')
def getIdentityCriterionDict(self):
"""
XXX: Move this to Predicate class?
"""
return dict(self._identity_criterion)
security.declareProtected(Permissions.AccessContentsInformation,
security.declareProtected(Permissions.AccessContentsInformation,
'
getVarMatchKeys
')
'
getVarMatchKeys
')
@deprecated('
getVarMatchKeys
()
deprecated
;
use
getCriterionPropertyList
()
')
def getVarMatchKeys(self):
def getVarMatchKeys(self):
key_list = []
"""
if self.getMatchedPortalTypeList():
DCWorkflow API
key_list.append('
portal_type
')
"""
if self.getMatchedSimulationStateList():
return self.getCriterionPropertyList()
key_list.append('
simulation_state
')
if self.getMatchedValidationStateList():
key_list.append('
validation_state
')
if self.getMatchedCausalityState():
key_list.append('
causality_state
')
key_list += [dynamic_variable.getReference() for dynamic_variable in self.objectValues()
if dynamic_variable.getVariableDefaultValue() or dynamic_variable.getVariableDefaultExpression()]
return key_list
security.declareProtected(Permissions.AccessContentsInformation,
security.declareProtected(Permissions.AccessContentsInformation,
'
getVarMatch
')
'
getVarMatch
')
@deprecated('
getVarMatch
()
deprecated
;
use
getIdentityCriterionDict
()
')
def getVarMatch(self, id):
def getVarMatch(self, id):
""" return value of matched keys"""
""" return value of matched keys"""
matches = None
return tuple(self._identity_criterion.get(id, ()))
if id == '
portal_type
':
v = self.getMatchedPortalTypeList()
if v: matches = tuple(v)
elif id in ['
validation_state
', '
simulation_state
', '
causality_state
']:
if id == '
validation_state
':
match_reference_list = self.getMatchedValidationStateList()
elif id == '
simulation_state
':
match_reference_list = self.getMatchedSimulationStateList()
elif id == '
causality_state
':
match_reference_list = self.getMatchedCausalityStateList()
matches = tuple(match_reference_list)
elif id:
# Local dynamic variable:
dynamic_variable = self._getOb('
variable_
'+id)
dynamic_variable_value = dynamic_variable.getVariableDefaultValue()
if dynamic_variable_value:
matches = [dynamic_variable_value]
# Override initial value if expression set:
dynamic_variable_default_expression = dynamic_variable.getVariableDefaultExpressionInstance()
if dynamic_variable_default_expression:
matches = dynamic_variable_default_expression
if matches not in ([], None):
if not isinstance(matches, (tuple, Expression)):
# Old version, convert it.
matches = tuple(matches)
return matches
else:
return ()
security.declareProtected(Permissions.AccessContentsInformation,
'
getVarMatchText
')
def getVarMatchText(self, id):
values = self.getVarMatch(id)
if isinstance(values, Expression):
return values.text
return '
;
'.join(values)
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security.declareProtected(Permissions.AccessContentsInformation,
security.declareProtected(Permissions.AccessContentsInformation,
'
getActionType
')
'
getActionType
')
def getActionType(self):
def getActionType(self):
...
...
product/ERP5Type/Tool/PropertySheetTool.py
View file @
49de5527
...
@@ -103,7 +103,7 @@ class PropertySheetTool(BaseTool):
...
@@ -103,7 +103,7 @@ class PropertySheetTool(BaseTool):
'State/acquire_permission_property'
,
'State/acquire_permission_property'
,
'State/selected_property'
,
'State/selected_property'
,
'State/state_type_property'
,
'State/state_type_property'
,
'
Worklist
'
,
'
Predicate
'
,
'Workflow'
,
'Workflow'
,
'Workflow/manager_bypass_property'
,
'Workflow/manager_bypass_property'
,
'Workflow/state_variable_property'
,
'Workflow/state_variable_property'
,
...
...
product/ERP5Type/Tool/WorkflowTool.py
View file @
49de5527
...
@@ -46,9 +46,12 @@ from sets import ImmutableSet
...
@@ -46,9 +46,12 @@ from sets import ImmutableSet
from
zLOG
import
LOG
,
WARNING
from
zLOG
import
LOG
,
WARNING
WORKLIST_METADATA_KEY
=
'metadata'
WORKLIST_METADATA_KEY
=
'metadata'
SECURITY_PARAMETER_ID
=
'local_roles'
COUNT_COLUMN_TITLE
=
'count'
COUNT_COLUMN_TITLE
=
'count'
SECURITY_PARAMETER_ID
=
'local_roles'
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
ModuleSecurityInfo
(
__name__
).
declarePublic
(
'SECURITY_PARAMETER_ID'
)
class
WorkflowTool
(
BaseTool
,
OriginalWorkflowTool
):
class
WorkflowTool
(
BaseTool
,
OriginalWorkflowTool
):
"""
"""
A new container for DC workflow and workflow;
A new container for DC workflow and workflow;
...
...
product/ERP5Type/mixin/guardable.py
View file @
49de5527
...
@@ -50,7 +50,6 @@ class GuardableMixin(ExpressionMixin('guard_expression')):
...
@@ -50,7 +50,6 @@ class GuardableMixin(ExpressionMixin('guard_expression')):
security_manager
,
security_manager
,
workflow
,
workflow
,
current_object
,
current_object
,
check_roles
=
True
,
**
kw
):
**
kw
):
"""
"""
Checks conditions in this guard. Original source code from DCWorkflow
Checks conditions in this guard. Original source code from DCWorkflow
...
@@ -78,17 +77,16 @@ class GuardableMixin(ExpressionMixin('guard_expression')):
...
@@ -78,17 +77,16 @@ class GuardableMixin(ExpressionMixin('guard_expression')):
break
break
else
:
else
:
return
False
return
False
if
check_roles
:
guard_role_list
=
self
.
getGuardRoleList
()
guard_role_list
=
self
.
getGuardRoleList
()
if
guard_role_list
:
if
guard_role_list
:
# Require at least one of the given roles.
# Require at least one of the given roles.
if
user_roles
is
None
:
if
user_roles
is
None
:
user_roles
=
getRoles
()
user_roles
=
getRoles
()
for
role
in
guard_role_list
:
for
role
in
guard_role_list
:
if
role
in
user_roles
:
if
role
in
user_roles
:
break
break
else
:
else
:
return
False
return
False
guard_group_list
=
self
.
getGuardGroupList
()
guard_group_list
=
self
.
getGuardGroupList
()
if
guard_group_list
:
if
guard_group_list
:
# Require at least one of the specified groups.
# Require at least one of the specified groups.
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
49de5527
...
@@ -1045,24 +1045,8 @@ def convertToERP5Workflow(self, temp_object=False):
...
@@ -1045,24 +1045,8 @@ def convertToERP5Workflow(self, temp_object=False):
worklist
.
setTitle
(
qdef
.
title
)
worklist
.
setTitle
(
qdef
.
title
)
worklist
.
setReference
(
qdef
.
id
)
worklist
.
setReference
(
qdef
.
id
)
worklist
.
setDescription
(
qdef
.
description
)
worklist
.
setDescription
(
qdef
.
description
)
for
key
,
values
in
qdef
.
var_matches
.
items
():
for
key
,
value
in
qdef
.
var_matches
.
items
():
if
key
==
'portal_type'
:
worklist
.
setCriterion
(
key
,
value
)
worklist
.
setMatchedPortalTypeList
(
values
)
elif
key
==
'simulation_state'
:
worklist
.
setMatchedSimulationStateList
(
values
)
elif
key
==
'validation_state'
:
worklist
.
setMatchedValidationStateList
(
values
)
elif
key
==
'causality_state'
:
worklist
.
setMatchedCausalityState
(
values
)
else
:
# dynamic variable.
worklist_variable_value
=
worklist
.
newContent
(
portal_type
=
'Worklist Variable'
,
reference
=
key
)
if
isinstance
(
values
,
Expression
):
worklist_variable_value
.
setVariableDefaultExpression
(
values
.
text
)
else
:
worklist_variable_value
.
setVariableDefaultValue
(
values
[
0
])
#XXX(WORKFLOW): to be changed
worklist
.
setAction
(
qdef
.
actbox_url
)
worklist
.
setAction
(
qdef
.
actbox_url
)
worklist
.
setActionType
(
qdef
.
actbox_category
)
worklist
.
setActionType
(
qdef
.
actbox_category
)
worklist
.
setIcon
(
qdef
.
actbox_icon
)
worklist
.
setIcon
(
qdef
.
actbox_icon
)
...
...
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