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
Boris Kocherov
erp5
Commits
1a9e95bb
Commit
1a9e95bb
authored
Jan 29, 2016
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: avoiding edit of documents if converter is not available, thanks
@cedric.leninivin
parent
4eba4662
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_ooffice_js.xml
...js/PathTemplateItem/web_page_module/gadget_ooffice_js.xml
+9
-2
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/OOoDocument_convertForJio.xml
...l_skins/erp5_officejs_theme/OOoDocument_convertForJio.xml
+13
-5
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_ooffice_js.xml
View file @
1a9e95bb
...
...
@@ -332,6 +332,13 @@
documentType = options.portal_type;\n
} else {\n
documentType = magic_to_format_map[options.value.substring(0, 5)];\n
if (documentType === undefined) {\n
g.props\n
.element\n
.getElementsByClassName(placeholder)[0]\n
.textContent = options.value;\n
return {};\n
}\n
}\n
return g.setFillStyle()\n
.push(function (size) {\n
...
...
@@ -537,7 +544,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
948.
36349.33632.1892
6
</string>
</value>
<value>
<string>
948.
52265.56945.5843
6
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -555,7 +562,7 @@
</tuple>
<state>
<tuple>
<float>
145
3142306.9
</float>
<float>
145
4097524.73
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/OOoDocument_convertForJio.xml
View file @
1a9e95bb
...
...
@@ -51,7 +51,7 @@
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# XXX not work for readonly documents\n
from Products.ERP5.Document.Document import NotConvertedError\n
from Products.ERP5.Document.Document import NotConvertedError
, ConversionError
\n
from Products.ERP5Type.Utils import sleep\n
\n
portal_type = context.getPortalType()\n
...
...
@@ -66,22 +66,30 @@ portal_type_empty_map = {\n
portal_type_format_map = {\n
"Spreadsheet": "xlsy",\n
"Text": "docy",\n
#
"Presentation": "ppty",\n
"Presentation": "ppty",\n
}\n
file_format = portal_type_format_map.get(portal_type, None)\n
if file_format:\n
if data:\n
if ((filename and not filename.endswith(\'.\' + file_format)) or \n
not content_type.startswith("application/yformat.")):\n
converted = False\n
for try_count in range(3):\n
try:\n
metadata, data = context.convert(format=file_format)\n
content_type, data = context.convert(format=file_format)\n
converted = True\n
break\n
except NotConvertedError:\n
data = \'ERRO;NotConvertedError;Please try reload this page again latter.\'\n
sleep()\n
continue\n
context.setData(data)\n
context.setContentType(metadata)\n
except ConversionError:\n
data = \'ERRO;ConversionError;Conversion error on Cloudooo server. Please contact support.\'\n
if converted:\n
context.setData(data)\n
context.setContentType(content_type)\n
else:\n
return data\n
else:\n
data = portal_type_empty_map.get(portal_type, None)\n
if data:\n
...
...
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