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
756d6323
Commit
756d6323
authored
Oct 09, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: use dictionnaries instead of tuple in API
This is more understandable
parent
c2bc7e33
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
32 deletions
+31
-32
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.js
...dule/gadget_supportrequest_pt_form_view_discussable_js.js
+14
-14
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.xml
...ule/gadget_supportrequest_pt_form_view_discussable_js.xml
+1
-1
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/PostModule_createHTMLPostForSupportRequest.py
...ort_request/PostModule_createHTMLPostForSupportRequest.py
+7
-7
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getCommentPostListAsJson.py
...upport_request/SupportRequest_getCommentPostListAsJson.py
+9
-10
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.js
View file @
756d6323
...
...
@@ -172,10 +172,10 @@
var
queue_list
=
[];
if
(
post_list
.
length
)
{
for
(
var
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
if
(
post_list
[
i
]
[
3
]
!==
null
&&
post_list
[
i
][
3
]
.
indexOf
(
"
image_module
"
)
!==
-
1
)
{
queue_list
.
push
(
gadget
.
getImageUrl
(
post_list
[
i
]
[
3
]
));
}
else
if
(
post_list
[
i
]
[
3
]
!==
null
&&
post_list
[
i
][
3
]
.
indexOf
(
"
document_module
"
)
!==
-
1
)
{
queue_list
.
push
(
gadget
.
getDocumentUrl
(
post_list
[
i
]
[
3
]
));
if
(
post_list
[
i
]
.
attachment_link
!==
null
&&
post_list
[
i
].
attachment_link
.
indexOf
(
"
image_module
"
)
!==
-
1
)
{
queue_list
.
push
(
gadget
.
getImageUrl
(
post_list
[
i
]
.
attachment_link
));
}
else
if
(
post_list
[
i
]
.
attachment_link
!==
null
&&
post_list
[
i
].
attachment_link
.
indexOf
(
"
document_module
"
)
!==
-
1
)
{
queue_list
.
push
(
gadget
.
getDocumentUrl
(
post_list
[
i
]
.
attachment_link
));
}
else
{
queue_list
.
push
(
null
);
}
...
...
@@ -190,25 +190,25 @@
if
(
post_list
.
length
)
{
for
(
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
s
+=
'
<li>
'
+
'
By <strong>
'
+
post_list
[
i
]
[
0
]
+
'
</strong>
'
+
'
- <time datetime="
'
+
post_list
[
i
]
[
1
]
+
'
" title="
'
+
moment
(
post_list
[
i
][
1
]).
format
(
'
LLLL
'
)
+
'
">
'
+
moment
(
post_list
[
i
][
1
]
).
fromNow
()
+
'
</time><br/>
'
;
if
(
post_list
[
i
]
[
3
]
!==
null
&&
result_list
[
i
]
!==
null
)
{
post_list
[
i
]
[
3
]
=
result_list
[
i
];
'
By <strong>
'
+
post_list
[
i
]
.
user
+
'
</strong>
'
+
'
- <time datetime="
'
+
post_list
[
i
]
.
date
+
'
" title="
'
+
moment
(
post_list
[
i
].
date
).
format
(
'
LLLL
'
)
+
'
">
'
+
moment
(
post_list
[
i
].
date
).
fromNow
()
+
'
</time><br/>
'
;
if
(
post_list
[
i
]
.
attachment_link
!==
null
&&
result_list
[
i
]
!==
null
)
{
post_list
[
i
]
.
attachment_link
=
result_list
[
i
];
}
if
(
post_list
[
i
]
[
2
]
)
{
plain_content
=
post_list
[
i
]
[
2
]
;
if
(
post_list
[
i
]
[
3
]
)
{
if
(
post_list
[
i
]
.
text
)
{
plain_content
=
post_list
[
i
]
.
text
;
if
(
post_list
[
i
]
.
attachment_link
)
{
s
+=
plain_content
+
'
<strong>Attachment: </strong>
'
+
'
<a href=
\
"
'
+
post_list
[
i
]
[
3
]
+
'
\
">
'
+
post_list
[
i
][
4
]
+
post_list
[
i
]
.
attachment_link
+
'
\
">
'
+
post_list
[
i
].
attachment_name
+
'
</a>
'
;
}
else
{
s
+=
plain_content
;
}
}
else
{
if
(
post_list
[
i
]
[
3
]
)
{
if
(
post_list
[
i
]
.
attachment_link
)
{
s
+=
'
<strong>Attachment: </strong>
'
+
'
<a href=
\
"
'
+
post_list
[
i
]
[
3
]
+
'
\
">
'
+
post_list
[
i
][
4
]
+
post_list
[
i
]
.
attachment_link
+
'
\
">
'
+
post_list
[
i
].
attachment_name
+
'
</a>
'
;
}
}
...
...
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.xml
View file @
756d6323
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
153
8972059.78
</float>
<float>
153
9065902.53
</float>
<string>
GMT+9
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/PostModule_createHTMLPostForSupportRequest.py
View file @
756d6323
...
...
@@ -51,10 +51,10 @@ successor_name = successor_link = None
if
successor_list
:
successor_link
,
successor_name
=
successor_list
[
0
].
getRelativeUrl
(),
successor_list
[
0
].
getFilename
()
portal
.
portal_sessions
[
'%s.latest_comment'
%
follow_up_value
.
getRelativeUrl
()][
'comment_post_list'
]
=
(
post
.
Base_getOwnerTitle
(),
post
.
getStartDate
().
ISO8601
(),
post
.
asStrippedHTML
(),
successor_link
,
successor_name
,
post
.
getSourceReference
(),
'%s.latest_comment'
%
follow_up_value
.
getRelativeUrl
()][
'comment_post_list'
]
=
dict
(
user
=
post
.
Base_getOwnerTitle
(),
date
=
post
.
getStartDate
().
ISO8601
(),
text
=
post
.
asStrippedHTML
(),
attachment_link
=
successor_link
,
attachment_name
=
successor_name
,
message_id
=
post
.
getSourceReference
(),)
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getCommentPostListAsJson.py
View file @
756d6323
...
...
@@ -21,22 +21,21 @@ for event in event_list:
if
attachment
is
not
None
:
attachment_link
,
attachment_name
=
attachment
.
getRelativeUrl
(),
attachment
.
getFilename
()
comment_list
.
append
((
event
.
getSourceTitle
(),
event
.
getStartDate
().
ISO8601
(),
event
.
asStrippedHTML
(),
attachment_link
,
attachment_name
,
event
.
getSourceReference
(),
))
comment_list
.
append
((
dict
(
user
=
event
.
getSourceTitle
(),
date
=
event
.
getStartDate
().
ISO8601
(),
text
=
event
.
asStrippedHTML
(),
attachment_link
=
attachment_link
,
attachment_name
=
attachment_name
,
message_id
=
event
.
getSourceReference
(),
))
)
just_posted_comment
=
portal
.
portal_sessions
[
'%s.latest_comment'
%
context
.
getRelativeUrl
()].
pop
(
'comment_post_list'
,
None
)
if
just_posted_comment
is
not
None
:
# make sure not to display twice if it was already ingested in the meantime.
if
just_posted_comment
[
-
1
]
not
in
[
comment
[
-
1
]
for
comment
in
comment_list
]:
if
just_posted_comment
[
'message_id'
]
not
in
[
comment
[
'message_id'
]
for
comment
in
comment_list
]:
comment_list
.
append
(
just_posted_comment
)
return
dumps
(
comment_list
)
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