Compare commits

..

12 Commits

115 changed files with 225 additions and 188 deletions

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -152,7 +152,7 @@ namespace OnlineEditorsExampleMVC.Helpers
string curExt = Path.GetExtension(fileName);
string downloadExt = Path.GetExtension(downloadUri);
var newFileName = fileName;
Boolean newFileName = false;
if (!curExt.Equals(downloadExt))
{
@ -162,7 +162,7 @@ namespace OnlineEditorsExampleMVC.Helpers
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
if (string.IsNullOrEmpty(newFileUri))
{
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
}
else
{
@ -171,7 +171,7 @@ namespace OnlineEditorsExampleMVC.Helpers
}
catch (Exception)
{
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
}
}
@ -180,18 +180,25 @@ namespace OnlineEditorsExampleMVC.Helpers
if (isSubmitForm)
{
if (newFileName.Equals(fileName))
if (newFileName)
{
newFileName = DocManagerHelper.GetCorrectName(fileName, userAddress);
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress);
} else
{
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
}
forcesavePath = DocManagerHelper.StoragePath(newFileName, userAddress);
forcesavePath = DocManagerHelper.StoragePath(fileName, userAddress);
}
else
{
forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, false);
if (newFileName)
{
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
forcesavePath = DocManagerHelper.ForcesavePath(fileName, userAddress, false);
if (forcesavePath.Equals(""))
{
forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, true);
forcesavePath = DocManagerHelper.ForcesavePath(fileName, userAddress, true);
}
}
@ -203,7 +210,7 @@ namespace OnlineEditorsExampleMVC.Helpers
var actions = jss.Deserialize<List<object>>(jss.Serialize(fileData["actions"]));
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
var user = action["userid"].ToString();
DocManagerHelper.CreateMeta(newFileName, user, "Filling Form", userAddress);
DocManagerHelper.CreateMeta(fileName, user, "Filling Form", userAddress);
}
return 0;

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
[assembly: AssemblyCopyright("Ascensio System SIA 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -14,7 +14,7 @@
<meta name="mobile-web-app-capable" content="yes" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -13,7 +13,7 @@
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -12,7 +12,7 @@
<title>ONLYOFFICE</title>
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -15,7 +15,7 @@
<title>ONLYOFFICE</title>
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExample")]
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
[assembly: AssemblyCopyright("Ascensio System SIA 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -160,7 +160,7 @@ namespace OnlineEditorsExample
string curExt = Path.GetExtension(fileName);
string downloadExt = Path.GetExtension(downloadUri);
var newFileName = fileName;
Boolean newFileName = false;
if (!curExt.Equals(downloadExt))
{
@ -170,7 +170,7 @@ namespace OnlineEditorsExample
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
if (string.IsNullOrEmpty(newFileUri))
{
newFileName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
}
else
{
@ -179,7 +179,7 @@ namespace OnlineEditorsExample
}
catch (Exception)
{
newFileName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
}
}
@ -194,18 +194,26 @@ namespace OnlineEditorsExample
if (isSubmitForm)
{
if (newFileName.Equals(fileName))
if (newFileName)
{
newFileName = _Default.GetCorrectName(fileName, userAddress);
fileName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress);
} else
{
fileName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
}
forcesavePath = _Default.StoragePath(newFileName, userAddress);
forcesavePath = _Default.StoragePath(fileName, userAddress);
}
else
{
forcesavePath = _Default.ForcesavePath(newFileName, userAddress, false);
if (newFileName)
{
fileName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
forcesavePath = _Default.ForcesavePath(fileName, userAddress, false);
if (forcesavePath.Equals(""))
{
forcesavePath = _Default.ForcesavePath(newFileName, userAddress, true);
forcesavePath = _Default.ForcesavePath(fileName, userAddress, true);
}
}
@ -217,7 +225,7 @@ namespace OnlineEditorsExample
var actions = jss.Deserialize<List<object>>(jss.Serialize(fileData["actions"]));
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
var user = action["userid"].ToString();
DocEditor.CreateMeta(newFileName, user, "Filling Form", userAddress);
DocEditor.CreateMeta(fileName, user, "Filling Form", userAddress);
}
return 0;

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -177,18 +177,18 @@ public class TrackManager {
String curExt = FileUtility.GetFileExtension(fileName);
String downloadExt = FileUtility.GetFileExtension(downloadUri);
String newFileName = fileName;
Boolean newFileName = false;
if (!curExt.equals(downloadExt)) {
try {
String newFileUri = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false);
if (newFileUri.isEmpty()) {
newFileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
} else {
downloadUri = newFileUri;
}
} catch (Exception e){
newFileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
newFileName = true;
}
}
@ -197,14 +197,20 @@ public class TrackManager {
if (isSubmitForm) {
//new file
if (newFileName.equals(fileName)){
newFileName = DocumentManager.GetCorrectName(fileName, userAddress);
if (newFileName){
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress);
} else {
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
}
forcesavePath = DocumentManager.StoragePath(newFileName, userAddress);
forcesavePath = DocumentManager.StoragePath(fileName, userAddress);
} else {
forcesavePath = DocumentManager.ForcesavePath(newFileName, userAddress, false);
if (newFileName){
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
forcesavePath = DocumentManager.ForcesavePath(fileName, userAddress, false);
if (forcesavePath == "") {
forcesavePath = DocumentManager.ForcesavePath(newFileName, userAddress, true);
forcesavePath = DocumentManager.ForcesavePath(fileName, userAddress, true);
}
}
@ -215,7 +221,7 @@ public class TrackManager {
JSONArray actions = (JSONArray) body.get("actions");
JSONObject action = (JSONObject) actions.get(0);
String user = (String) action.get("userid");
DocumentManager.CreateMeta(newFileName, user, "Filling Form", userAddress);
DocumentManager.CreateMeta(fileName, user, "Filling Form", userAddress);
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -12,7 +12,7 @@
<meta name="mobile-web-app-capable" content="yes" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -12,7 +12,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -3,7 +3,7 @@
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
"use strict";
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -447,20 +447,27 @@ app.post("/track", function (req, res) {
callbackProcessSave(downloadUri, body, fileName, userAddress, newFileName);
};
var callbackProcessForceSave = function (downloadUri, body, fileName, userAddress, newFileName){
var callbackProcessForceSave = function (downloadUri, body, fileName, userAddress, newFileName = false){
try {
var downloadExt = fileUtility.getFileExtension(downloadUri);
var isSubmitForm = body.forcesavetype === 3; //SubmitForm
if (isSubmitForm) {
//new file
if (newFileName == fileName){
newFileName = docManager.getCorrectName(fileName, userAddress);
if (newFileName){
fileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + "-form" + downloadExt, userAddress);
} else {
var ext = fileUtility.getFileExtension(fileName);
fileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + "-form" + ext, userAddress);
}
var forcesavePath = docManager.storagePath(newFileName, userAddress);
var forcesavePath = docManager.storagePath(fileName, userAddress);
} else {
forcesavePath = docManager.forcesavePath(newFileName, userAddress, false);
if (newFileName){
fileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + downloadExt, userAddress);
}
forcesavePath = docManager.forcesavePath(fileName, userAddress, false);
if (forcesavePath == "") {
forcesavePath = docManager.forcesavePath(newFileName, userAddress, true);
forcesavePath = docManager.forcesavePath(fileName, userAddress, true);
}
}
@ -469,7 +476,7 @@ app.post("/track", function (req, res) {
if (isSubmitForm) {
var uid =body.actions[0].userid
docManager.saveFileData(newFileName, uid, "Filling Form", userAddress);
docManager.saveFileData(fileName, uid, "Filling Form", userAddress);
}
} catch (ex) {
response.write("{\"error\":1}");
@ -484,25 +491,22 @@ app.post("/track", function (req, res) {
var processForceSave = function (downloadUri, body, fileName, userAddress, resp) {
var curExt = fileUtility.getFileExtension(fileName);
var downloadExt = fileUtility.getFileExtension(downloadUri);
var newFileName = fileName;
if (downloadExt != curExt) {
var key = documentService.generateRevisionId(downloadUri);
try {
documentService.getConvertedUriSync(downloadUri, downloadExt, curExt, key, function (err, data) {
if (err) {
newFileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + downloadExt, userAddress);
callbackProcessForceSave(downloadUri, body, fileName, userAddress, newFileName);
callbackProcessForceSave(downloadUri, body, fileName, userAddress, true);
return;
}
try {
var res = documentService.getResponseUri(data);
callbackProcessForceSave(res.value, body, fileName, userAddress, newFileName);
callbackProcessForceSave(res.value, body, fileName, userAddress, false);
return;
} catch (ex) {
console.log(ex);
newFileName = docManager.getCorrectName(fileUtility.getFileName(fileName, true) + downloadExt, userAddress);
callbackProcessForceSave(downloadUri, body, fileName, userAddress, newFileName);
callbackProcessForceSave(downloadUri, body, fileName, userAddress, true);
return;
}
});
@ -511,7 +515,7 @@ app.post("/track", function (req, res) {
console.log(ex);
}
}
callbackProcessForceSave (downloadUri, body, fileName, userAddress, newFileName);
callbackProcessForceSave (downloadUri, body, fileName, userAddress, false);
};
if (body.status == 1) { //Editing

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
"use strict";
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2010-2020, Loren West and other contributors
// Copyright 2010-2021, Loren West and other contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -8,7 +8,7 @@
<meta name="mobile-web-app-capable" content="yes" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -265,7 +265,7 @@
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<footer>&copy; Ascensio Systems SIA 2020. All rights reserved.</footer>
<footer>&copy; Ascensio Systems SIA 2021. All rights reserved.</footer>
<script type="text/javascript" src="javascripts/jquery-1.8.2.js"></script>
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -11,7 +11,7 @@ $GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot",
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
$GLOBALS['DOC_SERV_SITE_URL'] = "https://documentserver/";
$GLOBALS['DOC_SERV_SITE_URL'] = "http://192.168.0.142/";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "web-apps/apps/api/documents/api.js";

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -140,7 +140,7 @@ function processForceSave($data, $fileName, $userAddress) {
$curExt = strtolower('.' . pathinfo($fileName, PATHINFO_EXTENSION));
$downloadExt = strtolower('.' . pathinfo($downloadUri, PATHINFO_EXTENSION));
$newFileName = $fileName;
$newFileName = false;
if ($downloadExt != $curExt) {
$key = GenerateRevisionId($downloadUri);
@ -153,31 +153,34 @@ function processForceSave($data, $fileName, $userAddress) {
$downloadUri = $convertedUri;
} else {
sendlog(" Convert after save convertedUri is empty", "webedior-ajax.log");
$baseNameWithoutExt = substr($fileName, 0, strlen($fileName) - strlen($curExt));
$newFileName = GetCorrectName($baseNameWithoutExt . $downloadExt, $userAddress);
$newFileName = true;
}
} catch (Exception $e) {
sendlog(" Convert after save ".$e->getMessage(), "webedior-ajax.log");
$baseNameWithoutExt = substr($fileName, 0, strlen($fileName) - strlen($curExt));
$newFileName = GetCorrectName($baseNameWithoutExt . $downloadExt, $userAddress);
$newFileName = true;
}
}
$saved = 1;
if (!(($new_data = file_get_contents($downloadUri)) === FALSE)) {
$baseNameWithoutExt = substr($fileName, 0, strlen($fileName) - strlen($curExt));
$isSubmitForm = $data["forcesavetype"] == 3;
if ($isSubmitForm) {
if ($newFileName == $fileName){
$newFileName = GetCorrectName($fileName, $userAddress);
if ($newFileName){
$fileName = GetCorrectName($baseNameWithoutExt . "-form" . $downloadExt, $userAddress);
} else {
$fileName = GetCorrectName($baseNameWithoutExt . "-form" . $curExt, $userAddress);
}
$forcesavePath = getStoragePath($newFileName, $userAddress);
$forcesavePath = getStoragePath($fileName, $userAddress);
} else {
$forcesavePath = getForcesavePath($newFileName, $userAddress, false);
if ($newFileName){
$fileName = GetCorrectName($baseNameWithoutExt . $downloadExt, $userAddress);
}
$forcesavePath = getForcesavePath($fileName, $userAddress, false);
if ($forcesavePath == "") {
$forcesavePath = getForcesavePath($newFileName, $userAddress, true);
$forcesavePath = getForcesavePath($fileName, $userAddress, true);
}
}
@ -185,7 +188,7 @@ function processForceSave($data, $fileName, $userAddress) {
if ($isSubmitForm) {
$user = $data["actions"][0]["userid"];
createMeta($newFileName, $user, $userAddress);
createMeta($fileName, $user, $userAddress);
}
$saved = 0;

View File

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)
@ -100,34 +100,38 @@ def processForceSave(body, filename, usAddr):
curExt = fileUtils.getFileExt(filename)
downloadExt = fileUtils.getFileExt(download)
newFilename = filename
newFilename = False
if (curExt != downloadExt):
try:
newUri = serviceConverter.getConverterUri(download, downloadExt, curExt, docManager.generateRevisionId(download), False)
if not newUri:
newFilename = docManager.getCorrectName(fileUtils.getFileNameWithoutExt(filename) + downloadExt, usAddr)
newFilename = True
else:
download = newUri
except Exception:
newFilename = docManager.getCorrectName(fileUtils.getFileNameWithoutExt(filename) + downloadExt, usAddr)
newFilename = True
isSubmitForm = body.get('forcesavetype') == 3
if(isSubmitForm):
if (newFilename == filename):
newFilename = docManager.getCorrectName(filename, usAddr)
forcesavePath = docManager.getStoragePath(newFilename, usAddr)
if (newFilename):
filename = docManager.getCorrectName(fileUtils.getFileNameWithoutExt(filename) + "-form" + downloadExt, usAddr)
else :
filename = docManager.getCorrectName(fileUtils.getFileNameWithoutExt(filename) + "-form" + curExt, usAddr)
forcesavePath = docManager.getStoragePath(filename, usAddr)
else:
forcesavePath = docManager.getForcesavePath(newFilename, usAddr, False)
if (newFilename):
filename = docManager.getCorrectName(fileUtils.getFileNameWithoutExt(filename) + downloadExt, usAddr)
forcesavePath = docManager.getForcesavePath(filename, usAddr, False)
if (forcesavePath == ""):
forcesavePath = docManager.getForcesavePath(newFilename, usAddr, True)
forcesavePath = docManager.getForcesavePath(filename, usAddr, True)
docManager.saveFileFromUri(download, forcesavePath)
if(isSubmitForm):
uid = body['actions'][0]['userid']
historyManager.createMetaData(newFilename, uid, "Filling Form", usAddr)
historyManager.createMetaData(filename, uid, "Filling Form", usAddr)
return
def commandRequest(method, key):

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
"""
(c) Copyright Ascensio System SIA 2020
(c) Copyright Ascensio System SIA 2021
*
The MIT License (MIT)

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* The MIT License (MIT)
*
@ -258,7 +258,7 @@
<span id="loadScripts" data-docs="{{ preloadurl }}"></span>
<footer>&copy; Ascensio Systems SIA 2020. All rights reserved.</footer>
<footer>&copy; Ascensio Systems SIA 2021. All rights reserved.</footer>
<script type="text/javascript" src="{% static "js/jquery-1.8.2.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery-ui.js" %}"></script>

View File

@ -163,7 +163,7 @@ GEM
turbolinks-source (5.2.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
tzinfo-data (1.2020.1)
tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2020
# (c) Copyright Ascensio System SIA 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More