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
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
Eteri
erp5
Commits
fdf0509a
Commit
fdf0509a
authored
Apr 15, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_*: use Base_renderForm API to change the REQUEST
parent
f379099c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
177 additions
and
70 deletions
+177
-70
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_updateCreateResponse.py
...eItem/portal_skins/erp5_crm/Event_updateCreateResponse.py
+9
-9
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_updateCreateResponseWorkflowActionDialog.py
...p5_crm/Ticket_updateCreateResponseWorkflowActionDialog.py
+9
-15
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_updateNewEventDialog.py
...Item/portal_skins/erp5_crm/Ticket_updateNewEventDialog.py
+9
-15
bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py
...s/erp5_simulation/Delivery_updateSolveDivergenceDialog.py
+6
-6
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_printLastViewName.py
...teItem/portal_skins/erp5_ui_test/Foo_printLastViewName.py
+1
-2
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintDialog.xml
...ateItem/portal_skins/erp5_ui_test/Foo_viewPrintDialog.xml
+5
-1
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintoutForm/last_form_id.xml
..._skins/erp5_ui_test/Foo_viewPrintoutForm/last_form_id.xml
+137
-19
bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py
...web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py
+1
-3
No files found.
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_updateCreateResponse.py
View file @
fdf0509a
"""Preview the response from notification message for event create response dialog.
"""Preview the response from notification message for event create response dialog.
"""
"""
keep_items
=
None
if
response_event_notification_message
:
if
response_event_notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_object
=
True
,
temp_object
=
True
,
...
@@ -16,13 +17,12 @@ if response_event_notification_message:
...
@@ -16,13 +17,12 @@ if response_event_notification_message:
reference
=
response_event_notification_message
,
reference
=
response_event_notification_message
,
substitution_method_parameter_dict
=
dict
(
reply_body
=
context
.
getReplyBody
(),
substitution_method_parameter_dict
=
dict
(
reply_body
=
context
.
getReplyBody
(),
reply_subject
=
context
.
getReplySubject
()))
reply_subject
=
context
.
getReplySubject
()))
# XXX this relies on formulator internals, we force the variables in request and
# re-render the form.
request
=
container
.
REQUEST
request
.
form
[
'your_response_event_notification_message'
]
=
''
request
.
form
[
'your_response_event_title'
]
=
temp_event
.
getTitle
()
request
.
form
[
'your_response_event_text_content'
]
=
temp_event
.
getTextContent
()
request
.
form
[
'your_response_event_resource'
]
=
temp_event
.
getResource
()
return
context
.
Base_renderForm
(
'Event_viewCreateResponseDialog'
)
keep_items
=
{
'your_response_event_notification_message'
:
''
,
'your_response_event_title'
:
temp_event
.
getTitle
(),
'your_response_event_text_content'
:
temp_event
.
getTextContent
(),
'your_response_event_resource'
:
temp_event
.
getResource
()
}
return
context
.
Base_renderForm
(
'Event_viewCreateResponseDialog'
,
keep_items
=
keep_items
)
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_updateCreateResponseWorkflowActionDialog.py
View file @
fdf0509a
"""Preview the response from notification message for ticket create response dialog.
"""Preview the response from notification message for ticket create response dialog.
"""
"""
event
=
context
.
Ticket_getCausalityValue
()
event
=
context
.
Ticket_getCausalityValue
()
keep_items
=
None
if
response_event_notification_message
:
if
response_event_notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
...
@@ -33,19 +34,12 @@ if response_event_notification_message:
...
@@ -33,19 +34,12 @@ if response_event_notification_message:
if
reply_subject
not
in
title
:
if
reply_subject
not
in
title
:
title
=
'%s (%s)'
%
(
title
,
reply_subject
)
title
=
'%s (%s)'
%
(
title
,
reply_subject
)
# XXX this relies on formulator internals, we force the variables in request and
keep_items
=
{
# re-render the form.
'your_response_event_notification_message'
:
''
,
request
=
container
.
REQUEST
'your_response_event_title'
:
title
,
request
.
set
(
'your_response_event_notification_message'
,
''
)
'your_response_event_text_content'
:
temp_event
.
getTextContent
(),
request
.
set
(
'your_response_event_title'
,
title
)
'your_response_event_content_type'
:
temp_event
.
getContentType
(),
request
.
set
(
'your_response_event_text_content'
,
temp_event
.
getTextContent
())
'your_response_event_resource'
:
temp_event
.
getResource
()
request
.
set
(
'your_response_event_content_type'
,
temp_event
.
getContentType
())
}
request
.
set
(
'your_response_event_resource'
,
temp_event
.
getResource
())
# for new UI
request
.
form
[
'your_response_event_notification_message'
]
=
''
request
.
form
[
'your_response_event_title'
]
=
title
request
.
form
[
'your_response_event_text_content'
]
=
temp_event
.
getTextContent
()
request
.
form
[
'your_response_event_content_type'
]
=
temp_event
.
getContentType
()
request
.
form
[
'your_response_event_resource'
]
=
temp_event
.
getResource
()
return
context
.
Base_renderForm
(
'Ticket_viewCreateResponseWorkflowActionDialog'
)
return
context
.
Base_renderForm
(
'Ticket_viewCreateResponseWorkflowActionDialog'
,
keep_items
=
keep_items
)
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_updateNewEventDialog.py
View file @
fdf0509a
"""Preview the response from notification message for ticket create response dialog.
"""Preview the response from notification message for ticket create response dialog.
"""
"""
keep_items
=
None
if
notification_message
:
if
notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_object
=
True
,
temp_object
=
True
,
...
@@ -27,19 +28,12 @@ if notification_message:
...
@@ -27,19 +28,12 @@ if notification_message:
if
original_title
and
original_title
not
in
title
:
if
original_title
and
original_title
not
in
title
:
title
=
'%s (%s)'
%
(
title
,
original_title
)
title
=
'%s (%s)'
%
(
title
,
original_title
)
# XXX this relies on formulator internals, we force the variables in request and
keep_items
=
{
# re-render the form.
'your_notification_message'
:
''
,
request
=
container
.
REQUEST
'your_title'
:
temp_event
.
getTitle
(),
request
.
form
[
'your_notification_message'
]
=
''
'your_text_content'
:
temp_event
.
getTextContent
(),
request
.
form
[
'your_title'
]
=
temp_event
.
getTitle
()
'your_content_type'
:
temp_event
.
getContentType
(),
request
.
form
[
'your_text_content'
]
=
temp_event
.
getTextContent
()
'your_resource'
:
temp_event
.
getResource
()
request
.
form
[
'your_content_type'
]
=
temp_event
.
getContentType
()
}
request
.
form
[
'your_resource'
]
=
temp_event
.
getResource
()
# BBB for legacy UI
request
.
set
(
'your_notification_message'
,
''
)
request
.
set
(
'your_title'
,
temp_event
.
getTitle
())
request
.
set
(
'your_text_content'
,
temp_event
.
getTextContent
())
request
.
set
(
'your_content_type'
,
temp_event
.
getContentType
())
request
.
set
(
'your_resource'
,
temp_event
.
getResource
())
return
context
.
Base_renderForm
(
dialog_id
)
return
context
.
Base_renderForm
(
dialog_id
,
keep_items
=
keep_items
)
bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py
View file @
fdf0509a
...
@@ -7,21 +7,21 @@ if len(line_list) == 0:
...
@@ -7,21 +7,21 @@ if len(line_list) == 0:
kw
[
"keep_items"
]
=
{
'portal_status_message'
:
translateString
(
"Workflow state may have been updated by other user. Please try again."
)}
kw
[
"keep_items"
]
=
{
'portal_status_message'
:
translateString
(
"Workflow state may have been updated by other user. Please try again."
)}
return
context
.
Base_redirect
(
form_id
,
**
kw
)
return
context
.
Base_redirect
(
form_id
,
**
kw
)
keep_items
=
{
'your_dialog_updated'
:
'1'
,
}
for
listbox_dict
in
listbox
:
for
listbox_dict
in
listbox
:
line
=
[
x
for
x
in
line_list
if
x
.
getPath
()
==
listbox_dict
[
'listbox_key'
]][
0
]
line
=
[
x
for
x
in
line_list
if
x
.
getPath
()
==
listbox_dict
[
'listbox_key'
]][
0
]
uid
=
line
.
getUid
()
uid
=
line
.
getUid
()
for
prop
in
(
'solver'
,
'solver_configuration'
,
'delivery_solver'
,
'comment'
,):
for
prop
in
(
'solver'
,
'solver_configuration'
,
'delivery_solver'
,
'comment'
,):
value
=
listbox_dict
.
get
(
prop
,
None
)
value
=
listbox_dict
.
get
(
prop
,
None
)
key
=
'field_listbox_%s_%s'
%
(
prop
,
uid
)
key
=
'field_listbox_%s_%s'
%
(
prop
,
uid
)
request
.
form
[
key
]
=
request
.
other
[
key
]
=
value
keep_items
[
key
]
=
value
if
prop
==
'solver_configuration'
:
if
prop
==
'solver_configuration'
:
if
value
is
not
None
:
if
value
is
not
None
:
line
.
updateConfiguration
(
**
value
.
as_dict
())
line
.
updateConfiguration
(
**
value
.
as_dict
())
else
:
else
:
line
.
setProperty
(
prop
,
value
)
line
.
setProperty
(
prop
,
value
)
request
.
form
[
'your_dialog_updated'
]
=
'1'
keep_items
[
'listbox'
]
=
listbox
# xhtml style Base_callDialogMethod does not redirected because of the listbox
return
context
.
Base_renderForm
(
'Delivery_viewSolveDivergenceDialog'
,
keep_items
=
keep_items
)
request
.
set
(
'your_dialog_updated'
,
'1'
)
request
.
set
(
'listbox'
,
listbox
)
return
context
.
Base_renderForm
(
'Delivery_viewSolveDivergenceDialog'
)
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_printLastViewName.py
View file @
fdf0509a
...
@@ -2,5 +2,4 @@
...
@@ -2,5 +2,4 @@
#
#
# Print action expects the previous view to be accessible in `form_id`
# Print action expects the previous view to be accessible in `form_id`
# and it prints it out in both UI compatible way - as a redirect message.
# and it prints it out in both UI compatible way - as a redirect message.
context
.
REQUEST
.
form
[
'last_form_id'
]
=
form_id
return
context
.
Base_renderForm
(
'Foo_viewPrintoutForm'
,
keep_items
=
{
'last_form_id'
:
form_id
})
return
context
.
Base_renderForm
(
'Foo_viewPrintoutForm'
)
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintDialog.xml
View file @
fdf0509a
...
@@ -14,7 +14,11 @@
...
@@ -14,7 +14,11 @@
</item>
</item>
<item>
<item>
<key>
<string>
action
</string>
</key>
<key>
<string>
action
</string>
</key>
<value>
<string>
Foo_viewPrintoutForm
</string>
</value>
<value>
<string>
Foo_printLastViewName
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
...
...
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintoutForm/last_form_id.xml
View file @
fdf0509a
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py
View file @
fdf0509a
request
=
container
.
REQUEST
request
.
form
[
'your_integer_1'
]
=
integer_1
+
1
assert
button
==
'forbarcontent'
,
button
assert
button
==
'forbarcontent'
,
button
return
context
.
Base_renderForm
(
'Foo_viewFieldSubmitDialog'
,
message
=
'Field Action Submitted'
)
return
context
.
Base_renderForm
(
'Foo_viewFieldSubmitDialog'
,
message
=
'Field Action Submitted'
,
keep_items
=
{
'your_integer_1'
:
integer_1
+
1
}
)
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