Commit 2741d2ae authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: add filename for new onlyoffice documents

parent f6550708
......@@ -9,6 +9,12 @@
Text: 'application/x-asc-text'
};
var file_ext = {
Spreadsheet: 'xlsy',
Presentation: 'ppty',
Text: 'docy'
};
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
......@@ -37,6 +43,10 @@
if (content_type.hasOwnProperty(doc.portal_type)) {
doc.content_type = content_type[doc.portal_type];
}
if (file_ext.hasOwnProperty(doc.portal_type)) {
doc.filename = (doc.reference || doc.title || "default") +
"." + file_ext[doc.portal_type];
}
return gadget.jio_post(doc);
})
.push(function () {
......
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