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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
73594d3c
Commit
73594d3c
authored
Jun 23, 2014
by
Tatuya Kamada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Folder Worklow: Fix Folder Worklow action when the action_url is not ERP5Form.
parent
9ce895fe
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
406 additions
and
2 deletions
+406
-2
bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionWithoutConfirmationForm.xml
...zuite/testFolderWorkflowActionWithoutConfirmationForm.xml
+252
-0
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Base_directWorkflowAction.xml
...m/portal_skins/erp5_ui_test/Base_directWorkflowAction.xml
+78
-0
bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml
...emplateItem/portal_workflow/foo_workflow/states/draft.xml
+1
-0
bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/custom_action_no_dialog.xml
...flow/foo_workflow/transitions/custom_action_no_dialog.xml
+66
-0
bt5/erp5_ui_test/bt/change_log
bt5/erp5_ui_test/bt/change_log
+3
-0
bt5/erp5_ui_test/bt/revision
bt5/erp5_ui_test/bt/revision
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getPossibleWorkflowActionItemList.xml
...kins/erp5_core/Base_getPossibleWorkflowActionItemList.xml
+4
-0
product/ERP5/bootstrap/erp5_core/bt/revision
product/ERP5/bootstrap/erp5_core/bt/revision
+1
-1
No files found.
bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionWithoutConfirmationForm.xml
0 → 100644
View file @
73594d3c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<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_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<unicode
encoding=
"cdata"
>
<![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">
\n
<head>
\n
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
\n
<title>
Test Folder Workflow Action Without Confirmation Form/title>\n
</head>
\n
<body>
\n
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
\n
<thead>
\n
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Folder Workflow Action Without Confirmation Form
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection"
/></td></tr>
\n
</thead><tbody>
\n
<tal:block
metal:use-macro=
"here/PTZuite_CommonTemplate/macros/init"
/>
\n
<tr>
\n
<td>
open
</td>
\n
<td
tal:content=
"string:${here/portal_url}/foo_module/1/Foo_validate"
>
Validate the first document
</td>
\n
<td></td>
\n
</tr>
\n
<tr>
\n
<td>
assertTextPresent
</td>
\n
<td>
Validated
</td>
\n
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
open
</td>
\n
\t
<td>
${base_url}/foo_module/FooModule_createObjects?num:int=2
&
start:int=2
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertTextPresent
</td>
\n
\t
<td>
Created Successfully.
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
open
</td>
\n
\t
<td>
${base_url}/foo_module/Zuite_waitForActivities
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertTextPresent
</td>
\n
\t
<td>
Done.
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
open
</td>
\n
\t
<td>
${base_url}/foo_module/view
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
selectAndWait
</td>
\n
\t
<td>
select_action
</td>
\n
\t
<td>
Change State
</td>
\n
</tr>
\n
<!-- we have a listbox with 2 lines, one for 2 Draft Foos, the other for 1\n
Validated Foo -->
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//span[@class=
"
listbox-current-page-total-number workflow_action_listbox-current-page-total-number
"
]
</td>
\n
\t
<td>
2 records
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-0 DataA\']/td[1]/a
</td>
\n
\t
<td>
2
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-0 DataA\']/td[2]/a
</td>
\n
\t
<td>
Foo
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-0 DataA\']/td[3]/a
</td>
\n
\t
<td>
Draft
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-0 DataA\']/td[4]/a
</td>
\n
\t
<td>
Foo Workflow
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
select
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-0 DataA\']/td[5]/select
</td>
\n
\t
<td>
label=Custom Action No Dialog
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-1 DataB\']/td[1]/a
</td>
\n
\t
<td>
1
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-1 DataB\']/td[2]/a
</td>
\n
\t
<td>
Foo
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-1 DataB\']/td[3]/a
</td>
\n
\t
<td>
Validated
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'workflow_action_listbox-data-line-1 DataB\']/td[4]/a
</td>
\n
\t
<td>
Foo Workflow
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
click
</td>
\n
\t
<td>
field_your_enable_detail_list
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
clickAndWait
</td>
\n
\t
<td>
Base_callDialogMethod:method
</td>
\n
\t
<td></td>
\n
</tr>
\n
<!-- Now we have the custom dialog, plus a listbox with the documents we are\n
modifying.\n
-->
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//span[@class=
"
listbox-current-page-total-number
"
]
</td>
\n
\t
<td>
2 records
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//a[@class=
"
listbox_title
"
]
</td>
\n
\t
<td>
exact:Foos
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'listbox-data-line-0 DataA\']/td[2]
</td>
\n
\t
<td>
Title 2
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'listbox-data-line-0 DataA\']/td[4]
</td>
\n
\t
<td>
Custom Action No Dialog
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'listbox-data-line-1 DataB\']/td[2]
</td>
\n
\t
<td>
Title 3
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
//tr[@class=\'listbox-data-line-1 DataB\']/td[4]
</td>
\n
\t
<td>
Custom Action No Dialog
</td>
\n
</tr>
\n
<tr>
\n
\t
<td>
type
</td>
\n
\t
<td>
field_your_comment
</td>
\n
\t
<td>
Comment !
</td>
\n
</tr>
\n
<!-- this field only exist in our custom dialog for this workflow action. -->
\n
<tr>
\n
\t
<td>
clickAndWait
</td>
\n
\t
<td>
Base_callDialogMethod:method
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertPortalStatusMessage
</td>
\n
\t
<td>
Workflow modification in progress.
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
open
</td>
\n
\t
<td>
${base_url}/foo_module/Zuite_waitForActivities
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertTextPresent
</td>
\n
\t
<td>
Done.
</td>
\n
\t
<td></td>
\n
</tr>
\n
<!-- We\'ll check everything else (workflow history, comments, etc) in a python\n
script. -->
\n
<tr>
\n
\t
<td>
open
</td>
\n
\t
<td>
${base_url}/foo_module/Zuite_testFolderWorkflowActionCheckWorkflowHistory
</td>
\n
\t
<td></td>
\n
</tr>
\n
<tr>
\n
\t
<td>
assertText
</td>
\n
\t
<td>
result
</td>
\n
\t
<td>
OK
</td>
\n
</tr>
\n
</body>
\n
</html>
]]>
</unicode>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testFolderWorkflowActionWithoutConfirmationForm
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Base_directWorkflowAction.xml
0 → 100644
View file @
73594d3c
<?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>
_body
</string>
</key>
<value>
<string>
request = context.REQUEST\n
context.portal_workflow.doActionFor(context , workflow_action, comment=\'\', **kw)\n
message = \'direct workflow action done.\'\n
request.RESPONSE.redirect("%s/?portal_status_message=%s" % (context.absolute_url(), message) )\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
workflow_action, **kw
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_directWorkflowAction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml
View file @
73594d3c
...
...
@@ -28,6 +28,7 @@
<key>
<string>
transitions
</string>
</key>
<value>
<tuple>
<string>
custom_action_no_dialog
</string>
<string>
custom_dialog_action
</string>
<string>
delete
</string>
<string>
delete_action
</string>
...
...
bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/custom_action_no_dialog.xml
0 → 100644
View file @
73594d3c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"TransitionDefinition"
module=
"Products.DCWorkflow.Transitions"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string>
Custom Action No Dialog
</string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string>
%(content_url)s/Base_directWorkflowAction?workflow_action=validate_action
</string>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
NOTE: We need both \'validate\', \'validate_action\' in the Script(after) and the URL respectively.\r\n
\r\n
The validate_action in the URL is needed for user action.\r\n
\r\n
The one in Script(after) is needed when the transition is called from portal_workflow.doActionFor.
</string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
custom_action_no_dialog
</string>
</value>
</item>
<item>
<key>
<string>
new_state_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Custom Action No Dialog
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test/bt/change_log
View file @
73594d3c
2014-06-13 tatuya
* Add a test for folder workflow with a no dialog transition.
2010-06-07 yusei
* Remove short title.
...
...
bt5/erp5_ui_test/bt/revision
View file @
73594d3c
714
\ No newline at end of file
717
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getPossibleWorkflowActionItemList.xml
View file @
73594d3c
...
...
@@ -51,6 +51,7 @@
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
Base_translateString = context.Base_translateString\n
portal = context.getPortalObject()\n
item_list = [(\'\', \'\')]\n
for action in context.portal_actions.listFilteredActionsFor(brain).get(\'workflow\', []):\n
transition = action.get(\'transition\', None)\n
...
...
@@ -58,6 +59,9 @@ for action in context.portal_actions.listFilteredActionsFor(brain).get(\'workflo
workflow_id = action[\'transition\'].aq_parent.aq_parent.getId()\n
if workflow_id == brain.workflow_id:\n
dialog_id = action[\'url\'].split(\'?\', 1)[0].split(\'/\')[-1]\n
dialog_object = getattr(portal, dialog_id, None)\n
if dialog_object is None or dialog_object.meta_type != \'ERP5 Form\':\n
dialog_id = portal.Base_viewWorkflowActionDialog.getId()\n
item_list.append((Base_translateString(action[\'title\']),\n
\'%s/%s/%s\' % (workflow_id, action[\'id\'], dialog_id)))\n
\n
...
...
product/ERP5/bootstrap/erp5_core/bt/revision
View file @
73594d3c
41163
\ No newline at end of file
41164
\ No newline at end of file
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