Skip to content

Commit ef7c8b5

Browse files
committed
Plugin: OnlyOffice: Bump version to 1.5.0 and merge with exercise-specific code + fix issues saving document details
1 parent a722d1b commit ef7c8b5

27 files changed

+54
-43
lines changed

plugin/onlyoffice/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This plugin is developed and maintained at https://github.com/ONLYOFFICE/onlyoffice-chamilo.
44

5+
##
6+
## Added
7+
- Catalan, Czech, Danish, Hungarian, Indonesian, Romanian, Albanian, Urdu empty file templates
8+
59
## 1.5.0
610
## Added
711
- support learning path

plugin/onlyoffice/README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Chamilo ONLYOFFICE integration plugin
1+
# ONLYOFFICE plugin for Chamilo
22

3-
This plugin allows users to edit office documents from [Chamilo](https://chamilo.org) using ONLYOFFICE Docs packaged as Document Server - [Community or Enterprise Edition](#onlyoffice-docs-editions).
3+
This plugin enables users to edit office documents from [Chamilo](https://chamilo.org) using ONLYOFFICE Docs packaged as Document Server - [Community or Enterprise Edition](#onlyoffice-docs-editions).
44

5-
The plugin is compatible with Chamilo v1.11.16 and later, although some features might only work on the [latest stable version](https://chamilo.org/download) of Chamilo.
5+
The plugin is compatible with Chamilo v1.11.16 or newer.
66

77
## Features
88

@@ -54,7 +54,12 @@ the third party, here is the recommended procedure:
5454
git submodule update --init --recursive
5555
```
5656
57-
3. Clean up
57+
3. Get plugin dependencies:
58+
```
59+
composer install
60+
```
61+
62+
4. Collect all files
5863
```
5964
mkdir /tmp/onlyoffice-deploy
6065
mkdir /tmp/onlyoffice-deploy/onlyoffice
@@ -64,13 +69,13 @@ the third party, here is the recommended procedure:
6469
rm -rf */.git*
6570
```
6671
67-
4. Archive
72+
5. Archive
6873
```
6974
cd ../
7075
zip onlyoffice.zip -r onlyoffice
7176
```
7277
73-
## Installing Chamilo ONLYOFFICE integration plugin
78+
## Installing ONLYOFFICE plugin for Chamilo
7479
7580
The plugin has been integrated into Chamilo since version 1.11.16.
7681
@@ -90,12 +95,12 @@ Then launch `composer install` from the Chamilo root folder.
9095
9196
Return to the plugin list, select the ONLYOFFICE plugin, and click "Enable".
9297
93-
## Configuring Chamilo ONLYOFFICE integration plugin
98+
## Configuring ONLYOFFICE plugin for Chamilo
9499
95100
On the Plugins page, find ONLYOFFICE and click _Configure_. You'll see the _Settings_ page. Enable the plugin and specify the _Document Server address_.
96101
97-
Starting from version 7.2, JWT is enabled by default and the secret key is generated automatically to restrict the access to ONLYOFFICE Docs and for security reasons and data integrity.
98-
Specify your own **Secret key** on the Chamilo **Settings** page. The key can be found on your OnlyOffice server, depending on the type of server. See the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/editors/signature/) page for more details.
102+
Starting from version 7.2, JWT is enabled by default and the secret key is generated automatically to restrict the access to ONLYOFFICE Docs and for security reasons and data integrity.
103+
Specify your own **Secret key** on the Chamilo **Settings** page. The key can be found on your OnlyOffice server, depending on the type of server. See the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/docs/docs-api/additional-api/signature/) page for more details.
99104
Specify the same secret key (search for a long hash string next to "secret") and save.
100105
101106
The plugin will tell you if anything is wrong.
@@ -128,7 +133,7 @@ The plugin will tell you if anything is wrong.
128133
* Learners have access to a new ONLYOFFICE icon next to all documents supported by ONLYOFFICE in the documents tool.
129134
* In the learning paths, the viewer seamlessly integrates with Chamilo to open the supported documents.
130135
131-
More information on integration ONLYOFFICE Docs can be found in the [API documentation](https://api.onlyoffice.com/editors/basic).
136+
More information on integration ONLYOFFICE Docs can be found in the [API documentation](https://api.onlyoffice.com/docs/docs-api/get-started/basic-concepts/).
132137
133138
## ONLYOFFICE Docs editions
134139

plugin/onlyoffice/ajax/saveas.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/onlyoffice/callback.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
3131
$jwtManager = new OnlyofficeJwtManager($appSettings);
3232
list($hashData, $error) = $jwtManager->readHash($_GET['hash'], api_get_security_key());
3333
if (null === $hashData) {
34-
error_log("ONLYOFFICE CALLBACK: ERROR - Hash inválido: ".$error);
34+
error_log("ONLYOFFICE CALLBACK: ERROR - Invalid hash: ".$error);
3535
exit(json_encode(['status' => 'error', 'error' => $error]));
3636
}
3737

@@ -42,6 +42,9 @@
4242
$groupId = $hashData->groupId;
4343
$sessionId = $hashData->sessionId;
4444
$docPath = isset($_GET['docPath']) ? urldecode($_GET['docPath']) : ($hashData->docPath ?? null);
45+
// Load courseCode for various uses from global scope in other functions
46+
$courseInfo = api_get_course_info_by_id($courseId);
47+
$courseCode = $courseInfo['code'];
4548

4649
if (!empty($userId)) {
4750
$userInfo = api_get_user_info($userId);
@@ -196,7 +199,6 @@ function download()
196199
global $docId;
197200
global $groupId;
198201
global $docPath;
199-
global $courseCode;
200202
global $sessionId;
201203
global $courseInfo;
202204
global $appSettings;

plugin/onlyoffice/create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/onlyoffice/editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* You may not use this file except in compliance with the License.

plugin/onlyoffice/error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2022.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/onlyoffice/install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/onlyoffice/lib/langManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/onlyoffice/lib/onlyofficeActionObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* (c) Copyright Ascensio System SIA 2024.
3+
* (c) Copyright Ascensio System SIA 2025.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)