Skip to content

Commit

Permalink
Merge pull request #301 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/4.1.3
  • Loading branch information
LinneyS authored Jan 24, 2020
2 parents efa54f1 + dc38b3d commit ae70130
Show file tree
Hide file tree
Showing 43 changed files with 496 additions and 124 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 4.1.3
## Added
- inline editor if using the same tab, opening the sidebar, sharing from the editor
- setting zoom and autosave
- selection of a file for comparison (DocumentServer 5.5 required)

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

## 4.0.1
## Added
- Polish translation
Expand Down
2 changes: 1 addition & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down
2 changes: 1 addition & 1 deletion appinfo/application.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
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.0.1</version>
<version>4.1.3</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand Down
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down
22 changes: 12 additions & 10 deletions controller/callbackcontroller.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -140,7 +140,7 @@ class CallbackController extends Controller {
* @param OCA\Onlyoffice\Crypt $crypt - hash generator
* @param IManager $shareManager - Share manager
*/
public function __construct($AppName,
public function __construct($AppName,
IRequest $request,
IRootFolder $root,
IUserSession $userSession,
Expand Down Expand Up @@ -218,9 +218,13 @@ public function download($doc) {
$userId = $hashData->userId;
\OC_User::setUserId($userId);

$user = $this->userManager->get($userId);
if (!empty($user)) {
\OC_Util::setupFS($userId);
if ($this->config->checkEncryptionModule() === "master") {
\OC_User::setIncognitoMode(true);
} else {
$user = $this->userManager->get($userId);
if (!empty($user)) {
\OC_Util::setupFS($userId);
}
}
}

Expand Down Expand Up @@ -399,10 +403,6 @@ public function track($doc, $users, $key, $status, $url, $token) {
}
}

if ($this->config->checkEncryptionModule() === "master") {
\OC_User::setIncognitoMode(true);
}

// owner of file from the callback link
$ownerId = $hashData->ownerId;
$owner = $this->userManager->get($ownerId);
Expand All @@ -422,7 +422,9 @@ public function track($doc, $users, $key, $status, $url, $token) {
}
}

if (!empty($userId)) {
if ($this->config->checkEncryptionModule() === "master") {
\OC_User::setIncognitoMode(true);
} else if (!empty($userId)) {
\OC_Util::setupFS($userId);
}

Expand Down
54 changes: 45 additions & 9 deletions controller/editorcontroller.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -38,6 +38,7 @@
use OCP\Files\FileInfo;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\ForbiddenException;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IL10N;
Expand Down Expand Up @@ -238,6 +239,9 @@ public function create($name, $dir, $shareToken = NULL) {
} catch (NotPermittedException $e) {
$this->logger->error("Can't create file: $name", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
} catch (ForbiddenException $e) {
$this->logger->error("Can't put file: $name", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
}

$fileInfo = $file->getFileInfo();
Expand Down Expand Up @@ -350,6 +354,9 @@ public function convert($fileId, $shareToken = NULL) {
} catch (NotPermittedException $e) {
$this->logger->error("Can't create file: $newFileName", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
} catch (ForbiddenException $e) {
$this->logger->error("Can't put file: $newFileName", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
}

$fileInfo = $file->getFileInfo();
Expand Down Expand Up @@ -410,6 +417,9 @@ public function save($name, $dir, $url) {
} catch (NotPermittedException $e) {
$this->logger->error("Can't save file: $name", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
} catch (ForbiddenException $e) {
$this->logger->error("Can't put file: $name", array("app" => $this->appName));
return ["error" => $this->trans->t("Can't create file")];
}

$fileInfo = $file->getFileInfo();
Expand Down Expand Up @@ -470,15 +480,16 @@ public function url($filePath) {
* Print editor section
*
* @param integer $fileId - file identifier
* @param string $shareToken - access token
* @param string $filePath - file path
* @param string $shareToken - access token
* @param bool $inframe - open in frame
*
* @return TemplateResponse|RedirectResponse
*
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index($fileId, $shareToken = NULL, $filePath = NULL) {
public function index($fileId, $filePath = NULL, $shareToken = NULL, $inframe = false) {
$this->logger->debug("Open: $fileId $filePath", array("app" => $this->appName));

if (empty($shareToken) && !$this->userSession->isLoggedIn()) {
Expand All @@ -503,10 +514,16 @@ public function index($fileId, $shareToken = NULL, $filePath = NULL) {
"documentServerUrl" => $documentServerUrl,
"fileId" => $fileId,
"filePath" => $filePath,
"shareToken" => $shareToken
"shareToken" => $shareToken,
"inframe" => false
];

$response = new TemplateResponse($this->appName, "editor", $params);
if ($inframe === true) {
$params["inframe"] = true;
$response = new TemplateResponse($this->appName, "editor", $params, "plain");
} else {
$response = new TemplateResponse($this->appName, "editor", $params);
}

$csp = new ContentSecurityPolicy();
$csp->allowInlineScript(true);
Expand All @@ -527,15 +544,16 @@ public function index($fileId, $shareToken = NULL, $filePath = NULL) {
*
* @param integer $fileId - file identifier
* @param string $shareToken - access token
* @param bool $inframe - open in frame
*
* @return TemplateResponse
*
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
*/
public function PublicPage($fileId, $shareToken) {
return $this->index($fileId, $shareToken);
public function PublicPage($fileId, $shareToken, $inframe = false) {
return $this->index($fileId, null, $shareToken, $inframe);
}

/**
Expand All @@ -544,14 +562,15 @@ public function PublicPage($fileId, $shareToken) {
* @param integer $fileId - file identifier
* @param string $filePath - file path
* @param string $shareToken - access token
* @param integer $inframe - open in frame. 0 - no, 1 - yes, 2 - without goback for old editor (5.4)
* @param bool $desktop - desktop label
*
* @return array
*
* @NoAdminRequired
* @PublicPage
*/
public function config($fileId, $filePath = NULL, $shareToken = NULL, $desktop = false) {
public function config($fileId, $filePath = NULL, $shareToken = NULL, $inframe = 0, $desktop = false) {

if (empty($shareToken) && !$this->config->isUserAllowedToUse()) {
return ["error" => $this->trans->t("Not permitted")];
Expand Down Expand Up @@ -704,18 +723,25 @@ public function config($fileId, $filePath = NULL, $shareToken = NULL, $desktop =
}
}

if ($folderLink !== NULL) {
if ($folderLink !== NULL && $inframe !== 2) {
$params["editorConfig"]["customization"]["goback"] = [
"url" => $folderLink
];

if (!$desktop) {
if ($this->config->GetSameTab()) {
$params["editorConfig"]["customization"]["goback"]["blank"] = false;
if ($inframe === 1) {
$params["editorConfig"]["customization"]["goback"]["requestClose"] = true;
}
}
}
}

if ($inframe === 1) {
$params["_files_sharing"] = \OC::$server->getAppManager()->isEnabledForUser("files_sharing");
}

$params = $this->setCustomization($params);

if ($this->config->UseDemo()) {
Expand Down Expand Up @@ -878,6 +904,16 @@ private function setCustomization($params) {
$params["editorConfig"]["customization"]["logo"] = $logo;
}

$zoom = $this->config->GetSystemValue($this->config->_customization_zoom);
if (isset($zoom)) {
$params["editorConfig"]["customization"]["zoom"] = $zoom;
}

$autosave = $this->config->GetSystemValue($this->config->_customization_autosave);
if (isset($autosave)) {
$params["editorConfig"]["customization"]["autosave"] = $autosave;
}

return $params;
}

Expand Down
2 changes: 1 addition & 1 deletion controller/federationcontroller.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down
3 changes: 2 additions & 1 deletion controller/settingscontroller.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -150,6 +150,7 @@ public function SaveAddress($documentserver,
$secret,
$demo
) {
$error = null;
if (!$this->config->SelectDemo($demo === true)) {
$error = $this->trans->t("The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server.");
}
Expand Down
5 changes: 4 additions & 1 deletion css/editor.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -30,6 +30,9 @@
position: absolute;
vertical-align: top;
}
#body-public #content {
height: 100%;
}

.AscDesktopEditor #header {
display: none;
Expand Down
50 changes: 49 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down Expand Up @@ -40,6 +40,54 @@
background-image: url("../img/app-dark.svg");
}

/* onlyoffice-inline */
body.onlyoffice-inline {
overscroll-behavior-y: none;
overflow: hidden;
}
body.onlyoffice-inline #app-navigation,
body.onlyoffice-inline .searchbox,
body.onlyoffice-inline #app-content #controls {
display: none;
}
body.onlyoffice-inline #content #app-content {
margin-left: 0;
}
#onlyofficeFrame {
background-color: #fff;
width: 100%;
height: calc(100vh - 45px);
display: block;
position: absolute;
top: 0;
z-index: 110;
}

#onlyofficeHeader {
display: flex;
float: right;
}
.header-right #onlyofficeHeader {
float: left;
}

#onlyofficeHeader .icon {
display: block;
min-width: 50px;
height: 45px;
}
.header-right #onlyofficeHeader .icon {
height: 31px;
}
#onlyofficeHeader .icon-close {
background-image: url("../img/close.svg");
}
#onlyofficeHeader .icon-shared {
background-image: url("../img/shared.svg");
opacity: 1;
}

/* AscDesktopEditor */
.AscDesktopEditor #header {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion css/settings.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* This program is a free software product.
* You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
Expand Down
3 changes: 3 additions & 0 deletions img/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions img/shared.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ae70130

Please sign in to comment.