Skip to content
Snippets Groups Projects
Commit beb87262 authored by j.luginger's avatar j.luginger
Browse files

Merge origin/master into #1035025_SALUTATION

parents d7787f0a e4085849
No related branches found
No related tags found
No related merge requests found
Showing
with 209 additions and 52 deletions
......@@ -115,16 +115,11 @@
</entityField>
<entityField>
<name>UID</name>
<valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/uid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>ATTENDEESLENGTH</name>
</entityField>
<entityField>
<name>LINKOBJECT</name>
<title>Linkobject</title>
<consumer>Objects</consumer>
<linkedContext>Object</linkedContext>
</entityField>
<entityField>
<name>ICON</name>
</entityField>
......@@ -187,12 +182,6 @@
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>LINKTYPE</name>
<title>Linktype</title>
<consumer>Contexts</consumer>
<linkedContext>Context</linkedContext>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.vars");
import("system.result");
import("system.util");
if(!(vars.get("$field.UID")))
result.string(util.getNewUUID());
else
result.string(vars.get("$field.UID"));
\ No newline at end of file
......@@ -2,10 +2,10 @@ import("system.db");
import("system.result");
import("system.vars");
import("Attribute_lib");
import("Sql_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
var attrType = AttributeHandler.begin(attributeId).getAttributeType();
var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeType();
if (attrType == $AttributeTypes.COMBO)
result.string(AttributeUtil.getSimpleAttributeName(vars.get("$field.ID_VALUE")));
\ No newline at end of file
result.string(AttributeUtil.getSimpleAttributeName(vars.get("$field.ID_VALUE")));
else
result.string(vars.get("$field.ATTRIBUTERELATION_VALUE"));
......@@ -14,6 +14,5 @@ if (attrType == $AttributeTypes.COMBO)
.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.COMBOVALUE)
.buildSql("select AB_ATTRIBUTEID, ATTRIBUTE_NAME from AB_ATTRIBUTE");
var valueList = db.table(valueSql);
result.object(valueList);
}
\ No newline at end of file
}
......@@ -8,19 +8,19 @@ if (attrType != null) //load the value from the correct field for the type
{
switch (attrType)
{
case $AttributeTypes.TEXT:
case $AttributeTypes.TEXT.toString():
result.string(vars.get("$field.CHAR_VALUE"));
break;
case $AttributeTypes.DATE:
case $AttributeTypes.DATE.toString():
result.string(vars.get("$field.DATE_VALUE"));
break;
case $AttributeTypes.NUMBER:
case $AttributeTypes.NUMBER.toString():
result.string(vars.get("$field.NUMBER_VALUE"));
break;
case $AttributeTypes.BOOLEAN:
case $AttributeTypes.BOOLEAN.toString():
result.string(vars.get("$field.BOOL_VALUE"));
break;
case $AttributeTypes.COMBO:
case $AttributeTypes.COMBO.toString():
result.string(vars.get("$field.ID_VALUE"));
break;
}
......
......@@ -23,6 +23,7 @@
<title>Type</title>
<consumer>KeywordAttributeType</consumer>
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/displayValueProcess.js</displayValueProcess>
</entityField>
......
......@@ -2,4 +2,4 @@ import("system.vars");
import("system.result");
import("Attribute_lib");
result.string(AttributeUtil.getFullAttributeName(vars.get("$field.AB_ATTRIBUTEID")));
\ No newline at end of file
result.string(AttributeUtil.getFullAttributeName(vars.get("$field.AB_ATTRIBUTEID")));
import("system.db");
import("system.neon");
import("system.result");
import("system.vars");
import("Attribute_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.ATTRIBUTE_PARENT_ID") != "")
{
var type = AttributeHandler.begin(vars.get("$field.ATTRIBUTE_PARENT_ID")).getAttributeType();
if (type == $AttributeTypes.COMBO)
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
......@@ -7,24 +7,8 @@ import("Attribute_lib");
var condition = "AB_ATTRIBUTE.ATTRIBUTE_TYPE = '" + $AttributeTypes.GROUP + "'";
if (vars.exists("$param.attrParentId_param") && vars.get("$param.attrParentId_param"))
condition = "AB_ATTRIBUTE.AB_ATTRIBUTEID in ('" + getAllChildren(vars.getString("$param.attrParentId_param")).join("','") + "')";
condition = "AB_ATTRIBUTE.AB_ATTRIBUTEID in ('" + AttributeUtil.getAllChildren(vars.getString("$param.attrParentId_param")).join("','") + "')";
else if (vars.get("$param.attrParentId_param") !== "")
condition = "";
result.string(condition);
function getAllChildren (pAttributeId)
{
var childIds = [];
var attributes= [pAttributeId];
while (attributes.length > 0)
{
attributes = db.array(db.COLUMN, SqlCondition.begin()
.and("AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID in ('" + attributes.join("','") + "')")
.buildSql("select AB_ATTRIBUTEID from AB_ATTRIBUTE")
);
if (attributes.length > 0)
childIds = childIds.concat(attributes);
}
return childIds;
}
import("system.vars");
import("system.db");
import("Sql_lib");
import("Attribute_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTEID");
var usageCondition = SqlCondition.begin()
.andPrepare("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", attributeId)
var childIds = AttributeUtil.getAllChildren(attributeId).concat(attributeId);
var condition = SqlCondition.begin()
.and("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID in ('" + childIds.join("','") + "')")
.build();
//delete all entries in AB_ATTRIBUTEUSAGE belonging to the attribute to avoid unrelated entries
db.deleteData("AB_ATTRIBUTEUSAGE", usageCondition);
\ No newline at end of file
db.deleteData("AB_ATTRIBUTEUSAGE", condition);
condition = SqlCondition.begin()
.and("AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID in ('" + childIds.join("','") + "')")
.build();
//delete all entries in AB_ATTRIBUTERELATION for the attributes
db.deleteData("AB_ATTRIBUTERELATION", condition);
condition = SqlCondition.begin()
.and("AB_ATTRIBUTE.AB_ATTRIBUTEID in ('" + childIds.join("','") + "')")
.build();
//delete all attribute children
db.deleteData("AB_ATTRIBUTE", condition);
import("system.translate");
import("system.vars");
import("system.result");
import("Keyword_lib");
var cType = vars.get("$field.CONTRACTTYPE");
var cCode = vars.get("$field.CONTRACTCODE");
var contractType = KeywordUtils.getViewValue($KeywordRegistry.get.ContractType, vars.get("$field.CONTRACTTYPE"));
var contractCode = vars.get("$field.CONTRACTCODE");
result.string(KeywordUtils.getViewValue($KeywordRegistry.get.ContractType, cType) + " " + cCode);
\ No newline at end of file
result.string((contractType || translate.text("Contract")) + " " + contractCode);
\ No newline at end of file
......@@ -62,6 +62,7 @@
<fieldType>ACTION</fieldType>
<onActionProcess>%aditoprj%/entity/Document_entity/entityfields/document_actions/children/downloadfilesaction/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<isSelectionAction v="true" />
<iconId>VAADIN:DOWNLOAD</iconId>
</entityActionField>
</children>
......
......@@ -15,6 +15,8 @@
<name>CURRENCY</name>
<title>Currency</title>
<consumer>KeywordCurrencies</consumer>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/currency/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/currency/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>OFFERCODE</name>
......@@ -87,6 +89,7 @@
<name>HEADER</name>
<title>Cover letter</title>
<contentType>HTML</contentType>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/header/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>Offeritems</name>
......@@ -181,12 +184,14 @@
<title>Language</title>
<consumer>Languages</consumer>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/language/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/language/displayValueProcess.js</displayValueProcess>
</entityField>
<entityActionField>
<name>newOffer</name>
<name>copyOffer</name>
<fieldType>ACTION</fieldType>
<title>Copy offer</title>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/newoffer/onActionProcess.js</onActionProcess>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/copyoffer/onActionProcess.js</onActionProcess>
</entityActionField>
<entityField>
<name>VERSNR</name>
......@@ -198,6 +203,7 @@
<entityField>
<name>OFFER_ID</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/offer_id/documentation.adoc</documentation>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/offer_id/valueProcess.js</valueProcess>
</entityField>
<entityFieldGroup>
<name>OfferCode_VersNr_fieldgroup</name>
......@@ -229,10 +235,10 @@
<description>PARAMETER</description>
</entityParameter>
<entityActionField>
<name>offerReport</name>
<name>printOffer</name>
<fieldType>ACTION</fieldType>
<title>Offer report</title>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/offerreport/onActionProcess.js</onActionProcess>
<title>Print Offer</title>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/printoffer/onActionProcess.js</onActionProcess>
</entityActionField>
<entityField>
<name>CONTACT_ORG_ID</name>
......@@ -313,6 +319,8 @@
<title>Address</title>
<description></description>
<contentType>LONG_TEXT</contentType>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/address/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>ChosenAddress</name>
......@@ -395,6 +403,77 @@
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/newactivity/onActionProcess.js</onActionProcess>
<iconId>NEON:HISTORY</iconId>
</entityActionField>
<entityProvider>
<name>ContactOffers</name>
<fieldType>DEPENDENCY_IN</fieldType>
<dependencies>
<entityDependency>
<name>5c9720b5-1288-4a30-88fd-6dcff6359083</name>
<entityName>Person_entity</entityName>
<fieldName>Offers</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>ContactId_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>SalesprojectId_param</name>
<expose v="true" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>OfferCurrency_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferLanguage_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferHeader_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferOriginal_Id_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferAddress_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferCode_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>OfferVersnr_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -403,6 +482,7 @@
<maximumDbRows v="0" />
<fromClauseProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBInsert>%aditoprj%/entity/Offer_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
<onDBDelete>%aditoprj%/entity/Offer_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<linkInformation>
<linkInformation>
......
import("system.result");
import("system.vars");
if (vars.exists("$param.OfferAddress_param"))
{
result.string(vars.get("$param.OfferAddress_param"));
}
\ No newline at end of file
import("system.vars");
import("system.neon");
import("Offer_lib");
var contactId = vars.getString("$field.CONTACT_ID");
var currency = vars.getString("$field.CURRENCY");
var language = vars.getString("$field.LANGUAGE");
var header = vars.getString("$field.HEADER");
var offerId = vars.getString("$field.OFFERID");
OfferUtils.copyOffer(offerId, contactId, language, currency, header);
\ No newline at end of file
import("system.result");
import("system.vars");
import("Keyword_lib");
if (vars.exists("$param.OfferCurrency_param") && vars.get("$param.OfferCurrency_param"))
{
var currency = KeywordUtils.getViewValue($KeywordRegistry.get.Currency, vars.get("$param.OfferCurrency_param"));
result.string(currency);
}
\ No newline at end of file
import("system.result");
import("system.vars");
if (vars.exists("$param.OfferCurrency_param") && vars.get("$param.OfferCurrency_param"))
{
result.string(vars.get("$param.OfferCurrency_param"));
}
\ No newline at end of file
import("system.result");
import("system.vars");
if (vars.exists("$param.OfferHeader_param") && vars.get("$param.OfferHeader_param"))
{
result.string(vars.get("$param.OfferHeader_param"));
}
\ No newline at end of file
import("system.db");
import("system.translate");
import("system.result");
import("system.vars");
import("Sql_lib");
if (vars.exists("$param.OfferLanguage_param") && vars.get("$param.OfferLanguage_param"))
{
var iso3 = vars.get("$param.OfferLanguage_param");
var latinName = db.cell(SqlCondition.begin()
.andPrepare("AB_LANGUAGE.ISO3", iso3)
.buildSql("select NAME_LATIN from AB_LANGUAGE", "1=0"));
latinName = translate.text(latinName);
result.string(latinName);
}
\ No newline at end of file
import("system.result");
import("system.vars");
if (vars.exists("$param.OfferLanguage_param") && vars.get("$param.OfferLanguage_param"))
{
result.string(vars.get("$param.OfferLanguage_param"));
}
\ No newline at end of file
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