Skip to content

Commit

Permalink
Merge pull request 'Release/v1.4.0' from develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LinneyS committed Oct 16, 2024
2 parents b6ab4da + e8e8b63 commit b5f3c6c
Show file tree
Hide file tree
Showing 48 changed files with 1,931 additions and 2,243 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ jobs:
mkdir -p ./deploy/onlyoffice
rsync -av --exclude='deploy' ./ ./deploy/onlyoffice
cd ./deploy/onlyoffice
composer install
rm -rf ./.github
rm -rf ./.git/
rm ./.gitignore
rm ./.gitmodules
rm -rf ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-templates
mv ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.json ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.txt
rm ./composer.json
rm ./composer.lock
find ./vendor -type f -iname '*.json' -delete
find ./vendor -type f -iname '*.lock' -delete
find ./vendor -type f -iname 'LICENSE' -delete
cd ./assets
rm .git
cd $cwd
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ name: Lint

on:
workflow_dispatch:
push:
branches: [master, develop]
pull_request:
branches: [master]
branches: [master, develop]

jobs:
lint:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: cs2pr, phpcs

- name: Run phpcs
run: phpcs -q --extensions=php,module,inc,install,test,profile,theme,css,info --ignore=node_modules,bower_components,vendor,md,yml,txt ./
- uses: actions/checkout@v3
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ jobs:
mkdir -p ./onlyoffice
rsync -av --exclude='onlyoffice' ./ ./onlyoffice
cd ./onlyoffice
composer install
rm -rf .github/
rm -rf .git/
rm .gitignore
rm .gitmodules
rm -rf ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-templates
mv ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.json ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.txt
rm ./composer.json
rm ./composer.lock
find ./vendor -type f -iname '*.json' -delete
find ./vendor -type f -iname '*.lock' -delete
find ./vendor -type f -iname 'LICENSE' -delete
cd ./assets
rm .git
cd $cwd
Expand Down
37 changes: 37 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

$rules = [
'@Symfony' => true,
'array_syntax' => [
'syntax' => 'short',
],
'blank_line_after_opening_tag' => false,
'no_extra_blank_lines' => true,
'multiline_comment_opening_closing' => true,
'yoda_style' => false,
'phpdoc_to_comment' => false,
'phpdoc_no_package' => false,
'phpdoc_annotation_without_dot' => false,
'increment_style' => ['style' => 'post'],
'no_useless_else' => false,
'single_quote' => false,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'no_break_comment' => true,
];

$finder = PhpCsFixer\Finder::create()
->exclude('3rdparty')
->exclude('assets')
->exclude('layout')
->exclude('resources')
->in(__DIR__)
;

$config = new PhpCsFixer\Config();
return $config->setRules(
$rules
)
->setFinder($finder);
3 changes: 3 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

return require_once __DIR__.'/.php-cs-fixer.dist.php';
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## 1.4.0
## Added
- using onlyoffice/docs-integration-sdk
- Arabic and Serbian empty file templates
- default empty file templates
- Finnish, Hebrew, Norwegian, Slovenian empty file templates

## 1.3.0
## Added
- Chinese (Taiwan), Basque (Spain), Malay (Malaysia), and Galician empty file templates
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,18 @@ The table below will help you to make the right choice.
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Transitions | + | + |
| Animations | + | + |
| Presenter mode | + | + |
| Notes | + | + |
| **Form creator features** | **Community Edition** | **Enterprise Edition** |
| Adding form fields | + | + |
| Form preview | + | + |
| Saving as PDF | + | + |
| **Working with PDF** | **Community Edition** | **Enterprise Edition** |
| Text annotations (highlight, underline, cross out) | + | + |
| Comments | + | + |
| Freehand drawings | + | + |
| Form filling | + | + |
| | [Get it now](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubChamilo#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubChamilo#docs-enterprise) |
\* If supported by DMS.
40 changes: 20 additions & 20 deletions ajax/saveas.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2023
* (c) Copyright Ascensio System SIA 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +13,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

require_once __DIR__.'/../../../main/inc/global.inc.php';
Expand All @@ -25,16 +23,16 @@

$body = json_decode(file_get_contents('php://input'), true);

$title = $body["title"];
$url = $body["url"];
$title = $body['title'];
$url = $body['url'];

$folderId = !empty($body["folderId"]) ? $body["folderId"] : 0;
$sessionId = !empty($body["sessionId"]) ? $body["sessionId"] : 0;
$courseId = !empty($body["courseId"]) ? $body["courseId"] : 0;
$groupId = !empty($body["groupId"]) ? $body["groupId"] : 0;
$folderId = !empty($body['folderId']) ? $body['folderId'] : 0;
$sessionId = !empty($body['sessionId']) ? $body['sessionId'] : 0;
$courseId = !empty($body['courseId']) ? $body['courseId'] : 0;
$groupId = !empty($body['groupId']) ? $body['groupId'] : 0;

$courseInfo = api_get_course_info_by_id($courseId);
$courseCode = $courseInfo["code"];
$courseCode = $courseInfo['code'];

$isMyDir = false;
if (!empty($folderId)) {
Expand All @@ -46,21 +44,22 @@
);
$isMyDir = DocumentManager::is_my_shared_folder(
$userId,
$folderInfo["absolute_path"],
$folderInfo['absolute_path'],
$sessionId
);
}
$groupRights = Session::read("group_member_with_upload_rights");
$groupRights = Session::read('group_member_with_upload_rights');
$isAllowToEdit = api_is_allowed_to_edit(true, true);
if (!($isAllowToEdit || $isMyDir || $groupRights)) {
echo json_encode(["error" => "Not permitted"]);
echo json_encode(['error' => 'Not permitted']);

return;
}

$fileExt = strtolower(pathinfo($title, PATHINFO_EXTENSION));
$baseName = strtolower(pathinfo($title, PATHINFO_FILENAME));

$result = FileUtility::createFile(
$result = OnlyofficeDocumentManager::createFile(
$baseName,
$fileExt,
$folderId,
Expand All @@ -71,16 +70,17 @@
$url
);

if (isset($result["error"])) {
if ($result["error"] === "fileIsExist") {
$result["error"] = "File is exist";
if (isset($result['error'])) {
if ('fileIsExist' === $result['error']) {
$result['error'] = 'File is exist';
}
if ($result["error"] === "impossibleCreateFile") {
$result["error"] = "Impossible to create file";
if ('impossibleCreateFile' === $result['error']) {
$result['error'] = 'Impossible to create file';
}

echo json_encode($result);

return;
}

echo json_encode(["success" => "File is created"]);
echo json_encode(['success' => 'File is created']);
2 changes: 1 addition & 1 deletion assets
Submodule assets updated 205 files
Loading

0 comments on commit b5f3c6c

Please sign in to comment.