Commit 78de106b authored by Tristan Cavelier's avatar Tristan Cavelier

fixup! erp5_officejs_support_request_ui: Switch from ckeditor 4.5.3 to textarea for now.

- Text was not converted into HTML.
- HTML was converted into Text before rendering.
parent 146586fb
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
post_list[i][3] = result_list[i]; post_list[i][3] = result_list[i];
} }
if (post_list[i][2]) { if (post_list[i][2]) {
plain_content = "<p>" + post_list[i][2].replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<br/>") + "</p>"; plain_content = post_list[i][2];
if (post_list[i][3]) { if (post_list[i][3]) {
s += plain_content + '<strong>Attachment: </strong>' + s += plain_content + '<strong>Attachment: </strong>' +
'<a href=\"' + '<a href=\"' +
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
.push(function () { .push(function () {
var choose_file_html_element = gadget.element.querySelector('#attachment'), var choose_file_html_element = gadget.element.querySelector('#attachment'),
file_blob = choose_file_html_element.files[0], file_blob = choose_file_html_element.files[0],
url = gadget.hateoas_url + "post_module/PostModule_createHTMLPost", url = gadget.hateoas_url + "post_module/PostModule_createHTMLPostFromText",
data = new FormData(); data = new FormData();
data.append("follow_up", gadget.options.jio_key); data.append("follow_up", gadget.options.jio_key);
data.append("predecessor", ''); data.append("predecessor", '');
......
...@@ -44,7 +44,7 @@ if description or file is not None: ...@@ -44,7 +44,7 @@ if description or file is not None:
post.edit( post.edit(
start_date=now, start_date=now,
follow_up_value=support_request, follow_up_value=support_request,
text_content=description, text_content="<p>" + description.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace(" ", " &nbsp;").replace("\n", "<br/>") + "</p>",
) )
# handle attachments # handle attachments
......
return context.PostModule_createHTMLPost(
follow_up,
predecessor,
"<p>" + data.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace(" ", " &nbsp;").replace("\n", "<br/>") + "</p>",
file,
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>follow_up, predecessor, data, file</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PostModule_createHTMLPostFromText</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment