Skip to content
Snippets Groups Projects
Commit 74f0349f authored by A.Voegl's avatar A.Voegl
Browse files

Merge origin/master into KeywordMigration

Conflicts:
	entity/Offer_entity/Offer_entity.aod
	entity/Organisation_entity/Organisation_entity.aod
	entity/Salesproject_entity/Salesproject_entity.aod
	entity/Task_entity/Task_entity.aod
	others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry.xml
	others/db_changes/masterChangelog.xml
parents 115e64d5 e5f863eb
No related branches found
No related tags found
No related merge requests found
Showing
with 258 additions and 44 deletions
import("system.translate");
import("system.result");
import("system.db");
import("system.vars");
import("Sql_lib");
import("Entity_lib");
var container = vars.get("$field.CONTAINER");
var keyId = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.KEYID")).trim();
//a KEY has always to be unique within one container and since the user can specify the key on insert we've to ensure that it's unique
if (container && keyId)
{
var selfEntryId = vars.get("$field.AB_KEYWORD_ENTRYID");
var sqlMasks = new SqlMaskingUtils();
var alreadyExistsSql = SqlCondition.begin()
.andPrepare(sqlMasks.trim("AB_KEYWORD_ENTRY.KEYID"), keyId, null, SqlUtils.getSingleColumnType("AB_KEYWORD_ENTRY", "KEYID"))
.andPrepare("AB_KEYWORD_ENTRY.CONTAINER", container)
.andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", selfEntryId, "# != ?")
.buildSql("select AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID from AB_KEYWORD_ENTRY");
var alreadyExistantEntryId = db.cell(alreadyExistsSql);
if (alreadyExistantEntryId != "")
result.string(translate.text("the specified key has to be unique for that container but does already exist"));
}
\ No newline at end of file
......@@ -3,5 +3,5 @@ import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
result.string(util.getNewUUID());
\ No newline at end of file
......@@ -2,5 +2,6 @@ Used for sorting keyword-entries within a keyword-container.
[NOTE]
====
Currently this cannot be set (it's *READONLY*) - the value is generated automatically. Reserved for future use.
Currently this field can be edited - the value is generated automatically on save if the value has not been set by the user.
For future implementations this behavior may change (sorting may be done by drag and drop or similar)
====
import("Sql_lib");
import("system.db");
var cond = SqlCondition.begin().andPrepareVars("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID", "$field.AB_KEYWORD_ENTRYID").build("1=2");
db.deleteData("AB_KEYWORD_ATTRIBUTERELATION", cond);
\ No newline at end of file
import("system.translate");
import("system.db");
import("system.vars");
import("system.text");
import("system.neon");
import("Sql_lib");
var changedFields = vars.get("$local.changed");
//whenever the container is changed data that depends on the keyword-container has be "fixed" to keep consistency
//this could be information like Keyword-attributes or the sorting-position
// TODO: maybe it'd be better to lock KeywordContainer as read-only after creation
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && changedFields.indexOf("AB_KEYWORD_ENTRY.CONTAINER") > -1)
{
var keyContainer = vars.get("$field.CONTAINER");
if (keyContainer)
{
var cond = SqlCondition.begin().andPrepare("AB_KEYWORD_ENTRY.CONTAINER", keyContainer);
var maskingHelper = new SqlMaskingUtils();
var newCodeNumber = db.cell(cond.buildSql("select " + maskingHelper.max("AB_KEYWORD_ENTRY.SORTING") + " from AB_KEYWORD_ENTRY", "1 = 2"));
newCodeNumber = Number(newCodeNumber);//if no number exists till no, start value will be 1 (due to: ++0)
if (isNaN(newCodeNumber))
throw new TypeError(translate.text("The code number is not a valid number."));
var cols = ["SORTING"];
var vals = [++newCodeNumber];
cond.clear().andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", vars.get("$sys.uid"));
db.updateData("AB_KEYWORD_ENTRY", cols, null, vals, cond.build("1 = 2"));
}
}
\ No newline at end of file
......@@ -40,7 +40,9 @@
<linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/linkedContextProcess.js</linkedContextProcess>
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/titleProcess.js</titleProcess>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>OBJECT2_TYPE</name>
......@@ -153,6 +155,14 @@
<targetIdField>OBJECT2_ROWID</targetIdField>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc</documentation>
<recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>cb49ee3d-4497-4edc-90b6-82d397464f75</name>
<entityName>Organisation_entity</entityName>
<fieldName>TaskObjectRelations</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>AnyObjectRowid_param</name>
......@@ -165,7 +175,7 @@
<entityParameter>
<name>Object1Rowid_param</name>
<expose v="true" />
<mandatory v="true" />
<mandatory v="false" />
</entityParameter>
<entityParameter>
<name>Object1Type_param</name>
......@@ -175,7 +185,7 @@
<entityParameter>
<name>Object2Rowid_param</name>
<expose v="true" />
<mandatory v="true" />
<mandatory v="false" />
</entityParameter>
<entityParameter>
<name>Object2Type_param</name>
......@@ -211,8 +221,8 @@
<entityProvider>
<name>AnyObject</name>
<fieldType>DEPENDENCY_IN</fieldType>
<targetContextField>AnyTargetType</targetContextField>
<targetIdField>AnyTargetRowid</targetIdField>
<targetContextField>AnyObjectType</targetContextField>
<targetIdField>AnyObjectRowid</targetIdField>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc</documentation>
<recordContainer>db</recordContainer>
<dependencies>
......@@ -311,12 +321,25 @@
</children>
</entityConsumer>
<entityField>
<name>AnyTargetRowid</name>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js</valueProcess>
<name>AnyObjectRowid</name>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/documentation.adoc</documentation>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>AnyObjectType</name>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/documentation.adoc</documentation>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/displayValueProcess.js</displayValueProcess>
</entityField>
<entityParameter>
<name>Object2RowidTitle_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>AnyTargetType</name>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js</valueProcess>
<name>EMPTY</name>
</entityField>
</entityFields>
<recordContainers>
......
import("system.db");
import("system.result");
import("system.vars");
import("Context_lib");
if (vars.exists("$field.AnyObjectType") && vars.get("$field.AnyObjectType") && vars.exists("$field.AnyObjectRowid") && vars.get("$field.AnyObjectRowid"))
{
result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.AnyObjectType"), vars.get("$field.AnyObjectRowid"))));
}
This field is only filled when using the AnyObject Provider.
Calculates the opposite side of the given AnyObject parameters.
import("system.project");
import("system.result");
import("system.vars");
if (vars.exists("$field.AnyObjectType") && vars.get("$field.AnyObjectType"))
{
result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.AnyObjectType"))[1]);
}
\ No newline at end of file
This field is only filled when using the AnyObject Provider.
Calculates the opposite side of the given AnyObject parameters.
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.vars");
......@@ -14,11 +15,13 @@ if (vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_
// anyObject and object 1 == opened object --> target is object2
if (vars.get("$field.OBJECT1_ROWID") == openedRowid && vars.get("$field.OBJECT1_TYPE") == openedType)
{
logging.log(vars.get("$field.OBJECT2_TYPE"))
result.string(vars.get("$field.OBJECT2_TYPE"));
}
// anyObject and object 2 == opened object --> target is object1
else if (vars.get("$field.OBJECT2_ROWID") == openedRowid && vars.get("$field.OBJECT2_TYPE") == openedType)
{
logging.log(vars.get("$field.OBJECT1_TYPE"))
result.string(vars.get("$field.OBJECT1_TYPE"));
}
}
......
import("system.neon");
import("system.vars");
import("system.result");
import("system.db");
import("Context_lib");
var recordstate = vars.get("$sys.recordstate");
if (recordstate == neon.OPERATINGSTATE_EDIT)
{
if (vars.exists("$field.OBJECT1_ROWID") && vars.get("$field.OBJECT1_ROWID") && vars.exists("$field.OBJECT1_TYPE") && vars.get("$field.OBJECT1_TYPE"))
{
result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.OBJECT1_TYPE"), vars.get("$field.OBJECT1_ROWID"))));
}
}
\ No newline at end of file
import("system.translate");
import("system.vars");
import("system.result");
import("Context_lib");
result.string(vars.exists("$param.Object2RowidTitle_param") ? vars.get("$param.Object2RowidTitle_param") : "Object 2");
\ No newline at end of file
......@@ -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>
......@@ -383,6 +391,104 @@
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>Activities</name>
<title>Activities</title>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Activity_entity</entityName>
<fieldName>LinkedObjects</fieldName>
</dependency>
<children>
<entityParameter>
<name>ObjectId_param</name>
<code>%aditoprj%/entity/Offer_entity/entityfields/activities/children/objectid_param/code.js</code>
</entityParameter>
<entityParameter>
<name>RowId_param</name>
<code>%aditoprj%/entity/Offer_entity/entityfields/activities/children/rowid_param/code.js</code>
</entityParameter>
</children>
</entityConsumer>
<entityActionField>
<name>newActivity</name>
<fieldType>ACTION</fieldType>
<title>New activity</title>
<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>
......@@ -391,6 +497,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("Context_lib");
result.string(ContextUtils.getCurrentContextId());
\ No newline at end of file
import("system.result");
import("system.vars");
result.string(vars.get("$field.OFFERID"));
\ No newline at end of file
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
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