Skip to content

Commit

Permalink
Merge pull request #309 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/4.2.1
  • Loading branch information
LinneyS authored Jun 8, 2020
2 parents ae70130 + 510e2cb commit a1d1e5f
Show file tree
Hide file tree
Showing 29 changed files with 456 additions and 349 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 4.2.1
## Added
- review display settings

## 4.1.3
## Added
- inline editor if using the same tab, opening the sidebar, sharing from the editor
Expand All @@ -8,7 +12,6 @@

## Changed
- fix file opening if master key encryption is enabled
- fix file opening the federated file when watermark is enabled

## 4.0.1
## Added
Expand Down
195 changes: 97 additions & 98 deletions README.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace OCA\Onlyoffice\AppInfo;

use OCP\AppFramework\App;
use OCP\Share\IManager;
use OCP\Util;

use OCA\Onlyoffice\AppConfig;
Expand All @@ -45,14 +44,14 @@ class Application extends App {
/**
* Application configuration
*
* @var OCA\Onlyoffice\AppConfig
* @var AppConfig
*/
public $appConfig;

/**
* Hash generator
*
* @var OCA\Onlyoffice\Crypt
* @var Crypt
*/
public $crypt;

Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>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.</description>
<licence>agpl</licence>
<author>Ascensio System SIA</author>
<version>4.1.3</version>
<version>4.2.1</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand Down
137 changes: 68 additions & 69 deletions controller/callbackcontroller.php

Large diffs are not rendered by default.

144 changes: 73 additions & 71 deletions controller/editorcontroller.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions controller/federationcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ class FederationController extends OCSController {
/**
* Application configuration
*
* @var OCA\Onlyoffice\AppConfig
* @var AppConfig
*/
public $config;

/**
* File utility
*
* @var OCA\Onlyoffice\FileUtility
* @var FileUtility
*/
private $fileUtility;

Expand Down Expand Up @@ -114,13 +114,13 @@ public function key($shareToken, $path) {
list ($file, $error, $share) = $this->fileUtility->getFileByToken(null, $shareToken, $path);

if (isset($error)) {
$this->logger->error("Federated getFileByToken: $error", array("app" => $this->appName));
$this->logger->error("Federated getFileByToken: $error", ["app" => $this->appName]);
return new Result(["error" => $error]);
}

$key = $this->fileUtility->getKey($file, true);

$this->logger->debug("Federated request get for " . $file->getId() . " key $key", array("app" => $this->appName));
$this->logger->debug("Federated request get for " . $file->getId() . " key $key", ["app" => $this->appName]);

return new Result(["key" => $key]);
}
Expand Down
32 changes: 18 additions & 14 deletions controller/settingscontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SettingsController extends Controller {
/**
* Application configuration
*
* @var OCA\Onlyoffice\AppConfig
* @var AppConfig
*/
private $config;

Expand All @@ -76,7 +76,7 @@ class SettingsController extends Controller {
/**
* Hash generator
*
* @var OCA\Onlyoffice\Crypt
* @var Crypt
*/
private $crypt;

Expand All @@ -86,8 +86,8 @@ class SettingsController extends Controller {
* @param IURLGenerator $urlGenerator - url generator service
* @param IL10N $trans - l10n service
* @param ILogger $logger - logger
* @param OCA\Onlyoffice\AppConfig $config - application configuration
* @param OCA\Onlyoffice\Crypt $crypt - hash generator
* @param AppConfig $config - application configuration
* @param Crypt $crypt - hash generator
*/
public function __construct($AppName,
IRequest $request,
Expand Down Expand Up @@ -128,7 +128,8 @@ public function index() {
"feedback" => $this->config->GetCustomizationFeedback(),
"help" => $this->config->GetCustomizationHelp(),
"toolbarNoTabs" => $this->config->GetCustomizationToolbarNoTabs(),
"successful" => $this->config->SettingsAreSuccessful()
"successful" => $this->config->SettingsAreSuccessful(),
"reviewDisplay" => $this->config->GetCustomizationReviewDisplay()
];
return new TemplateResponse($this->appName, "settings", $data, "blank");
}
Expand Down Expand Up @@ -169,7 +170,7 @@ public function SaveAddress($documentserver,
}

if ($this->config->checkEncryptionModule() === true) {
$this->logger->info("SaveSettings when encryption is enabled", array("app" => $this->appName));
$this->logger->info("SaveSettings when encryption is enabled", ["app" => $this->appName]);
}
}

Expand All @@ -194,6 +195,7 @@ public function SaveAddress($documentserver,
* @param bool $feedback - display feedback
* @param bool $help - display help
* @param bool $toolbarNoTabs - display toolbar tab
* @param string $reviewDisplay - review viewing mode
*
* @return array
*/
Expand All @@ -205,7 +207,8 @@ public function SaveCommon($defFormats,
$compactHeader,
$feedback,
$help,
$toolbarNoTabs
$toolbarNoTabs,
$reviewDisplay
) {

$this->config->SetDefaultFormats($defFormats);
Expand All @@ -217,6 +220,7 @@ public function SaveCommon($defFormats,
$this->config->SetCustomizationFeedback($feedback);
$this->config->SetCustomizationHelp($help);
$this->config->SetCustomizationToolbarNoTabs($toolbarNoTabs);
$this->config->SetCustomizationReviewDisplay($reviewDisplay);

return [
];
Expand Down Expand Up @@ -254,7 +258,7 @@ private function checkDocServiceUrl() {
}

} catch (\Exception $e) {
$this->logger->error("Protocol on check error: " . $e->getMessage(), array("app" => $this->appName));
$this->logger->logException($e, ["message" => "Protocol on check error", "app" => $this->appName]);
return $e->getMessage();
}

Expand All @@ -268,7 +272,7 @@ private function checkDocServiceUrl() {
}

} catch (\Exception $e) {
$this->logger->error("HealthcheckRequest on check error: " . $e->getMessage(), array("app" => $this->appName));
$this->logger->logException($e, ["message" => "HealthcheckRequest on check error", "app" => $this->appName]);
return $e->getMessage();
}

Expand All @@ -278,7 +282,7 @@ private function checkDocServiceUrl() {

$commandResponse = $documentService->CommandRequest("version");

$this->logger->debug("CommandRequest on check: " . json_encode($commandResponse), array("app" => $this->appName));
$this->logger->debug("CommandRequest on check: " . json_encode($commandResponse), ["app" => $this->appName]);

if (empty($commandResponse)) {
throw new \Exception($this->trans->t("Error occurred in the document service"));
Expand All @@ -290,11 +294,11 @@ private function checkDocServiceUrl() {
}

} catch (\Exception $e) {
$this->logger->error("CommandRequest on check error: " . $e->getMessage(), array("app" => $this->appName));
$this->logger->logException($e, ["message" => "CommandRequest on check error", "app" => $this->appName]);
return $e->getMessage();
}

$convertedFileUri;
$convertedFileUri = null;
try {

$hashUrl = $this->crypt->GetHash(["action" => "empty"]);
Expand All @@ -306,14 +310,14 @@ private function checkDocServiceUrl() {
$convertedFileUri = $documentService->GetConvertedUri($fileUrl, "docx", "docx", "check_" . rand());

} catch (\Exception $e) {
$this->logger->error("GetConvertedUri on check error: " . $e->getMessage(), array("app" => $this->appName));
$this->logger->logException($e, ["message" => "GetConvertedUri on check error", "app" => $this->appName]);
return $e->getMessage();
}

try {
$documentService->Request($convertedFileUri);
} catch (\Exception $e) {
$this->logger->error("Request converted file on check error: " . $e->getMessage(), array("app" => $this->appName));
$this->logger->logException($e, ["message" => "Request converted file on check error", "app" => $this->appName]);
return $e->getMessage();
}

Expand Down
5 changes: 5 additions & 0 deletions css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@
-moz-column-width: 100px;
-webkit-column-width: 100px;
}
.onlyoffice-tables {
column-width: 140px;
-moz-column-width: 140px;
-webkit-column-width: 140px;
}
10 changes: 6 additions & 4 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@
return;
}

if (config.editorConfig.tenant) {
displayError(t(OCA.Onlyoffice.AppName, "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data."));
}

var docIsChanged = null;
var docIsChangedTimeout = null;

Expand All @@ -126,6 +122,12 @@
"onDocumentStateChange": setPageTitle,
};

if (config.editorConfig.tenant) {
config.events.onAppReady = function() {
OCA.Onlyoffice.docEditor.showMessage(t(OCA.Onlyoffice.AppName, "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data."));
};
}

if (OCA.Onlyoffice.inframe && !shareToken
|| OC.currentUser) {
config.events.onRequestSaveAs = OCA.Onlyoffice.onRequestSaveAs;
Expand Down
4 changes: 3 additions & 1 deletion js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
var feedback = $("#onlyofficeFeedback").is(":checked");
var help = $("#onlyofficeHelp").is(":checked");
var toolbarNoTabs = !$("#onlyofficeToolbarNoTabs").is(":checked");
var reviewDisplay = $("input[type='radio'][name='reviewDisplay']:checked").attr("id").replace("onlyofficeReviewDisplay_", "");

$.ajax({
method: "PUT",
Expand All @@ -150,7 +151,8 @@
compactHeader: compactHeader,
feedback: feedback,
help: help,
toolbarNoTabs: toolbarNoTabs
toolbarNoTabs: toolbarNoTabs,
reviewDisplay: reviewDisplay
},
success: function onSuccess(response) {
$(".section-onlyoffice").removeClass("icon-loading");
Expand Down
17 changes: 10 additions & 7 deletions js/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,17 @@
* @param properties
*/
updateShareProperties: function(shareId, properties) {
var that = this;
if (_.isUndefined(properties.permissions) && _.isUndefined(properties.attributes)) {
// no attribute or permission change, ignore
return properties;
}

var updatedProperties = properties;
updatedProperties.attributes = properties.attributes || {};

// if share permission got enabled unset all attributes
// as resharing is not compatible
if (that._hasPermission(properties.permissions, OC.PERMISSION_SHARE)) {
if (this._hasPermission(properties.permissions, OC.PERMISSION_SHARE)) {
updatedProperties.attributes = this._updateAttributes(
updatedProperties.attributes, "permissions", "download", null
);
Expand All @@ -157,9 +160,9 @@
}

// if edit permission got enabled, enable only modifyFilter
if (that._hasPermission(properties.permissions, OC.PERMISSION_UPDATE)
|| that._hasPermission(properties.permissions, OC.PERMISSION_CREATE)
|| that._hasPermission(properties.permissions, OC.PERMISSION_DELETE)) {
if (this._hasPermission(properties.permissions, OC.PERMISSION_UPDATE)
|| this._hasPermission(properties.permissions, OC.PERMISSION_CREATE)
|| this._hasPermission(properties.permissions, OC.PERMISSION_DELETE)) {
updatedProperties.attributes = this._updateAttributes(
updatedProperties.attributes, "permissions", "download", null
);
Expand All @@ -183,7 +186,7 @@
}

// default checkboxes on permission update
var canDownload = that._getAttribute(properties.attributes, "permissions", "download");
var canDownload = this._getAttribute(properties.attributes, "permissions", "download");
if (canDownload === null) {
// if this attribute has not been set by other app, set to tru as default
updatedProperties.attributes = this._updateAttributes(
Expand All @@ -192,7 +195,7 @@
}

if (!this.model.hasReshare()
|| that._hasPermission(this.model.attributes.permissions, OC.PERMISSION_UPDATE))
|| this._hasPermission(this.model.attributes.permissions, OC.PERMISSION_UPDATE))
{
if (this.config.review) {
updatedProperties.attributes = this._updateAttributes(
Expand Down
5 changes: 4 additions & 1 deletion l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ OC.L10N.register(
"This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Dies ist ein öffentlicher Testserver. Bitte verwende beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar.",
"The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "Der 30-tägige Testzeitraum ist abgelaufen. Du kannst keine Verbindung mehr zu Demo ONLYOFFICE Document Server herstellen.",
"You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Du verwendest den öffentlichen Demo ONLYOFFICE Document Server. Bitte benutze ihn nicht zum Speichern von Deinen privaten sensiblen Daten.",
"Select file to compare" : "Datei zum Vergleich auswählen"
"Select file to compare" : "Datei zum Vergleich auswählen",
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original"
},
"nplurals=2; plural=(n != 1);");
5 changes: 4 additions & 1 deletion l10n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Dies ist ein öffentlicher Testserver. Bitte verwende beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar.",
"The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "Der 30-tägige Testzeitraum ist abgelaufen. Du kannst keine Verbindung mehr zu Demo ONLYOFFICE Document Server herstellen.",
"You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Du verwendest den öffentlichen Demo ONLYOFFICE Document Server. Bitte benutze ihn nicht zum Speichern von Deinen privaten sensiblen Daten.",
"Select file to compare" : "Datei zum Vergleich auswählen"
"Select file to compare" : "Datei zum Vergleich auswählen",
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
5 changes: 4 additions & 1 deletion l10n/de_DE.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ OC.L10N.register(
"This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Dies ist ein öffentlicher Testserver. Bitte verwenden Sie beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar.",
"The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "Der 30-tägige Testzeitraum ist abgelaufen. Sie können keine Verbindung mehr zu Demo ONLYOFFICE Document Server herstellen.",
"You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Sie verwenden den öffentlichen Demo ONLYOFFICE Document Server. Bitte benutzen Sie ihn nicht zum Speichern von Ihren privaten sensiblen Daten.",
"Select file to compare" : "Datei zum Vergleich auswählen"
"Select file to compare" : "Datei zum Vergleich auswählen",
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original"
},
"nplurals=2; plural=(n != 1);");
5 changes: 4 additions & 1 deletion l10n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Dies ist ein öffentlicher Testserver. Bitte verwenden Sie beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar.",
"The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "Der 30-tägige Testzeitraum ist abgelaufen. Sie können keine Verbindung mehr zu Demo ONLYOFFICE Document Server herstellen.",
"You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Sie verwenden den öffentlichen Demo ONLYOFFICE Document Server. Bitte benutzen Sie ihn nicht zum Speichern von Ihren privaten sensiblen Daten.",
"Select file to compare" : "Datei zum Vergleich auswählen"
"Select file to compare" : "Datei zum Vergleich auswählen",
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
5 changes: 4 additions & 1 deletion l10n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ OC.L10N.register(
"File saved" : "El archivo ha sido guardado",
"Insert image" : "Insertar imagen",
"Select recipients" : "Seleccionar destinatarios",
"Select file to compare" : "Seleccione un archivo para comparar"
"Select file to compare" : "Seleccione un archivo para comparar",
"Markup": "Cambios",
"Final": "Final",
"Original": "Original"
},
"nplurals=2; plural=(n != 1);");
5 changes: 4 additions & 1 deletion l10n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"File saved" : "El archivo ha sido guardado",
"Insert image" : "Insertar imagen",
"Select recipients" : "Seleccionar destinatarios",
"Select file to compare" : "Seleccione un archivo para comparar"
"Select file to compare" : "Seleccione un archivo para comparar",
"Markup": "Cambios",
"Final": "Final",
"Original": "Original"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
5 changes: 4 additions & 1 deletion l10n/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ OC.L10N.register(
"File saved" : "Le fichier a été enregistré",
"Insert image" : "Insérer une image",
"Select recipients" : "Sélectionner les destinataires",
"Select file to compare" : "Sélectionner fichier à comparer"
"Select file to compare" : "Sélectionner fichier à comparer",
"Markup": "Balisage",
"Final": "Finale",
"Original": "Original"
},
"nplurals=2; plural=(n != 1);");
Loading

0 comments on commit a1d1e5f

Please sign in to comment.