Skip to content

Commit ec96853

Browse files
authored
Merge pull request #484 from ONLYOFFICE/develop
Release/9.3.1
2 parents f8cd959 + 4a55869 commit ec96853

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+317
-211
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 9.3.1
4+
## Changed
5+
- creating and editing pdf form
6+
37
## 9.1.1
48
## Added
59
- support of user avatar in editor

appinfo/application.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ function () {
119119
$detector->registerType("ott", "application/vnd.oasis.opendocument.text-template");
120120
$detector->registerType("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
121121
$detector->registerType("otp", "application/vnd.oasis.opendocument.presentation-template");
122-
$detector->registerType("docxf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf");
123122

124123
$previewManager = $container->query(IPreview::class);
125124
if ($this->appConfig->getPreview()) {

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<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>
77
<licence>apl2</licence>
88
<author>Ascensio System SIA</author>
9-
<version>9.1.1</version>
9+
<version>9.3.1</version>
1010
<namespace>Onlyoffice</namespace>
1111
<types>
1212
<filesystem/>

controller/callbackcontroller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,11 @@ function () use ($file, $newData) {
580580
$changes = null;
581581
if (!empty($changesurl)) {
582582
$changesurl = $this->config->replaceDocumentServerUrlToInternal($changesurl);
583-
$changes = $documentService->request($changesurl);
583+
try {
584+
$changes = $documentService->request($changesurl);
585+
} catch (\Exception $e) {
586+
$this->logger->logException($e, ["message" => "Failed to download changes", "app" => $this->appName]);
587+
}
584588
}
585589
FileVersions::saveHistory($file->getFileInfo(), $history, $changes, $prevVersion);
586590
}

controller/editorapicontroller.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,15 @@ public function fillempty($fileId) {
234234
* @param bool $desktop - desktop label
235235
* @param bool $template - file is template
236236
* @param string $anchor - anchor link
237+
* @param bool $forceEdit - open editing
237238
*
238239
* @return JSONResponse
239240
*
240241
* @NoAdminRequired
241242
* @PublicPage
242243
* @CORS
243244
*/
244-
public function config($fileId, $filePath = null, $shareToken = null, $version = 0, $inframe = false, $desktop = false, $template = false, $anchor = null) {
245+
public function config($fileId, $filePath = null, $shareToken = null, $version = 0, $inframe = false, $desktop = false, $template = false, $anchor = null, $forceEdit = false) {
245246
$user = $this->userSession->getUser();
246247
$userId = null;
247248
$accountId = null;
@@ -380,8 +381,8 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
380381
&& $file->isUpdateable()
381382
&& !$isPersistentLock
382383
&& (empty($shareToken) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE);
383-
$params["document"]["permissions"]["edit"] = $editable;
384-
if (($editable || $restrictedEditing) && $canEdit || $canFillForms) {
384+
$params["document"]["permissions"]["edit"] = $editable && ($forceEdit || !$canFillForms);
385+
if (($editable || $restrictedEditing) && ($canEdit || $canFillForms)) {
385386
$ownerId = null;
386387
$owner = $file->getOwner();
387388
if (!empty($owner)) {
@@ -399,6 +400,11 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
399400
$params["document"]["permissions"]["protect"] = false;
400401
}
401402

403+
if ($canFillForms) {
404+
$params["document"]["permissions"]["fillForms"] = true;
405+
$params["canEdit"] = $canEdit && $editable;
406+
}
407+
402408
$hashCallback = $this->crypt->getHash(["userId" => $userId, "ownerId" => $ownerId, "fileId" => $file->getId(), "filePath" => $filePath, "shareToken" => $shareToken, "action" => "track"]);
403409
$callback = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.track", ["doc" => $hashCallback]);
404410

controller/editorcontroller.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function create($name, $dir, $templateId = null, $targetPath = null, $sha
279279
$ext = strtolower(pathinfo($name, PATHINFO_EXTENSION));
280280
$documentService = new DocumentService($this->trans, $this->config);
281281
try {
282-
$newFileUri = $documentService->getConvertedUri($fileUrl, $targetExt, $ext, $targetKey);
282+
$newFileUri = $documentService->getConvertedUri($fileUrl, $targetExt, $ext, $targetKey, $ext === "pdf");
283283
} catch (\Exception $e) {
284284
$this->logger->logException($e, ["message" => "getConvertedUri: " . $targetFile->getId(), "app" => $this->appName]);
285285
return ["error" => $e->getMessage()];
@@ -1278,6 +1278,7 @@ public function download($fileId, $toExtension = null, $template = false) {
12781278
* @param string $shareToken - access token
12791279
* @param integer $version - file version
12801280
* @param bool $inframe - open in frame
1281+
* @param bool $forceEdit - open editing
12811282
* @param bool $template - file is template
12821283
* @param string $anchor - anchor for file content
12831284
*
@@ -1286,7 +1287,7 @@ public function download($fileId, $toExtension = null, $template = false) {
12861287
* @NoAdminRequired
12871288
* @NoCSRFRequired
12881289
*/
1289-
public function index($fileId, $filePath = null, $shareToken = null, $version = 0, $inframe = false, $template = false, $anchor = null) {
1290+
public function index($fileId, $filePath = null, $shareToken = null, $version = 0, $inframe = false, $forceEdit = false, $template = false, $anchor = null) {
12901291
$this->logger->debug("Open: $fileId ($version) $filePath", ["app" => $this->appName]);
12911292

12921293
if (empty($shareToken) && !$this->userSession->isLoggedIn()) {
@@ -1326,7 +1327,8 @@ public function index($fileId, $filePath = null, $shareToken = null, $version =
13261327
"version" => $version,
13271328
"template" => $template,
13281329
"inframe" => false,
1329-
"anchor" => $anchor
1330+
"anchor" => $anchor,
1331+
"forceEdit" => $forceEdit
13301332
];
13311333

13321334
if ($inframe === true) {
@@ -1357,15 +1359,16 @@ public function index($fileId, $filePath = null, $shareToken = null, $version =
13571359
* @param string $shareToken - access token
13581360
* @param integer $version - file version
13591361
* @param bool $inframe - open in frame
1362+
* @param bool $forceEdit - open editing
13601363
*
13611364
* @return TemplateResponse
13621365
*
13631366
* @NoAdminRequired
13641367
* @NoCSRFRequired
13651368
* @PublicPage
13661369
*/
1367-
public function publicPage($fileId, $shareToken, $version = 0, $inframe = false) {
1368-
return $this->index($fileId, null, $shareToken, $version, $inframe);
1370+
public function publicPage($fileId, $shareToken, $version = 0, $inframe = false, $forceEdit = false) {
1371+
return $this->index($fileId, null, $shareToken, $version, $inframe, $forceEdit);
13691372
}
13701373

13711374
/**

css/main.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
.icon-onlyoffice-new-pptx {
2626
background-image: url("../img/new-pptx.svg");
2727
}
28-
.icon-onlyoffice-new-docxf {
29-
background-image: url("../img/new-docxf.svg");
28+
.icon-onlyoffice-new-pdf {
29+
background-image: url("../img/new-pdf.svg");
3030
}
3131
.icon-onlyoffice-open,
3232
.icon-onlyoffice-convert,
3333
.icon-onlyoffice-download,
34-
.icon-onlyoffice-fill,
3534
.icon-onlyoffice-create {
3635
background-image: url("../img/app-dark.svg");
3736
}
Lines changed: 8 additions & 8 deletions
Loading

0 commit comments

Comments
 (0)