Compare commits

...

9 Commits

Author SHA1 Message Date
ea7e3c0f02 Fix bug #70332
Convert drawing to inline form when adding picture content control
2025-05-05 16:55:41 +03:00
1da45dde0e For bug #71640
Add subforms to a complex form with the role name of the complex form
2025-04-30 12:03:09 +03:00
4ac368daa0 Merge branch hotfix/v8.3.3 into release/v9.0.0 2025-04-21 09:08:04 +00:00
b8cbadfde6 Merge branch hotfix/v8.3.2 into release/v9.0.0 2025-04-01 08:39:13 +00:00
4732938f0a Merge branch hotfix/v8.3.2 into master 2025-03-19 12:50:23 +00:00
7505fadefe Fix bug #73572
Fix changing roles order
2025-03-17 18:32:49 +03:00
439c9b3085 [de] Don't translate default role name 2025-03-14 21:18:45 +03:00
f4d5a88be0 Merge pull request '[bu][plugins] Use Api in proto' (#2) from fix/bu-description into release/v9.0.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/sdkjs-forms/pulls/2
2025-03-06 11:36:13 +00:00
c8bff88071 [bu][plugins] Use Api in proto 2025-03-06 15:23:08 +07:00
6 changed files with 24 additions and 8 deletions

14
api.js
View File

@ -189,6 +189,17 @@ window["AscOForm"] = window.AscOForm = AscOForm;
let h = isSignature ? 32 / 72 * 25.4 : undefined;
var oCC = oLogicDocument.AddContentControlPicture(w, h);
// MSWord can't open files with anchored picture content controls (70332)
if (oCC && !oFormPr)
{
let allDrawings = oCC.GetAllDrawingObjects();
for (let i = 0; i < allDrawings.length; ++i)
{
allDrawings[i].MakeInline();
}
}
let oFormParaDrawing = null;
if (oCC && oFormPr)
{
@ -673,6 +684,9 @@ window["AscOForm"] = window.AscOForm = AscOForm;
form.SetFormPr(formPr.Copy());
if (!form.IsMainForm() && form.GetMainForm().GetFormRole() !== formPr.GetRole())
form.SetFormRole(form.GetMainForm().GetFormRole());
let docPartId = form.GetPlaceholder();
let glossary = logicDocument.GetGlossaryDocument();
if ((form.IsTextForm()

View File

@ -34,6 +34,8 @@
(function(window)
{
let Api = window["asc_docs_api"];
/**
* @typedef {Object} ContentControl
* Content control object.
@ -62,7 +64,7 @@
* @returns {ContentControl[]} - An array with all the forms from the document.
* @see office-js-api/Examples/Plugins/Forms/Api/Methods/GetAllForms.js
*/
window["asc_docs_api"].prototype["pluginMethod_GetAllForms"] = function()
Api.prototype["pluginMethod_GetAllForms"] = function()
{
let oFormsManager = this.private_GetFormsManager();
if (!oFormsManager)
@ -85,7 +87,7 @@
* @returns {ContentControl[]} - An array with all the forms from the document with the specified tag.
* @see office-js-api/Examples/Plugins/Forms/Api/Methods/GetFormsByTag.js
*/
window["asc_docs_api"].prototype["pluginMethod_GetFormsByTag"] = function(tag)
Api.prototype["pluginMethod_GetFormsByTag"] = function(tag)
{
let oFormsManager = this.private_GetFormsManager();
if (!oFormsManager)
@ -111,7 +113,7 @@
* @param {string | boolean} value - Form value to be set. Its type depends on the form type.
* @see office-js-api/Examples/Plugins/Forms/Api/Methods/SetFormValue.js
*/
window["asc_docs_api"].prototype["pluginMethod_SetFormValue"] = function(internalId, value)
Api.prototype["pluginMethod_SetFormValue"] = function(internalId, value)
{
this.private_SetFormValue(internalId, value);
};
@ -124,7 +126,7 @@
* @returns {null | string | boolean} The form value in the string or boolean format depending on the form type. The null value means that the form is filled with a placeholder.
* @see office-js-api/Examples/Plugins/Forms/Api/Methods/GetFormValue.js
*/
window["asc_docs_api"].prototype["pluginMethod_GetFormValue"] = function(internalId)
Api.prototype["pluginMethod_GetFormValue"] = function(internalId)
{
if (!AscCommon.g_oTableId)
return "";

View File

@ -568,7 +568,7 @@
this.OForm.onChangeRoles();
};
CDocument.prototype.onChangeFieldGroup = function(fieldGroup)
CDocument.prototype.onChangeFieldGroupFilled = function(fieldGroup)
{
if (!this.OForm)
return;

View File

@ -69,7 +69,7 @@
AscCommon.History.Add(new AscDFH.CChangesOFormFieldGroupFilled(this, this.Filled, isFilled));
this.Filled = isFilled;
this.onChange();
this.onChangeFilled();
};
CFieldGroup.prototype.setWeight = function(value)
{

View File

@ -124,7 +124,7 @@
CUserMaster.prototype.initDefaultUser = function()
{
// TODO: Возможно стоит придумать уникальный id общий для дефолтовой роли
this.setRole(AscCommon.translateManager.getValue("Anyone"));
this.setRole("Anyone");
this.setColor(255, 239, 191);
};
CUserMaster.prototype.compare = function(user)

View File

@ -137,7 +137,7 @@
function(value)
{
this.Class.Filled = value;
this.Class.onChange();
this.Class.onChangeFilled();
},
false
);