Skip to content

Commit 91820eb

Browse files
committed
Merge pull request 'Release/9.12.1' from develop into master
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/onlyoffice-owncloud/pulls/56
2 parents 4ec9d43 + 5bd4da3 commit 91820eb

46 files changed

Lines changed: 425 additions & 112 deletions

Some content is hidden

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

CHANGELOG.md

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

3+
## 9.12.1
4+
## Added
5+
- plugin description and useful links in admin settings
6+
7+
## Changed
8+
- fix opening a shared link when group access to the app is restricted
9+
- replaced general save success message with dedicated messages for each settings section
10+
- change settings save button color to primary
11+
- show confirmation modal before performing clear version metadata
12+
- download all document pages when converting to image types with Download As method
13+
314
## 9.10.1
415
## Added
516
- insert svg to editor

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Moreover, any AI assistant, including local ones, can be effortlessly connected
1616
]]></description>
1717
<licence>apl2</licence>
1818
<author>Ascensio System SIA</author>
19-
<version>9.10.1</version>
19+
<version>9.12.1</version>
2020
<namespace>Onlyoffice</namespace>
2121
<types>
2222
<filesystem/>

controller/callbackcontroller.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,20 @@ function () use ($file, $newData) {
602602
$result = 0;
603603
} catch (\Exception $e) {
604604
$this->logger->logException($e, ["message" => "Track: $fileId status $status error", "app" => $this->appName]);
605+
// if (isset($file) && $status === self::TRACKERSTATUS_MUSTSAVE) {
606+
// $notificationManager = \OC::$server->getNotificationManager();
607+
// $notification = $notificationManager->createNotification();
608+
// $notification->setApp($this->appName)
609+
// ->setDateTime(new \DateTime())
610+
// ->setObject("documentUnsaved", $fileId)
611+
// ->setSubject(
612+
// "documentunsaved_info",
613+
// ["fileId" => $fileId,
614+
// "fileName" => $file->getName()]
615+
// )
616+
// ->setUser($userId);
617+
// $notificationManager->notify($notification);
618+
// }
605619
}
606620
break;
607621

controller/editorcontroller.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,13 +1315,30 @@ public function download($fileId, $toExtension = null, $template = false) {
13151315
}
13161316

13171317
$newFileUri = null;
1318+
$newFileType = $toExtension;
13181319
$documentService = new DocumentService($this->trans, $this->config);
13191320
$key = $this->fileUtility->getKey($file);
13201321
$fileUrl = $this->getUrl($file, $user);
1322+
$thumbnail = ['first' => false];
13211323
try {
1322-
$newFileUri = $documentService->getConvertedUri($fileUrl, $ext, $toExtension, $key);
1324+
$response = $documentService->sendRequestToConvertService(
1325+
$fileUrl,
1326+
$ext,
1327+
$toExtension,
1328+
$key,
1329+
false,
1330+
false,
1331+
$thumbnail,
1332+
);
1333+
if (isset($response->error)) {
1334+
$documentService->processConvServResponceError($response->error);
1335+
}
1336+
if (isset($response->endConvert) && $response->endConvert === true) {
1337+
$newFileUri = $response->fileUrl;
1338+
$newFileType = $response->fileType;
1339+
}
13231340
} catch (\Exception $e) {
1324-
$this->logger->logException($e, ["message" => "getConvertedUri: " . $file->getId(), "app" => $this->appName]);
1341+
$this->logger->logException($e, ["message" => "sendRequestToConvertService: " . $file->getId(), "app" => $this->appName]);
13251342
return $this->renderError($e->getMessage());
13261343
}
13271344

@@ -1333,9 +1350,9 @@ public function download($fileId, $toExtension = null, $template = false) {
13331350
}
13341351

13351352
$fileNameWithoutExt = substr($fileName, 0, \strlen($fileName) - \strlen($ext) - 1);
1336-
$newFileName = $fileNameWithoutExt . "." . $toExtension;
1353+
$newFileName = "$fileNameWithoutExt.$newFileType";
13371354

1338-
$mimeType = $this->config->getMimeType($toExtension);
1355+
$mimeType = $this->config->getMimeType($newFileType);
13391356

13401357
return new DataDownloadResponse($newData, $newFileName, $mimeType);
13411358
}

css/settings.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,41 @@
144144
color: #000;
145145
}
146146

147+
.onlyoffice-description {
148+
display: flex;
149+
flex-direction: column;
150+
margin: 24px 0;
151+
row-gap: 11px;
152+
}
153+
154+
.onlyoffice-description h1 {
155+
font-size: 18px;
156+
font-weight: 400;
157+
}
158+
159+
.onlyoffice-description p {
160+
font-size: 12px;
161+
margin-bottom: 0 !important;
162+
}
163+
164+
.onlyoffice-description .useful-links {
165+
column-gap: 24px;
166+
display: flex;
167+
}
168+
169+
.onlyoffice-description .useful-links a {
170+
display: flex;
171+
font-size: 12px;
172+
font-weight: 500;
173+
gap: 4px;
174+
}
175+
176+
.onlyoffice-description .useful-links a::after {
177+
content: url("../img/top-right-arrow.svg");
178+
height: 12px;
179+
width: 12px;
180+
}
181+
147182
@media (max-width: 580px) {
148183
#onlyoffice-docscloud-banner-pic-wrapper {
149184
padding: 20px 0 0 5px;

img/top-right-arrow.svg

Lines changed: 3 additions & 0 deletions
Loading

js/settings.js

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,43 @@
135135
!!response.error.length
136136
);
137137

