Skip to content

Commit

Permalink
Merge pull request #367 from ONLYOFFICE/release/7.3.1
Browse files Browse the repository at this point in the history
Release/7.3.1
  • Loading branch information
LinneyS authored Jan 18, 2022
2 parents e80c002 + 1ef8f06 commit 4d79239
Show file tree
Hide file tree
Showing 39 changed files with 618 additions and 64 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 7.3.1
## Added
- support docxf and oform formats
- create blank docxf from creation menu
- create docxf from docx from creation menu
- create oform from docxf from document manager

## 7.2.3
## Changed
- opening editor in new tab for ownCloud Web
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The app allows to:

Supported formats:

* For viewing and editing: DOCX, XLSX, PPTX, CSV, TXT.
* For viewing and editing: DOCX, XLSX, PPTX, CSV, TXT, DOCXF, OFORM.
* For viewing only: PDF.
* For converting to Office Open XML formats: DOC, DOCM, DOT, DOTX, EPUB, HTM, HTML, ODP, ODT, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM, RTF, XLS, XLSM, XLT, XLTM, XLTX.

Expand Down Expand Up @@ -206,18 +206,17 @@ The table below will help you to make the right choice.
| **Support** | **Community Edition** | **Enterprise Edition** |
| Documentation | [Help Center](https://helpcenter.onlyoffice.com/installation/docs-community-index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/installation/docs-enterprise-index.aspx) |
| Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included |
| Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) |
| Premium support | [Contact us](mailto:sales@onlyoffice.com) | [Contact us](mailto:sales@onlyoffice.com) |
| **Services** | **Community Edition** | **Enterprise Edition** |
| Conversion Service | + | + |
| Document Builder Service | + | + |
| **Interface** | **Community Edition** | **Enterprise Edition** |
| Tabbed interface | + | + |
| Dark theme | + | + |
| 150% scaling | + | + |
| 125%, 150%, 175%, 200% scaling | + | + |
| White Label | - | - |
| Integrated test example (node.js)* | - | + |
| Mobile web editors | - | + |
| Access to pro features via desktop | - | + |
| Integrated test example (node.js) | + | + |
| Mobile web editors | - | +* |
| **Plugins & Macros** | **Community Edition** | **Enterprise Edition** |
| Plugins | + | + |
| Macros | + | + |
Expand All @@ -231,29 +230,33 @@ The table below will help you to make the right choice.
| **Document Editor features** | **Community Edition** | **Enterprise Edition** |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Adding Content control | - | + |
| Adding Content control | + | + |
| Editing Content control | + | + |
| Layout tools | + | + |
| Table of contents | + | + |
| Navigation panel | + | + |
| Mail Merge | + | + |
| Comparing Documents | - | +* |
| Comparing Documents | + | + |
| **Spreadsheet Editor features** | **Community Edition** | **Enterprise Edition** |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Functions, formulas, equations | + | + |
| Table templates | + | + |
| Pivot tables | + | + |
| Conditional formatting for viewing | +** | +** |
| Sheet Views | - | + |
| Data validation | + | + |
| Conditional formatting | + | + |
| Sparklines | + | + |
| Sheet Views | + | + |
| **Presentation Editor features** | **Community Edition** | **Enterprise Edition** |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Transitions | + | + |
| Presenter mode | + | + |
| Notes | + | + |
| **Form creator features** | **Community Edition** | **Enterprise Edition** |
| Adding form fields | + | + |
| Form preview | + | + |
| Saving as PDF | + | + |
| | [Get it now](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-enterprise) |

