Commit 369b436d authored by Alexey.Golubev's avatar Alexey.Golubev Committed by Alexander.Trofimov

При любой команде передаем идентификатор пользователя.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54237 954022d7-b5bf-4e40-9824-e11837661b57
parent 5d5ca862
......@@ -3,6 +3,7 @@ var ASC_DOCS_API_DEBUG = true;
var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var documentId = undefined;
var documentUserId = undefined;
var documentUrl = 'null';
var documentTitle = 'null';
var documentTitleWithoutExtention = 'null';
......@@ -720,6 +721,7 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
var rData = {
"c" : "getsettings",
"id" : this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId(),
"format" : this.DocInfo.get_Format(),
"vkey" : this.DocInfo.get_VKey(),
"editorid" : c_oEditorId.Presentation
......@@ -735,7 +737,9 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getLicense = function () {
var t = this;
var rdata = {
"c" : "getlicense"
"c" : "getlicense",
"id" : this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId()
};
sendCommand(this, function (response) {t._onGetLicense(response);}, rdata);
};
......@@ -802,6 +806,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
if(this.DocInfo){
documentId = this.DocInfo.get_Id();
documentUserId = this.DocInfo.get_UserId();
documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format();
......@@ -842,7 +847,17 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
if (documentId)
{
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Presentation, "c":"open", "url": documentUrl, "title": documentTitle, "embeddedfonts": this.isUseEmbeddedCutFonts};
var rData = {
"id":documentId,
"userid": documentUserId,
"format": documentFormat,
"vkey": documentVKey,
"editorid": c_oEditorId.Presentation,
"c":"open",
"url": documentUrl,
"title": documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts};
sendCommand( oThis, function(){}, rData );
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, this.WordControl.m_nZoomType);
......@@ -1427,7 +1442,13 @@ asc_docs_api.prototype.asc_OnSaveEnd = function (isDocumentSaved) {
//если нет совместного редактирования, надо всегда чистить кешированную копию файла, иначе будет всегда одна версия файла.
if(!this.CoAuthoringApi.get_onlineWork())
{
var rData = {"id": documentId, "vkey": documentVKey, "format": documentFormat, "c":"cc"};
var rData = {
"id": documentId,
"userid": documentUserId,
"vkey": documentVKey,
"format": documentFormat,
"c":"cc"};
sendCommand(this, function(){}, rData);
}
} else {
......@@ -1462,7 +1483,13 @@ asc_docs_api.prototype.Help = function(){
}
asc_docs_api.prototype.ClearCache = function(){
var rData = {"id":documentId, "vkey": documentVKey, "format": documentFormat, "c":"cc"};
var rData = {
"id":documentId,
"userid": documentUserId,
"vkey": documentVKey,
"format": documentFormat,
"c":"cc"};
sendCommand(editor, function(){}, rData);
}
asc_docs_api.prototype.startGetDocInfo = function(){
......@@ -1780,6 +1807,7 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
var oAdditionalData = new Object();
oAdditionalData["c"] = "save";
oAdditionalData["id"] = documentId;
oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = documentFormatSave;
oAdditionalData["innersave"] = true;
......@@ -2997,7 +3025,13 @@ asc_docs_api.prototype.AddImageUrl = function(url){
}
else
{
var rData = {"id":documentId, "vkey": documentVKey, "c":"imgurl", "data": url};
var rData = {
"id":documentId,
"userid": documentUserId,
"vkey": documentVKey,
"c":"imgurl",
"data": url};
var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand(this, function(incomeObject){
......@@ -4995,7 +5029,14 @@ function sendCommand(editor, fCallback, rdata){
editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress);
}
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Presentation, "c":"chopen"};
var rData = {
"id":documentId,
"userid": documentUserId,
"format": documentFormat,
"vkey": documentVKey,
"editorid": c_oEditorId.Presentation,
"c":"chopen"};
setTimeout( function(){sendCommand(editor, fCallback, rData)}, 3000);
break;
case "save":
......@@ -5003,7 +5044,14 @@ function sendCommand(editor, fCallback, rdata){
fCallback(incomeObject);
break;
case "waitsave":
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject["data"]};
var rData = {
"id":documentId,
"userid": documentUserId,
"vkey": documentVKey,
"title": documentTitleWithoutExtention,
"c":"chsave",
"data": incomeObject["data"]};
setTimeout( function(){sendCommand(editor, fCallback, rData)}, 3000);
break;
case "savepart":
......@@ -5054,6 +5102,7 @@ function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey)
var oAdditionalData = new Object();
oAdditionalData["c"] = "save";
oAdditionalData["id"] = documentId;
oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = filetype;
if(null != sSaveKey)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment