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
Léo-Paul Géneau
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
Show 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.
"""
keep_items
=
None
if
response_event_notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_object
=
True
,
...
...
@@ -17,12 +18,11 @@ if response_event_notification_message:
substitution_method_parameter_dict
=
dict
(
reply_body
=
context
.
getReplyBody
(),
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
()
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'
)
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.
"""
event
=
context
.
Ticket_getCausalityValue
()
keep_items
=
None
if
response_event_notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
...
...
@@ -33,19 +34,12 @@ if response_event_notification_message:
if
reply_subject
not
in
title
:
title
=
'%s (%s)'
%
(
title
,
reply_subject
)
# XXX this relies on formulator internals, we force the variables in request and
# re-render the form.
request
=
container
.
REQUEST
request
.
set
(
'your_response_event_notification_message'
,
''
)
request
.
set
(
'your_response_event_title'
,
title
)
request
.
set
(
'your_response_event_text_content'
,
temp_event
.
getTextContent
())
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
()
keep_items
=
{
'your_response_event_notification_message'
:
''
,
'your_response_event_title'
:
title
,
'your_response_event_text_content'
:
temp_event
.
getTextContent
(),
'your_response_event_content_type'
:
temp_event
.
getContentType
(),
'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.
"""
keep_items
=
None
if
notification_message
:
temp_event
=
context
.
getPortalObject
().
event_module
.
newContent
(
temp_object
=
True
,
...
...
@@ -27,19 +28,12 @@ if notification_message:
if
original_title
and
original_title
not
in
title
:
title
=
'%s (%s)'
%
(
title
,
original_title
)
# XXX this relies on formulator internals, we force the variables in request and
# re-render the form.
request
=
container
.
REQUEST
request
.
form
[
'your_notification_message'
]
=
''
request
.
form
[
'your_title'
]
=
temp_event
.
getTitle
()
request
.
form
[
'your_text_content'
]
=
temp_event
.
getTextContent
()
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
())
keep_items
=
{
'your_notification_message'
:
''
,
'your_title'
:
temp_event
.
getTitle
(),
'your_text_content'
:
temp_event
.
getTextContent
(),
'your_content_type'
:
temp_event
.
getContentType
(),
'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:
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
)
keep_items
=
{
'your_dialog_updated'
:
'1'
,
}
for
listbox_dict
in
listbox
:
line
=
[
x
for
x
in
line_list
if
x
.
getPath
()
==
listbox_dict
[
'listbox_key'
]][
0
]
uid
=
line
.
getUid
()
for
prop
in
(
'solver'
,
'solver_configuration'
,
'delivery_solver'
,
'comment'
,):
value
=
listbox_dict
.
get
(
prop
,
None
)
key
=
'field_listbox_%s_%s'
%
(
prop
,
uid
)
request
.
form
[
key
]
=
request
.
other
[
key
]
=
value
keep_items
[
key
]
=
value
if
prop
==
'solver_configuration'
:
if
value
is
not
None
:
line
.
updateConfiguration
(
**
value
.
as_dict
())
else
:
line
.
setProperty
(
prop
,
value
)
request
.
form
[
'your_dialog_updated'
]
=
'1'
# xhtml style Base_callDialogMethod does not redirected because of the listbox
request
.
set
(
'your_dialog_updated'
,
'1'
)
request
.
set
(
'listbox'
,
listbox
)
return
context
.
Base_renderForm
(
'Delivery_viewSolveDivergenceDialog'
)
keep_items
[
'listbox'
]
=
listbox
return
context
.
Base_renderForm
(
'Delivery_viewSolveDivergenceDialog'
,
keep_items
=
keep_items
)
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_printLastViewName.py
View file @
fdf0509a
...
...
@@ -2,5 +2,4 @@
#
# 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.
context
.
REQUEST
.
form
[
'last_form_id'
]
=
form_id
return
context
.
Base_renderForm
(
'Foo_viewPrintoutForm'
)
return
context
.
Base_renderForm
(
'Foo_viewPrintoutForm'
,
keep_items
=
{
'last_form_id'
:
form_id
})
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintDialog.xml
View file @
fdf0509a
...
...
@@ -14,7 +14,11 @@
</item>
<item>
<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>
<key>
<string>
description
</string>
</key>
...
...
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewPrintoutForm/last_form_id.xml
View file @
fdf0509a
...
...
@@ -2,7 +2,7 @@
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"
Label
Field"
module=
"Products.Formulator.StandardFields"
/>
<global
name=
"
String
Field"
module=
"Products.Formulator.StandardFields"
/>
</pickle>
<pickle>
<dictionary>
...
...
@@ -13,13 +13,30 @@
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary/>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
<item>
<key>
<string>
required_not_found
</string>
</key>
<value>
<string>
Input is required but no input given.
</string>
</value>
</item>
<item>
<key>
<string>
too_long
</string>
</key>
<value>
<string>
Too much input was given.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -32,6 +49,14 @@
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -40,6 +65,10 @@
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -48,10 +77,34 @@
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
...
...
@@ -59,20 +112,30 @@
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -81,6 +144,10 @@
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -89,10 +156,34 @@
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
...
...
@@ -100,18 +191,30 @@
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
No Last FormID
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
20
</int>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
...
...
@@ -120,6 +223,10 @@
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -128,25 +235,36 @@
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string>
text
</string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Last Form ID
</string>
</value>
</item>
</dictionary>
</value>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<int>
0
</int>
</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: here.REQUEST.form.get(\'form_id\', \'No Last FormID\')
</string>
</value>
<key>
<string>
unicode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
...
...
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
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