\* It's possible to add documents for comparison from your local drive, from URL and from ownCloud storage.
\** Support for all conditions and gradient. Adding/Editing capabilities are coming soon
\* If supported by DMS.
2 changes: 2 additions & 0 deletions appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function () {
$detector->registerType("ott", "application/vnd.oasis.opendocument.text-template");
$detector->registerType("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
$detector->registerType("otp", "application/vnd.oasis.opendocument.presentation-template");
$detector->registerType("docxf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf");
$detector->registerType("oform", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform");

$previewManager = $container->query(IPreview::class);
if ($this->appConfig->GetPreview()) {
Expand Down
7 changes: 6 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within ownCloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.</description>
<licence>apl2</licence>
<author>Ascensio System SIA</author>
<version>7.2.3</version>
<version>7.3.1</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand All @@ -30,4 +30,9 @@
<commands>
<command>OCA\Onlyoffice\Command\DocumentServer</command>
</commands>
<repair-steps>
<post-migration>
<step>OCA\Onlyoffice\MimeRepair</step>
</post-migration>
</repair-steps>
</info>
3 changes: 2 additions & 1 deletion controller/editorapicontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,14 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
}

$canEdit = isset($format["edit"]) && $format["edit"];
$canFillForms = isset($format["fillForms"]) && $format["fillForms"];
$editable = $version < 1
&& !$template
&& $file->isUpdateable()
&& !$isPersistentLock
&& (empty($shareToken) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE);
$params["document"]["permissions"]["edit"] = $editable;
if (($editable || $restrictedEditing) && $canEdit) {
if (($editable || $restrictedEditing) && $canEdit || $canFillForms) {
$ownerId = null;
$owner = $file->getOwner();
if (!empty($owner)) {
Expand Down
56 changes: 40 additions & 16 deletions controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,15 @@ public function __construct($AppName,
* @param string $name - file name
* @param string $dir - folder path
* @param string $templateId - file identifier
* @param string $targetPath - file path for using as template for create
* @param string $shareToken - access token
*
* @return array
*
* @NoAdminRequired
* @PublicPage
*/
public function create($name, $dir, $templateId = null, $shareToken = null) {
public function create($name, $dir, $templateId = null, $targetPath = null, $shareToken = null) {
$this->logger->debug("Create: $name", ["app" => $this->appName]);

if (empty($shareToken) && !$this->config->isUserAllowedToUse()) {
Expand All @@ -217,8 +218,10 @@ public function create($name, $dir, $templateId = null, $shareToken = null) {
return ["error" => $this->trans->t("Template not found")];
}

$user = null;
if (empty($shareToken)) {
$userId = $this->userSession->getUser()->getUID();
$user = $this->userSession->getUser();
$userId = $user->getUID();
$userFolder = $this->root->getUserFolder($userId);
} else {
list ($userFolder, $error, $share) = $this->fileUtility->getNodeByToken($shareToken);
Expand Down Expand Up @@ -249,13 +252,37 @@ public function create($name, $dir, $templateId = null, $shareToken = null) {
return ["error" => $this->trans->t("You don't have enough permission to create")];
}

if (empty($templateId)) {
$template = TemplateManager::GetEmptyTemplate($name);
} else {
if (!empty($templateId)) {
$templateFile = TemplateManager::GetTemplate($templateId);
if ($templateFile) {
$template = $templateFile->getContent();
}
} elseif (!empty($targetPath)) {
$targetFile = $userFolder->get($targetPath);

$canDownload = $this->fileUtility->hasPermissionAttribute($targetFile);
if (!$canDownload) {
return ["error" => $this->trans->t("Not permitted")];
}

$targetId = $targetFile->getId();
$targetName = $targetFile->getName();
$targetExt = strtolower(pathinfo($targetName, PATHINFO_EXTENSION));
$targetKey = $this->fileUtility->getKey($targetFile);

$fileUrl = $this->getUrl($targetFile, $user, $shareToken);

$ext = strtolower(pathinfo($name, PATHINFO_EXTENSION));
$documentService = new DocumentService($this->trans, $this->config);
try {
$newFileUri = $documentService->GetConvertedUri($fileUrl, $targetExt, $ext, $targetKey);
} catch (\Exception $e) {
$this->logger->logException($e, ["message" => "GetConvertedUri: " . $targetFile->getId(), "app" => $this->appName]);
return ["error" => $e->getMessage()];
}
$template = $documentService->Request($newFileUri);
} else {
$template = TemplateManager::GetEmptyTemplate($name);
}

if (!$template) {
Expand Down Expand Up @@ -527,6 +554,11 @@ public function convert($fileId, $shareToken = null) {
return ["error" => $this->trans->t("You do not have enough permissions to view the file")];
}

$canDownload = $this->fileUtility->hasPermissionAttribute($file);
if (!$canDownload) {
return ["error" => $this->trans->t("Not permitted")];
}

$fileName = $file->getName();
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
$format = $this->config->FormatsSetting()[$ext];
Expand Down Expand Up @@ -1021,17 +1053,9 @@ public function download($fileId, $toExtension = null, $template = false) {
}
}

$fileStorage = $file->getStorage();
if ($fileStorage->instanceOfStorage("\OCA\Files_Sharing\SharedStorage")) {
$storageShare = $fileStorage->getShare();
if (method_exists($storageShare, "getAttributes")) {
$attributes = $storageShare->getAttributes();

$permissionsDownload = $attributes->getAttribute("permissions", "download");
if ($permissionsDownload !== null && $permissionsDownload !== true) {
return $this->renderError($this->trans->t("Not permitted"));
}
}
$canDownload = $this->fileUtility->hasPermissionAttribute($file);
if (!$canDownload) {
return $this->renderError($this->trans->t("Not permitted"));
}

$fileName = $file->getName();
Expand Down
7 changes: 6 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@
.icon-onlyoffice-new-pptx {
background-image: url("../img/new-pptx.svg");
}
.icon-onlyoffice-new-docxf {
background-image: url("../img/new-docxf.svg");
}
.icon-onlyoffice-open,
.icon-onlyoffice-convert,
.icon-onlyoffice-download {
.icon-onlyoffice-download,
.icon-onlyoffice-fill,
.icon-onlyoffice-create {
background-image: url("../img/app-dark.svg");
}

Expand Down
13 changes: 13 additions & 0 deletions img/new-docxf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
return;
}

if ((config.document.fileType === "docxf" || config.document.fileType === "oform")
&& DocsAPI.DocEditor.version().split(".")[0] < 7) {
OCA.Onlyoffice.showMessage(t(OCA.Onlyoffice.AppName, "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online"), {type: "error"});
return;
}

var docIsChanged = null;
var docIsChangedTimeout = null;

Expand Down
Loading

0 comments on commit 4d79239

Please sign in to comment.