diff --git a/CHANGELOG.md b/CHANGELOG.md index 3529e00c..4b2616c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 2.2.1 +## Added +- download permission +- review permission +- filling forms permission +- comment permission +- modify filter permission + +## Changed +- fix getting domain for desktop +- title in the convertation request + ## 2.1.7 ## Added - file creation in public folder diff --git a/README.md b/README.md index 200fbd35..4b505e2e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# ![](screenshots/icon.png) ownCloud ONLYOFFICE integration app +* [ownCloud-ONLYOFFICE integration app](#-owncloud-onlyoffice-integration-app) +* [Installing ONLYOFFICE Document Server](#installing-onlyoffice-document-server) +* [ONLYOFFICE Document Server editions](#onlyoffice-document-server-editions) +* [Installing ownCloud ONLYOFFICE integration app](#installing-owncloud-onlyoffice-integration-app) +* [Configuring ownCloud-ONLYOFFICE integration app](#configuring-owncloud-onlyoffice-integration-app) +* [How it works](#how-it-works) +* [Known issues](#known-issues) + +# ![onlyoffice icon](screenshots/icon.png) ownCloud ONLYOFFICE integration app This app enables users to edit office documents from [ownCloud](https://owncloud.com) using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. @@ -11,7 +19,6 @@ This allows multiple users to collaborate in real time and to save back those ch You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud)** to get installed and configured Document Server and ownCloud installation with a couple of commands. - ## Installing ONLYOFFICE Document Server You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from ownCloud and any end clients (version 4.2.7 and later are supported for use with the app). @@ -23,6 +30,73 @@ Or you can use Document Server behind a proxy, please refer to [this article](ht The easiest way to start an instance of ONLYOFFICE Document Server is to use [Docker](https://github.com/ONLYOFFICE/Docker-DocumentServer). +## ONLYOFFICE Document Server editions + +ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers. + +ONLYOFFICE Document Server: + +* Community Edition (`onlyoffice-documentserver` package) + +* Integration Edition (`onlyoffice-documentserver-ie` package) + +The table below will help you to make the right choice. + +| Pricing and licensing | Community Edition | Integration Edition | +| ------------- | ------------- | ------------- | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/integration-edition-prices.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| Simultaneous connections | up to 20 maximum | As in chosen pricing plan | +| Number of users | up to 20 recommended | As in chosen pricing plan | +| License | GNU AGPL v.3 | Proprietary | +| **Support** | **Community Edition** | **Integration Edition** | +| Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/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) | +| **Services** | **Community Edition** | **Integration Edition** | +| Conversion Service | + | + | +| Document Builder Service | - | + | +| **Interface** | **Community Edition** | **Integration Edition** | +| Tabbed interface | - | + | +| White Label | - | - | +| Integrated test example (node.js)* | - | + | +| **Plugins & Macros** | **Community Edition** | **Integration Edition** | +| Plugins | + | + | +| Macros | + | + | +| **Collaborative capabilities** | **Community Edition** | **Integration Edition** | +| Two co-editing modes | + | + | +| Comments | + | + | +| Built-in chat | + | + | +| Review and tracking changes | + | + | +| Display modes of tracking changes | - | + | +| Version history | + | + | +| **Document Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Content control | - | + | +| Layout tools | + | + | +| Table of contents | + | + | +| Navigation panel | - | + | +| Mail Merge | + | + | +| **Spreadsheet Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Functions, formulas, equations | + | + | +| Table templates | + | + | +| Pivot tables | - | +** | +| **Presentation Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Animations | + | + | +| Presenter mode | - | + | +| Notes | + | + | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | + +\* Note that by default DocumentServer Community Edition does not contain any document management system. +Integration Edition and Developer Edition versions include integrated test examples (simplest DMS to test the editors). +For Community version, please use the [ONLYOFFICE Community Server](https://github.com/ONLYOFFICE/CommunityServer/) or [check out integration](https://www.onlyoffice.com/connectors.aspx) with 3rd party platforms, e.g. ownCloud/Nextcloud + +\** Changing style and deleting (Full support coming soon) ## Installing ownCloud ONLYOFFICE integration app @@ -34,7 +108,8 @@ If the server with the ownCloud installed does not have an Internet access, or i To start using ONLYOFFICE Document Server with ownCloud, the following steps must be performed: 1. Go to the ownCloud server _apps/_ directory (or some other directory [used](https://doc.owncloud.org/server/administration_manual/installation/apps_management_installation.html#using-custom-app-directories)): - ``` + + ```bash cd apps/ ``` @@ -45,27 +120,28 @@ There are several ways to do that: b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases) on GitHub. - c. Or you can clone the application source code and compile it yourself: - ``` + c. Or you can clone the application source code and compile it yourself: + + ```bash git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice ``` > ownCloud does not work with unsigned applications giving an alert, so you will need to use either option **a** or **b** to get the application. -2. Change the owner to update the application right from ownCloud web interface: - ``` +3. Change the owner to update the application right from ownCloud web interface: + + ```bash chown -R www-data:www-data onlyoffice ``` -3. In ownCloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. - +4. In ownCloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. ## Configuring ownCloud ONLYOFFICE integration app In ownCloud open the `~/index.php/settings/admin#onlyoffice` page with administrative settings for **ONLYOFFICE** section. Enter the following address to connect ONLYOFFICE Document Server: -``` +```bash https:/// ``` @@ -86,10 +162,9 @@ Enable or disable the _Open file in the same tab_ setting. The **Open in ONLYOFFICE** action will be added to the file context menu. You can specify this action as default and it will be used when the file name is clicked for the selected file types. - ## How it works -The ONLYOFFICE integration follows the API documented here https://api.onlyoffice.com/editors/basic: +The ONLYOFFICE integration follows the API documented [here](https://api.onlyoffice.com/editors/basic): * When creating a new file, the user navigates to a document folder within ownCloud and clicks the **Document**, **Spreadsheet** or **Presentation** item in the _new_ (+) menu. @@ -124,7 +199,6 @@ This method adds the copy of the file from the assets folder to the folder the u * ownCloud downloads the new version of the document, replacing the old one. - ## Known issues * If the document is shared using the **Federated Cloud Sharing** app, the co-editing among the servers will not be avaialble. @@ -142,9 +216,11 @@ However if you set the encryption with the _master key_, ONLYOFFICE application The instruction on enabling _master key_ based encryption is available in the official documentation on [ownCloud](https://doc.owncloud.org/server/administration_manual/configuration/files/encryption_configuration.html#enabling-encryption-from-the-command-line) websites. * If you are using a self-signed certificate for your **Document Server**, ownCloud will not validate such a certificate and will not allow connection to/from **Document Server**. This issue can be solved the following way: locate the ownCloud config file (_/owncloud/config/config.php_) and open it. Insert the following section to it: - ``` + + ```php 'onlyoffice' => array ( 'verify_peer_off' => true ) ``` + This will disable the certificate verification and allow ownCloud to establish connection with **Document Server**, but you must remember that this is a temporary insecure solution and we strongly recommend that you replace the certificate with the one issued by some CA. Once you do that, do not forget to remove the above section from ownCloud config file. diff --git a/appinfo/info.xml b/appinfo/info.xml index 034a273c..abf79961 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -7,7 +7,7 @@ ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage. agpl Ascensio System SIA - 2.1.7 + 2.2.1 Onlyoffice diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index dccb139d..a6feba30 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -373,26 +373,30 @@ public function track($doc, $users, $key, $status, $url, $token) { } try { + $ownerId = $hashData->ownerId; + $token = isset($hashData->token) ? $hashData->token : NULL; + if (empty($ownerId) && empty($token)) { + $this->logger->error("Track without owner: " . $fileId . " status " . $trackerStatus, array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("File owner is empty")], Http::STATUS_BAD_REQUEST); + } + $userId = $users[0]; $user = $this->userManager->get($userId); if (!empty($user)) { - \OC_Util::tearDownFS(); - \OC_Util::setupFS($userId); - $this->userSession->setUser($user); } else { - $ownerId = $hashData->ownerId; + $this->logger->debug("Track by anonymous " . $userId, array("app" => $this->appName)); + } - \OC_Util::tearDownFS(); - if (!empty($ownerId)) { - \OC_Util::setupFS($ownerId); - } + \OC_Util::tearDownFS(); + if (!empty($ownerId)) { + \OC_Util::setupFS($ownerId); } - $token = isset($hashData->token) ? $hashData->token : NULL; - list ($file, $error) = empty($token) ? $this->getFile($userId, $fileId) : $this->getFileByToken($fileId, $token); + list ($file, $error) = !empty($ownerId) ? $this->getFile($ownerId, $fileId) : $this->getFileByToken($fileId, $token); if (isset($error)) { + $this->logger->error("track error" . $fileId ." " . $error, array("app" => $this->appName)); return $error; } @@ -430,6 +434,8 @@ public function track($doc, $users, $key, $status, $url, $token) { } $newData = $documentService->Request($url); + + $this->logger->debug("Track put content " . $file->getPath(), array("app" => $this->appName)); $file->putContent($newData); $error = 0; } catch (\Exception $e) { diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index c3e1a888..768372b7 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -485,6 +485,7 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals "document" => [ "fileType" => $ext, "key" => DocumentService::GenerateRevisionId($key), + "permissions" => [], "title" => $fileName, "url" => $fileUrl, ], @@ -494,14 +495,53 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals ] ]; - if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) { - $params["type"] = "mobile"; + $restrictedEditing = false; + $fileStorage = $file->getStorage(); + if (empty($token) && $fileStorage->instanceOfStorage("\OCA\Files_Sharing\SharedStorage")) { + $share = $fileStorage->getShare(); + + $permissionsDownload = $share->getAttributes()->getAttribute("permissions", "download"); + if ($permissionsDownload !== null) { + $params["document"]["permissions"]["download"] = $params["document"]["permissions"]["print"] = $permissionsDownload === true; + } + + if (isset($format["review"]) && $format["review"]) { + $permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "review"); + if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) { + $restrictedEditing = true; + $params["document"]["permissions"]["review"] = true; + } + } + + if (isset($format["fillForms"]) && $format["fillForms"]) { + $permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillForms"); + if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) { + $restrictedEditing = true; + $params["document"]["permissions"]["fillForms"] = true; + } + } + + if (isset($format["comment"]) && $format["comment"]) { + $permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "comment"); + if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) { + $restrictedEditing = true; + $params["document"]["permissions"]["comment"] = true; + } + } + + if (isset($format["modifyFilter"]) && $format["modifyFilter"]) { + $permissionsModifyFilter = $share->getAttributes()->getAttribute($this->appName, "modifyFilter"); + if ($permissionsModifyFilter !== null) { + $params["document"]["permissions"]["modifyFilter"] = $permissionsModifyFilter === true; + } + } } $canEdit = isset($format["edit"]) && $format["edit"]; $editable = $file->isUpdateable() && (empty($token) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE); - if ($editable && $canEdit) { + $params["document"]["permissions"]["edit"] = $editable; + if (($editable || $restrictedEditing) && $canEdit) { $ownerId = NULL; $owner = $file->getOwner(); if (!empty($owner)) { @@ -520,6 +560,10 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params["editorConfig"]["mode"] = "view"; } + if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) { + $params["type"] = "mobile"; + } + if (!empty($userId)) { $params["editorConfig"]["user"] = [ "id" => $userId, @@ -569,14 +613,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params = $this->setCustomization($params); - $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); - if (isset($permissions_modifyFilter)) { - if (!array_key_exists("permissions", $params["document"])) { - $params["document"]["permissions"] = []; - } - $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter; - } - if (!empty($this->config->GetDocumentServerSecret())) { $token = \Firebase\JWT\JWT::encode($params, $this->config->GetDocumentServerSecret()); $params["token"] = $token; diff --git a/js/desktop.js b/js/desktop.js index 1590f3ad..534a6db9 100644 --- a/js/desktop.js +++ b/js/desktop.js @@ -37,7 +37,8 @@ OCA.Onlyoffice.Desktop = true; $("html").addClass("AscDesktopEditor"); - var domain = location.href.split(OC.generateUrl(""))[0]; + var domain = new RegExp("^http(s)?:\/\/[^\/]+").exec(location)[0]; + domain += OC.getRootPath(); var data = { displayName: oc_user.displayName, diff --git a/js/main.js b/js/main.js index 7b3825c0..e5d00ec1 100644 --- a/js/main.js +++ b/js/main.js @@ -168,28 +168,28 @@ var register = function() { var formats = OCA.Onlyoffice.setting.formats; - $.each(formats, function (ext, attr) { - if (!attr.mime) { + $.each(formats, function (ext, config) { + if (!config.mime) { return true; } fileList.fileActions.registerAction({ name: "onlyofficeOpen", displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"), - mime: attr.mime, + mime: config.mime, permissions: OC.PERMISSION_READ, iconClass: "icon-onlyoffice-open", actionHandler: OCA.Onlyoffice.FileClick }); - if (attr.def) { - fileList.fileActions.setDefault(attr.mime, "onlyofficeOpen"); + if (config.def) { + fileList.fileActions.setDefault(config.mime, "onlyofficeOpen"); } - if (attr.conv) { + if (config.conv) { fileList.fileActions.registerAction({ name: "onlyofficeConvert", displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"), - mime: attr.mime, + mime: config.mime, permissions: ($("#isPublic").val() ? OC.PERMISSION_UPDATE : OC.PERMISSION_READ), iconClass: "icon-onlyoffice-convert", actionHandler: OCA.Onlyoffice.FileConvertClick @@ -245,33 +245,137 @@ } }; - var initPage = function(){ + OCA.Onlyoffice.Share = { + attach: function (model) { + if (_.isUndefined(model)) { + return; + } + var fileName = model.getFileInfo().attributes.name; + + var extension = getFileExtension(fileName); + + var formats = OCA.Onlyoffice.setting.formats; + + var config = formats[extension]; + if (!config) { + return; + } + + var addDownload = model.getRegisteredShareAttribute("permissions", "download") === null; + + if (addDownload) { + model.registerShareAttribute({ + "scope": "permissions", + "key": "download", + "default": true, + "label": t(OCA.Onlyoffice.AppName, "download"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE] + }); + } + + if (config.review) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "review", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "review"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], + }); + } + + if (config.fillForms) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "fillForms", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "form filling"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "review", + "enabled": true + } + ] + }); + } + + if (config.comment) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "comment", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "comment"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "review", + "enabled": true + }, + { + "scope": OCA.Onlyoffice.AppName, + "key": "fillForms", + "enabled": true + } + ] + }); + } + + if (config.modifyFilter) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "modifyFilter", + "default": true, + "label": t(OCA.Onlyoffice.AppName, "modify filter"), + "requiredPermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "commentOnly", + "enabled": true + } + ] + }); + } + } + }; + + var getFileExtension = function (fileName) { + var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); + return extension; + } + + var initPage = function () { if ($("#isPublic").val() === "1" && !$("#filestable").length) { var fileName = $("#filename").val(); - var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); + var extension = getFileExtension(fileName); var initSharedButton = function() { var formats = OCA.Onlyoffice.setting.formats; - var conf = formats[extension]; - if (conf) { - var button = document.createElement("a"); - button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); - button.className = "button"; - button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") + var config = formats[extension]; + if (!config) { + return; + } - if (!OCA.Onlyoffice.setting.sameTab) { - button.target = "_blank"; - } + var button = document.createElement("a"); + button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); + button.className = "button"; + button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") - $("#preview").append(button); + if (!OCA.Onlyoffice.setting.sameTab) { + button.target = "_blank"; } + + $("#preview").append(button); }; OCA.Onlyoffice.GetSettings(initSharedButton); } else { OC.Plugins.register("OCA.Files.FileList", OCA.Onlyoffice.FileList); OC.Plugins.register("OCA.Files.NewFileMenu", OCA.Onlyoffice.NewFileMenu); + OC.Plugins.register("OC.Share.ShareItemModel", OCA.Onlyoffice.Share); } }; diff --git a/js/settings.js b/js/settings.js index a8b48cb1..11af5f1d 100644 --- a/js/settings.js +++ b/js/settings.js @@ -117,7 +117,7 @@ ? (t(OCA.Onlyoffice.AppName, "Error when trying to connect") + " (" + response.error + ")") : t(OCA.Onlyoffice.AppName, "Settings have been successfully updated"); OC.Notification.show(message, { - type: "error", + type: response.error ? "error" : null, timeout: 3 }); } diff --git a/l10n/bg_BG.js b/l10n/bg_BG.js index ce01ee08..b53e6474 100644 --- a/l10n/bg_BG.js +++ b/l10n/bg_BG.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Виж детайли", "Save" : "Запази", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.", - "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи" + "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи", + "review" : "преглед", + "form filling" : "попълване на формуляр", + "comment" : "коментар", + "download" : "изтегли" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); diff --git a/l10n/bg_BG.json b/l10n/bg_BG.json index 6da128ff..00fe1dc2 100644 --- a/l10n/bg_BG.json +++ b/l10n/bg_BG.json @@ -43,6 +43,10 @@ "View details" : "Виж детайли", "Save" : "Запази", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.", - "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи" + "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи", + "review" : "преглед", + "form filling" : "попълване на формуляр", + "comment" : "коментар", + "download" : "изтегли" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" } \ No newline at end of file diff --git a/l10n/de.js b/l10n/de.js index b578c2c8..1bd3681f 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index e29b9cef..567da631 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -43,6 +43,10 @@ "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/de_DE.js b/l10n/de_DE.js index 05c90da6..0423d9bc 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index 6cf04f71..94e9a6c7 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -43,6 +43,10 @@ "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/es.js b/l10n/es.js index e22b794c..8cc315aa 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Ver detalles", "Save" : "Guardar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.", - "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos" + "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos", + "review" : "revista", + "form filling" : "relleno de formulario", + "comment" : "comentarios", + "download" : "descargar" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 9c0922a4..4af2c218 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -43,6 +43,10 @@ "View details" : "Ver detalles", "Save" : "Guardar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.", - "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos" + "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos", + "review" : "revista", + "form filling" : "relleno de formulario", + "comment" : "comentarios", + "download" : "descargar" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index 6adddb8b..4f861d06 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Voir les détails", "Save" : "Enregistrer", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise", - "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants" + "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants", + "review" : "révision", + "form filling" : "remplissage de formulaire", + "comment" : "commentaire", + "download" : "télécharger" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index b129788e..d75e3bc9 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -43,6 +43,10 @@ "View details" : "Voir les détails", "Save" : "Enregistrer", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise", - "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants" + "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants", + "review" : "révision", + "form filling" : "remplissage de formulaire", + "comment" : "commentaire", + "download" : "télécharger" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js index 40f74b98..28d36898 100644 --- a/l10n/pt_BR.js +++ b/l10n/pt_BR.js @@ -45,6 +45,9 @@ OC.L10N.register( "View details" : "Ver detalhes", "Save" : "Salvar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o Servidor de Documentos.", - "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos" + "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos", + "review" : "revisar", + "comment" : "comente", + "download" : "baixar" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json index d8164b02..a5f8b32b 100644 --- a/l10n/pt_BR.json +++ b/l10n/pt_BR.json @@ -43,6 +43,9 @@ "View details" : "Ver detalhes", "Save" : "Salvar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o Servidor de Documentos.", - "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos" + "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos", + "review" : "revisar", + "comment" : "comente", + "download" : "baixar" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/ru.js b/l10n/ru.js index b6ddd3e9..fc2b128a 100644 --- a/l10n/ru.js +++ b/l10n/ru.js @@ -45,6 +45,11 @@ OC.L10N.register( "View details" : "Подробнее", "Save" : "Сохранить", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.", - "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам" + "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам", + "review" : "рецензирование", + "form filling" : "заполнение форм", + "comment" : "комментирование", + "modify filter" : "изменять фильтр", + "download" : "скачивание" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); diff --git a/l10n/ru.json b/l10n/ru.json index 58a53d24..71252887 100644 --- a/l10n/ru.json +++ b/l10n/ru.json @@ -43,6 +43,11 @@ "View details" : "Подробнее", "Save" : "Сохранить", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.", - "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам" + "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам", + "review" : "рецензирование", + "form filling" : "заполнение форм", + "comment" : "комментирование", + "modify filter" : "изменять фильтр", + "download" : "скачивание" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" } \ No newline at end of file diff --git a/l10n/sv.js b/l10n/sv.js index a0fbe381..8c5542e9 100644 --- a/l10n/sv.js +++ b/l10n/sv.js @@ -45,6 +45,9 @@ OC.L10N.register( "View details" : "Visa detaljer", "Save" : "Spara", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Blandat aktivt innehåll är inte tillåtet. HTTPS-adress till dokumentserver krävs.", - "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper" + "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper", + "review" : "granska", + "comment" : "kommentar", + "download" : "ladda ner" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/sv.json b/l10n/sv.json index 378eaea9..9e28e695 100644 --- a/l10n/sv.json +++ b/l10n/sv.json @@ -43,6 +43,9 @@ "View details" : "Visa detaljer", "Save" : "Spara", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Blandat aktivt innehåll är inte tillåtet. HTTPS-adress till dokumentserver krävs.", - "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper" + "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper", + "review" : "granska", + "comment" : "kommentar", + "download" : "ladda ner" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/lib/appconfig.php b/lib/appconfig.php index a92c1f9c..50f525db 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -144,13 +144,6 @@ class AppConfig { */ private $_settingsError = "settings_error"; - /** - * The config key for the modifyFilter - * - * @var string - */ - public $_permissions_modifyFilter = "permissions_modifyFilter"; - /** * The config key for the customer * @@ -575,7 +568,8 @@ public function FormatsSetting() { "csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true, "editable" => true ], "doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], "docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ], - "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true ], + "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true, "fillForms" => true ], + "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true, "fillForms" => true, "comment" => true ], "dot" => [ "type" => "text", "conv" => true ], "dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ], "epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ], @@ -593,12 +587,12 @@ public function FormatsSetting() { "ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "conv" => true ], "ppt" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ], "pptm" => [ "mime" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12", "type" => "presentation", "conv" => true ], - "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true ], + "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true, "comment" => true ], "rtf" => [ "mime" => "text/rtf", "type" => "text", "conv" => true, "editable" => true ], "txt" => [ "mime" => "text/plain", "type" => "text", "edit" => true, "editable" => true ], "xls" => [ "mime" => "application/vnd.ms-excel", "type" => "spreadsheet", "conv" => true ], "xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], - "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true ], + "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true, "comment" => true, "modifyFilter" => true ], "xlt" => [ "type" => "spreadsheet", "conv" => true ], "xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], "xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ] diff --git a/lib/documentservice.php b/lib/documentservice.php index afe94dc3..8fe75cf9 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -118,36 +118,32 @@ function GetConvertedUri($document_uri, $from_extension, $to_extension, $documen * @return array */ function SendRequestToConvertService($document_uri, $from_extension, $to_extension, $document_revision_id, $is_async) { - if (empty($from_extension)) { - $path_parts = pathinfo($document_uri); - $from_extension = $path_parts["extension"]; - } + $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false); - $title = basename($document_uri); - if (empty($title)) { - $title = $document_revision_id . $from_extension; + if (empty($documentServerUrl)) { + throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin")); } + $urlToConverter = $documentServerUrl . "ConvertService.ashx"; + if (empty($document_revision_id)) { $document_revision_id = $document_uri; } $document_revision_id = self::GenerateRevisionId($document_revision_id); - $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false); - - if (empty($documentServerUrl)) { - throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin")); + if (empty($from_extension)) { + $from_extension = pathinfo($document_uri)["extension"]; + } else { + $from_extension = trim($from_extension, "."); } - $urlToConverter = $documentServerUrl . "ConvertService.ashx"; - $data = [ "async" => $is_async, "url" => $document_uri, "outputtype" => trim($to_extension, "."), - "filetype" => trim($from_extension, "."), - "title" => $title, + "filetype" => $from_extension, + "title" => $document_revision_id . "." . $from_extension, "key" => $document_revision_id ];