Skip to content

Commit

Permalink
Merge pull request #385 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/7.5.3
  • Loading branch information
LinneyS authored Jul 19, 2022
2 parents 1c5835b + 378484c commit 82b54bc
Show file tree
Hide file tree
Showing 37 changed files with 592 additions and 289 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 7.5.3
## Added
- Catalan translation
- macro launch setting
- theme setting

## 7.3.3
## Added
- Turkish and Galician empty file templates
Expand Down
7 changes: 1 addition & 6 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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>
<licence>apl2</licence>
<author>Ascensio System SIA</author>
<version>7.3.3</version>
<version>7.5.3</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand All @@ -30,9 +30,4 @@
<commands>
<command>OCA\Onlyoffice\Command\DocumentServer</command>
</commands>
<repair-steps>
<post-migration>
<step>OCA\Onlyoffice\MimeRepair</step>
</post-migration>
</repair-steps>
</info>
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
["name" => "editor#restore", "url" => "/ajax/restore", "verb" => "PUT"],
["name" => "settings#save_address", "url" => "/ajax/settings/address", "verb" => "PUT"],
["name" => "settings#save_common", "url" => "/ajax/settings/common", "verb" => "PUT"],
["name" => "settings#save_security", "url" => "/ajax/settings/security", "verb" => "PUT"],
["name" => "settings#get_settings", "url" => "/ajax/settings", "verb" => "GET"],
["name" => "settings#clear_history", "url" => "/ajax/settings/history", "verb" => "DELETE"],
["name" => "template#add_template", "url" => "/ajax/template", "verb" => "POST"],
Expand Down
2 changes: 1 addition & 1 deletion assets
15 changes: 12 additions & 3 deletions controller/editorapicontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =

