Commit 4f26ed19 authored by Oleg Korshul's avatar Oleg Korshul

add signatures view

parent a410e150
...@@ -240,8 +240,28 @@ window["asc_initAdvancedOptions"] = function(_code) ...@@ -240,8 +240,28 @@ window["asc_initAdvancedOptions"] = function(_code)
window["DesktopOfflineAppDocumentSignatures"] = function(_json) window["DesktopOfflineAppDocumentSignatures"] = function(_json)
{ {
var _editor = window["Asc"]["editor"] ? window["Asc"]["editor"] : window.editor;
_editor.signatures = [];
var _signatures = JSON.parse(_json); var _signatures = JSON.parse(_json);
console.log(_signatures); var _count = _signatures["count"];
var _data = _signatures["data"];
var _sign;
var _add_sign;
for (var i = 0; i < _count; i++)
{
_sign = _data[i];
_add_sign = new window["AscCommon"].asc_CSignarureLine();
_add_sign.guid = _sign["guid"];
_add_sign.valid = _sign["valid"];
_add_sign.image = (_add_sign.valid == 0) ? _sign["image_valid"] : _sign["image_invalid"];
_add_sign.signer1 = _sign["name"];
_add_sign.id = i;
_editor.signatures.push(_add_sign);
}
}; };
// меняем среду // меняем среду
......
...@@ -163,6 +163,8 @@ ...@@ -163,6 +163,8 @@
this.lastWorkTime = 0; this.lastWorkTime = 0;
this.signatures = [];
return this; return this;
} }
...@@ -1259,6 +1261,32 @@ ...@@ -1259,6 +1261,32 @@
}; };
// signatures
baseEditorsApi.prototype.asc_AddSignarureLine2 = function(_obj)
{
function s4() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); }
function guid() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); }
return this.asc_addSignatureLine(guid(), _obj.asc_getSigner1(), _obj.asc_getSigner2(), _obj.asc_getEmail());
};
baseEditorsApi.prototype.asc_Sign = function(guid)
{
if (window["AscDesktopEditor"])
window["AscDesktopEditor"]["Sign"](guid);
};
baseEditorsApi.prototype.asc_ViewSign = function(id)
{
if (window["AscDesktopEditor"])
window["AscDesktopEditor"]["ViewCertificate"](guid);
};
baseEditorsApi.prototype.asc_getSignatures = function()
{
return this.signatures;
};
baseEditorsApi.prototype.asc_getSignatureImage = function (sGuid) { baseEditorsApi.prototype.asc_getSignatureImage = function (sGuid) {
return ""; return "";
}; };
......
...@@ -121,6 +121,38 @@ ...@@ -121,6 +121,38 @@
View : 4 View : 4
}; };
function asc_CSignarureLine()
{
this.id = undefined;
this.guid = "";
this.signer1 = "";
this.signer2 = "";
this.email = "";
this.instructions = "";
this.showDate = false;
this.valid = 0;
this.image = "";
}
asc_CSignarureLine.prototype.asc_getId = function(){ return this.id; };
asc_CSignarureLine.prototype.asc_setId = function(v){ this.id = v; };
asc_CSignarureLine.prototype.asc_getGuid = function(){ return this.guid; };
asc_CSignarureLine.prototype.asc_setGuid = function(v){ this.guid = v; };
asc_CSignarureLine.prototype.asc_getSigner1 = function(){ return this.signer1; };
asc_CSignarureLine.prototype.asc_setSigner1 = function(v){ this.signer1 = v; };
asc_CSignarureLine.prototype.asc_getSigner2 = function(){ return this.signer2; };
asc_CSignarureLine.prototype.asc_setSigner2 = function(v){ this.signer2 = v; };
asc_CSignarureLine.prototype.asc_getEmail = function(){ return this.email; };
asc_CSignarureLine.prototype.asc_setEmail = function(v){ this.email = v; };
asc_CSignarureLine.prototype.asc_getInstructions = function(){ return this.instructions; };
asc_CSignarureLine.prototype.asc_setInstructions = function(v){ this.instructions = v; };
asc_CSignarureLine.prototype.asc_getShowDate = function(){ return this.showDate; };
asc_CSignarureLine.prototype.asc_setShowDate = function(v){ this.showDate = v; };
asc_CSignarureLine.prototype.asc_getValid = function(){ return this.valid; };
asc_CSignarureLine.prototype.asc_setValid = function(v){ this.valid = v; };
/** /**
* Класс asc_CAscEditorPermissions для прав редакторов * Класс asc_CAscEditorPermissions для прав редакторов
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
...@@ -3163,6 +3195,23 @@ ...@@ -3163,6 +3195,23 @@
prot['Comment'] = prot.Comment; prot['Comment'] = prot.Comment;
prot['View'] = prot.View; prot['View'] = prot.View;
window["AscCommon"]["asc_CSignarureLine"] = window["AscCommon"].asc_CSignarureLine = asc_CSignarureLine;
prot = asc_CSignarureLine.prototype;
prot["asc_getId"] = prot.asc_getId;
prot["asc_setId"] = prot.asc_setId;
prot["asc_getGuid"] = prot.asc_getGuid;
prot["asc_setGuid"] = prot.asc_setGuid;
prot["asc_getSigner1"] = prot.asc_getSigner1;
prot["asc_setSigner1"] = prot.asc_setSigner1;
prot["asc_getSigner2"] = prot.asc_getSigner2;
prot["asc_setSigner2"] = prot.asc_setSigner2;
prot["asc_getEmail"] = prot.asc_getEmail;
prot["asc_setEmail"] = prot.asc_setEmail;
prot["asc_getInstructions"] = prot.asc_getInstructions;
prot["asc_setInstructions"] = prot.asc_setInstructions;
prot["asc_getShowDate"] = prot.asc_getShowDate;
prot["asc_setShowDate"] = prot.asc_setShowDate;
window["AscCommon"].asc_CAscEditorPermissions = asc_CAscEditorPermissions; window["AscCommon"].asc_CAscEditorPermissions = asc_CAscEditorPermissions;
prot = asc_CAscEditorPermissions.prototype; prot = asc_CAscEditorPermissions.prototype;
prot["asc_getLicenseType"] = prot.asc_getLicenseType; prot["asc_getLicenseType"] = prot.asc_getLicenseType;
......
...@@ -3501,6 +3501,15 @@ background-repeat: no-repeat;\ ...@@ -3501,6 +3501,15 @@ background-repeat: no-repeat;\
} }
}; };
// signatures
asc_docs_api.prototype.asc_AddSignarureLine2 = function(_obj)
{
function s4() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); }
function guid() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); }
return this.asc_addSignatureLine(guid(), _obj.asc_getSigner1(), _obj.asc_getSigner2(), _obj.asc_getEmail());
};
asc_docs_api.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail) { asc_docs_api.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail) {
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Document_Content_Add)) if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Document_Content_Add))
{ {
...@@ -3519,6 +3528,20 @@ background-repeat: no-repeat;\ ...@@ -3519,6 +3528,20 @@ background-repeat: no-repeat;\
return this.WordControl.m_oLogicDocument.GetAllSignatures(); return this.WordControl.m_oLogicDocument.GetAllSignatures();
}; };
asc_docs_api.prototype.asc_Sign = function(guid)
{
if (window["AscDesktopEditor"])
window["AscDesktopEditor"]["Sign"](guid);
};
asc_docs_api.prototype.asc_ViewSign = function(id)
{
if (window["AscDesktopEditor"])
window["AscDesktopEditor"]["ViewSertificate"](guid);
};
//////////////////////////////////////////////////////////////////////////
asc_docs_api.prototype.IncreaseIndent = function() asc_docs_api.prototype.IncreaseIndent = function()
{ {
this.WordControl.m_oLogicDocument.IncreaseIndent(); this.WordControl.m_oLogicDocument.IncreaseIndent();
...@@ -8244,6 +8267,12 @@ background-repeat: no-repeat;\ ...@@ -8244,6 +8267,12 @@ background-repeat: no-repeat;\
// signatures
asc_docs_api.prototype["asc_AddSignarureLine2"] = asc_docs_api.prototype.asc_AddSignarureLine2;
asc_docs_api.prototype["asc_Sign"] = asc_docs_api.prototype.asc_Sign;
asc_docs_api.prototype["asc_ViewSign"] = asc_docs_api.prototype.asc_ViewSign;
asc_docs_api.prototype["asc_getSignatures"] = asc_docs_api.prototype.asc_getSignatures;
CDocInfoProp.prototype['get_PageCount'] = CDocInfoProp.prototype.get_PageCount; CDocInfoProp.prototype['get_PageCount'] = CDocInfoProp.prototype.get_PageCount;
CDocInfoProp.prototype['put_PageCount'] = CDocInfoProp.prototype.put_PageCount; CDocInfoProp.prototype['put_PageCount'] = CDocInfoProp.prototype.put_PageCount;
CDocInfoProp.prototype['get_WordsCount'] = CDocInfoProp.prototype.get_WordsCount; CDocInfoProp.prototype['get_WordsCount'] = CDocInfoProp.prototype.get_WordsCount;
......
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