Skip to content
Snippets Groups Projects
Commit c8e7f615 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

ORG: Bild eingefügt

parent 6257cafa
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,10 @@
<name>IMAGE</name>
<contentType>IMAGE</contentType>
<valueProcess>%aditoprj%/entity/Org_entity/entityfields/image/valueProcess.js</valueProcess>
<onValueChange>%aditoprj%/entity/Org_entity/entityfields/image/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityFieldGroup>
<name>CUSTOMERCODE_DISPLAY_fieldGroup</name>
......@@ -378,6 +382,7 @@
<alias>Data_alias</alias>
<fromClauseProcess>%aditoprj%/entity/Org_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/Org_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBUpdate>%aditoprj%/entity/Org_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<linkInformation>
<linkInformation>
<name>ff0fa64f-4d73-49b3-bc02-02018392e838</name>
......
import("system.vars");
import("system.neon");
// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process
if (vars.get("$field.IMAGE"))
{
vars.set("$image.changedImage", true);
}
else
{
vars.set("$image.changedImage", "deleted");
}
This diff is collapsed.
import("system.vars");
import("Org_lib");
// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer
if (vars.exists("$image.changedImage"))
{
if (vars.get("$image.changedImage"))
{
var imageData = vars.getString("$field.IMAGE");
if (vars.get("$image.changedImage") != "deleted")
{
OrgUtils.setImage(vars.get("$field.ORGID"), imageData);
}
else
{
OrgUtils.removeImage(vars.get("$field.ORGID"));
}
}
}
vars.set("$image.changedImage", false);
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7">
<name>Org_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/Org_lib/process.js</process>
<alias>_____SYSTEMALIAS</alias>
</process>
import("Binary_lib");
/**
* a static Utility class for the Org context.
*
* Do not create an instance of this!
* @class
*/
function OrgUtils() {}
/**
* returns the image for a organisation
*
* @param {String} pOrgId the id of the organisation.
* @param {String} pDefaultText the text, to use for default image generation.
* @return {String} base64 coded String of the image. If none existed, the given String is used to create an image.
*/
OrgUtils.getImage = function(pOrgId, pDefaultText)
{
return ImageUtils.get("PERS", "IMAGE", pOrgId, pDefaultText);
}
/**
* sets the image of a organisation
*
* @param {String} pOrgId the id of the organisation.
* @param {String} pImageDateBase64 base64 coded String of the image.
* @return {Boolean} if image could be set
*/
OrgUtils.setImage = function(pOrgId, pImageDateBase64)
{
return ImageUtils.set("PERS", "IMAGE", pOrgId, pImageDateBase64, "OrgImage", "Image of the organisation");
}
/**
* deletes the image of a organisation
*
* @param {String} pOrgId the id of the organisation.
* @return {Boolean} if image could be removed
*/
OrgUtils.removeImage = function(pOrgId)
{
return ImageUtils.remove("PERS", "IMAGE", pOrgId);
}
import("system.logging");
import("Binary_lib");
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment