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
0662333c
Commit
0662333c
authored
Feb 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: py3
parent
6f182bba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowStateInfoDict.py
...upport_request/ERP5Site_getTicketWorkflowStateInfoDict.py
+3
-2
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
...ort_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
+2
-2
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/Post_ingestWebMessageForSupportRequest.py
...support_request/Post_ingestWebMessageForSupportRequest.py
+3
-3
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_getWorklistAsJson.py
...support_request/SupportRequestModule_getWorklistAsJson.py
+2
-1
No files found.
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowStateInfoDict.py
View file @
0662333c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
This script has proxy role, as only manager can access workflow configuration.
This script has proxy role, as only manager can access workflow configuration.
"""
"""
import
six
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
...
@@ -11,9 +12,9 @@ workflow = portal.portal_workflow.ticket_workflow
...
@@ -11,9 +12,9 @@ workflow = portal.portal_workflow.ticket_workflow
for
state
in
workflow
.
getStateValueList
():
for
state
in
workflow
.
getStateValueList
():
state_title
=
state
.
title_or_id
()
state_title
=
state
.
title_or_id
()
state_title
=
unicod
e
(
translateString
(
state_title
=
six
.
text_typ
e
(
translateString
(
'%s [state in %s]'
%
(
state_title
,
workflow
.
getId
()),
'%s [state in %s]'
%
(
state_title
,
workflow
.
getId
()),
default
=
unicod
e
(
translateString
(
state_title
))))
default
=
six
.
text_typ
e
(
translateString
(
state_title
))))
info
[
state
.
getReference
()]
=
state_title
info
[
state
.
getReference
()]
=
state_title
return
info
return
info
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
View file @
0662333c
...
@@ -28,9 +28,9 @@ for worklist in workflow.getWorklistValueList():
...
@@ -28,9 +28,9 @@ for worklist in workflow.getWorklistValueList():
# so that it looks good in the module view.
# so that it looks good in the module view.
key
=
'translated_%s_title'
%
key
key
=
'translated_%s_title'
%
key
state_title
=
workflow
.
getStateValueByReference
(
value
[
0
]).
title_or_id
()
state_title
=
workflow
.
getStateValueByReference
(
value
[
0
]).
title_or_id
()
value
=
unicod
e
(
translateString
(
value
=
six
.
text_typ
e
(
translateString
(
'%s [state in %s]'
%
(
state_title
,
workflow
.
getId
()),
'%s [state in %s]'
%
(
state_title
,
workflow
.
getId
()),
default
=
unicod
e
(
translateString
(
state_title
))))
default
=
six
.
text_typ
e
(
translateString
(
state_title
))))
if
isinstance
(
value
,
(
tuple
,
list
)):
if
isinstance
(
value
,
(
tuple
,
list
)):
query_list
.
extend
([{
query_list
.
extend
([{
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/Post_ingestWebMessageForSupportRequest.py
View file @
0662333c
...
@@ -4,8 +4,8 @@ support_request = context.getFollowUpValue()
...
@@ -4,8 +4,8 @@ support_request = context.getFollowUpValue()
web_site_value
=
portal
.
restrictedTraverse
(
web_site_relative_url
)
web_site_value
=
portal
.
restrictedTraverse
(
web_site_relative_url
)
# XXX what to do with PData ?
# XXX what to do with PData ?
# As a first step just use
a string
.
# As a first step just use
bytes
.
data
=
str
(
context
.
getData
())
data
=
bytes
(
context
.
getData
())
is_html
=
context
.
getPortalType
()
==
'HTML Post'
is_html
=
context
.
getPortalType
()
==
'HTML Post'
if
is_html
:
if
is_html
:
...
@@ -34,7 +34,7 @@ web_message = portal.event_module.newContent(
...
@@ -34,7 +34,7 @@ web_message = portal.event_module.newContent(
portal_type
=
'Web Message'
,
portal_type
=
'Web Message'
,
title
=
context
.
getTitle
()
if
context
.
hasTitle
()
else
None
,
title
=
context
.
getTitle
()
if
context
.
hasTitle
()
else
None
,
content_type
=
'text/html'
if
is_html
else
'text/plain'
,
content_type
=
'text/html'
if
is_html
else
'text/plain'
,
text_content
=
data
,
text_content
=
data
.
decode
(
'utf-8'
)
,
follow_up_value
=
support_request
,
follow_up_value
=
support_request
,
aggregate_value_list
=
[
context
]
+
context
.
getSuccessorValueList
(
aggregate_value_list
=
[
context
]
+
context
.
getSuccessorValueList
(
portal_type
=
portal
.
getPortalDocumentTypeList
()),
portal_type
=
portal
.
getPortalDocumentTypeList
()),
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_getWorklistAsJson.py
View file @
0662333c
# return worklists from ticket workflow in JSON format
# return worklists from ticket workflow in JSON format
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
import
json
import
json
import
six
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
worklist_query_dict
=
portal
.
ERP5Site_getTicketWorkflowWorklistInfoDict
(
worklist_query_dict
=
portal
.
ERP5Site_getTicketWorkflowWorklistInfoDict
(
...
@@ -11,7 +12,7 @@ worklist_query_dict = portal.ERP5Site_getTicketWorkflowWorklistInfoDict(
...
@@ -11,7 +12,7 @@ worklist_query_dict = portal.ERP5Site_getTicketWorkflowWorklistInfoDict(
# extend this information with the query from our helper script.
# extend this information with the query from our helper script.
worklist_action_list
=
[
worklist_action_list
=
[
{
{
'action_name'
:
unicod
e
(
translateString
(
action
[
'name'
].
rsplit
(
' ('
,
1
)[
0
])),
# Action name include the count, but we display it separatly.
'action_name'
:
six
.
text_typ
e
(
translateString
(
action
[
'name'
].
rsplit
(
' ('
,
1
)[
0
])),
# Action name include the count, but we display it separatly.
'action_count'
:
action
[
'count'
],
'action_count'
:
action
[
'count'
],
'query'
:
worklist_query_dict
[
action
[
'worklist_id'
]],
'query'
:
worklist_query_dict
[
action
[
'worklist_id'
]],
}
}
...
...
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