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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
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
Show 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 @@
...
@@ -172,10 +172,10 @@
var
queue_list
=
[];
var
queue_list
=
[];
if
(
post_list
.
length
)
{
if
(
post_list
.
length
)
{
for
(
var
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
for
(
var
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
if
(
post_list
[
i
]
[
3
]
!==
null
&&
post_list
[
i
][
3
]
.
indexOf
(
"
image_module
"
)
!==
-
1
)
{
if
(
post_list
[
i
]
.
attachment_link
!==
null
&&
post_list
[
i
].
attachment_link
.
indexOf
(
"
image_module
"
)
!==
-
1
)
{
queue_list
.
push
(
gadget
.
getImageUrl
(
post_list
[
i
]
[
3
]
));
queue_list
.
push
(
gadget
.
getImageUrl
(
post_list
[
i
]
.
attachment_link
));
}
else
if
(
post_list
[
i
]
[
3
]
!==
null
&&
post_list
[
i
][
3
]
.
indexOf
(
"
document_module
"
)
!==
-
1
)
{
}
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
]
[
3
]
));
queue_list
.
push
(
gadget
.
getDocumentUrl
(
post_list
[
i
]
.
attachment_link
));
}
else
{
}
else
{
queue_list
.
push
(
null
);
queue_list
.
push
(
null
);
}
}
...
@@ -190,25 +190,25 @@
...
@@ -190,25 +190,25 @@
if
(
post_list
.
length
)
{
if
(
post_list
.
length
)
{
for
(
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
post_list
.
length
;
i
+=
1
)
{
s
+=
'
<li>
'
+
s
+=
'
<li>
'
+
'
By <strong>
'
+
post_list
[
i
]
[
0
]
+
'
</strong>
'
+
'
By <strong>
'
+
post_list
[
i
]
.
user
+
'
</strong>
'
+
'
- <time datetime="
'
+
post_list
[
i
]
[
1
]
+
'
" title="
'
+
moment
(
post_list
[
i
][
1
]).
format
(
'
LLLL
'
)
+
'
">
'
+
moment
(
post_list
[
i
][
1
]
).
fromNow
()
+
'
</time><br/>
'
;
'
- <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
]
[
3
]
!==
null
&&
result_list
[
i
]
!==
null
)
{
if
(
post_list
[
i
]
.
attachment_link
!==
null
&&
result_list
[
i
]
!==
null
)
{
post_list
[
i
]
[
3
]
=
result_list
[
i
];
post_list
[
i
]
.
attachment_link
=
result_list
[
i
];
}
}
if
(
post_list
[
i
]
[
2
]
)
{
if
(
post_list
[
i
]
.
text
)
{
plain_content
=
post_list
[
i
]
[
2
]
;
plain_content
=
post_list
[
i
]
.
text
;
if
(
post_list
[
i
]
[
3
]
)
{
if
(
post_list
[
i
]
.
attachment_link
)
{
s
+=
plain_content
+
'
<strong>Attachment: </strong>
'
+
s
+=
plain_content
+
'
<strong>Attachment: </strong>
'
+
'
<a href=
\
"
'
+
'
<a href=
\
"
'
+
post_list
[
i
]
[
3
]
+
'
\
">
'
+
post_list
[
i
][
4
]
+
post_list
[
i
]
.
attachment_link
+
'
\
">
'
+
post_list
[
i
].
attachment_name
+
'
</a>
'
;
'
</a>
'
;
}
else
{
}
else
{
s
+=
plain_content
;
s
+=
plain_content
;
}
}
}
else
{
}
else
{
if
(
post_list
[
i
]
[
3
]
)
{
if
(
post_list
[
i
]
.
attachment_link
)
{
s
+=
'
<strong>Attachment: </strong>
'
+
'
<a href=
\
"
'
+
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>
'
;
'
</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 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
153
8972059.78
</float>
<float>
153
9065902.53
</float>
<string>
GMT+9
</string>
<string>
GMT+9
</string>
</tuple>
</tuple>
</state>
</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
...
@@ -51,10 +51,10 @@ successor_name = successor_link = None
if
successor_list
:
if
successor_list
:
successor_link
,
successor_name
=
successor_list
[
0
].
getRelativeUrl
(),
successor_list
[
0
].
getFilename
()
successor_link
,
successor_name
=
successor_list
[
0
].
getRelativeUrl
(),
successor_list
[
0
].
getFilename
()
portal
.
portal_sessions
[
portal
.
portal_sessions
[
'%s.latest_comment'
%
follow_up_value
.
getRelativeUrl
()][
'comment_post_list'
]
=
(
'%s.latest_comment'
%
follow_up_value
.
getRelativeUrl
()][
'comment_post_list'
]
=
dict
(
post
.
Base_getOwnerTitle
(),
user
=
post
.
Base_getOwnerTitle
(),
post
.
getStartDate
().
ISO8601
(),
date
=
post
.
getStartDate
().
ISO8601
(),
post
.
asStrippedHTML
(),
text
=
post
.
asStrippedHTML
(),
successor_link
,
attachment_link
=
successor_link
,
successor_name
,
attachment_name
=
successor_name
,
post
.
getSourceReference
(),
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:
...
@@ -21,22 +21,21 @@ for event in event_list:
if
attachment
is
not
None
:
if
attachment
is
not
None
:
attachment_link
,
attachment_name
=
attachment
.
getRelativeUrl
(),
attachment
.
getFilename
()
attachment_link
,
attachment_name
=
attachment
.
getRelativeUrl
(),
attachment
.
getFilename
()
comment_list
.
append
((
comment_list
.
append
((
dict
(
event
.
getSourceTitle
(),
user
=
event
.
getSourceTitle
(),
event
.
getStartDate
().
ISO8601
(),
date
=
event
.
getStartDate
().
ISO8601
(),
event
.
asStrippedHTML
(),
text
=
event
.
asStrippedHTML
(),
attachment_link
,
attachment_link
=
attachment_link
,
attachment_name
,
attachment_name
=
attachment_name
,
event
.
getSourceReference
(),
message_id
=
event
.
getSourceReference
(),
))
))
)
just_posted_comment
=
portal
.
portal_sessions
[
just_posted_comment
=
portal
.
portal_sessions
[
'%s.latest_comment'
%
context
.
getRelativeUrl
()].
pop
(
'%s.latest_comment'
%
context
.
getRelativeUrl
()].
pop
(
'comment_post_list'
,
None
)
'comment_post_list'
,
None
)
if
just_posted_comment
is
not
None
:
if
just_posted_comment
is
not
None
:
# make sure not to display twice if it was already ingested in the meantime.
# 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
)
comment_list
.
append
(
just_posted_comment
)
return
dumps
(
comment_list
)
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