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
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
edda9659
Commit
edda9659
authored
Feb 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: py3
parent
7a680ab5
Changes
4
Show 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 @
edda9659
...
...
@@ -2,6 +2,7 @@
This script has proxy role, as only manager can access workflow configuration.
"""
import
six
from
Products.ERP5Type.Message
import
translateString
portal
=
context
.
getPortalObject
()
...
...
@@ -11,9 +12,9 @@ workflow = portal.portal_workflow.ticket_workflow
for
state
in
workflow
.
getStateValueList
():
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
()),
default
=
unicod
e
(
translateString
(
state_title
))))
default
=
six
.
text_typ
e
(
translateString
(
state_title
))))
info
[
state
.
getReference
()]
=
state_title
return
info
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/ERP5Site_getTicketWorkflowWorklistInfoDict.py
View file @
edda9659
...
...
@@ -28,9 +28,9 @@ for worklist in workflow.getWorklistValueList():
# so that it looks good in the module view.
key
=
'translated_%s_title'
%
key
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
()),
default
=
unicod
e
(
translateString
(
state_title
))))
default
=
six
.
text_typ
e
(
translateString
(
state_title
))))
if
isinstance
(
value
,
(
tuple
,
list
)):
query_list
.
extend
([{
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/Post_ingestWebMessageForSupportRequest.py
View file @
edda9659
...
...
@@ -4,8 +4,8 @@ support_request = context.getFollowUpValue()
web_site_value
=
portal
.
restrictedTraverse
(
web_site_relative_url
)
# XXX what to do with PData ?
# As a first step just use
a string
.
data
=
str
(
context
.
getData
())
# As a first step just use
bytes
.
data
=
bytes
(
context
.
getData
())
is_html
=
context
.
getPortalType
()
==
'HTML Post'
if
is_html
:
...
...
@@ -34,7 +34,7 @@ web_message = portal.event_module.newContent(
portal_type
=
'Web Message'
,
title
=
context
.
getTitle
()
if
context
.
hasTitle
()
else
None
,
content_type
=
'text/html'
if
is_html
else
'text/plain'
,
text_content
=
data
,
text_content
=
data
.
decode
(
'utf-8'
)
,
follow_up_value
=
support_request
,
aggregate_value_list
=
[
context
]
+
context
.
getSuccessorValueList
(
portal_type
=
portal
.
getPortalDocumentTypeList
()),
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_getWorklistAsJson.py
View file @
edda9659
# return worklists from ticket workflow in JSON format
from
Products.ERP5Type.Message
import
translateString
import
json
import
six
portal
=
context
.
getPortalObject
()
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.
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'
],
'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