$fileName = $file->getName();
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
$format = !empty($ext) ? $this->config->FormatsSetting()[$ext] : null;
$format = !empty($ext) && array_key_exists($ext, $this->config->FormatsSetting()) ? $this->config->FormatsSetting()[$ext] : null;
if (!isset($format)) {
$this->logger->info("Format is not supported for editing: $fileName", ["app" => $this->appName]);
return new JSONResponse(["error" => $this->trans->t("Format is not supported")]);
Expand Down Expand Up @@ -626,8 +626,7 @@ private function getUrl($file, $user = null, $shareToken = null, $version = 0, $

$fileUrl = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.download", ["doc" => $hashUrl]);

if (!empty($this->config->GetStorageUrl())
&& !$changes) {
if (!empty($this->config->GetStorageUrl())) {
$fileUrl = str_replace($this->urlGenerator->getAbsoluteURL("/"), $this->config->GetStorageUrl(), $fileUrl);
}

Expand Down Expand Up @@ -686,11 +685,21 @@ private function setCustomization($params) {
$params["editorConfig"]["customization"]["reviewDisplay"] = $reviewDisplay;
}

$theme = $this->config->GetCustomizationTheme();
if (isset($theme)) {
$params["editorConfig"]["customization"]["uiTheme"] = $theme;
}

//default is false
if ($this->config->GetCustomizationToolbarNoTabs() === true) {
$params["editorConfig"]["customization"]["toolbarNoTabs"] = true;
}

//default is true
if($this->config->GetCustomizationMacros() === false) {
$params["editorConfig"]["customization"]["macros"] = false;
}


/* from system config */

Expand Down
3 changes: 1 addition & 2 deletions controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,7 @@ private function getUrl($file, $user = null, $shareToken = null, $version = 0, $

$fileUrl = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.download", ["doc" => $hashUrl]);

if (!empty($this->config->GetStorageUrl())
&& !$changes) {
if (!empty($this->config->GetStorageUrl())) {
$fileUrl = str_replace($this->urlGenerator->getAbsoluteURL("/"), $this->config->GetStorageUrl(), $fileUrl);
}

Expand Down
22 changes: 21 additions & 1 deletion controller/settingscontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public function index() {
"help" => $this->config->GetCustomizationHelp(),
"toolbarNoTabs" => $this->config->GetCustomizationToolbarNoTabs(),
"successful" => $this->config->SettingsAreSuccessful(),
"macros" => $this->config->GetCustomizationMacros(),
"reviewDisplay" => $this->config->GetCustomizationReviewDisplay(),
"theme" => $this->config->GetCustomizationTheme(),
"templates" => $this->GetGlobalTemplates()
];
return new TemplateResponse($this->appName, "settings", $data, "blank");
Expand Down Expand Up @@ -203,6 +205,7 @@ public function SaveAddress($documentserver,
* @param bool $help - display help
* @param bool $toolbarNoTabs - display toolbar tab
* @param string $reviewDisplay - review viewing mode
* @param string $theme - default theme mode
*
* @return array
*/
Expand All @@ -218,7 +221,8 @@ public function SaveCommon($defFormats,
$forcesave,
$help,
$toolbarNoTabs,
$reviewDisplay
$reviewDisplay,
$theme
) {

$this->config->SetDefaultFormats($defFormats);
Expand All @@ -234,6 +238,22 @@ public function SaveCommon($defFormats,
$this->config->SetCustomizationHelp($help);
$this->config->SetCustomizationToolbarNoTabs($toolbarNoTabs);
$this->config->SetCustomizationReviewDisplay($reviewDisplay);
$this->config->SetCustomizationTheme($theme);

return [
];
}

/**
* Save security settings
*
* @param bool $macros - run document macros
*
* @return array
*/
public function SaveSecurity($macros) {

$this->config->SetCustomizationMacros($macros);

return [
];
Expand Down
27 changes: 26 additions & 1 deletion js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
var help = $("#onlyofficeHelp").is(":checked");
var toolbarNoTabs = $("#onlyofficeToolbarNoTabs").is(":checked");
var reviewDisplay = $("input[type='radio'][name='reviewDisplay']:checked").attr("id").replace("onlyofficeReviewDisplay_", "");
var theme = $("input[type='radio'][name='theme']:checked").attr("id").replace("onlyofficeTheme_", "");

$.ajax({
method: "PUT",
Expand All @@ -153,7 +154,31 @@
forcesave: forcesave,
help: help,
toolbarNoTabs: toolbarNoTabs,
reviewDisplay: reviewDisplay
reviewDisplay: reviewDisplay,
theme: theme
},
success: function onSuccess(response) {
$(".section-onlyoffice").removeClass("icon-loading");
if (response) {
var message = t(OCA.Onlyoffice.AppName, "Settings have been successfully updated");
OC.Notification.show(message, {
timeout: 3
});
}
}
});
});

$("#onlyofficeSecuritySave").click(function () {
$(".section-onlyoffice").addClass("icon-loading");

var macros = $("#onlyofficeMacros").is(":checked");

$.ajax({
method: "PUT",
url: OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/security"),
data: {
macros: macros
},
success: function onSuccess(response) {
$(".section-onlyoffice").removeClass("icon-loading");
Expand Down
9 changes: 7 additions & 2 deletions l10n/bg_BG.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ OC.L10N.register(
"Keep intermediate versions when editing (forcesave)": "Съхранявайте междинни версии при редактиране (force save)",
"Use ONLYOFFICE to generate a document preview (it will take up disk space)": "Използвайте ONLYOFFICE, за да генерирате преглед на документа (ще заеме дисково пространство)",
"Keep metadata for each version once the document is edited (it will take up disk space)": "Запазете метаданните за всяка версия, щом документът бъде редактиран (ще заеме дисково пространство)",
"Clear": "Изчисти",
"All history successfully deleted": "Цялата история е успешно изтрита",
"Create": "Създай",
"Select template" : "Избор на шаблон",
Expand All @@ -97,13 +98,17 @@ OC.L10N.register(
"Origin format": "Формат на произход",
"Failed to send notification": "Неуспешно изпращане на известие",
"Notification sent successfully": "Успешно изпратено известие",
"%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s, споменат във %2\$s: \"%3\$s\".",
"%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s, Ви спомена във %2\$s: \"%3\$s\".",
"Choose a format to convert {fileName}": "Изберете формат за конвертиране {fileName}",
"Form template": "Шаблон на формуляр",
"Form template from existing text file": "Шаблон на формуляр от съществуващ текстов файл",
"Create form": "Създайте формуляр",
"Fill in form in ONLYOFFICE": "Попълнете формуляр в ONLYOFFICE",
"Create new Form template": "Създайте нов шаблон на формуляр",
"Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване"
"Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване",
"Security": "Сигурност",
"Light": "Светла",
"Classic Light": "Класически светла",
"Dark": "Тъмна"
},
"nplurals=2; plural=(n != 1);");
9 changes: 7 additions & 2 deletions l10n/bg_BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Keep intermediate versions when editing (forcesave)": "Съхранявайте междинни версии при редактиране (force save)",
"Use ONLYOFFICE to generate a document preview (it will take up disk space)": "Използвайте ONLYOFFICE, за да генерирате преглед на документа (ще заеме дисково пространство)",
"Keep metadata for each version once the document is edited (it will take up disk space)": "Запазете метаданните за всяка версия, щом документът бъде редактиран (ще заеме дисково пространство)",
"Clear": "Изчисти",
"All history successfully deleted": "Цялата история е успешно изтрита",
"Create": "Създай",
"Select template" : "Избор на шаблон",
Expand All @@ -95,13 +96,17 @@
"Origin format": "Формат на произход",
"Failed to send notification": "Неуспешно изпращане на известие",
"Notification sent successfully": "Успешно изпратено известие",
"%1$s mentioned in the %2$s: \"%3$s\".": "%1$s, споменат във %2$s: \"%3$s\".",
"%1$s mentioned in the %2$s: \"%3$s\".": "%1$s, Ви спомена във %2$s: \"%3$s\".",
"Choose a format to convert {fileName}": "Изберете формат за конвертиране {fileName}",
"Form template": "Шаблон на формуляр",
"Form template from existing text file": "Шаблон на формуляр от съществуващ текстов файл",
"Create form": "Създайте формуляр",
"Fill in form in ONLYOFFICE": "Попълнете формуляр в ONLYOFFICE",
"Create new Form template": "Създайте нов шаблон на формуляр",
"Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване"
"Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване",
"Security": "Сигурност",
"Light": "Светла",
"Classic Light": "Класически светла",
"Dark": "Тъмна"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
Loading

0 comments on commit 82b54bc

Please sign in to comment.