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; ...@@ -3,6 +3,7 @@ var ASC_DOCS_API_DEBUG = true;
var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var documentId = undefined; var documentId = undefined;
var documentUserId = undefined;
var documentUrl = 'null'; var documentUrl = 'null';
var documentTitle = 'null'; var documentTitle = 'null';
var documentTitleWithoutExtention = 'null'; var documentTitleWithoutExtention = 'null';
...@@ -720,6 +721,7 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() ...@@ -720,6 +721,7 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
var rData = { var rData = {
"c" : "getsettings", "c" : "getsettings",
"id" : this.DocInfo.get_Id(), "id" : this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId(),
"format" : this.DocInfo.get_Format(), "format" : this.DocInfo.get_Format(),
"vkey" : this.DocInfo.get_VKey(), "vkey" : this.DocInfo.get_VKey(),
"editorid" : c_oEditorId.Presentation "editorid" : c_oEditorId.Presentation
...@@ -735,7 +737,9 @@ asc_docs_api.prototype.asc_getEditorPermissions = function() ...@@ -735,7 +737,9 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getLicense = function () { asc_docs_api.prototype.asc_getLicense = function () {
var t = this; var t = this;
var rdata = { var rdata = {
"c" : "getlicense" "c" : "getlicense",
"id" : this.DocInfo.get_Id(),
"userid" : this.DocInfo.get_UserId()
}; };
sendCommand(this, function (response) {t._onGetLicense(response);}, rdata); sendCommand(this, function (response) {t._onGetLicense(response);}, rdata);
}; };
...@@ -802,6 +806,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -802,6 +806,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
if(this.DocInfo){ if(this.DocInfo){
documentId = this.DocInfo.get_Id(); documentId = this.DocInfo.get_Id();
documentUserId = this.DocInfo.get_UserId();
documentUrl = this.DocInfo.get_Url(); documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
...@@ -842,7 +847,17 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -842,7 +847,17 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
if (documentId) if (documentId)
{ {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); 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 ); sendCommand( oThis, function(){}, rData );
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, this.WordControl.m_nZoomType); this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, this.WordControl.m_nZoomType);
...@@ -1427,7 +1442,13 @@ asc_docs_api.prototype.asc_OnSaveEnd = function (isDocumentSaved) { ...@@ -1427,7 +1442,13 @@ asc_docs_api.prototype.asc_OnSaveEnd = function (isDocumentSaved) {
//если нет совместного редактирования, надо всегда чистить кешированную копию файла, иначе будет всегда одна версия файла. //если нет совместного редактирования, надо всегда чистить кешированную копию файла, иначе будет всегда одна версия файла.
if(!this.CoAuthoringApi.get_onlineWork()) 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); sendCommand(this, function(){}, rData);
} }
} else { } else {
...@@ -1462,7 +1483,13 @@ asc_docs_api.prototype.Help = function(){ ...@@ -1462,7 +1483,13 @@ asc_docs_api.prototype.Help = function(){
} }
asc_docs_api.prototype.ClearCache = 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); sendCommand(editor, function(){}, rData);
} }
asc_docs_api.prototype.startGetDocInfo = function(){ asc_docs_api.prototype.startGetDocInfo = function(){
...@@ -1780,6 +1807,7 @@ asc_docs_api.prototype.onSaveCallback = function (e) { ...@@ -1780,6 +1807,7 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
var oAdditionalData = new Object(); var oAdditionalData = new Object();
oAdditionalData["c"] = "save"; oAdditionalData["c"] = "save";
oAdditionalData["id"] = documentId; oAdditionalData["id"] = documentId;
oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey; oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = documentFormatSave; oAdditionalData["outputformat"] = documentFormatSave;
oAdditionalData["innersave"] = true; oAdditionalData["innersave"] = true;
...@@ -2997,7 +3025,13 @@ asc_docs_api.prototype.AddImageUrl = function(url){ ...@@ -2997,7 +3025,13 @@ asc_docs_api.prototype.AddImageUrl = function(url){
} }
else 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; var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand(this, function(incomeObject){ sendCommand(this, function(incomeObject){
...@@ -4995,7 +5029,14 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -4995,7 +5029,14 @@ function sendCommand(editor, fCallback, rdata){
editor._lastConvertProgress = incomeObject["data"] / 2; editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress); 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); setTimeout( function(){sendCommand(editor, fCallback, rData)}, 3000);
break; break;
case "save": case "save":
...@@ -5003,7 +5044,14 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -5003,7 +5044,14 @@ function sendCommand(editor, fCallback, rdata){
fCallback(incomeObject); fCallback(incomeObject);
break; break;
case "waitsave": 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); setTimeout( function(){sendCommand(editor, fCallback, rData)}, 3000);
break; break;
case "savepart": case "savepart":
...@@ -5054,6 +5102,7 @@ function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey) ...@@ -5054,6 +5102,7 @@ function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey)
var oAdditionalData = new Object(); var oAdditionalData = new Object();
oAdditionalData["c"] = "save"; oAdditionalData["c"] = "save";
oAdditionalData["id"] = documentId; oAdditionalData["id"] = documentId;
oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey; oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = filetype; oAdditionalData["outputformat"] = filetype;
if(null != sSaveKey) 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