138-
const message = response.error
139-
? t(OCA.Onlyoffice.AppName, "Error when trying to connect") +
140-
" (" +
141-
response.error +
142-
")"
143-
: t(
138+
if (!response.error && response.secret === null) {
139+
OC.dialogs.info(
140+
t(
144141
OCA.Onlyoffice.AppName,
145-
"Settings have been successfully updated"
146-
);
147-
148-
const versionMessage = response.version
149-
? " (" +
150-
t(OCA.Onlyoffice.AppName, "version") +
151-
" " +
152-
response.version +
153-
")"
154-
: "";
155-
156-
OC.Notification.show(message + versionMessage, {
157-
type: response.error ? "error" : null,
158-
timeout: 3,
159-
});
142+
"Server settings have been successfully updated"
143+
) +
144+
". " +
145+
t(
146+
OCA.Onlyoffice.AppName,
147+
"To ensure the security of important parameters in ONLYOFFICE Docs requests, please set a Secret Key on the Settings page."
148+
),
149+
t(OCA.Onlyoffice.AppName, "Info")
150+
);
151+
} else {
152+
const message = response.error
153+
? t(OCA.Onlyoffice.AppName, "Error when trying to connect") +
154+
" (" +
155+
response.error +
156+
")"
157+
: t(
158+
OCA.Onlyoffice.AppName,
159+
"Server settings have been successfully updated"
160+
);
161+
162+
const versionMessage = response.version
163+
? " (" +
164+
t(OCA.Onlyoffice.AppName, "version") +
165+
" " +
166+
response.version +
167+
")"
168+
: "";
169+
170+
OC.Notification.show(message + versionMessage, {
171+
type: response.error ? "error" : null,
172+
timeout: 3,
173+
});
174+
}
160175
} else {
161176
$(".section-onlyoffice-2").addClass("onlyoffice-hide");
162177
}
@@ -235,7 +250,7 @@
235250
if (response) {
236251
const message = t(
237252
OCA.Onlyoffice.AppName,
238-
"Settings have been successfully updated"
253+
"Common settings have been successfully updated"
239254
);
240255
OC.Notification.show(message, {
241256
timeout: 3,
@@ -269,7 +284,7 @@
269284
if (response) {
270285
const message = t(
271286
OCA.Onlyoffice.AppName,
272-
"Settings have been successfully updated"
287+
"Security settings have been successfully updated"
273288
);
274289
OC.Notification.show(message, {
275290
timeout: 3,
@@ -295,26 +310,36 @@
295310
});
296311

297312
$("#onlyofficeClearVersionHistory").click(function () {
298-
$(".section-onlyoffice").addClass("icon-loading");
299-
300-
$.ajax({
301-
method: "DELETE",
302-
url: OC.generateUrl(
303-
"apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/history"
304-
),
305-
success: function onSuccess(response) {
306-
$(".section-onlyoffice").removeClass("icon-loading");
307-
if (response) {
308-
const message = t(
309-
OCA.Onlyoffice.AppName,
310-
"All history successfully deleted"
311-
);
312-
OC.Notification.show(message, {
313-
timeout: 3,
314-
});
313+
OC.dialogs.confirm(
314+
t(OCA.Onlyoffice.AppName, 'Are you sure you want to clear metadata?'),
315+
t(OCA.Onlyoffice.AppName, 'Confirm metadata removal'),
316+
(clicked) => {
317+
if (!clicked) {
318+
return
315319
}
320+
321+
$(".section-onlyoffice").addClass("icon-loading");
322+
323+
$.ajax({
324+
method: "DELETE",
325+
url: OC.generateUrl(
326+
"apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/history"
327+
),
328+
success: function onSuccess(response) {
329+
$(".section-onlyoffice").removeClass("icon-loading");
330+
if (response) {
331+
const message = t(
332+
OCA.Onlyoffice.AppName,
333+
"All history successfully deleted"
334+
);
335+
OC.Notification.show(message, {
336+
timeout: 3,
337+
});
338+
}
339+
},
340+
});
316341
},
317-
});
342+
)
318343
});
319344

320345
$("#onlyofficeAddTemplate").change(function () {

l10n/bg_BG.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ OC.L10N.register(
2828
"Spreadsheet" : "Електронна таблица",
2929
"Presentation" : "Презентация",
3030
"Error when trying to connect" : "Грешка при опит за свързване",
31-
"Settings have been successfully updated" : "Настройките са успешно обновени",
3231
"Server can't read xml" : "Невъзможно прочитане на xml файла на сървъра",
3332
"Bad Response. Errors: " : "Неправилен отговор. Грешки:",
3433
"Documentation" : "Документация",

l10n/bg_BG.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"Spreadsheet" : "Електронна таблица",
2727
"Presentation" : "Презентация",
2828
"Error when trying to connect" : "Грешка при опит за свързване",
29-
"Settings have been successfully updated" : "Настройките са успешно обновени",
3029
"Server can't read xml" : "Невъзможно прочитане на xml файла на сървъра",
3130
"Bad Response. Errors: " : "Неправилен отговор. Грешки:",
3231
"Documentation" : "Документация",

0 commit comments

Comments
 (0)