diff --git a/.aditoprj/project.version b/.aditoprj/project.version index 817464665829f12fb65f86361d53a94a319aa3a7..e2deba5a713985f7b57474c4976932b2bcfa097e 100644 --- a/.aditoprj/project.version +++ b/.aditoprj/project.version @@ -1,3 +1,3 @@ #This file is generated by ADITO designer. Do NOT delete or modify! -#Wed Apr 03 07:50:41 CEST 2019 -version=5.1.10 +#Thu Apr 04 07:54:23 CEST 2019 +version=5.1.11 diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b4cb0e41a13b48bacb75b77b3e9ab50b0a32a67 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ +<component name="InspectionProjectProfileManager"> + <profile version="1.0"> + <option name="myName" value="Project Default" /> + <inspection_tool class="LossyEncoding" enabled="false" level="WARNING" enabled_by_default="false" /> + </profile> +</component> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 0f68cca8156f81830e7545d18e619ab3b6851a07..fb634569f2d2d3b7e26d44bcd45633d5ac5eb4d6 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -108,9 +108,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -122,9 +122,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -253,7 +253,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <title></title> <description></description> </entityFieldDb> @@ -317,9 +317,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -345,9 +345,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -516,9 +516,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -544,9 +544,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -739,7 +739,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <title></title> <description></description> <dependencies> @@ -767,9 +767,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -795,9 +795,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -860,7 +860,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <title></title> <description></description> </entityFieldDb> @@ -873,7 +873,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <title></title> <description></description> <dependencies> @@ -1297,9 +1297,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -1325,9 +1325,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -2138,9 +2138,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -2166,9 +2166,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -3467,9 +3467,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -3495,9 +3495,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -4047,7 +4047,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -4117,7 +4117,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -4309,6 +4309,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>INFO</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="2005" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -4576,20 +4590,6 @@ <title></title> <description></description> </entityFieldDb> - <entityFieldDb> - <name>BOOL_VALUE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="5" /> - <size v="5" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <documentation></documentation> - <title></title> - <description></description> - </entityFieldDb> <entityFieldDb> <name>DATE_VALUE</name> <dbName></dbName> @@ -4651,7 +4651,7 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="12" /> - <size v="63" /> + <size v="512" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> @@ -4689,12 +4689,12 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>MEMO_VALUE</name> + <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="2005" /> - <size v="2147483647" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -4703,11 +4703,11 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>DATE_EDIT</name> + <name>USER_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> + <columnType v="12" /> + <size v="50" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> @@ -4717,13 +4717,13 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>USER_EDIT</name> + <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> - <size v="50" /> - <scale v="0" /> - <notNull v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -4731,11 +4731,11 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>DATE_NEW</name> + <name>USER_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> + <columnType v="12" /> + <size v="50" /> <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> @@ -4745,13 +4745,13 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>USER_NEW</name> + <name>INT_VALUE</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> - <size v="50" /> + <columnType v="4" /> + <size v="10" /> <scale v="0" /> - <notNull v="true" /> + <notNull v="false" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -4814,7 +4814,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -4837,9 +4837,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -4851,9 +4851,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -4931,7 +4931,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -5137,7 +5137,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -5254,7 +5254,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -5419,7 +5419,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -5514,6 +5514,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>HIERARCHY</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -5940,6 +5954,68 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>TEST</name> + <dbName></dbName> + <idColumn>TESTID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>TEST2</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TESTID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TEST1</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> <entityDb> <name>CAMPAIGNPARTICIPANT</name> <dbName></dbName> diff --git a/aliasDefinition/Data_alias/indexsearchgroups/contract/query.js b/aliasDefinition/Data_alias/indexsearchgroups/contract/query.js index d10d2a6fac72a181df3979be5e857620e0846cc3..c80b55a38be25139beeefac4cbcbeb4b08a88cad 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/contract/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/contract/query.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.result"); import("system.vars"); import("system.calendars"); @@ -17,7 +18,8 @@ sqlHelper = new SqlMaskingUtils(); sqlQuery = "select CONTRACTID, " + sqlHelper.concat(["CONTRACTCODE", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractStatus(), "CONTRACTSTATUS")], " | ") + " as TITLECOLUMN, " - + sqlHelper.concat(["ORGANISATION.NAME", "'| Contract Type: '", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractType(), "CONTRACTTYPE")]) //TODO: translation in index? + + sqlHelper.concat(["ORGANISATION.NAME", "'| " + translate.text("Type of contract") + ":'", + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractType(), "CONTRACTTYPE")]) + " as DESCCOLUMN, CONTRACTCODE, ORGANISATION.NAME, CUSTOMERCODE " + " from CONTRACT " + " join CONTACT on CONTRACT.CONTACT_ID = CONTACTID " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js b/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js index 1244f85e0fed5fdd4527c1a99b60bdcfdbd5cd1e..edc6c63a6391c12b33b79fee916d3ecd17515e15 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js @@ -1,3 +1,5 @@ +import("system.SQLTYPES"); +import("system.translate"); import("system.result"); import("system.vars"); import("system.calendars"); @@ -15,9 +17,9 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select OFFERID, " - + sqlHelper.concat(["cast(OFFERCODE as CHAR(10)) ", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ") + + sqlHelper.concat([sqlHelper.cast("OFFERCODE", SQLTYPES.CHAR, 10), KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ") + " as TITLECOLUMN, " - + sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) + + sqlHelper.concat(["ORGANISATION.NAME"], " | ") // "'" + translate.text("Description") + ":'", sqlHelper.castLob("OFFER.INFO", 256) + " as DESCCOLUMN, OFFERCODE, ORGANISATION.NAME, CUSTOMERCODE " + " from OFFER " + " join CONTACT on OFFER.CONTACT_ID = CONTACTID " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js b/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js index 0480b06a5f4a5fbfa7c71cd85fa8e9fa26400045..791c356592a9b881be9e598b9a5ba50cd7c86bab 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js @@ -1,8 +1,10 @@ +import("system.translate"); import("system.result"); import("system.vars"); import("system.calendars"); import("system.db"); import("Sql_lib"); +import("Communication_lib"); var sqlQuery, sqlHelper, queryCondition, affectedIds; if (vars.exists("$local.idvalue")) { @@ -15,9 +17,11 @@ sqlQuery = "select CONTACT.CONTACTID " + "," + sqlHelper.concat(["ORGANISATION.NAME", "'|'", "ORGANISATION.CUSTOMERCODE"]) + " as TITLECOLUMN " + "," + sqlHelper.concat([ - sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) - ,sqlHelper.concat(["defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) - ], " - ") + " as DESCCOLUMN " + sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO", "'-'" + ,"defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) + ,sqlHelper.concat(["'" + translate.text("Phone") + ":'", CommUtil.getStandardSubSqlPhone("CONTACTID")]) + ,sqlHelper.concat(["'" + translate.text("Email") + ":'", CommUtil.getStandardSubSqlMail("CONTACTID")]) + ], " | ") + " as DESCCOLUMN " //additional indexed fields + ",ORGANISATION.NAME, COMMUNICATION.ADDR " + " from ORGANISATION " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/person/query.js b/aliasDefinition/Data_alias/indexsearchgroups/person/query.js index 32e581b155214d82537f61f44d0528912ad8f7eb..44981a5fe2a7c0a2510485756b7d3ef523f743d2 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/person/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/person/query.js @@ -1,8 +1,11 @@ +import("system.translate"); import("system.result"); import("system.vars"); import("system.calendars"); import("system.db"); import("Sql_lib"); +import("Communication_lib"); + var sqlQuery, sqlHelper, queryCondition, affectedIds; if (vars.exists("$local.idvalue")) { affectedIds = vars.get("$local.idvalue"); @@ -14,9 +17,11 @@ sqlQuery = "select CONTACT.CONTACTID " + "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "'|'", "ORGANISATION.NAME"]) + " as TITLECOLUMN " + "," + sqlHelper.concat([ - sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) - ,sqlHelper.concat(["defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) - ], " - ") + " as DESCCOLUMN " + sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO", "'-'" + ,"defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) + ,sqlHelper.concat(["'" + translate.text("Phone") + ":'", CommUtil.getStandardSubSqlPhone("CONTACTID")]) + ,sqlHelper.concat(["'" + translate.text("Email") + ":'", CommUtil.getStandardSubSqlMail("CONTACTID")]) + ], " | ") + " as DESCCOLUMN " //additional indexed fields + ",ORGANISATION.NAME, COMMUNICATION.ADDR " + " from PERSON " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js b/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js index 02db43bf565a08088d3f2c3141b58f5a530a25bf..b3953edcbdba55a383ccbf7336ed9493f7c79617 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js @@ -1,8 +1,11 @@ +import("system.SQLTYPES"); import("system.result"); import("system.vars"); import("system.calendars"); import("system.db"); import("Sql_lib"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); var sqlQuery, sqlHelper, queryCondition, affectedIds; queryCondition = ""; @@ -13,8 +16,9 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select SALESORDERID, " - + " SALESORDERCODE as TITLECOLUMN, " - + sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) + + sqlHelper.concat([sqlHelper.cast("SALESORDERCODE", SQLTYPES.CHAR, 10), KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesorderState(), "SALESORDER.STATUS")], " | ") + + " as TITLECOLUMN, " + + sqlHelper.concat(["ORGANISATION.NAME"], " | ") + " as DESCCOLUMN, SALESORDERCODE, ORGANISATION.NAME, CUSTOMERCODE " + " from SALESORDER " + " join CONTACT on SALESORDER.CONTACT_ID = CONTACTID " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/salesproject/query.js b/aliasDefinition/Data_alias/indexsearchgroups/salesproject/query.js index e03985eafd0631e8451fb505e7a0ac5e1d5e15fa..b5db958b18fdb85576d0ee3ce7e7a929188e9297 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/salesproject/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/salesproject/query.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.result"); import("system.vars"); import("system.calendars"); @@ -16,8 +17,8 @@ if (vars.exists("$local.idvalue")) { sqlHelper = new SqlMaskingUtils(); sqlQuery = "select SALESPROJECTID, PROJECTTITLE as TITLECOLUMN, " + sqlHelper.concat([ - "'Status: '", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectState(), "STATE"), - "'| Phase: '", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectPhase(), "PHASE") + "'" + translate.text("Status") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectState(), "STATE"), + "'| " + translate.text("Phase") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectPhase(), "PHASE") ]) + " as DESCCOLUMN, PROJECTCODE " + " from SALESPROJECT " diff --git a/entity/Activity_entity/entityfields/creator/valueProcess.js b/entity/Activity_entity/entityfields/creator/valueProcess.js index b8bc2d05397d92e47cf8c606c6ff8d5099f73ecf..a95c59aa0b3b800aa722f4da67d502dd69d18ae9 100644 --- a/entity/Activity_entity/entityfields/creator/valueProcess.js +++ b/entity/Activity_entity/entityfields/creator/valueProcess.js @@ -1,7 +1,7 @@ -import("system.neon"); -import("system.vars"); -import("system.result"); -import("Employee_lib"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +import("system.neon"); +import("system.vars"); +import("system.result"); +import("Employee_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) result.string(EmployeeUtils.getCurrentContactId()); \ No newline at end of file diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index 334ba18c6430270f1216494357448658421ed531..76217f3083ad4b778071b258c87b84857d5140a7 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -21,6 +21,7 @@ </entityField> <entityField> <name>ADDRIDENTIFIER</name> + <title>{$ADDRESS_IDENTIFIER}</title> </entityField> <entityField> <name>ADDR_TYPE</name> @@ -104,6 +105,7 @@ </entityProvider> <entityParameter> <name>ContactId_param</name> + <valueProcess>%aditoprj%/entity/Address_entity/entityfields/contactid_param/valueProcess.js</valueProcess> <expose v="true" /> <mandatory v="true" /> <documentation>%aditoprj%/entity/Address_entity/entityfields/contactid_param/documentation.adoc</documentation> @@ -141,6 +143,10 @@ <name>DefaultAddressId_param</name> <expose v="true" /> </entityParameter> + <entityParameter> + <name>OrganisationId_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityProvider> @@ -188,6 +194,7 @@ </entityField> <entityParameter> <name>DefaultAddressId_param</name> + <valueProcess>%aditoprj%/entity/Address_entity/entityfields/defaultaddressid_param/valueProcess.js</valueProcess> <expose v="true" /> <mandatory v="false" /> <documentation>%aditoprj%/entity/Address_entity/entityfields/defaultaddressid_param/documentation.adoc</documentation> @@ -210,6 +217,12 @@ <fieldName>ContactAndOrganisationAddresses</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>daa41953-8e95-46f2-b08a-6c843ab87985</name> + <entityName>Offer_entity</entityName> + <fieldName>PossibleAddresses</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -222,7 +235,10 @@ </entityParameter> <entityParameter> <name>OrganisationId_param</name> + <title></title> + <valueProcess>%aditoprj%/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/valueProcess.js</valueProcess> <expose v="true" /> + <documentation>%aditoprj%/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/documentation.adoc</documentation> </entityParameter> <entityParameter> <name>ContactId_param</name> @@ -266,12 +282,20 @@ <name>DATE_EDIT</name> <valueProcess>%aditoprj%/entity/Address_entity/entityfields/date_edit/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>IS_STANDARD_ICON</name> + <title>Standard</title> + <contentType>IMAGE</contentType> + <contentTypeProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard_icon/contentTypeProcess.js</contentTypeProcess> + <valueProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard_icon/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> <name>db</name> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Address_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Address_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <onDBInsert>%aditoprj%/entity/Address_entity/recordcontainers/db/onDBInsert.js</onDBInsert> <linkInformation> <linkInformation> diff --git a/entity/Address_entity/entityfields/contactid_param/valueProcess.js b/entity/Address_entity/entityfields/contactid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Address_entity/entityfields/defaultaddressid_param/valueProcess.js b/entity/Address_entity/entityfields/defaultaddressid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9c5d394a1a55a336b53ea24c4bbe5cc5afa53be7 --- /dev/null +++ b/entity/Address_entity/entityfields/defaultaddressid_param/valueProcess.js @@ -0,0 +1,20 @@ +import("Sql_lib"); +import("system.db"); +import("system.result"); +import("system.vars"); + +//this organisationId param is optional which means: +//if it's not given for the "OrganisationAndContactAddresses"-provider we've to find the orgId by the passed CONTACTID +//the reason behind this is: whenever the consuming entity can provide the organisationid it should provide the id to improve performance +//(since we[Address_entity] have not to find out the value our own) +//but if the consuming entity does not have the value we[Address_entity] will do it for the sake of simpler usage + +var contactId = vars.get("$param.ContactId_param"); +if (contactId) +{ + var sql = SqlCondition.begin() + .andPrepare("CONTACT.CONTACTID", contactId) + .buildSql("select CONTACT.ADDRESS_ID from CONTACT"); + var organisationId = db.cell(sql); + result.string(organisationId); +} \ No newline at end of file diff --git a/entity/Address_entity/entityfields/is_standard/documentation.adoc b/entity/Address_entity/entityfields/is_standard/documentation.adoc index fb7d4bac8de251235814acac61084c0f44919064..6a7186b4676561a755c46356e525477ed0c6ea28 100644 --- a/entity/Address_entity/entityfields/is_standard/documentation.adoc +++ b/entity/Address_entity/entityfields/is_standard/documentation.adoc @@ -1,3 +1,3 @@ The `IS_STANDARD` field specifies if an ADDRESS is the standard address (see Address_entity documentation) - -However that information is not stored directly in the `ADDRESS` database table. Every `CONTACT`-record has an own standard address. \ No newline at end of file +However that information is not stored directly in the `ADDRESS` database table. Every `CONTACT`-record has an own standard address. +This fields works only correct if `DefaultAddressId_param` is passed. \ No newline at end of file diff --git a/entity/Address_entity/entityfields/is_standard_icon/contentTypeProcess.js b/entity/Address_entity/entityfields/is_standard_icon/contentTypeProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2c348afa93c82ff8f11312242f9eb36fcd174111 --- /dev/null +++ b/entity/Address_entity/entityfields/is_standard_icon/contentTypeProcess.js @@ -0,0 +1,10 @@ +import("system.vars"); +import("system.result"); + +var isStandard = vars.getString("$field.IS_STANDARD") == "true"; +var res; +if (isStandard) + res = "IMAGE"; +else + res = "TEXT"; +result.string(res); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/is_standard_icon/valueProcess.js b/entity/Address_entity/entityfields/is_standard_icon/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7420487f08a230ce60f272cdd253abf4331667c2 --- /dev/null +++ b/entity/Address_entity/entityfields/is_standard_icon/valueProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); + +var isStandard = vars.getString("$field.IS_STANDARD") == "true"; +var res; +if (isStandard) + res = "VAADIN:MAP_MARKER"; +else + res = ""; +result.string(res); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/documentation.adoc b/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..74649993db04d3b1a82da68fb7f50ba86b972235 --- /dev/null +++ b/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/documentation.adoc @@ -0,0 +1,2 @@ +This param will be calculated automatically with the given "ContactId_param" if you do not pass it. +When you've got the ORGANISTAIONID-value already you should pass it for better performance. \ No newline at end of file diff --git a/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/valueProcess.js b/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c4bf0500f2c4d1835300f8dbcb921f28b8917f7c --- /dev/null +++ b/entity/Address_entity/entityfields/organisationandcontactaddresses/children/organisationid_param/valueProcess.js @@ -0,0 +1,20 @@ +import("Sql_lib"); +import("system.db"); +import("system.result"); +import("system.vars"); + +//this organisationId param is optional which means: +//if it's not given for the "OrganisationAndContactAddresses"-provider we've to find the orgId by the passed CONTACTID +//the reason behind this is: whenever the consuming entity can provide the organisationid it should provide the id to improve performance +//(since we[Address_entity] have not to find out the value our own) +//but if the consuming entity does not have the value we[Address_entity] will do it for the sake of simpler usage + +var contactId = vars.get("$param.ContactId_param"); +if (contactId) +{ + var sql = SqlCondition.begin() + .andPrepare("CONTACT.CONTACTID", contactId) + .buildSql("select CONTACT.ORGANISATION_ID from CONTACT"); + var organisationId = db.cell(sql); + result.string(organisationId); +} \ No newline at end of file diff --git a/entity/Address_entity/recordcontainers/db/orderClauseProcess.js b/entity/Address_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7cafef1a54066dc53101218e6709f0d4f18b400e --- /dev/null +++ b/entity/Address_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,5 @@ +import("system.result"); +import("system.db"); + +result.object({"ADDRESS.COUNTRY": db.ASCENDING, + "ADDRESS.ADDRESS": db.ASCENDING}); \ No newline at end of file diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index 03d05f63fe67ce29fe7428f665f640bcc239e6e8..35c8f47b397dcfc477de0368b279fd2585ff2ec9 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -68,36 +68,6 @@ See ContactUtils.getRelationTypeByPersOrg for possible values</description> <searchable v="false" /> <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/contactType/valueProcess.js</valueProcess> </entityField> - <entityConsumer> - <name>Contact</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>Person_entity</entityName> - <fieldName>Contact</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/contact/children/contactid_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - <entityConsumer> - <name>Organisations</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>Organisation_entity</entityName> - <fieldName>Organisations</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/organisations/children/contactid_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> <entityField> <name>ORGANISATION_NAME</name> <title>Organisation name</title> @@ -116,38 +86,6 @@ See ContactUtils.getRelationTypeByPersOrg for possible values</description> <searchable v="false" /> <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/image/valueProcess.js</valueProcess> </entityField> - <entityConsumer> - <name>EmailCommunications</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>Communication_entity</entityName> - <fieldName>EmailCommunications</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/emailcommunications/children/contactid_param/valueProcess.js</valueProcess> - <expose v="false" /> - </entityParameter> - </children> - </entityConsumer> - <entityConsumer> - <name>PhoneCommunications</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>Communication_entity</entityName> - <fieldName>PhoneCommunications</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/phonecommunications/children/contactid_param/valueProcess.js</valueProcess> - <expose v="false" /> - </entityParameter> - </children> - </entityConsumer> <entityField> <name>STANDARD_EMAIL_COMMUNICATION</name> <title>standard email</title> @@ -184,6 +122,7 @@ See ContactUtils.getRelationTypeByPersOrg for possible values</description> <alias>Data_alias</alias> <fromClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <linkInformation> <linkInformation> <name>7b3fa460-44a1-40f3-89e3-1625ce9c6bb3</name> diff --git a/entity/AnyContact_entity/entityfields/organisations/children/contactid_param/valueProcess.js b/entity/AnyContact_entity/entityfields/organisations/children/contactid_param/valueProcess.js deleted file mode 100644 index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/organisations/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/phonecommunications/children/contactid_param/valueProcess.js b/entity/AnyContact_entity/entityfields/phonecommunications/children/contactid_param/valueProcess.js deleted file mode 100644 index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/phonecommunications/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file diff --git a/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js b/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..19dc62881edc6aaf5268121f4d793bc895e8e942 --- /dev/null +++ b/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.db"); + +result.object({ + "ORGANISATION.CUSTOMERCODE": db.ASCENDING, + "ORGANISATION.NAME": db.ASCENDING, + "PERSON.LASTNAME": db.ASCENDING, + "PERSON.FIRSTNAME": db.ASCENDING + }); \ No newline at end of file diff --git a/entity/AppointmentLink_entity/entityfields/objectid/displayValueProcess.js b/entity/AppointmentLink_entity/entityfields/objectid/displayValueProcess.js index 48efd9fecbbd7b0c6e7b15e44e1269dc2eb976a4..844708f89dc0cc824e7651eade24917d5a38e4fb 100644 --- a/entity/AppointmentLink_entity/entityfields/objectid/displayValueProcess.js +++ b/entity/AppointmentLink_entity/entityfields/objectid/displayValueProcess.js @@ -1,8 +1,7 @@ -import("system.logging"); -import("system.db"); -import("system.vars"); -import("system.result"); -import("Context_lib") - -logging.log("name??") +import("system.logging"); +import("system.db"); +import("system.vars"); +import("system.result"); +import("Context_lib") + result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.OBJECTTYPE"), vars.get("$field.OBJECTID")))); \ No newline at end of file diff --git a/entity/Appointment_entity/afterUiInit.js b/entity/Appointment_entity/afterUiInit.js index c47e48d2310d87c55d94dc8b4a9632fca4bc4fb4..4e420da40299a338582d21fb1974cb19ca6cc29e 100644 --- a/entity/Appointment_entity/afterUiInit.js +++ b/entity/Appointment_entity/afterUiInit.js @@ -1,23 +1,22 @@ -import("system.util"); -import("system.neon"); -import("system.logging"); -import("system.vars"); - - - - -if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) -{ - var entry = JSON.parse(vars.getString("$param.Entry_param")); - - if(entry["AppLinkContext"] && entry["AppLinkId"]) - { - logging.log("hier geht lohos... " + vars.get("$field.UID") + " id"); - neon.addRecord(null, "AppointmentLinks", - { - "AB_APPOINTMENTLINKID" : util.getNewUUID(), - "OBJECTID" : entry["AppLinkId"], - "OBJECTTYPE" : entry["AppLinkContext"] - }); - } +import("system.util"); +import("system.neon"); +import("system.logging"); +import("system.vars"); + + + + +if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) +{ + var entry = JSON.parse(vars.getString("$param.Entry_param")); + + if(entry["AppLinkContext"] && entry["AppLinkId"]) + { + neon.addRecord(null, "AppointmentLinks", + { + "AB_APPOINTMENTLINKID" : util.getNewUUID(), + "OBJECTID" : entry["AppLinkId"], + "OBJECTTYPE" : entry["AppLinkContext"] + }); + } } \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/summary/valueProcess.js b/entity/Appointment_entity/entityfields/summary/valueProcess.js index 72d7fc725df6d67b5d6a30d236fb0b87094d287f..8fd3d347cac2df60651d46bdab6fb9caffbd7ca6 100644 --- a/entity/Appointment_entity/entityfields/summary/valueProcess.js +++ b/entity/Appointment_entity/entityfields/summary/valueProcess.js @@ -1,18 +1,36 @@ -import("system.logging"); -import("system.neon"); -import("system.vars"); -import("system.calendars"); -import("system.result"); - -/** - * Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate - */ -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param")) -{ - logging.log() - - var event = JSON.parse(vars.getString("$param.Entry_param")); - - if(event[calendars.SUMMARY]) - result.string(event[calendars.SUMMARY]); -} \ No newline at end of file +import("system.logging"); +import("system.neon"); +import("system.vars"); +import("system.calendars"); +import("system.result"); + +/** + * Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate + */ +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param")) +{ + logging.log() + + var event = JSON.parse(vars.getString("$param.Entry_param")); + + if(event[calendars.SUMMARY]) + result.string(event[calendars.SUMMARY]); +} + + + +//if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param")) +//{ +// var uiVal = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.SUMMARY")); +// var paramVal = JSON.parse(vars.getString("$param.Entry_param"))[calendars.SUMMARY]; +// +// logging.log("os: " + vars.get("$sys.operatingstate")); +// logging.log("rs: " + vars.get("$sys.recordstate")); +// logging.log("paramVal: " + paramVal); +// logging.log("uiVal: " + uiVal); +// +// if(uiVal === paramVal || !uiVal) +// result.string(paramVal); +// else if(uiVal && !uiVal.equals(paramVal)) +// result.string(uiVal); +//} \ No newline at end of file diff --git a/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod b/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod index 8728871cf3791e830855a698c09771301960bdfe..bb483a46acd306a1096488ef3a58288d6e768fd0 100644 --- a/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod +++ b/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod @@ -1,90 +1,90 @@ -<?xml version="1.0" encoding="UTF-8"?> -<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1"> - <name>AttributeRelationTree_entity</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <recordContainer>jdito</recordContainer> - <entityFields> - <entityProvider> - <name>#PROVIDER</name> - </entityProvider> - <entityField> - <name>PARENT_ID</name> - </entityField> - <entityField> - <name>TITLE</name> - </entityField> - <entityField> - <name>UID</name> - </entityField> - <entityParameter> - <name>ObjectType_param</name> - <expose v="true" /> - <description>PARAMETER</description> - </entityParameter> - <entityParameter> - <name>ObjectRowId_param</name> - <expose v="true" /> - <description>PARAMETER</description> - </entityParameter> - <entityProvider> - <name>TreeProvider</name> - <fieldType>DEPENDENCY_IN</fieldType> - <dependencies> - <entityDependency> - <name>e0a7a4bc-ec7f-4f09-9b94-cbeb328cd7b8</name> - <entityName>Organisation_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>f29d91fe-2537-486f-b9de-44065a7790d4</name> - <entityName>Person_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>445c1bd7-4e72-4ab7-a5b1-cc77924eb562</name> - <entityName>Product_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>4498139f-067c-4cca-b122-d9bc9100c53d</name> - <entityName>Activity_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>d6d5f9aa-4582-4ec5-9381-394a38a726e8</name> - <entityName>Offer_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>b728166d-a74f-4ca1-8ce7-7e57032f2a7d</name> - <entityName>Contract_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>3921c712-d15c-4941-b04d-44f4536dc404</name> - <entityName>Employee_entity</entityName> - <fieldName>AttributeTree</fieldName> - <isConsumer v="false" /> - </entityDependency> - </dependencies> - </entityProvider> - </entityFields> - <recordContainers> - <jDitoRecordContainer> - <name>jdito</name> - <jDitoRecordAlias>Data_alias</jDitoRecordAlias> - <contentProcess>%aditoprj%/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js</contentProcess> - <recordFields> - <element>UID.value</element> - <element>PARENT_ID.value</element> - <element>TITLE.value</element> - </recordFields> - </jDitoRecordContainer> - </recordContainers> -</entity> +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1"> + <name>AttributeRelationTree_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>PARENT_ID</name> + </entityField> + <entityField> + <name>TITLE</name> + </entityField> + <entityField> + <name>UID</name> + </entityField> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityParameter> + <name>ObjectRowId_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>TreeProvider</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>e0a7a4bc-ec7f-4f09-9b94-cbeb328cd7b8</name> + <entityName>Organisation_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>f29d91fe-2537-486f-b9de-44065a7790d4</name> + <entityName>Person_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>445c1bd7-4e72-4ab7-a5b1-cc77924eb562</name> + <entityName>Product_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>4498139f-067c-4cca-b122-d9bc9100c53d</name> + <entityName>Activity_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>d6d5f9aa-4582-4ec5-9381-394a38a726e8</name> + <entityName>Offer_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>b728166d-a74f-4ca1-8ce7-7e57032f2a7d</name> + <entityName>Contract_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>3921c712-d15c-4941-b04d-44f4536dc404</name> + <entityName>Employee_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFields> + <element>UID.value</element> + <element>PARENT_ID.value</element> + <element>TITLE.value</element> + </recordFields> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index e6588fbe363eaad34e82afe75a89f8ed35b9b193..d06a6101b3c5dd8a0a0c2582f4333610b8a91cb5 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -131,10 +131,10 @@ <description>PARAMETER</description> </entityParameter> <entityField> - <name>BOOL_VALUE</name> + <name>INT_VALUE</name> <contentType>BOOLEAN</contentType> <searchable v="false" /> - <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js</valueProcess> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/int_value/valueProcess.js</valueProcess> </entityField> <entityField> <name>ID_VALUE</name> @@ -169,10 +169,6 @@ </entityParameter> </children> </entityConsumer> - <entityField> - <name>MEMO_VALUE</name> - <searchable v="false" /> - </entityField> <entityParameter> <name>FilteredAttributeIds_param</name> <expose v="true" /> @@ -278,10 +274,6 @@ <name>NUMBER_VALUE.value</name> <recordfield>AB_ATTRIBUTERELATION.NUMBER_VALUE</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>BOOL_VALUE.value</name> - <recordfield>AB_ATTRIBUTERELATION.BOOL_VALUE</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>ID_VALUE.value</name> <recordfield>AB_ATTRIBUTERELATION.ID_VALUE</recordfield> @@ -290,10 +282,6 @@ <name>ATTRIBUTE_PARENT_ID.value</name> <recordfield>AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>MEMO_VALUE.value</name> - <recordfield>AB_ATTRIBUTERELATION.MEMO_VALUE</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>USER_NEW.value</name> <recordfield>AB_ATTRIBUTERELATION.USER_NEW</recordfield> @@ -310,6 +298,10 @@ <name>DATE_EDIT.value</name> <recordfield>AB_ATTRIBUTERELATION.DATE_EDIT</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>INT_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.INT_VALUE</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js index 9347efa6c0caed251cd27fdabf8e94710302e365..132c9bbe345620f8d9fc4550c13dcdb87a493487 100644 --- a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js +++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js @@ -3,10 +3,9 @@ import("system.neon"); if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { - neon.setFieldValue("$field.BOOL_VALUE", null); + neon.setFieldValue("$field.INT_VALUE", null); neon.setFieldValue("$field.CHAR_VALUE", null); neon.setFieldValue("$field.DATE_VALUE", null); neon.setFieldValue("$field.ID_VALUE", null); neon.setFieldValue("$field.NUMBER_VALUE", null); - neon.setFieldValue("$field.MEMO_VALUE", null); } \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/int_value/valueProcess.js similarity index 65% rename from entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js rename to entity/AttributeRelation_entity/entityfields/int_value/valueProcess.js index c5937313ed5351c005fd2f860e5df0cbd2f6cf5d..91ca68074f8ae51f3149c59954293133708905ea 100644 --- a/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/int_value/valueProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -if(!vars.get("$field.BOOL_VALUE")) +if(!vars.get("$field.INT_VALUE")) result.string("0"); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/valueproxy/valueProcess.js b/entity/AttributeRelation_entity/entityfields/valueproxy/valueProcess.js index f1d1025828f4a7c554dd525a6f8ed38fc3551b2f..bea46eecb189b5b83f3704ecf8ea3f019d0581c4 100644 --- a/entity/AttributeRelation_entity/entityfields/valueproxy/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/valueproxy/valueProcess.js @@ -6,9 +6,8 @@ import("Attribute_lib"); "$field.CHAR_VALUE"; "$field.DATE_VALUE"; "$field.NUMBER_VALUE"; -"$field.BOOL_VALUE"; +"$field.INT_VALUE"; "$field.ID_VALUE"; -"$field.MEMO_VALUE"; if(vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW) { diff --git a/entity/AttributeUsage_entity/AttributeUsage_entity.aod b/entity/AttributeUsage_entity/AttributeUsage_entity.aod index daac2b16c156244a3421ee01c201e33db05a8460..1d04eaa1faddc57d89dd575a5bd69803b7ae14fa 100644 --- a/entity/AttributeUsage_entity/AttributeUsage_entity.aod +++ b/entity/AttributeUsage_entity/AttributeUsage_entity.aod @@ -70,6 +70,12 @@ <entityName>Context_entity</entityName> <fieldName>#PROVIDER</fieldName> </dependency> + <children> + <entityParameter> + <name>GetAllContexts_param</name> + <valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/context/children/getallcontexts_param/valueProcess.js</valueProcess> + </entityParameter> + </children> </entityConsumer> </entityFields> <recordContainers> diff --git a/entity/ObjectTree_entity/entityfields/description/valueProcess.js b/entity/AttributeUsage_entity/entityfields/context/children/getallcontexts_param/valueProcess.js similarity index 54% rename from entity/ObjectTree_entity/entityfields/description/valueProcess.js rename to entity/AttributeUsage_entity/entityfields/context/children/getallcontexts_param/valueProcess.js index 552c76f9742ef18911436c6a7cee0f9e98d4eea0..ed5935fc124e63ff268a7e65d5efceab70ac456e 100644 --- a/entity/ObjectTree_entity/entityfields/description/valueProcess.js +++ b/entity/AttributeUsage_entity/entityfields/context/children/getallcontexts_param/valueProcess.js @@ -1 +1,2 @@ -import("system.result"); +import("system.result"); +result.string(true); \ No newline at end of file diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index 4c4890962509ca2467975008355929cad0381978..7a53655d326d89c0f289e70d22176c8ed389a346 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -149,6 +149,7 @@ <entityField> <name>ATTRIBUTE_LEVEL</name> <title>Level</title> + <description>The level is required in the order-by to make sure that superordinate attributes come before their subordinates for the tree</description> <contentType>NUMBER</contentType> <state>INVISIBLE</state> <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js</valueProcess> diff --git a/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js b/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c56f881e002f57622f6c794a36084061d48df894 --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,97 @@ +import("JditoFilter_lib"); +import("KeywordRegistry_basic"); +import("Keyword_lib"); +import("system.db"); +import("system.vars"); +import("system.result"); +import("Sql_lib"); +import("Attribute_lib"); + +var condition = new SqlCondition(); + +var getGroups = vars.exists("$param.GetGroups_param") && vars.get("$param.GetGroups_param"); +var objectType = vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"); +if (getGroups) +{ + //this is for the selection of the superordinate attribute, this condition + //filters out the own id and the children to prevent loops + condition.andSqlCondition(SqlCondition.begin() + .andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.GROUP) + .andPrepareVars("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$param.AttrParentId_param", "# != ?") + .and("AB_ATTRIBUTE.AB_ATTRIBUTEID not in ('" + AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")).join("','") + "')") + .build()); +} +else if (objectType) //if there's an objectType, it comes from the AttributeRelation entity +{ + var filteredAttributes = []; + if (vars.exists("$param.FilteredAttributeIds_param") && vars.get("$param.FilteredAttributeIds_param")) + filteredAttributes = JSON.parse(vars.get("$param.FilteredAttributeIds_param")); + + var ids = AttributeUtil.getPossibleAttributes(objectType, false, filteredAttributes); + condition.and("AB_ATTRIBUTE.AB_ATTRIBUTEID in ('" + ids.join("','") + "')"); +} +else +{ + var type = vars.exists("$param.AttrParentType_param") && vars.get("$param.AttrParentType_param"); + if (type == $AttributeTypes.COMBO) + condition = SqlCondition.begin() + .andPrepareVars("AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID", "$param.AttrParentId_param") + .build(); + else if (type) + { + var parentId = vars.exists("$param.AttrParentId_param") && vars.get("$param.AttrParentId_param"); + if (parentId) + condition.and("AB_ATTRIBUTE.AB_ATTRIBUTEID in ('" + AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")).join("','") + "')"); + } +} + +var sql = "select AB_ATTRIBUTEID, AB_ATTRIBUTEID, ATTRIBUTE_ACTIVE, " + + "ATTRIBUTE_NAME, ATTRIBUTE_PARENT_ID, ATTRIBUTE_TYPE, " + + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.attributeType(), "ATTRIBUTE_TYPE") + + ", KEYWORD_CONTAINER from AB_ATTRIBUTE"; + +if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) + condition.and(" AB_ATTRIBUTEID in ('" + vars.get("$local.idvalues").join("','") + "')"); +else if (vars.exists("$local.filter") && vars.get("$local.filter")) +{ + var filter = vars.get("$local.filter"); + condition.andSqlCondition((JditoFilterUtils.getSqlCondition(filter, "AB_ATTRIBUTE"))); +} + +var attributes = db.table(condition.buildSql(sql, "1=1")); + +if (!(vars.exists("$local.idvalues") && vars.get("$local.idvalues"))) + attributes = _sortArrayForTree(attributes); + +result.object(attributes); + +//sorts the records in a way that a tree can be built +function _sortArrayForTree (pArray) +{ + var rows = {}; + var allIds = {}; + var idIndex = 1; + var parentIdIndex = 4; + + pArray.forEach(function (row) {allIds[row[idIndex]] = true;}); + + var index = 0; + + for (let itemsAdded = true; itemsAdded; itemsAdded = oldIndex != index) + { + var oldIndex = index; + pArray.forEach(function (row) + { + if (!(row[idIndex] in this) && (row[parentIdIndex] in this || !allIds[row[parentIdIndex]])) + this[row[idIndex]] = { + data : row, + index : index++ + }; + }, rows); + } + var sortedArray = new Array(Object.keys(rows).length); + for (let i in rows) + sortedArray[rows[i].index] = rows[i].data; + + return sortedArray; +} \ No newline at end of file diff --git a/entity/Attribute_entity/recordcontainers/jdito/onDelete.js b/entity/Attribute_entity/recordcontainers/jdito/onDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..61929ba31c941a074a9666920632025c03fb614c --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/jdito/onDelete.js @@ -0,0 +1,35 @@ +import("Sql_lib"); +import("system.db"); +import("system.vars"); +import("Attribute_lib"); + +var condition = SqlCondition.begin() + .andPrepareVars("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$field.UID") + .build("1=2"); + +db.deleteData("AB_ATTRIBUTE", conditon); + +var attributeId = vars.get("$field.UID"); + +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", 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); diff --git a/entity/Attribute_entity/recordcontainers/jdito/onInsert.js b/entity/Attribute_entity/recordcontainers/jdito/onInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..87565632d7cf592ac1bfe137d87ca62be849a32c --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/jdito/onInsert.js @@ -0,0 +1,23 @@ +import("system.db"); +import("system.vars"); + +var columns = [ + "AB_ATTRIBUTEID", + "ATTRIBUTE_ACTIVE", + "ATTRIBUTE_LEVEL", + "ATTRIBUTE_NAME", + "ATTRIBUTE_PARENT_ID", + "ATTRIBUTE_TYPE", + "KEYWORD_CONTAINER" +]; +var values = [ + vars.get("$field.UID"), + vars.get("$field.ATTRIBUTE_ACTIVE"), + vars.get("$field.ATTRIBUTE_LEVEL"), + vars.get("$field.ATTRIBUTE_NAME"), + vars.get("$field.ATTRIBUTE_PARENT_ID"), + vars.get("$field.ATTRIBUTE_TYPE"), + vars.get("$field.KEYWORD_CONTAINER") +]; + +db.insertData("AB_ATTRIBUTE", columns, null, values); \ No newline at end of file diff --git a/entity/Attribute_entity/recordcontainers/jdito/onUpdate.js b/entity/Attribute_entity/recordcontainers/jdito/onUpdate.js new file mode 100644 index 0000000000000000000000000000000000000000..6740df0d149b19858958fbc5b0c9839a721bd4e1 --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/jdito/onUpdate.js @@ -0,0 +1,26 @@ +import("Sql_lib"); +import("system.db"); +import("system.vars"); + +var columns = [ + "ATTRIBUTE_ACTIVE", + "ATTRIBUTE_LEVEL", + "ATTRIBUTE_NAME", + "ATTRIBUTE_PARENT_ID", + "ATTRIBUTE_TYPE", + "KEYWORD_CONTAINER" +]; +var values = [ + vars.get("$field.ATTRIBUTE_ACTIVE"), + vars.get("$field.ATTRIBUTE_LEVEL"), + vars.get("$field.ATTRIBUTE_NAME"), + vars.get("$field.ATTRIBUTE_PARENT_ID"), + vars.get("$field.ATTRIBUTE_TYPE"), + vars.get("$field.KEYWORD_CONTAINER") +]; + +var condition = SqlCondition.begin() + .andPrepareVars("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$field.UID") + .build("1=2"); + +db.updateData("AB_ATTRIBUTE", columns, null, values, conditon); \ No newline at end of file diff --git a/entity/Communication_entity/Communication_entity.aod b/entity/Communication_entity/Communication_entity.aod index 5bf31e7e5fd236f69a2d6f139825a545b4d548da..8c7e0e773a9a474fae34ce2b9438a725009f5c7f 100644 --- a/entity/Communication_entity/Communication_entity.aod +++ b/entity/Communication_entity/Communication_entity.aod @@ -111,12 +111,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <fieldName>PhoneCommunications</fieldName> <isConsumer v="false" /> </entityDependency> - <entityDependency> - <name>ddcd3c3d-f305-4ced-a8ac-ffb510474aa4</name> - <entityName>AnyContact_entity</entityName> - <fieldName>PhoneCommunications</fieldName> - <isConsumer v="false" /> - </entityDependency> </dependencies> <children> <entityParameter> @@ -150,12 +144,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <fieldName>EmailCommunications</fieldName> <isConsumer v="false" /> </entityDependency> - <entityDependency> - <name>c6e2631a-896f-4689-b254-0091ed25f705</name> - <entityName>AnyContact_entity</entityName> - <fieldName>EmailCommunications</fieldName> - <isConsumer v="false" /> - </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index 6192516f60e44fd0dbe5e1b5c17b29291bd72664..1d93750675aa2aee7876bdc244076e2af6906282 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -4,6 +4,7 @@ <title>Contact</title> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Contact_entity/documentation.adoc</documentation> + <onValidation>%aditoprj%/entity/Contact_entity/onValidation.js</onValidation> <iconId>VAADIN:USERS</iconId> <recordContainer>db</recordContainer> <entityFields> @@ -26,7 +27,6 @@ <title>Company</title> <consumer>Organisations</consumer> <mandatory v="false" /> - <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess> <onValidation>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValidation.js</onValidation> <onValueChange>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValueChange.js</onValueChange> @@ -227,15 +227,24 @@ <dbRecordContainer> <name>db</name> <alias>Data_alias</alias> + <fromClauseProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <linkInformation> <linkInformation> - <name>d2a29013-e270-4ce1-8f2d-b372206f0aa3</name> + <name>31dbd8d8-b10c-4621-ab45-b735216f078f</name> <tableName>CONTACT</tableName> <primaryKey>CONTACTID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> + <linkInformation> + <name>31948bfb-2fe9-4345-a65c-14ad49ffbc0e</name> + <tableName>ORGANISATION</tableName> + <primaryKey>ORGANISATIONID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> <recordFieldMappings> <dbRecordFieldMapping> @@ -290,6 +299,10 @@ <name>DATE_EDIT.value</name> <recordfield>CONTACT.DATE_EDIT</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORGANISATION_ID.displayValue</name> + <recordfield>ORGANISATION.NAME</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Contact_entity/entityfields/organisation_id/onValidation.js b/entity/Contact_entity/entityfields/organisation_id/onValidation.js index 1f8c6d2abee5ca29256187efa14767677a418d7b..414972ba58306e857d7bf27cd11c1175bf96cae3 100644 --- a/entity/Contact_entity/entityfields/organisation_id/onValidation.js +++ b/entity/Contact_entity/entityfields/organisation_id/onValidation.js @@ -1,3 +1,4 @@ +import("Contact_lib"); import("system.translate"); import("system.result"); import("system.db"); @@ -5,21 +6,17 @@ import("system.vars"); import("Entity_lib"); import("Sql_lib"); -var personId = vars.get("$field.PERSON_ID"); +var personId = vars.getString("$field.PERSON_ID"); var organisationId = ProcessHandlingUtils.getOnValidationValue("$field.ORGANISATION_ID"); //workaround for organisationId: $local.value will return the name of the organisation which is not what we want //but the field already contains the changed value; so let's load the field instead of the $local.value-variable //this is a bug within the ADITO-kernel //TODO: change the workaround behaviour when $local.value is retrieved correct -organisationId = vars.get("$field.ORGANISATION_ID") +organisationId = vars.getString("$field.ORGANISATION_ID"); -if (personId && organisationId) -{ - var alreadyExistantContactId = db.cell(SqlCondition.begin() - .andPrepare("CONTACT.PERSON_ID", personId) - .andPrepare("CONTACT.ORGANISATION_ID", organisationId) - .buildSql("select CONTACT.CONTACTID from CONTACT")); - if (alreadyExistantContactId != "") - result.string(translate.text("This combination of person and organisation does already exist and can not be created once more.")); -} \ No newline at end of file +//a entry within the Contact_enity can never be edited only created (it's edited within the Person_entity) +//so no need to provide our own CONTACTID since it does not exist in the database right now => provide null instead +var validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, null); +if (validationMsg) + result.string(validationMsg); \ No newline at end of file diff --git a/entity/Contact_entity/entityfields/organisation_id/onValueChange.js b/entity/Contact_entity/entityfields/organisation_id/onValueChange.js index 80f1e97c87383bde995515d7383b083726b7e8bf..0347a3d2d5b43d2b6be7a3464f03c5e61330828d 100644 --- a/entity/Contact_entity/entityfields/organisation_id/onValueChange.js +++ b/entity/Contact_entity/entityfields/organisation_id/onValueChange.js @@ -1,10 +1,4 @@ import("system.vars"); -import("system.neon"); //since the standard address can be only values of org the standard address has to be reset on org change -vars.set("$field.ADDRESS_ID", ""); - -if(vars.exists("$local.value") && !vars.get("$local.value")) -{ - neon.setFieldValue("$field.ORGANISATION_ID", "0"); -} +vars.set("$field.ADDRESS_ID", ""); \ No newline at end of file diff --git a/entity/Contact_entity/onValidation.js b/entity/Contact_entity/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..ef3e299e677759fc8fe8b0237ee9fe27d6c4723f --- /dev/null +++ b/entity/Contact_entity/onValidation.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); + +//TODO: workaround till there exists somtehing that can be done "beforeSave"; a validation of the whole entity is done before saving so let's use this process at the moment +if(!vars.get("$field.ORGANISATION_ID")) +{ + neon.setFieldValue("$field.ORGANISATION_ID", "0"); +} \ No newline at end of file diff --git a/entity/Contact_entity/recordcontainers/db/fromClauseProcess.js b/entity/Contact_entity/recordcontainers/db/fromClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f1b7f857628de43f0e06daf553421d7758a099ff --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/fromClauseProcess.js @@ -0,0 +1,4 @@ +import("system.result"); + +result.string("CONTACT\n\ + join ORGANISATION on CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID"); \ No newline at end of file diff --git a/entity/Contact_entity/recordcontainers/db/orderClauseProcess.js b/entity/Contact_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..be00ad88d1395634e3a06d856da1652cb7b5ecdb --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.db"); + +result.object({ + "ORGANISATION.NAME": db.ASCENDING +}); \ No newline at end of file diff --git a/entity/Context_entity/Context_entity.aod b/entity/Context_entity/Context_entity.aod index 75c65e40e4a703b3b6cff3a18e7f9666ef380ad3..6b92f784aa1b0eefdd87b1fe711183f4a0bbe562 100644 --- a/entity/Context_entity/Context_entity.aod +++ b/entity/Context_entity/Context_entity.aod @@ -89,6 +89,11 @@ </entityParameter> </children> </entityProvider> + <entityParameter> + <name>GetAllContexts_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Context_entity/recordcontainers/jdito/contentProcess.js b/entity/Context_entity/recordcontainers/jdito/contentProcess.js index 503f36da098c12ff704a1efb5c1b0c53db89ae9d..6ae2f8ad3cb2027b7ca6d81d5c7a803cf78b2663 100644 --- a/entity/Context_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Context_entity/recordcontainers/jdito/contentProcess.js @@ -5,4 +5,6 @@ import("Context_lib"); var excludeContexts = vars.getString("$param.excludeContexts_param"); if (excludeContexts) excludeContexts = JSON.parse(excludeContexts); -result.object(ContextUtils.getContexts(true, excludeContexts)); +var filterContexts = !(vars.exists("$param.GetAllContexts_param") && vars.get("$param.GetAllContexts_param") == "true"); + +result.object(ContextUtils.getContexts(filterContexts, excludeContexts)); \ No newline at end of file diff --git a/entity/Document_entity/recordcontainers/jdito/contentProcess.js b/entity/Document_entity/recordcontainers/jdito/contentProcess.js index 6682c389f91318540cc0e444e7f5106bc2db2c66..ccee9b0372c42613f4f3fb78de22b7bfff755ef9 100644 --- a/entity/Document_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Document_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.vars"); import("system.result"); import("system.db"); @@ -16,7 +17,7 @@ if(vars.exists("$param.AssignmentTable_param") && if(vars.exists("$param.Keyword_param")) { keyword = vars.get("$param.Keyword_param"); } - + // Check if multiple Documents are selected if(vars.exists("$local.idvalues") && vars.get("$local.idvalues")) metadata = db.getBinaryMetadataForIds(vars.get("$local.idvalues"), true, alias) diff --git a/entity/EmployeeRole_entity/EmployeeRole_entity.aod b/entity/EmployeeRole_entity/EmployeeRole_entity.aod index bc87a355559270d38dc8c6f91cfe448a6cc87634..634f8e557f4ad28238fa8a0c69abf38cea1e34f2 100644 --- a/entity/EmployeeRole_entity/EmployeeRole_entity.aod +++ b/entity/EmployeeRole_entity/EmployeeRole_entity.aod @@ -13,6 +13,7 @@ <entityParameter> <name>UserTitle_param</name> <expose v="true" /> + <mandatory v="true" /> <description>PARAMETER</description> </entityParameter> <entityProvider> @@ -30,6 +31,7 @@ <entityParameter> <name>UserTitle_param</name> <expose v="true" /> + <mandatory v="true" /> </entityParameter> </children> </entityProvider> diff --git a/entity/EmployeeRole_entity/entityfields/role/possibleItemsProcess.js b/entity/EmployeeRole_entity/entityfields/role/possibleItemsProcess.js index a9b4b9a616dbb75ca19a78151f6ef27d129d472b..e52145c8011337d56bd0cd3a5e9eea62f3562493 100644 --- a/entity/EmployeeRole_entity/entityfields/role/possibleItemsProcess.js +++ b/entity/EmployeeRole_entity/entityfields/role/possibleItemsProcess.js @@ -1,10 +1,27 @@ +import("system.translate"); +import("system.vars"); import("system.result"); import("system.tools"); +var selectedRole = vars.get("$field.ROLE"); var roles = []; var allRoles = tools.getAllRoles([tools.ROLE_INTERNAL, tools.ROLE_PROJECT, tools.ROLE_XMPP]); +var excludeRoles = { + "INTERNAL_GROUPWARE" : true, + "INTERNAL_SNMP" : true, + "INTERNAL_DESIGNER" : true, + "INTERNAL_TECHNICAL" : true +}; + +if (tools.existUsers(vars.get("$param.UserTitle_param"))) +{ + var userRoles = tools.getRoles(vars.get("$param.UserTitle_param")); + for (let i in userRoles) + excludeRoles[userRoles[i]] = true; +} for (let roleId in allRoles) - roles.push([roleId, allRoles[roleId][0]]) + if (!excludeRoles[roleId] || roleId == selectedRole) + roles.push([roleId, translate.text(allRoles[roleId][0])]); result.object(roles); \ No newline at end of file diff --git a/entity/EmployeeRole_entity/recordcontainers/jdito/contentProcess.js b/entity/EmployeeRole_entity/recordcontainers/jdito/contentProcess.js index 5e4ff916b039af3ae7779f072503a419b2c4c960..d39a3cf15fb32ae74c737f572788ed07720a257c 100644 --- a/entity/EmployeeRole_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/EmployeeRole_entity/recordcontainers/jdito/contentProcess.js @@ -1,11 +1,11 @@ -import("system.result"); -import("system.vars"); -import("system.tools"); - -var roles = []; -var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); - -if (userTitle && tools.existUsers(userTitle)) - roles = tools.getRoles(userTitle).map(function (role) {return [role, role]}); - +import("system.result"); +import("system.vars"); +import("system.tools"); + +var roles = []; +var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); + +if (userTitle && tools.existUsers(userTitle)) + roles = tools.getRoles(userTitle).map(function (role) {return [role, role]}); + result.object(roles); \ No newline at end of file diff --git a/entity/EmployeeRole_entity/recordcontainers/jdito/onDelete.js b/entity/EmployeeRole_entity/recordcontainers/jdito/onDelete.js index cb067aab6831890bb3c9e05f1f4c8396c962d312..1ac230e6252328d3f455e833dc5db787c34d9fe4 100644 --- a/entity/EmployeeRole_entity/recordcontainers/jdito/onDelete.js +++ b/entity/EmployeeRole_entity/recordcontainers/jdito/onDelete.js @@ -1,19 +1,19 @@ -import("system.result"); -import("system.vars"); -import("system.tools"); - -var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); -var role = vars.get("$field.UID"); - -if (userTitle) -{ - var user = tools.getUser(userTitle); - var roles = tools.getRoles(userTitle); - roles = roles.filter(function (row) - { - return row != role; - }); - user[tools.ROLES] = roles; - - tools.updateUser(user); +import("system.result"); +import("system.vars"); +import("system.tools"); + +var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); +var role = vars.get("$field.UID"); + +if (userTitle) +{ + var user = tools.getUser(userTitle); + var roles = tools.getRoles(userTitle); + roles = roles.filter(function (row) + { + return row != role; + }); + user[tools.ROLES] = roles; + + tools.updateUser(user); } \ No newline at end of file diff --git a/entity/EmployeeRole_entity/recordcontainers/jdito/onInsert.js b/entity/EmployeeRole_entity/recordcontainers/jdito/onInsert.js index cd847798b8185ce26d821b1637726d6ff6e3284c..258b1455824907ef5831d1b350b843da2330aa37 100644 --- a/entity/EmployeeRole_entity/recordcontainers/jdito/onInsert.js +++ b/entity/EmployeeRole_entity/recordcontainers/jdito/onInsert.js @@ -1,23 +1,23 @@ -import("system.result"); -import("system.vars"); -import("system.tools"); - -var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); -var role = vars.get("$field.ROLE"); - -if (userTitle) -{ - var user = tools.getUser(userTitle); - var roles = tools.getRoles(userTitle); - var roleObj = {}; - roles = [role].concat(roles) - .filter(function (role) - { - var exists = role in roleObj; - roleObj[role] = true; - return !exists; - }); - user[tools.ROLES] = roles; - - tools.updateUser(user); +import("system.result"); +import("system.vars"); +import("system.tools"); + +var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); +var role = vars.get("$field.ROLE"); + +if (userTitle) +{ + var user = tools.getUser(userTitle); + var roles = tools.getRoles(userTitle); + var roleObj = {}; + roles = [role].concat(roles) + .filter(function (role) + { + var exists = role in roleObj; + roleObj[role] = true; + return !exists; + }); + user[tools.ROLES] = roles; + + tools.updateUser(user); } \ No newline at end of file diff --git a/entity/EmployeeRole_entity/recordcontainers/jdito/onUpdate.js b/entity/EmployeeRole_entity/recordcontainers/jdito/onUpdate.js index ae08df85d869504a918c2b71140f22bdc5df8459..338f14eb0341a000ce6e5a21425d633a9d37478a 100644 --- a/entity/EmployeeRole_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/EmployeeRole_entity/recordcontainers/jdito/onUpdate.js @@ -1,25 +1,25 @@ -import("system.result"); -import("system.vars"); -import("system.tools"); - -var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); -var oldRole = vars.get("$field.UID"); -var newRole = vars.get("$field.ROLE"); - -if (userTitle && oldRole != newRole) -{ - var user = tools.getUser(userTitle); - var roles = tools.getRoles(userTitle); - var roleObj = {}; - roleObj[oldRole] = true; - roles = [newRole].concat(roles) - .filter(function (role) - { - var exists = role in roleObj; - roleObj[role] = true; - return !exists; - }); - user[tools.ROLES] = roles; - - tools.updateUser(user); +import("system.result"); +import("system.vars"); +import("system.tools"); + +var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param"); +var oldRole = vars.get("$field.UID"); +var newRole = vars.get("$field.ROLE"); + +if (userTitle && oldRole != newRole) +{ + var user = tools.getUser(userTitle); + var roles = tools.getRoles(userTitle); + var roleObj = {}; + roleObj[oldRole] = true; + roles = [newRole].concat(roles) + .filter(function (role) + { + var exists = role in roleObj; + roleObj[role] = true; + return !exists; + }); + user[tools.ROLES] = roles; + + tools.updateUser(user); } \ No newline at end of file diff --git a/entity/Employee_entity/Employee_entity.aod b/entity/Employee_entity/Employee_entity.aod index 968d2fb2edaeec1a3a80883ab5ef4707dda7ec39..748fd22d321b296b99cfb1c9072045c3068be6c6 100644 --- a/entity/Employee_entity/Employee_entity.aod +++ b/entity/Employee_entity/Employee_entity.aod @@ -15,14 +15,15 @@ </entityProvider> <entityField> <name>UID</name> - <title>Username</title> - <mandatory v="true" /> - <onValidation>%aditoprj%/entity/Employee_entity/entityfields/uid/onValidation.js</onValidation> + <searchable v="false" /> + <valueProcess>%aditoprj%/entity/Employee_entity/entityfields/uid/valueProcess.js</valueProcess> </entityField> <entityField> - <name>TITLE_ORIGINAL</name> - <description>the original username, this is required to update the correct user when the username is changed</description> - <searchable v="false" /> + <name>TITLE</name> + <title>Username</title> + <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Employee_entity/entityfields/title/valueProcess.js</valueProcess> + <onValidation>%aditoprj%/entity/Employee_entity/entityfields/title/onValidation.js</onValidation> </entityField> <entityField> <name>CONTACT_ID</name> @@ -30,17 +31,18 @@ <consumer>Contacts</consumer> <linkedContext>Person</linkedContext> <mandatory v="true" /> + <stateProcess>%aditoprj%/entity/Employee_entity/entityfields/contact_id/stateProcess.js</stateProcess> <onValidation>%aditoprj%/entity/Employee_entity/entityfields/contact_id/onValidation.js</onValidation> + <onValueChange>%aditoprj%/entity/Employee_entity/entityfields/contact_id/onValueChange.js</onValueChange> </entityField> <entityField> <name>FIRSTNAME</name> <title>Firstname</title> - <valueProcess>%aditoprj%/entity/Employee_entity/entityfields/firstname/valueProcess.js</valueProcess> </entityField> <entityField> <name>LASTNAME</name> <title>Lastname</title> - <valueProcess>%aditoprj%/entity/Employee_entity/entityfields/lastname/valueProcess.js</valueProcess> + <mandatory v="false" /> </entityField> <entityField> <name>ISACTIVE</name> @@ -53,6 +55,9 @@ <name>EMAIL_ADDRESS</name> <title>Email</title> <mandatory v="true" /> + <possibleItemsProcess>%aditoprj%/entity/Employee_entity/entityfields/email_address/possibleItemsProcess.js</possibleItemsProcess> + <newItemsAllowed v="true" /> + <onValidation>%aditoprj%/entity/Employee_entity/entityfields/email_address/onValidation.js</onValidation> </entityField> <entityField> <name>PASSWORD</name> @@ -210,29 +215,10 @@ </entityParameter> </children> </entityConsumer> - <entityConsumer> - <name>StoredSelections</name> - <title>Stored selections</title> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>StoredSelection_entity</entityName> - <fieldName>StoredSelections</fieldName> - </dependency> - <children> - <entityParameter> - <name>Base64String_param</name> - <valueProcess>%aditoprj%/entity/Employee_entity/entityfields/storedselections/children/base64string_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - <entityField> - <name>STORED_SELECTIONS</name> - <searchable v="false" /> - </entityField> <entityProvider> <name>Employees</name> <fieldType>DEPENDENCY_IN</fieldType> + <lookupIdfield>CONTACT_ID</lookupIdfield> <dependencies> <entityDependency> <name>0ca415b9-a940-424e-bee8-05c007b20659</name> @@ -254,6 +240,10 @@ </entityParameter> </children> </entityProvider> + <entityField> + <name>TITLE_ORIGINAL</name> + <searchable v="false" /> + </entityField> </entityFields> <recordContainers> <jDitoRecordContainer> @@ -265,11 +255,13 @@ <onDelete>%aditoprj%/entity/Employee_entity/recordcontainers/jdito/onDelete.js</onDelete> <recordFields> <element>UID.value</element> + <element>TITLE.value</element> <element>TITLE_ORIGINAL.value</element> <element>ISACTIVE.value</element> <element>FIRSTNAME.value</element> <element>LASTNAME.value</element> <element>EMAIL_ADDRESS.value</element> + <element>EMAIL_ADDRESS.displayValue</element> <element>DESCRIPTION.value</element> <element>CONTACT_ID.value</element> <element>CONTACT_ID.displayValue</element> diff --git a/entity/Employee_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js b/entity/Employee_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js index 24b12e282d0e416b544f4b8f318b447a972e1733..16c85500b5355a72548030867e3d300661e9d4aa 100644 --- a/entity/Employee_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACT_ID")); \ No newline at end of file +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.UID")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/attributes/children/objecttype_param/valueProcess.js b/entity/Employee_entity/entityfields/attributes/children/objecttype_param/valueProcess.js index 5996e99db232db8df50f155732110608e5abff4e..008915f61deac19ccdd40fff81701de63eb3b6a2 100644 --- a/entity/Employee_entity/entityfields/attributes/children/objecttype_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/attributes/children/objecttype_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.result"); -import("Context_lib"); - +import("system.result"); +import("Context_lib"); + result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Employee_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js index 24b12e282d0e416b544f4b8f318b447a972e1733..16c85500b5355a72548030867e3d300661e9d4aa 100644 --- a/entity/Employee_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACT_ID")); \ No newline at end of file +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.UID")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Employee_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js index 5996e99db232db8df50f155732110608e5abff4e..008915f61deac19ccdd40fff81701de63eb3b6a2 100644 --- a/entity/Employee_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.result"); -import("Context_lib"); - +import("system.result"); +import("Context_lib"); + result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/confirm_password/mandatoryProcess.js b/entity/Employee_entity/entityfields/confirm_password/mandatoryProcess.js index 66736a3ca98abea439334d4d1364a6e9b74bfb06..fec2cc6ff48f1b706465426d53c69f773af1ed8d 100644 --- a/entity/Employee_entity/entityfields/confirm_password/mandatoryProcess.js +++ b/entity/Employee_entity/entityfields/confirm_password/mandatoryProcess.js @@ -1,8 +1,8 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || changePassword) - result.string(true); - +import("system.vars"); +import("system.result"); +import("system.neon"); + +var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || changePassword) + result.string(true); + diff --git a/entity/Employee_entity/entityfields/confirm_password/stateProcess.js b/entity/Employee_entity/entityfields/confirm_password/stateProcess.js index 7df5126f5865033048bf20af2c352257ae0376ce..a2440a36b0d0a6befdeff33db5800db1d9d02664 100644 --- a/entity/Employee_entity/entityfields/confirm_password/stateProcess.js +++ b/entity/Employee_entity/entityfields/confirm_password/stateProcess.js @@ -1,10 +1,10 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -var state = neon.COMPONENTSTATE_INVISIBLE; -var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || changePassword) - state = neon.COMPONENTSTATE_AUTO; - +import("system.vars"); +import("system.result"); +import("system.neon"); + +var state = neon.COMPONENTSTATE_INVISIBLE; +var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || changePassword) + state = neon.COMPONENTSTATE_AUTO; + result.string(state); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/contact_id/onValueChange.js b/entity/Employee_entity/entityfields/contact_id/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..8b8af980eacaa7cf7553115592be5a360dd3406b --- /dev/null +++ b/entity/Employee_entity/entityfields/contact_id/onValueChange.js @@ -0,0 +1,25 @@ +import("Communication_lib"); +import("Entity_lib"); +import("system.result"); +import("system.db"); +import("system.neon"); +import("system.vars"); +import("Sql_lib"); + +var contactId = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ID")); +if ((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) + && contactId) +{ + var name = db.array( + db.ROW, + SqlCondition.begin() + .andPrepare("CONTACT.CONTACTID", contactId) + .buildSql("select FIRSTNAME, LASTNAME, (" + CommUtil.getStandardSubSqlMail() + ") from PERSON join CONTACT on CONTACT.PERSON_ID = PERSON.PERSONID") + ); + + neon.setFieldValues({ + "$field.FIRSTNAME" : name[0] || "", + "$field.LASTNAME" : name[1] || "", + "$field.EMAIL_ADDRESS" : name[2] || "" + }); +} \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/contact_id/stateProcess.js b/entity/Employee_entity/entityfields/contact_id/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..465a0be94edd9d1e3bbd126cb3f0546a546917a2 --- /dev/null +++ b/entity/Employee_entity/entityfields/contact_id/stateProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("Employee_lib") + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && EmployeeUtils.hasRelations(vars.get("$field.CONTACT_ID"))) + result.string(neon.COMPONENTSTATE_READONLY); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/documents/children/assignmentname_param/valueProcess.js b/entity/Employee_entity/entityfields/documents/children/assignmentname_param/valueProcess.js index f002ad73ad354a03117ff02c9f303e30b7fa453f..3e4bf7585b2ca4628118e46818683fc51bfcf1c5 100644 --- a/entity/Employee_entity/entityfields/documents/children/assignmentname_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/documents/children/assignmentname_param/valueProcess.js @@ -1,3 +1,3 @@ -import("system.result"); - +import("system.result"); + result.string("DOCUMENT"); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js b/entity/Employee_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js index 24b12e282d0e416b544f4b8f318b447a972e1733..16c85500b5355a72548030867e3d300661e9d4aa 100644 --- a/entity/Employee_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACT_ID")); \ No newline at end of file +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.UID")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js b/entity/Employee_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js index d8e665c062008cfe155ae02e2fbc6dbd94dd9dd2..183fb187965d2c5c6796149d00f00a617f88aab9 100644 --- a/entity/Employee_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js @@ -1,3 +1,3 @@ -import("system.result"); - +import("system.result"); + result.string("EMPLOYEE"); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/email_address/onValidation.js b/entity/Employee_entity/entityfields/email_address/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..35d65102d1e956f09fd9c6298ae86f754c985a83 --- /dev/null +++ b/entity/Employee_entity/entityfields/email_address/onValidation.js @@ -0,0 +1,13 @@ +import("Entity_lib"); +import("system.result"); +import("system.vars"); +import("system.tools"); +import("system.translate"); + +var email = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.EMAIL_ADDRESS")); +var isTaken = tools.getUserByAttribute(tools.EMAIL, [email]); +isTaken = isTaken + ? isTaken[tools.TITLE] != vars.get("$field.TITLE_ORIGINAL") + : false; +if (email && isTaken) + result.string(translate.text("Email must be unique!")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/email_address/possibleItemsProcess.js b/entity/Employee_entity/entityfields/email_address/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..21bbfcda32c97039f276ebb89db9eecaf6e21db1 --- /dev/null +++ b/entity/Employee_entity/entityfields/email_address/possibleItemsProcess.js @@ -0,0 +1,30 @@ +import("Communication_lib"); +import("system.neon"); +import("system.vars"); +import("system.db"); +import("system.result"); +import("Sql_lib"); + +var contactId = vars.get("$field.CONTACT_ID"); +if ((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) + && contactId) +{ + var sql = SqlCondition.begin() + .andPrepare("COMMUNICATION.CONTACT_ID", contactId) + .and("COMMUNICATION.MEDIUM_ID in ('" + CommUtil.getMediumIdsByCategory("EMAIL").join("', '") + "')") + .buildSql("select ADDR, ADDR from COMMUNICATION"); + + var addresses = db.table(sql); + + //include the currently set email address + var currentAddress = vars.get("$field.EMAIL_ADDRESS"); + if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && currentAddress + && !addresses.some(function (row) {return row[0] == currentAddress;})) + { + addresses.push([currentAddress, currentAddress]); + } + + result.object(addresses); +} +else + result.object([]); diff --git a/entity/Employee_entity/entityfields/employeeroles/children/usertitle_param/valueProcess.js b/entity/Employee_entity/entityfields/employeeroles/children/usertitle_param/valueProcess.js index 2c71e53a498b1ad3d5a0f915aacb4a836b81657f..16c85500b5355a72548030867e3d300661e9d4aa 100644 --- a/entity/Employee_entity/entityfields/employeeroles/children/usertitle_param/valueProcess.js +++ b/entity/Employee_entity/entityfields/employeeroles/children/usertitle_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - +import("system.vars"); +import("system.result"); + result.string(vars.get("$field.UID")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/firstname/valueProcess.js b/entity/Employee_entity/entityfields/firstname/valueProcess.js deleted file mode 100644 index 7558bfe94977c13c45b073b0c9a99adc12c23a77..0000000000000000000000000000000000000000 --- a/entity/Employee_entity/entityfields/firstname/valueProcess.js +++ /dev/null @@ -1,16 +0,0 @@ -import("system.result"); -import("system.db"); -import("system.neon"); -import("system.vars"); -import("Sql_lib"); - -var contactId = vars.get("$field.CONTACT_ID"); -if ((vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT) - && contactId) -{ - var firstname = db.cell(SqlCondition.begin() - .andPrepare("CONTACT.CONTACTID", contactId) - .buildSql("select FIRSTNAME from PERSON join CONTACT on CONTACT.PERSON_ID = PERSON.PERSONID") - ); - result.string(firstname); -} \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/image/valueProcess.js b/entity/Employee_entity/entityfields/image/valueProcess.js index 4701975fe7b89eee8bb5b3b9c03696a18d155ba2..d36f4b5cb45ad14fb9cb51f57ec4ba149c526468 100644 --- a/entity/Employee_entity/entityfields/image/valueProcess.js +++ b/entity/Employee_entity/entityfields/image/valueProcess.js @@ -1,15 +1,15 @@ -import("system.db"); -import("system.result"); -import("system.neon"); -import("system.vars"); -import("Person_lib"); -import("Sql_lib"); - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) -{ - var personId = db.cell(SqlCondition.begin() - .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") - .buildSql("select PERSON_ID from CONTACT") - ); - result.string(PersUtils.getImage(personId, (vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME")).trim())); -} +import("system.db"); +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Person_lib"); +import("Sql_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) +{ + var personId = db.cell(SqlCondition.begin() + .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") + .buildSql("select PERSON_ID from CONTACT") + ); + result.string(PersUtils.getImage(personId, (vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME")).trim())); +} diff --git a/entity/Employee_entity/entityfields/isactive/possibleItemsProcess.js b/entity/Employee_entity/entityfields/isactive/possibleItemsProcess.js index 7ae1ab2b4f2ce2228273b9c5a937ebf89b3631dd..2ce6bd157cf099c253f6dcac83d83af8a1f08720 100644 --- a/entity/Employee_entity/entityfields/isactive/possibleItemsProcess.js +++ b/entity/Employee_entity/entityfields/isactive/possibleItemsProcess.js @@ -1,7 +1,7 @@ -import("system.translate"); -import("system.result"); - -result.object({ - "true" : translate.text("Yes"), - "false" : translate.text("No") +import("system.translate"); +import("system.result"); + +result.object({ + "true" : translate.text("Yes"), + "false" : translate.text("No") }); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/isactive/valueProcess.js b/entity/Employee_entity/entityfields/isactive/valueProcess.js index d6c42ccf6d70b17406460ece9041aadeae6fa295..86ff56f08f7147b273771b10752464d691c1deb0 100644 --- a/entity/Employee_entity/entityfields/isactive/valueProcess.js +++ b/entity/Employee_entity/entityfields/isactive/valueProcess.js @@ -1,6 +1,6 @@ -import("system.neon"); -import("system.vars"); -import("system.result"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) result.string("true"); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/lastname/valueProcess.js b/entity/Employee_entity/entityfields/lastname/valueProcess.js deleted file mode 100644 index 919ab8037451c587e5471a35d2a215dbed43170f..0000000000000000000000000000000000000000 --- a/entity/Employee_entity/entityfields/lastname/valueProcess.js +++ /dev/null @@ -1,16 +0,0 @@ -import("system.result"); -import("system.db"); -import("system.neon"); -import("system.vars"); -import("Sql_lib"); - -var contactId = vars.get("$field.CONTACT_ID"); -if ((vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT) - && contactId) -{ - var lastname = db.cell(SqlCondition.begin() - .andPrepare("CONTACT.CONTACTID", contactId) - .buildSql("select LASTNAME from PERSON join CONTACT on CONTACT.PERSON_ID = PERSON.PERSONID") - ); - result.string(lastname); -} \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/name_fieldgroup/valueProcess.js b/entity/Employee_entity/entityfields/name_fieldgroup/valueProcess.js index 2cb5fabc5425ebd133fdb7348d64547af9480c7b..cfe8dbda0147ed4ce85bc5394e118459edb315d1 100644 --- a/entity/Employee_entity/entityfields/name_fieldgroup/valueProcess.js +++ b/entity/Employee_entity/entityfields/name_fieldgroup/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - +import("system.vars"); +import("system.result"); + result.string((vars.get("$field.FIRSTNAME") + " " + vars.get("$field.LASTNAME")).trim()); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/password/mandatoryProcess.js b/entity/Employee_entity/entityfields/password/mandatoryProcess.js index 66736a3ca98abea439334d4d1364a6e9b74bfb06..fec2cc6ff48f1b706465426d53c69f773af1ed8d 100644 --- a/entity/Employee_entity/entityfields/password/mandatoryProcess.js +++ b/entity/Employee_entity/entityfields/password/mandatoryProcess.js @@ -1,8 +1,8 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || changePassword) - result.string(true); - +import("system.vars"); +import("system.result"); +import("system.neon"); + +var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || changePassword) + result.string(true); + diff --git a/entity/Employee_entity/entityfields/password/stateProcess.js b/entity/Employee_entity/entityfields/password/stateProcess.js index 7df5126f5865033048bf20af2c352257ae0376ce..a2440a36b0d0a6befdeff33db5800db1d9d02664 100644 --- a/entity/Employee_entity/entityfields/password/stateProcess.js +++ b/entity/Employee_entity/entityfields/password/stateProcess.js @@ -1,10 +1,10 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -var state = neon.COMPONENTSTATE_INVISIBLE; -var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || changePassword) - state = neon.COMPONENTSTATE_AUTO; - +import("system.vars"); +import("system.result"); +import("system.neon"); + +var state = neon.COMPONENTSTATE_INVISIBLE; +var changePassword = vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param"); +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || changePassword) + state = neon.COMPONENTSTATE_AUTO; + result.string(state); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/setpassword/onActionProcess.js b/entity/Employee_entity/entityfields/setpassword/onActionProcess.js index bda0a6b48ab0454c9c53a24d7ef9b843d2fc9cb8..47df2ead20cc125d332d120712a5f30184b81b70 100644 --- a/entity/Employee_entity/entityfields/setpassword/onActionProcess.js +++ b/entity/Employee_entity/entityfields/setpassword/onActionProcess.js @@ -1,7 +1,7 @@ -import("system.vars"); -import("system.neon"); - -var params = { - "PasswordChange_param" : true -}; +import("system.vars"); +import("system.neon"); + +var params = { + "PasswordChange_param" : true +}; neon.openContext("Employee", "EmployeePassword_view", [vars.get("$field.UID")], neon.OPERATINGSTATE_EDIT, params); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/storedselections/children/base64string_param/valueProcess.js b/entity/Employee_entity/entityfields/storedselections/children/base64string_param/valueProcess.js deleted file mode 100644 index d3297d7eb88ebfc6bd431f13133fca055a238a63..0000000000000000000000000000000000000000 --- a/entity/Employee_entity/entityfields/storedselections/children/base64string_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.STORED_SELECTIONS")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/uid/onValidation.js b/entity/Employee_entity/entityfields/title/onValidation.js similarity index 69% rename from entity/Employee_entity/entityfields/uid/onValidation.js rename to entity/Employee_entity/entityfields/title/onValidation.js index e6c2cc26a81f30f31d1916545a062ac1c023498c..b7a2177b025698809ddcc9f2d4adb5ea62cdd6e6 100644 --- a/entity/Employee_entity/entityfields/uid/onValidation.js +++ b/entity/Employee_entity/entityfields/title/onValidation.js @@ -5,7 +5,7 @@ import("system.vars"); import("system.tools"); import("Entity_lib"); -var title = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.UID")); -if (!(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT && title == vars.get("$field.TITLE_ORIGINAL")) +var title = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.TITLE")); +if (!(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && title == vars.get("$field.TITLE_ORIGINAL")) && title != "" && tools.existUsers(title)) result.string(translate.text("Username already exists!")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/title/valueProcess.js b/entity/Employee_entity/entityfields/title/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..058b37c3c1c367ab44f6212d3e684707bb3a398b --- /dev/null +++ b/entity/Employee_entity/entityfields/title/valueProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("Employee_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && !vars.get("$field.TITLE")) + result.string(EmployeeUtils.generateUserName(vars.get("$field.FIRSTNAME"), vars.get("$field.LASTNAME"), "f.l+")); \ No newline at end of file diff --git a/entity/Employee_entity/entityfields/uid/valueProcess.js b/entity/Employee_entity/entityfields/uid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4e2c2abf86f0bd1c75ffb84ca5ef712288a78c3f --- /dev/null +++ b/entity/Employee_entity/entityfields/uid/valueProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if ((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) + && vars.get("$field.TITLE")) + result.string(vars.get("$field.TITLE")); \ No newline at end of file diff --git a/entity/Employee_entity/onValidation.js b/entity/Employee_entity/onValidation.js index 1ade64458c9052adb9112d77cc99c22a7a70829e..d10cbbc9b092349c5dccd050e9b687c838570a01 100644 --- a/entity/Employee_entity/onValidation.js +++ b/entity/Employee_entity/onValidation.js @@ -1,6 +1,6 @@ -import("system.translate"); -import("system.result"); -import("system.vars"); - -if (vars.get("$field.PASSWORD") != vars.get("$field.CONFIRM_PASSWORD")) +import("system.translate"); +import("system.result"); +import("system.vars"); + +if (vars.get("$field.PASSWORD") != vars.get("$field.CONFIRM_PASSWORD")) result.string(translate.text("Password and confirmation must be the same!")); \ No newline at end of file diff --git a/entity/Employee_entity/recordcontainers/jdito/contentProcess.js b/entity/Employee_entity/recordcontainers/jdito/contentProcess.js index de090b22a0c999486c279171bd108c1f8c17d1aa..f40cbd25c020ec69598596d91c051cac0ab0c538 100644 --- a/entity/Employee_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Employee_entity/recordcontainers/jdito/contentProcess.js @@ -1,43 +1,46 @@ -import("system.vars"); -import("system.result"); -import("system.tools"); -import("Util_lib"); -import("Contact_lib"); -import("JditoFilter_lib"); - -var users; -if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) - users = [tools.getUser(vars.get("$local.idvalues"), tools.PROFILE_FULL)]; -else -{ - var values = ["true", "false"]; - if (vars.exists("$param.OnlyActives_param") && vars.get("$param.OnlyActives_param") == "true") - values = ["true"]; - users = tools.getUsersByAttribute(tools.ISACTIVE, values, tools.PROFILE_FULL); -} - -users = users.map(function (user) -{ - return [ - user[tools.TITLE], - user[tools.TITLE], - user[tools.PARAMS][tools.ISACTIVE], - user[tools.PARAMS][tools.FIRSTNAME], - user[tools.PARAMS][tools.LASTNAME], - user[tools.PARAMS][tools.EMAIL], - user[tools.DESCRIPTION], - user[tools.PARAMS][tools.CONTACTID], - ContactUtils.getTitleByContactId(user[tools.PARAMS][tools.CONTACTID]), //TODO: get the names more efficiently - user[tools.PARAMS][tools.FRAME_STOREDSEARCHES] - ]; -}); - -var filter = vars.exists("$local.filter") && vars.get("$local.filter"); - -//TODO: this is a workaround that filters the records manually, it should be possible to filter the users with a tools.* method -users = JditoFilterUtils.filterRecords(["UID", "", "ISACTIVE", "FIRSTNAME", "LASTNAME", "EMAIL_ADDRESS", "DESCRIPTION", "CONTACT_ID", "", ], users, filter); - - -ArrayUtils.sort2d(users, 0, true, false); //sort by username - +import("system.vars"); +import("system.result"); +import("system.tools"); +import("Util_lib"); +import("Contact_lib"); +import("JditoFilter_lib"); +import("Employee_lib"); + +var users; +if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) + users = [tools.getUser(vars.get("$local.idvalues"), tools.PROFILE_FULL)]; +else +{ + var values = ["true", "false"]; + if (vars.exists("$param.OnlyActives_param") && vars.get("$param.OnlyActives_param") == "true") + values = ["true"]; + users = tools.getUsersByAttribute(tools.ISACTIVE, values, tools.PROFILE_FULL); +} + +users = users.map(function (user) +{ + return [ + user[tools.TITLE], + user[tools.TITLE], + user[tools.TITLE], + user[tools.PARAMS][tools.ISACTIVE], + user[tools.PARAMS][tools.FIRSTNAME], + user[tools.PARAMS][tools.LASTNAME], + user[tools.PARAMS][tools.EMAIL], + user[tools.PARAMS][tools.EMAIL], + user[tools.DESCRIPTION], + user[tools.PARAMS][tools.CONTACTID], + ContactUtils.getTitleByContactId(user[tools.PARAMS][tools.CONTACTID]), //TODO: get the names more efficiently + user[tools.PARAMS][tools.FRAME_STOREDSEARCHES] + ]; +}); + +var filter = vars.exists("$local.filter") && vars.get("$local.filter"); + +//TODO: this is a workaround that filters the records manually, it should be possible to filter the users with a tools.* method +users = JditoFilterUtils.filterRecords(["UID", "TITLE", "TITLE_ORIGINAL", "ISACTIVE", "FIRSTNAME", "LASTNAME", "EMAIL_ADDRESS", "DESCRIPTION", "CONTACT_ID", ""], users, filter); + + +ArrayUtils.sort2d(users, 0, true, false); //sort by username + result.object(users); \ No newline at end of file diff --git a/entity/Employee_entity/recordcontainers/jdito/onDelete.js b/entity/Employee_entity/recordcontainers/jdito/onDelete.js index b3064b9528d3c514953b7e2441c5d71490bcb865..212b6d23132d934d2e7169624a2607b58d99a2e0 100644 --- a/entity/Employee_entity/recordcontainers/jdito/onDelete.js +++ b/entity/Employee_entity/recordcontainers/jdito/onDelete.js @@ -1,8 +1,8 @@ -import("system.neon"); -import("system.vars"); -import("system.tools"); -import("Employee_lib"); - -//TODO: the current user should not delete himself, put this condition in grantDelete when available -if (EmployeeUtils.getCurrentUserName() != vars.get("$field.UID")) - tools.deleteUser(vars.get("$field.UID")); \ No newline at end of file +import("system.neon"); +import("system.vars"); +import("system.tools"); +import("Employee_lib"); + +//TODO: the current user should not delete himself, put this condition in grantDelete when available +if (EmployeeUtils.getCurrentUserName() != vars.get("$field.TITLE") && !EmployeeUtils.hasRelations(vars.get("$field.CONTACT_ID"))) + tools.deleteUser(vars.get("$field.TITLE")); \ No newline at end of file diff --git a/entity/Employee_entity/recordcontainers/jdito/onInsert.js b/entity/Employee_entity/recordcontainers/jdito/onInsert.js index 3693a103f69a82d454fdbad9cf027ef76635ecc4..9d7e0fddbe405e9a445b8373a512eec792dc929c 100644 --- a/entity/Employee_entity/recordcontainers/jdito/onInsert.js +++ b/entity/Employee_entity/recordcontainers/jdito/onInsert.js @@ -1,22 +1,23 @@ -import("system.neon"); -import("system.vars"); -import("system.tools"); - -var user = {}; -var params = []; //this has to be an array -params[tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); -params[tools.LASTNAME] = vars.get("$field.LASTNAME"); -params[tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); -params[tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); -params[tools.CONTACTID] = vars.get("$field.CONTACT_ID"); -params[tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); -params[tools.ISACTIVE] = vars.get("$field.ISACTIVE"); - -user[tools.TITLE] = vars.get("$field.UID"); -user[tools.PARAMS] = params; - -if (vars.get("$field.PASSWORD") && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) -{ - user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); -} +import("system.neon"); +import("system.vars"); +import("system.tools"); +import("Employee_lib"); + +var user = {}; +var params = []; //this has to be an array +params[tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); +params[tools.LASTNAME] = vars.get("$field.LASTNAME"); +params[tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); +params[tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); +params[tools.CONTACTID] = vars.get("$field.CONTACT_ID"); +params[tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); +params[tools.ISACTIVE] = vars.get("$field.ISACTIVE"); + +user[tools.TITLE] = vars.get("$field.TITLE"); +user[tools.PARAMS] = params; + +if (vars.get("$field.PASSWORD") && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) +{ + user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); +} tools.insertUser(user); \ No newline at end of file diff --git a/entity/Employee_entity/recordcontainers/jdito/onUpdate.js b/entity/Employee_entity/recordcontainers/jdito/onUpdate.js index 5cc71867cd697b16bbfc17ef56a0678b144e2545..6402be1fa563698440eecb3c0421427a58406644 100644 --- a/entity/Employee_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/Employee_entity/recordcontainers/jdito/onUpdate.js @@ -1,39 +1,37 @@ -import("system.db"); -import("system.logging"); -import("system.vars"); -import("system.tools"); -import("Person_lib"); -import("Entity_lib"); - -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 -FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function (state, value) -{ - var personId = db.cell(SqlCondition.begin() - .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") - .buildSql("select PERSON_ID from CONTACT") - ); - if (state == FieldChanges.STATE_CHANGED()) - PersUtils.setImage(personId, value); - else - PersUtils.removeImage(personId); -}); - -var user = {}; -user[tools.PARAMS] = []; - -user[tools.TITLE] = vars.get("$field.UID"); -user[tools.PARAMS][tools.ISACTIVE] = vars.get("$field.ISACTIVE"); -user[tools.PARAMS][tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); -user[tools.PARAMS][tools.LASTNAME] = vars.get("$field.LASTNAME"); -user[tools.PARAMS][tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); -user[tools.PARAMS][tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); -user[tools.PARAMS][tools.CONTACTID] = vars.get("$field.CONTACT_ID"); -user[tools.PARAMS][tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); - -if (vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param") - && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) -{ - user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); -} - +import("system.db"); +import("system.vars"); +import("system.tools"); +import("Person_lib"); +import("Entity_lib"); + +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 +FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function (state, value) +{ + var personId = db.cell(SqlCondition.begin() + .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") + .buildSql("select PERSON_ID from CONTACT") + ); + if (state == FieldChanges.STATE_CHANGED()) + PersUtils.setImage(personId, value); + else + PersUtils.removeImage(personId); +}); + +var user = tools.getUser(vars.get("$field.TITLE_ORIGINAL")); + +user[tools.TITLE] = vars.get("$field.TITLE"); +user[tools.PARAMS][tools.ISACTIVE] = vars.get("$field.ISACTIVE"); +user[tools.PARAMS][tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); +user[tools.PARAMS][tools.LASTNAME] = vars.get("$field.LASTNAME"); +user[tools.PARAMS][tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); +user[tools.PARAMS][tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); +user[tools.PARAMS][tools.CONTACTID] = vars.get("$field.CONTACT_ID"); +user[tools.PARAMS][tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); + +if (vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param") + && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) +{ + user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); +} + tools.updateUser(user); \ No newline at end of file diff --git a/entity/Employee_entity/titleProcess.js b/entity/Employee_entity/titleProcess.js index 2cb5fabc5425ebd133fdb7348d64547af9480c7b..cfe8dbda0147ed4ce85bc5394e118459edb315d1 100644 --- a/entity/Employee_entity/titleProcess.js +++ b/entity/Employee_entity/titleProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); -import("system.result"); - +import("system.vars"); +import("system.result"); + result.string((vars.get("$field.FIRSTNAME") + " " + vars.get("$field.LASTNAME")).trim()); \ No newline at end of file diff --git a/entity/ObjectRelationType_entity/ObjectRelationType_entity.aod b/entity/ObjectRelationType_entity/ObjectRelationType_entity.aod index 27f8339b5b0d693590b977d85d3aa51ecb69185f..7569f2f522cda9dfe237cdd8af2d3594c8a505ea 100644 --- a/entity/ObjectRelationType_entity/ObjectRelationType_entity.aod +++ b/entity/ObjectRelationType_entity/ObjectRelationType_entity.aod @@ -32,9 +32,18 @@ <entityProvider> <name>ObjectRelationTypes</name> <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>81f4567a-fc89-49fc-be86-77600cb66305</name> + <entityName>ObjectTree_entity</entityName> + <fieldName>ObjectRelationTypes</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> <children> <entityParameter> <name>SourceObjectType_param</name> + <expose v="true" /> <triggerRecalculation v="true" /> </entityParameter> </children> diff --git a/entity/ObjectRelationType_entity/recordcontainers/jdito/contentProcess.js b/entity/ObjectRelationType_entity/recordcontainers/jdito/contentProcess.js index 853e49e1a53cc5de0f317ea827cf4a56bc5c6adc..23e43cb44c7bc9f62000e8d7c77f7f8b24cc0a22 100644 --- a/entity/ObjectRelationType_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/ObjectRelationType_entity/recordcontainers/jdito/contentProcess.js @@ -1,14 +1,6 @@ -import("system.translate"); -import("system.db"); +import("system.logging"); import("system.result"); import("system.vars"); +import("ObjectRelation_lib"); -result.object(db.table( -["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE \n\ - from AB_OBJECTRELATIONTYPE main \n\ - left join AB_OBJECTRELATIONTYPE type2 on (type2.AB_OBJECTRELATIONTYPEID <> main.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = main.RELATION_TYPE) \n\ - where case when type2.OBJECT_TYPE is null then ( ? = main.OBJECT_TYPE) else ( ? = type2.OBJECT_TYPE) end" -, [ - [vars.get("$param.SourceObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]], - [vars.get("$param.SourceObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]], -]])); \ No newline at end of file +result.object(ObjectRelationUtils.getPossibleRelationTypes(vars.get("$param.SourceObjectType_param"))); \ No newline at end of file diff --git a/entity/ObjectRelationType_entity/titleProcess.js b/entity/ObjectRelationType_entity/titleProcess.js index 6a95b85f7554fe3572386e6aa5b7a2ba5ec4deae..71a9111fb455f300d19637ad0dac20645516bac6 100644 --- a/entity/ObjectRelationType_entity/titleProcess.js +++ b/entity/ObjectRelationType_entity/titleProcess.js @@ -1,4 +1,5 @@ +import("system.translate"); import("system.vars"); import("system.result"); -result.string(vars.get("$field.RELATION_TITLE")) \ No newline at end of file +result.string(translate.text(vars.get("$field.RELATION_TITLE"))) \ No newline at end of file diff --git a/entity/ObjectRelation_entity/ObjectRelation_entity.aod b/entity/ObjectRelation_entity/ObjectRelation_entity.aod index f495721eb13f304f78bf5276952927f10ce304f4..1a3854b6597d50888dbbfb4f9735a17f94265763 100644 --- a/entity/ObjectRelation_entity/ObjectRelation_entity.aod +++ b/entity/ObjectRelation_entity/ObjectRelation_entity.aod @@ -160,6 +160,10 @@ <entityField> <name>OBJECT2_TYPE</name> </entityField> + <entityField> + <name>INFO</name> + <title>Description</title> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -213,6 +217,10 @@ <name>OBJECT1_TYPE.value</name> <expression>%aditoprj%/entity/ObjectRelation_entity/recordcontainers/db/recordfieldmappings/object1_type.value/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>INFO.value</name> + <recordfield>AB_OBJECTRELATION.INFO</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/possibleItemsProcess.js b/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/possibleItemsProcess.js index 6a50b40e6edb73828ddc114540c1f58f8b85627c..41ddaad8d5dc1f6a137232492c62683cab4da7e0 100644 --- a/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/possibleItemsProcess.js +++ b/entity/ObjectRelation_entity/entityfields/selectedobjectrelationtypeidproxy/possibleItemsProcess.js @@ -7,10 +7,9 @@ result.object(db.table( ["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE \n\ from AB_OBJECTRELATIONTYPE main \n\ left join AB_OBJECTRELATIONTYPE type2 on (type2.AB_OBJECTRELATIONTYPEID <> main.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = main.RELATION_TYPE) \n\ - where case when type2.OBJECT_TYPE is null then ( ? = main.OBJECT_TYPE) else ( ? = type2.OBJECT_TYPE) end" + where case when type2.OBJECT_TYPE is null then main.OBJECT_TYPE else type2.OBJECT_TYPE end = ? " , [ - [vars.get("$param.ObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]], - [vars.get("$param.ObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]], + [vars.get("$param.ObjectType_param"), db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]] ]]).map(function(pItem) { return [pItem[0], translate.text(pItem[1])]; diff --git a/entity/ObjectTree_entity/ObjectTree_entity.aod b/entity/ObjectTree_entity/ObjectTree_entity.aod index 76ab8c7b04769223fd90e79169ebe97af852c7ea..1be26c1bbfc3609921f444ec9918c1522d1f49a2 100644 --- a/entity/ObjectTree_entity/ObjectTree_entity.aod +++ b/entity/ObjectTree_entity/ObjectTree_entity.aod @@ -11,6 +11,8 @@ <entityProvider> <name>TreeProvider</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>TARGET_CONTEXT</targetContextField> + <targetIdField>TARGET_ID</targetIdField> <dependencies> <entityDependency> <name>f4c0605f-3ccb-4ff1-b460-7268e8553857</name> @@ -25,6 +27,22 @@ <isConsumer v="false" /> </entityDependency> </dependencies> + <children> + <entityParameter> + <name>ObjectId_param</name> + <expose v="true" /> + <mandatory v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + <mandatory v="true" /> + </entityParameter> + <entityParameter> + <name>RelationType_param</name> + <expose v="false" /> + </entityParameter> + </children> </entityProvider> <entityParameter> <name>ObjectId_param</name> @@ -34,31 +52,130 @@ </entityParameter> <entityField> <name>UID</name> + <searchable v="false" /> </entityField> <entityField> <name>PARENT_ID</name> + <searchable v="false" /> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/parent_id/valueProcess.js</valueProcess> </entityField> <entityField> <name>TITLE</name> + <searchable v="false" /> </entityField> <entityField> <name>ICON</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/icon/valueProcess.js</valueProcess> </entityField> + <entityConsumer> + <name>ObjectRelationTypes</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>ObjectRelationType_entity</entityName> + <fieldName>ObjectRelationTypes</fieldName> + </dependency> + <children> + <entityParameter> + <name>SourceObjectType_param</name> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objectrelationtypes/children/sourceobjecttype_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + <mandatory v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityField> + <name>EXPANDED</name> + <searchable v="false" /> + </entityField> + <entityField> + <name>NODEID</name> + <searchable v="false" /> + </entityField> + <entityField> + <name>TARGET_ID</name> + <consumer>Objects</consumer> + <searchable v="false" /> + </entityField> <entityField> - <name>DESCRIPTION</name> - <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/description/valueProcess.js</valueProcess> + <name>TARGET_CONTEXT</name> + <searchable v="false" /> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/target_context/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>INFO</name> + <title>Description</title> + <searchable v="false" /> + </entityField> + <entityField> + <name>OBJECTRELATIONTYPEID</name> + <title>Relationtype</title> + <consumer>ObjectRelationTypes</consumer> + <stateProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objectrelationtypeid/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objectrelationtypeid/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objectrelationtypeid/displayValueProcess.js</displayValueProcess> + <onValueChange>%aditoprj%/entity/ObjectTree_entity/entityfields/objectrelationtypeid/onValueChange.js</onValueChange> + </entityField> + <entityConsumer> + <name>Objects</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Object_entity</entityName> + <fieldName>FilteredObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectType_param</name> + <title></title> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objects/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ExcludedObjectIds_param</name> + <valueProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/objects/children/excludedobjectids_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityActionGroup> + <name>alter</name> + <children> + <entityActionField> + <name>insert</name> + <fieldType>ACTION</fieldType> + <onActionProcess>%aditoprj%/entity/ObjectTree_entity/entityfields/alter/children/insert/onActionProcess.js</onActionProcess> + <isSelectionAction v="true" /> + <iconId>VAADIN:FILE_TREE_SMALL</iconId> + </entityActionField> + </children> + </entityActionGroup> + <entityParameter> + <name>RelationType_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> <name>jdito</name> <jDitoRecordAlias>Data_alias</jDitoRecordAlias> <contentProcess>%aditoprj%/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <onInsert>%aditoprj%/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js</onInsert> + <onDelete>%aditoprj%/entity/ObjectTree_entity/recordcontainers/jdito/onDelete.js</onDelete> <recordFields> <element>UID.value</element> - <element>PARENT_ID.value</element> <element>TITLE.value</element> + <element>PARENT_ID.value</element> + <element>EXPANDED.value</element> + <element>TARGET_ID.value</element> + <element>TARGET_CONTEXT.value</element> + <element>INFO.value</element> + <element>OBJECTRELATIONTYPEID.value</element> </recordFields> </jDitoRecordContainer> </recordContainers> diff --git a/entity/ObjectTree_entity/entityfields/alter/children/insert/onActionProcess.js b/entity/ObjectTree_entity/entityfields/alter/children/insert/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..16288da8047743cf9d006aa8eab8a7264fc3ec65 --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/alter/children/insert/onActionProcess.js @@ -0,0 +1,33 @@ +import("ObjectRelation_lib"); +import("system.neon"); +import("system.vars"); + +if (vars.exists("$local.rows") && vars.get("$local.rows")) +{ + var selectedRows = JSON.parse(vars.get("$local.rows")); + var uid = JSON.parse(selectedRows[0]["#LOOKUPID"]); + var isObjectRelationNode = typeof uid[2] == "string"; + + var parentId; + var parentObjectType; + var relationType; + + if (isObjectRelationNode) + { + parentId = uid[0]; + parentObjectType = uid[3]; + } + else + { + parentId = vars.getString("$param.ObjectId_param"); + parentObjectType = vars.getString("$param.ObjectType_param"); + } + + var params = { + "ObjectId_param" : parentId, + "ObjectType_param" : parentObjectType, + "RelationType_param" : vars.get("$field.OBJECTRELATIONTYPEID") + }; + + neon.openContext("ObjectTree", "ObjectTreeEdit_view", null, neon.OPERATINGSTATE_NEW, params); +} \ No newline at end of file diff --git a/entity/ObjectTree_entity/entityfields/objectrelationtypeid/displayValueProcess.js b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..83a799bf3424546b0600c284b48eba126d842a1a --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/displayValueProcess.js @@ -0,0 +1,9 @@ +import("system.translate"); +import("system.result"); +import("system.vars"); +import("ObjectRelation_lib"); + +if (vars.get("$field.OBJECTRELATIONTYPEID")) +{ + result.string(translate.text(ObjectRelationUtils.getRelationType(vars.get("$field.OBJECTRELATIONTYPEID"))[1])); +} diff --git a/entity/ObjectTree_entity/entityfields/objectrelationtypeid/onValueChange.js b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..9264282cd7b4f9b9dca1cdd33aff00bb63064dd5 --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/onValueChange.js @@ -0,0 +1,38 @@ +import("system.vars"); +import("system.db"); +import("system.result"); +import("system.neon"); +import("Sql_lib"); +import("Entity_lib"); + +var selectedObjectRelationTypeId = vars.exists("$field.selectedObjectRelationTypeIdProxy") ? vars.get("$field.selectedObjectRelationTypeIdProxy") : ""; +selectedObjectRelationTypeId = ProcessHandlingUtils.getOnValidationValue(selectedObjectRelationTypeId); + +var relationTypeData = db.array(db.ROW, SqlCondition.begin() + .andPrepare("AB_OBJECTRELATIONTYPE.AB_OBJECTRELATIONTYPEID", selectedObjectRelationTypeId) + .buildSql("select AB_OBJECTRELATIONTYPEID, OBJECT_TYPE, RELATION_TITLE, RELATION_TYPE, SIDE from AB_OBJECTRELATIONTYPE", "1=2")); + +if (relationTypeData[0]) +{ + var otherRelationTypeData = db.array(db.ROW, SqlCondition.begin() + .andPrepare("AB_OBJECTRELATIONTYPE.RELATION_TYPE", relationTypeData[3]) + .andPrepare("AB_OBJECTRELATIONTYPE.SIDE", (relationTypeData[4] == "1" ? "2" : "1")) + .buildSql("select AB_OBJECTRELATIONTYPEID, OBJECT_TYPE, RELATION_TITLE, RELATION_TYPE, SIDE from AB_OBJECTRELATIONTYPE", "1=2")) + if (!otherRelationTypeData[0]) + { + otherRelationTypeData = relationTypeData; + } + + if (relationTypeData[4] == "2") + { + //neon.setFieldValue("$field.AB_OBJECTRELATIONTYPE2", relationTypeData[0]); + //neon.setFieldValue("$field.AB_OBJECTRELATIONTYPE1", otherRelationTypeData[0]); + } + else if (relationTypeData[4] == "1") + { + //neon.setFieldValue("$field.AB_OBJECTRELATIONTYPE1", relationTypeData[0]); + //neon.setFieldValue("$field.AB_OBJECTRELATIONTYPE2", otherRelationTypeData[0]); + } + + // neon.setFieldValue("$field.MySide", otherRelationTypeData[4]); +} diff --git a/entity/ObjectTree_entity/entityfields/objectrelationtypeid/stateProcess.js b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7c27f2f690b8a109532759ab6ed8da6d97c671bb --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/stateProcess.js @@ -0,0 +1,12 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); + +if (vars.exists("$param.RelationType_param") && vars.get("$param.RelationType_param")) +{ + result.string(neon.COMPONENTSTATE_DISABLED); +} +else +{ + result.string(neon.COMPONENTSTATE_AUTO); +} \ No newline at end of file diff --git a/entity/Contact_entity/entityfields/organisation_id/valueProcess.js b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/valueProcess.js similarity index 50% rename from entity/Contact_entity/entityfields/organisation_id/valueProcess.js rename to entity/ObjectTree_entity/entityfields/objectrelationtypeid/valueProcess.js index 008844fbe522bd43628d4ef5741d38d8c456a6ae..6dad72dac58144e1246329a26405c1de0f7e8845 100644 --- a/entity/Contact_entity/entityfields/organisation_id/valueProcess.js +++ b/entity/ObjectTree_entity/entityfields/objectrelationtypeid/valueProcess.js @@ -1,8 +1,8 @@ -import("system.result"); -import("system.vars"); import("system.neon"); +import("system.vars"); +import("system.result"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.getString("$field.ORGANISATION_ID") == "") +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.RelationType_param") && vars.get("$param.RelationType_param")) { - result.string("0"); + result.string(vars.get("$param.RelationType_param")) } \ No newline at end of file diff --git a/entity/ObjectTree_entity/entityfields/objectrelationtypes/children/sourceobjecttype_param/valueProcess.js b/entity/ObjectTree_entity/entityfields/objectrelationtypes/children/sourceobjecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..95c8514f3bbc2804547c47b50ec222c09aec3f59 --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/objectrelationtypes/children/sourceobjecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$param.ObjectType_param")); \ No newline at end of file diff --git a/entity/ObjectTree_entity/entityfields/objects/children/excludedobjectids_param/valueProcess.js b/entity/ObjectTree_entity/entityfields/objects/children/excludedobjectids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..59596bc5946502edbb523a4d0a6f9d5f43cbe67b --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/objects/children/excludedobjectids_param/valueProcess.js @@ -0,0 +1,21 @@ +import("Sql_lib"); +import("system.vars"); +import("system.result"); +import("system.db"); +import("ObjectRelation_lib"); + +var relationTypeData = ObjectRelationUtils.getRelationType(vars.get("$field.OBJECTRELATIONTYPEID")); + +var sql1 = db.translateStatement(SqlCondition.begin() + .andPrepareVars("AB_OBJECTRELATION.OBJECT1_ROWID", "$field.PARENT_ID") + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE1", relationTypeData[7]) + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE2", relationTypeData[8]) + .buildSql("select OBJECT2_ROWID from AB_OBJECTRELATION", "1=2")); + +var sql2 = db.translateStatement(SqlCondition.begin() + .andPrepareVars("AB_OBJECTRELATION.OBJECT2_ROWID", "$field.PARENT_ID") + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE1", relationTypeData[7]) + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE2", relationTypeData[8]) + .buildSql("select OBJECT1_ROWID from AB_OBJECTRELATION", "1=2")); + +result.object([vars.get("$field.PARENT_ID")].concat(db.array(db.COLUMN, sql1 + " union " + sql2))); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/emailcommunications/children/contactid_param/valueProcess.js b/entity/ObjectTree_entity/entityfields/objects/children/objecttype_param/valueProcess.js similarity index 50% rename from entity/AnyContact_entity/entityfields/emailcommunications/children/contactid_param/valueProcess.js rename to entity/ObjectTree_entity/entityfields/objects/children/objecttype_param/valueProcess.js index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..b73f117c996323ede362e09f72d077c486603806 100644 --- a/entity/AnyContact_entity/entityfields/emailcommunications/children/contactid_param/valueProcess.js +++ b/entity/ObjectTree_entity/entityfields/objects/children/objecttype_param/valueProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file +result.string(vars.get("$field.TARGET_CONTEXT")); \ No newline at end of file diff --git a/entity/ObjectTree_entity/entityfields/parent_id/valueProcess.js b/entity/ObjectTree_entity/entityfields/parent_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7eed476d46447384559b14a62f4cfb3fd04f5475 --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/parent_id/valueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ObjectRelation_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) +{ + result.string(vars.get("$param.ObjectId_param")); +} \ No newline at end of file diff --git a/entity/ObjectTree_entity/entityfields/target_context/valueProcess.js b/entity/ObjectTree_entity/entityfields/target_context/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..700dc7461b5f61b17ead3d2735ef8fd2eb7ac6f6 --- /dev/null +++ b/entity/ObjectTree_entity/entityfields/target_context/valueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ObjectRelation_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) +{ + result.string(ObjectRelationUtils.getRelationType(vars.get("$field.OBJECTRELATIONTYPEID"))[6]); +} \ No newline at end of file diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js index 34ef78477331f19dc8f0ebb899c3b97bfb14454d..bc49795bd4cba307a64304d10edd0cc1f6234716 100644 --- a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js @@ -1,107 +1,275 @@ import("system.db"); -import("system.vars"); -import("system.result"); import("system.translate"); +import("system.result"); +import("system.vars"); +import("ObjectRelation_lib"); import("Context_lib"); -import("Sql_lib") +import("Sql_lib"); -var thisObjectId = vars.get("$param.ObjectId_param"); +var tree = [] +var filter = JSON.parse(vars.get("$local.filter")) +var selectedRelationType = null; -var objectRelations = fetchObjectRelations(thisObjectId); -var mappedObjectRelations = mapObjectRelations(objectRelations); +if (filter) +{ + if (filter.childs.length > 0) + { + selectedRelationType = filter.childs[0].value; + } +} +var originalObjectId = vars.get("$param.ObjectId_param"); + +_loadObjectRelationTree(originalObjectId, vars.get("$param.ObjectType_param"), selectedRelationType); -var treeData = buildTreeData(mappedObjectRelations); +result.object(tree); + +function _loadObjectRelationTree(pObjectId, pObjectType, pObjectRelationTypeId, pNodeId, pLayer, pRelationTypeData) +{ + // prevent stack overflows + if (pLayer > 30) + return; + + if (pLayer == undefined) + pLayer = 0; + + if (pNodeId == undefined) + pNodeId = null; + + var currentObjectId = pObjectId + + if (currentObjectId && pObjectType) + { + if (pLayer == 0) + { + if (pObjectRelationTypeId) + { + var relationTypeData = ObjectRelationUtils.getRelationType(pObjectRelationTypeId); + + // if hirachy: get most top id else use the current currentObjectId + if (relationTypeData[4] == "1") + { + // use always reverse-type + relationTypeData = ObjectRelationUtils.getRelationType(relationTypeData[8]); + currentObjectId = _getRootID(currentObjectId, relationTypeData); + } + + let uids = _insertEntry(tree, [[currentObjectId, "", "", "", "", relationTypeData[7]]], pNodeId, pLayer, pObjectType, selectedRelationType) + for (let i = 0; i < uids.length; i++) + { + _loadObjectRelationTree(uids[i][0], uids[i][3], relationTypeData[0], uids[i], pLayer+1, relationTypeData); + } + } + else // no ObjectType chosen + { + // load all ObjectRelationTypes + var relationTypes = _getRelationTypes(pObjectType); + + for (let i=0; i<relationTypes.length; i++) + { + var data = _getEntryData(currentObjectId, relationTypes[i][3], relationTypes[i][7], relationTypes[i][8]); + + // if any subentry: show objectType + if (data.length > 0) + { + // TODO: Icons, BINDATA + // var icon = getIcon... + let uid = [currentObjectId, i, relationTypes[i]]; + tree.push([JSON.stringify(uid), translate.text(relationTypes[i][1]), JSON.stringify(pNodeId), true, null, null, "", relationTypes[i][0]]); + + _loadObjectRelationTree(pObjectId, pObjectType, pObjectRelationTypeId, uid, pLayer+1, relationTypeData); + } + } + } + } + else if (pLayer >= 1) + { + // if no relationType given, load from nodeId + if (!pRelationTypeData) + pRelationTypeData = pNodeId[2]; + var thisRelationTypeId = pRelationTypeData[0]; + var otherRelationTypeId = pRelationTypeData[10]; + var hierarchy = pRelationTypeData[4]; + var destObjectType = pRelationTypeData[6]; + var relationType1 = pRelationTypeData[7]; + var relationType2 = pRelationTypeData[8]; + var direction = pRelationTypeData[3]; + + var relationTypeIdForNew = otherRelationTypeId; + + if (hierarchy == "1") + { + var myData = _getEntryData(pNodeId[0], direction, relationType1, relationType2) + + + + // if hierarchy and selected RelationType -> use the selected one + if (selectedRelationType) + relationTypeIdForNew = selectedRelationType + else + relationTypeIdForNew = thisRelationTypeId; + + + let uids = _insertEntry(tree, myData, pNodeId, pLayer, destObjectType, relationTypeIdForNew) + for (let i = 0; i < uids.length; i++) + { + _loadObjectRelationTree(uids[i][0], uids[i][3], pObjectRelationTypeId, uids[i], pLayer+1, pRelationTypeData); + } + } + else + { + // pNodeId[4] is the previous NodeId and pNodeId[4][0] the previous ObjectId + var prevObjectId; + if (pNodeId[4] != undefined) + { + prevObjectId = pNodeId[4][0]; + } + + var entryData = _getEntryData(pNodeId[0], direction, relationType1, relationType2, prevObjectId, true); + if (direction == "same") + relationTypeIdForNew = thisRelationTypeId -result.object(treeData); + // add both sides. Only one will succeed, because the prevObjectId will be filtered and it will just return [] + let uids = _insertEntry(tree, entryData, pNodeId, pLayer, destObjectType, thisRelationTypeId, 0); + if (direction == "same") + { + var otherEntryData = _getEntryData(pNodeId[0], "normal", relationType1, relationType2, prevObjectId, true); + uids = uids.concat(_insertEntry(tree, otherEntryData, pNodeId, pLayer, destObjectType, thisRelationTypeId, 1)); + } + + for (let i = 0; i < uids.length; i++) + { + _loadObjectRelationTree(uids[i][0], uids[i][3], pObjectRelationTypeId, uids[i], pLayer+1, pRelationTypeData); + } + } + } + } +} /** - * Will fetch all objects relations which are in relation with the given - * object ID. It will compare the given object ID with `OBJECT1_ROWID` and - * `OBJECT2_ROWID`. + * load data for a relation. + * OBJECT_ROWID, AB_OBJECTRELATIONID, OBJECT_TYPE, RELATION_TITLE, AB_OBJECTRELATIONTYPEID * - * It will always return the following array signature: - * (0) OBJECT1_ROWID | (1) OBJECT2_ROWID | (2) AB_OBJECTRELATIONTYPE1 |(3) type1.OBJECT_TYPE | (4) type1.RELATION_TITLE - * (5) AB_OBJECTRELATIONTYPE2 | (6) type2.OBJECT_TYPE | (7) type2.RELATION_TITLE | (8) Name of object 1 | (9) Name of object 2 - * - * @return Will return the given schema above. You can assume, that there will always - * be an array. + * @param {String} pObjectId + * @param {String} pDirection + * @param {String} pRelationType1 + * @param {String} pRelationType2 + * @param {String} pPrevId Id of the previous node to exclude it + * @param {Boolean} [pNoRecursion=false] if false: select for direction "same" the other direction, if result is empty. + * + * @return {[][]} */ -function fetchObjectRelations (pObjectID) { - var databaseResult = db.table( - "SELECT OBJECT1_ROWID, OBJECT2_ROWID, AB_OBJECTRELATIONTYPE1, type1.OBJECT_TYPE, type1.RELATION_TITLE, AB_OBJECTRELATIONTYPE2, type2.OBJECT_TYPE, type2.RELATION_TITLE, " - + ContextUtils.getNameSubselectSql("type1.OBJECT_TYPE", "OBJECT1_ROWID") + ", " + ContextUtils.getNameSubselectSql("type2.OBJECT_TYPE", "OBJECT2_ROWID") + " " - + "FROM ADITO.AB_OBJECTRELATION as relation " - + "left join AB_OBJECTRELATIONTYPE as type1 on AB_OBJECTRELATIONTYPE1 = type1.AB_OBJECTRELATIONTYPEID " - + "left join AB_OBJECTRELATIONTYPE as type2 on AB_OBJECTRELATIONTYPE2 = type2.AB_OBJECTRELATIONTYPEID " - + "where OBJECT1_ROWID = '" + thisObjectId + "' or OBJECT2_ROWID = '" + thisObjectId + "'"); +function _getEntryData(pObjectId, pDirection, pRelationType1, pRelationType2, pPrevId, pNoRecursion) +{ + if (pRelationType1 == undefined || pRelationType2 == undefined) + return []; + + var myNum; + var otherNum; + + if (pDirection == "normal") + { + otherNum = 1; + myNum = 2; + } + else + { + otherNum = 2; + myNum = 1; + } + + var cond = SqlCondition.begin() + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE1", pRelationType1) + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE2", pRelationType2) + .andPrepare("AB_OBJECTRELATION.OBJECT" + myNum + "_ROWID", pObjectId); + + // exclude previous node + if (!pPrevId) + cond.and("AB_OBJECTRELATION.OBJECT" + otherNum + "_ROWID is not null"); + else + { + cond.andPrepare("AB_OBJECTRELATION.OBJECT" + otherNum + "_ROWID", pPrevId, "# <> ?"); + } + + // TODO: BINDATA? + // var image = getImageObject("Beziehung"); + + var data = db.table(cond.buildSql( + "select OBJECT" + otherNum + "_ROWID, AB_OBJECTRELATIONID, OBJECT_TYPE, RELATION_TITLE, INFO, AB_OBJECTRELATIONTYPEID \n\ + from AB_OBJECTRELATION \n\ + join AB_OBJECTRELATIONTYPE on AB_OBJECTRELATIONTYPEID = AB_OBJECTRELATIONTYPE" + myNum + " and ","1=2", "", false)); + + if (data.length == 0 && pDirection == "same" && !pNoRecursion) + { + return _getEntryData(pObjectId, "normal", pRelationType1, pRelationType2, pPrevId, true) + } - return databaseResult; + // TODO: BINDATA? + //for ( var i = 0; i < data.length; i++) data[i][2] = image[data[i][2]] == undefined ? "" : image[data[i][2]]; + return data; +} + +function _getRelationTypes(pObjectType) +{ + // TODO: load from entity when possible + return ObjectRelationUtils.getPossibleRelationTypes(pObjectType, true); } /** - * Will map the given object relations into a valid schema for the tree. - * The requried schema for the param can be found in function - * {@link fetchObjectRelations}. - * This function is required for additional filtering an mapping of the data. - * - * It will always return the following array signature: - * (0) Object type ID | (1) Object type name | (2) Relation + * insert a new Entry + * + * @param {Array} pTree + * @param {Array[][]} pEntryData + * @param {Array[][]} pNodeId id of the parent + * @param {Integer} pLayer layernumber + * @param {String} pObjectType + * @param {String} pNewRelationTypeId the RelationType, a new relation should have, if this node is selected. + * @param {Integer} [pNum=undefined] optional number added to the key. Needed, if the key would not be unique. * - * - * @param pObjectRelations Array with object relations in specific schema. - * @return Will return the given schema above. You can assume, that there will - * always be an array. -* -* @return The mapped Array with object relations in the following format: -* ObjectTypeID | ObjectType | RelationTitle | ObjectID + * @return {Array[][]} the uids of the inserted data. Consists of [ObjectId, pEntryData-Index, AB_OBJECTRELATIONTYPEID, pObjectType, pNodeId, objectrelationid, objecttype */ -function mapObjectRelations (pObjectRelations) { - var resultSet = []; - - for (var i = 0; i < pObjectRelations.length; i++) { - var currentRecord = pObjectRelations[i]; - - var objectRowId1 = currentRecord[0]; - var objectRowId2 = currentRecord[1]; - - if (objectRowId1 === thisObjectId) { - resultSet.push([currentRecord[5], currentRecord[6], currentRecord[7], currentRecord[1], currentRecord[9]]); - } else if (objectRowId2 === thisObjectId) { - resultSet.push([currentRecord[2], currentRecord[3], currentRecord[4], currentRecord[0], currentRecord[8]]); - } +function _insertEntry(pTree, pEntryData, pNodeId, pLayer, pObjectType, pNewRelationTypeId, pNum) +{ + var expanded = true; + if (pLayer > 10) expanded = false; + // TODO: display address (tooltip wird denke ich nicht benötigt, da preview vorhanden) + var uids = []; + for(let i = 0; i < pEntryData.length; i++) + { + var display = db.cell(ContextUtils.getNameSql(pObjectType, pEntryData[i][0])); + // TODO: Icon + var uid = [pEntryData[i][0], i, pEntryData[i][5], pObjectType, pNodeId, pEntryData[i][2], pEntryData[i][1]] + if (pNum) + uid.push(pNum); + uids.push(uid); + pTree.push([JSON.stringify(uid), display, JSON.stringify(pNodeId), expanded, pEntryData[i][0], pObjectType, pEntryData[i][4], pNewRelationTypeId]); } - - return resultSet + return uids; } -function buildTreeData (pObjectRelations) { - // Group each relation type - var relationTypeMapping = {} - - var i = 0; - for (i = 0; i < pObjectRelations.length; i++) { - let currentRelation = pObjectRelations[i]; - - if (relationTypeMapping[currentRelation[0]] === undefined) - relationTypeMapping[currentRelation[0]] = currentRelation[2]; - } - - var treeRows = [] - for (i = 0; i < pObjectRelations.length; i++) { - let currentRelation = pObjectRelations[i]; - - treeRows.push([currentRelation[3], currentRelation[0], currentRelation[4]]); - } - - // Root elements - for (i = 0 ; i < Object.keys(relationTypeMapping).length; i++) { - var currentKey = Object.keys(relationTypeMapping)[i]; - - var translatedTitle = translate.text(relationTypeMapping[currentKey]) - - treeRows.push([currentKey, null, translatedTitle]); - } - - return treeRows; +/* +* get most top root of a node +* +* @param {String} pObjectId +* @param {String[]} pObjectRelationTypeData +* +* @return {String} RootObjectId +*/ +function _getRootID(pObjectId, pObjectRelationTypeData) +{ + var sourceid = pObjectId; + var max = 100; + do + { + var rootid = sourceid; + max--; + sourceid = db.cell(SqlCondition.begin() + .andPrepare("AB_OBJECTRELATION.OBJECT2_ROWID", sourceid) + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE1", pObjectRelationTypeData[7]) + .andPrepare("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE2", pObjectRelationTypeData[8]) + .buildSql("select OBJECT1_ROWID from AB_OBJECTRELATION", "1=2")) + } + while( sourceid != "" && max > 0 ); + return rootid; + return currentObjectId; } \ No newline at end of file diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/onDelete.js b/entity/ObjectTree_entity/recordcontainers/jdito/onDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..27ac27f8fe01dcffa3e2123c1e9f90978aa358a6 --- /dev/null +++ b/entity/ObjectTree_entity/recordcontainers/jdito/onDelete.js @@ -0,0 +1,19 @@ +import("system.vars"); +import("system.neon"); +import("system.db"); +import("Sql_lib"); + + +var uid = JSON.parse(vars.get("$field.UID")); +var isObjectRelationNode = typeof uid[2] == "string"; + +if (isObjectRelationNode) +{ + var objectRelationId = uid[6]; + db.deleteData("AB_OBJECTRELATION", SqlCondition.begin() + .andPrepareIfSet("AB_OBJECTRELATION.AB_OBJECTRELATIONID", objectRelationId) + .build("1=2")); + + // Refresh otherwise the children of the deleted node would be moved to the root. + neon.refresh(); +} diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js b/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..9be46d3b15a8cba7ef2c661771a116404d4b0f16 --- /dev/null +++ b/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js @@ -0,0 +1,47 @@ +import("system.util"); +import("ObjectRelation_lib"); +import("system.vars"); +import("system.db"); + +selectedObjectRelationTypeId = vars.get("$field.OBJECTRELATIONTYPEID"); +if (selectedObjectRelationTypeId) +{ + relationTypeData = ObjectRelationUtils.getRelationType(selectedObjectRelationTypeId) + if (relationTypeData[0]) + { + var relationType1 = relationTypeData[7]; + var relationType2 = relationTypeData[8]; + var side = relationTypeData[9]; + var objectId1; + var objectId2; + var info = vars.get("$field.INFO"); + + + if (side == "1") + { + objectId1 = vars.get("$field.TARGET_ID"); + objectId2 = vars.get("$field.PARENT_ID"); + } + else + { + objectId1 = vars.get("$field.PARENT_ID"); + objectId2 = vars.get("$field.TARGET_ID"); + } + + db.insertData("AB_OBJECTRELATION", [ + "AB_OBJECTRELATIONID", + "OBJECT1_ROWID", + "OBJECT2_ROWID", + "AB_OBJECTRELATIONTYPE1", + "AB_OBJECTRELATIONTYPE2", + "INFO" + ], null, [ + util.getNewUUID(), + objectId1, + objectId2, + relationType1, + relationType2, + info + ]); + } +} \ No newline at end of file diff --git a/entity/Object_entity/Object_entity.aod b/entity/Object_entity/Object_entity.aod index 62d80564faf8ff52440f4514aa96a8e57ce7530d..189f11b3a9e366446d7115baa6c948503634dc4f 100644 --- a/entity/Object_entity/Object_entity.aod +++ b/entity/Object_entity/Object_entity.aod @@ -29,32 +29,6 @@ <mandatory v="true" /> <description>PARAMETER</description> </entityParameter> - <entityParameter> - <name>ObjectRowId_param</name> - <expose v="true" /> - <mandatory v="false" /> - <description>PARAMETER</description> - </entityParameter> - <entityProvider> - <name>OneObject</name> - <fieldType>DEPENDENCY_IN</fieldType> - <documentation>%aditoprj%/entity/Object_entity/entityfields/oneobject/documentation.adoc</documentation> - <recordContainer>jdito</recordContainer> - <children> - <entityParameter> - <name>ObjectRowId_param</name> - <expose v="true" /> - <triggerRecalculation v="true" /> - <mandatory v="true" /> - </entityParameter> - <entityParameter> - <name>ObjectType_param</name> - <expose v="true" /> - <triggerRecalculation v="true" /> - <mandatory v="true" /> - </entityParameter> - </children> - </entityProvider> <entityProvider> <name>AllObjects</name> <fieldType>DEPENDENCY_IN</fieldType> @@ -88,17 +62,16 @@ </entityDependency> </dependencies> <children> - <entityParameter> - <name>ObjectRowId_param</name> - <expose v="false" /> - <mandatory v="false" /> - </entityParameter> <entityParameter> <name>ObjectType_param</name> <expose v="true" /> <triggerRecalculation v="true" /> <mandatory v="true" /> </entityParameter> + <entityParameter> + <name>ExcludedObjectIds_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityConsumer> @@ -164,6 +137,35 @@ <fieldName>#PROVIDER</fieldName> </dependency> </entityConsumer> + <entityParameter> + <name>ExcludedObjectIds_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>FilteredObjects</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>e644a709-cc8f-425e-bef2-9c51eea9bbe9</name> + <entityName>ObjectTree_entity</entityName> + <fieldName>Objects</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + <children> + <entityParameter> + <name>ExcludedObjectIds_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + <triggerRecalculation v="true" /> + <mandatory v="true" /> + </entityParameter> + </children> + </entityProvider> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Object_entity/entityfields/oneobject/documentation.adoc b/entity/Object_entity/entityfields/oneobject/documentation.adoc deleted file mode 100644 index 628c21478017d70552888637466be8b427010c37..0000000000000000000000000000000000000000 --- a/entity/Object_entity/entityfields/oneobject/documentation.adoc +++ /dev/null @@ -1,3 +0,0 @@ -== OneObjects provider == - -This provider returns one specific object. \ No newline at end of file diff --git a/entity/Object_entity/recordcontainers/jdito/contentProcess.js b/entity/Object_entity/recordcontainers/jdito/contentProcess.js index 4c8e5d685bc170924f901660acd523c9c34450c4..4497cff4006889629e44c87348ca9169084ad09b 100644 --- a/entity/Object_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Object_entity/recordcontainers/jdito/contentProcess.js @@ -3,16 +3,14 @@ import("system.vars"); import("system.result"); import("Context_lib"); + if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param")) { - if (vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param")) - { - result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"), false, undefined, false))); - } - else - { - result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false, undefined, false))) - } + var excludedIds = []; + if (vars.exists("$param.ExcludedObjectIds_param") && vars.get("$param.ExcludedObjectIds_param")) + excludedIds = JSON.parse(vars.get("$param.ExcludedObjectIds_param")); + + result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false, undefined, false, excludedIds))) } else { diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index c1bf480be604d9c20db4984dd52e7720f7dbf30a..36e8bee336ba4f8af8ccd2b908feffe9ff9e4333 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -37,7 +37,7 @@ </entityField> <entityField> <name>OFFERDATE</name> - <title>Creation date</title> + <title>Date</title> <contentType>DATE</contentType> <resolution>DAY</resolution> <outputFormat>dd.MM.yyyy</outputFormat> @@ -336,8 +336,14 @@ <dependency> <name>dependency</name> <entityName>Salesproject_entity</entityName> - <fieldName>#PROVIDER</fieldName> + <fieldName>openSalesprojects</fieldName> </dependency> + <children> + <entityParameter> + <name>ContactId_param</name> + <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/salesprojects/children/contactid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> </entityConsumer> <entityField> <name>ADDRESS</name> @@ -351,7 +357,7 @@ <entityField> <name>ChosenAddress</name> <title>Choose address</title> - <possibleItemsProcess>%aditoprj%/entity/Offer_entity/entityfields/chosenaddress/possibleItemsProcess.js</possibleItemsProcess> + <consumer>PossibleAddresses</consumer> <stateProcess>%aditoprj%/entity/Offer_entity/entityfields/chosenaddress/stateProcess.js</stateProcess> <onValueChange>%aditoprj%/entity/Offer_entity/entityfields/chosenaddress/onValueChange.js</onValueChange> <onValueChangeTypes> @@ -591,6 +597,7 @@ <name>Tasks</name> <title>Tasks</title> <fieldType>DEPENDENCY_OUT</fieldType> + <stateProcess>%aditoprj%/entity/Offer_entity/entityfields/tasks/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>Task_entity</entityName> @@ -694,6 +701,21 @@ <state>READONLY</state> <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/fulloffercode/valueProcess.js</valueProcess> </entityField> + <entityConsumer> + <name>PossibleAddresses</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Address_entity</entityName> + <fieldName>OrganisationAndContactAddresses</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContactId_param</name> + <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/possibleaddresses/children/contactid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Offer_entity/entityfields/chosenaddress/possibleItemsProcess.js b/entity/Offer_entity/entityfields/chosenaddress/possibleItemsProcess.js deleted file mode 100644 index c45999248fc3f0f12bfe2dcf4987b648fdf4a25a..0000000000000000000000000000000000000000 --- a/entity/Offer_entity/entityfields/chosenaddress/possibleItemsProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.vars"); -import("system.result"); -import("PostalAddress_lib"); - -result.object(AddressUtils.getAllPossibleAddresses(vars.get("$field.CONTACT_ID"))); \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/contact_id/onValueChange.js b/entity/Offer_entity/entityfields/contact_id/onValueChange.js index 96af6855c0f276ec0fd3ccea251c7063f8904681..98ae338e181debb430e224d724a4e4fc430d7f2d 100644 --- a/entity/Offer_entity/entityfields/contact_id/onValueChange.js +++ b/entity/Offer_entity/entityfields/contact_id/onValueChange.js @@ -1,14 +1,20 @@ -import("system.neon"); -import("system.vars"); -import("system.db"); -import("Util_lib"); -import("Entity_lib"); - -var contactid = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ID")); -if(contactid != "") -{ - var relData = db.array(db.ROW, "select LANGUAGE from CONTACT where CONTACTID = '" + contactid + "'"); - - if(relData[0] != "") - neon.setFieldValue("field.LANGUAGE", relData[0]); +import("system.logging"); +import("system.neon"); +import("system.vars"); +import("system.db"); +import("Util_lib"); +import("Entity_lib"); +import("Contact_lib"); + +var contactid = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ID")); +if(contactid != "") +{ + //Language Preset + var relData = db.array(db.ROW, "select LANGUAGE from CONTACT where CONTACTID = '" + contactid + "'"); + if(relData[0] != "") + neon.setFieldValue("field.LANGUAGE", relData[0]); + + // set $field.CONTATCT_ORG_ID per contactid + var orgid = ContactUtils.getPersOrgIds(contactid); + neon.setFieldValue("$field.CONTACT_ORG_ID", orgid[2]); } \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/deliveryterms/valueProcess.js b/entity/Offer_entity/entityfields/deliveryterms/valueProcess.js index 911cd325a0adcf0def03c682d6926d51aae3a143..c3d8c920eeae0f1fc9c1089633fa9b076a011264 100644 --- a/entity/Offer_entity/entityfields/deliveryterms/valueProcess.js +++ b/entity/Offer_entity/entityfields/deliveryterms/valueProcess.js @@ -1,8 +1,17 @@ -import("system.logging"); +import("system.neon"); import("system.result"); import("system.vars"); +import("Attribute_lib"); if (vars.exists("$param.OfferDeliveryTerm_param") && vars.get("$param.OfferDeliveryTerm_param")) { result.string(vars.get("$param.OfferDeliveryTerm_param")); +} +else if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +{ + var contactId = vars.getString("$field.CONTACT_ID"); + if (contactId) + { // Lieferkondition + result.string(AttributeRelationUtils.getAttribute("3a6e11fc-b00a-4cf3-975a-a5e8b60fc5cb", contactId)); + } } \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/paymentterms/valueProcess.js b/entity/Offer_entity/entityfields/paymentterms/valueProcess.js index 298cb1a859a5f83be6c6a747b37e4a4ddff476e4..35d02f62cada7767c96df6d5b45bbce9658d3b0c 100644 --- a/entity/Offer_entity/entityfields/paymentterms/valueProcess.js +++ b/entity/Offer_entity/entityfields/paymentterms/valueProcess.js @@ -1,7 +1,17 @@ -import("system.result"); -import("system.vars"); - -if (vars.exists("$param.OfferPaymentTerm_param") && vars.get("$param.OfferPaymentTerm_param")) -{ - result.string(vars.get("$param.OfferPaymentTerm_param")); +import("system.neon"); +import("system.result"); +import("system.vars"); +import("Attribute_lib"); + +if (vars.exists("$param.OfferPaymentTerm_param") && vars.get("$param.OfferPaymentTerm_param")) +{ + result.string(vars.get("$param.OfferPaymentTerm_param")); +} +else if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +{ + var contactId = vars.getString("$field.CONTACT_ID"); + if (contactId) + { // Zahlungskondition + result.string(AttributeRelationUtils.getAttribute("292fae38-6557-466d-8843-3b1b4a1f6599", contactId)); + } } \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/contact/children/contactid_param/valueProcess.js b/entity/Offer_entity/entityfields/possibleaddresses/children/contactid_param/valueProcess.js similarity index 52% rename from entity/AnyContact_entity/entityfields/contact/children/contactid_param/valueProcess.js rename to entity/Offer_entity/entityfields/possibleaddresses/children/contactid_param/valueProcess.js index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..7e0951d02b7c26bc9ff0a84ad34eb2b47aa0ced8 100644 --- a/entity/AnyContact_entity/entityfields/contact/children/contactid_param/valueProcess.js +++ b/entity/Offer_entity/entityfields/possibleaddresses/children/contactid_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); import("system.result"); +import("system.vars"); -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file +result.string(vars.get("$field.CONTACT_ID")); \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/salesproject_id/stateProcess.js b/entity/Offer_entity/entityfields/salesproject_id/stateProcess.js index a88395a1cc7e5206b5396eba14e7dcf6c927214a..1a1eb537b9b727aa99c48fe7236750b5c19c8e5a 100644 --- a/entity/Offer_entity/entityfields/salesproject_id/stateProcess.js +++ b/entity/Offer_entity/entityfields/salesproject_id/stateProcess.js @@ -1,13 +1,19 @@ -import("system.neon"); -import("system.result"); -import("system.vars"); - - -switch (vars.get("$sys.recordstate")) -{ - case neon.OPERATINGSTATE_NEW: - result.object(neon.COMPONENTSTATE_EDITABLE); - break; - default: - result.object(neon.COMPONENTSTATE_READONLY); +import("system.logging"); +import("system.neon"); +import("system.result"); +import("system.vars"); +import("Entity_lib"); + + +switch (vars.get("$sys.recordstate")) +{ + case neon.OPERATINGSTATE_NEW: + //only EDITABLE if $field.CONTACT_ID is set + if(ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ID"))) + result.object(neon.COMPONENTSTATE_EDITABLE); + else + result.object(neon.COMPONENTSTATE_READONLY); + break; + default: + result.object(neon.COMPONENTSTATE_READONLY); } \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/salesprojects/children/contactid_param/valueProcess.js b/entity/Offer_entity/entityfields/salesprojects/children/contactid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2b24f74fc8720337e690ffb5b66610529cdbb859 --- /dev/null +++ b/entity/Offer_entity/entityfields/salesprojects/children/contactid_param/valueProcess.js @@ -0,0 +1,7 @@ +import("system.logging"); +import("system.vars"); +import("system.result"); +import("Entity_lib"); + +var contact = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ORG_ID")); +result.string(contact); \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/status/valueProcess.js b/entity/Offer_entity/entityfields/status/valueProcess.js index 7d4ed678a49b3ccfbd5d34fdb892fd6f0c8520a1..ef4ec27fb0c16db8e3b6a59b3723da26f78f54e8 100644 --- a/entity/Offer_entity/entityfields/status/valueProcess.js +++ b/entity/Offer_entity/entityfields/status/valueProcess.js @@ -2,5 +2,5 @@ import("system.neon"); import("system.vars"); import("system.result"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) result.string("70d27a1b-7233-481d-826f-01a13a4bb0b2"); //Open \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/tasks/stateProcess.js b/entity/Offer_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fca9129ea68cf45ad847604b3e6f12b25052ce36 --- /dev/null +++ b/entity/Offer_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if(TaskUtils.hasTasks(vars.get("$field.OFFERID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Offer_entity/recordcontainers/db/onDBInsert.js b/entity/Offer_entity/recordcontainers/db/onDBInsert.js index 6b3c4033a05890bdd874ce4fa610333b06fdc538..c9c487029913a28d6eda69030fccfc6f6f3a3f5f 100644 --- a/entity/Offer_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Offer_entity/recordcontainers/db/onDBInsert.js @@ -1,6 +1,6 @@ -import("system.neon"); -import("system.vars"); -import("Offer_lib"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferOriginal_Id_param")) - OfferUtils.copyOfferItems(vars.getString("$param.OfferOriginal_Id_param"), vars.get("$field.OFFERID")); +import("system.neon"); +import("system.vars"); +import("Offer_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferOriginal_Id_param")) + OfferUtils.copyOfferItems(vars.getString("$param.OfferOriginal_Id_param"), vars.get("$field.OFFERID")); diff --git a/entity/Order_entity/recordcontainers/db/onDBInsert.js b/entity/Order_entity/recordcontainers/db/onDBInsert.js index f3f8fd6de5a6a1febfa39604a10cd0249ed35e89..940a4ff0f9a833f00b45814bab915e9ed2014fb6 100644 --- a/entity/Order_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Order_entity/recordcontainers/db/onDBInsert.js @@ -1,12 +1,12 @@ -import("system.neon"); -import("system.vars"); -import("Sql_lib"); -import("Order_lib"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferId_param")) -{ - var orderId = vars.getString("$field.SALESORDERID"); - var offerId = vars.getString("$param.OfferId_param"); - - OrderUtils.copyOfferItemsToOrder(offerId, orderId); //copy all offerItems -} +import("system.neon"); +import("system.vars"); +import("Sql_lib"); +import("Order_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferId_param")) +{ + var orderId = vars.getString("$field.SALESORDERID"); + var offerId = vars.getString("$param.OfferId_param"); + + OrderUtils.copyOfferItemsToOrder(offerId, orderId); //copy all offerItems +} diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 050b6738dd5c452c86620029a839f8555a0391e1..4c1e471d6c434880440c4cd5d98d2d70ca8479c3 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -122,20 +122,6 @@ <name>Organisations</name> <fieldType>DEPENDENCY_IN</fieldType> <recordContainer>db</recordContainer> - <dependencies> - <entityDependency> - <name>e56d51be-aaf7-4ddc-8bed-7a4a3c42b4dd</name> - <entityName>AnyContact_entity</entityName> - <fieldName>Organisations</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>19a28531-bec6-49e2-b00d-aae3816e6690</name> - <entityName>Person_entity</entityName> - <fieldName>Organisations</fieldName> - <isConsumer v="false" /> - </entityDependency> - </dependencies> <children> <entityParameter> <name>ContactId_param</name> @@ -292,13 +278,6 @@ </entityParameter> </children> </entityConsumer> - <entityParameter> - <name>ContactId_param</name> - <expose v="true" /> - <triggerRecalculation v="true" /> - <mandatory v="false" /> - <description>PARAMETER</description> - </entityParameter> <entityActionField> <name>openEditDefaultsView</name> <fieldType>ACTION</fieldType> @@ -571,6 +550,7 @@ <name>Tasks</name> <title>Tasks</title> <fieldType>DEPENDENCY_OUT</fieldType> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/tasks/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>Task_entity</entityName> @@ -609,6 +589,10 @@ <name>ObjectId_param</name> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/objecttrees/children/objectid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityActionField> @@ -652,6 +636,12 @@ <fieldName>Organisations</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>a80c3db0-29db-433c-8f7c-4ebf6639ad6d</name> + <entityName>Person_entity</entityName> + <fieldName>Organisations</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -668,6 +658,18 @@ <name>WithPrivate_param</name> <expose v="true" /> </entityParameter> + <entityParameter> + <name>AttributeId_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>AttributeKeyId_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>ExcludedContactIds_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityParameter> @@ -813,23 +815,31 @@ <alias>Data_alias</alias> <fromClauseProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <onDBInsert>%aditoprj%/entity/Organisation_entity/recordcontainers/db/onDBInsert.js</onDBInsert> <onDBUpdate>%aditoprj%/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate> <linkInformation> <linkInformation> - <name>47c6c065-ae0e-4cee-b913-335570e3221c</name> + <name>f745a13c-6fbe-4cab-99d8-3cb7d599005a</name> <tableName>ORGANISATION</tableName> <primaryKey>ORGANISATIONID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> <linkInformation> - <name>e6120ee7-e6c3-4f60-9327-417627ba1fac</name> + <name>31f03bd6-83c1-4185-a9a7-4e6d94469fd2</name> <tableName>CONTACT</tableName> <primaryKey>CONTACTID</primaryKey> <isUIDTable v="false" /> <readonly v="false" /> </linkInformation> + <linkInformation> + <name>695731e1-879d-4fb1-a1bb-56ecfd6f7c03</name> + <tableName>ADDRESS</tableName> + <primaryKey>ADDRESSID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> <recordFieldMappings> <dbRecordFieldMapping> @@ -918,6 +928,10 @@ <name>DATE_NEW_CONTACT.value</name> <recordfield>CONTACT.DATE_NEW</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ADDRESS_ID.displayValue</name> + <expression>%aditoprj%/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Organisation_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js b/entity/Organisation_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Organisation_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/tasks/stateProcess.js b/entity/Organisation_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2d6a0eb24444a21440ea2433c6acd0e252c6e68d --- /dev/null +++ b/entity/Organisation_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if(TaskUtils.hasTasks(vars.get("$field.ORGANISATIONID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/conditionProcess.js b/entity/Organisation_entity/recordcontainers/db/conditionProcess.js index a42eafd4400a52b510acf02a51d1f9139c44c87b..8743459e608d7cb1e9195871a64eb5d0868d4ea2 100644 --- a/entity/Organisation_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Organisation_entity/recordcontainers/db/conditionProcess.js @@ -4,8 +4,7 @@ import("system.result"); import("Sql_lib"); import("Context_lib"); -var cond = SqlCondition.begin() - .andPrepareVars("ORGANISATION.ORGANISATIONID", "$param.ContactId_param"); +var cond = SqlCondition.begin(); // filter privat company if it is not needed if (vars.getString("$param.WithPrivate_param") != "true") diff --git a/entity/Organisation_entity/recordcontainers/db/fromClauseProcess.js b/entity/Organisation_entity/recordcontainers/db/fromClauseProcess.js index fd4f9ce328d42a3ef11efbd7b6454d99d6b3f30c..81779a42ee9e845df049275fd8bdf352063e1d4a 100644 --- a/entity/Organisation_entity/recordcontainers/db/fromClauseProcess.js +++ b/entity/Organisation_entity/recordcontainers/db/fromClauseProcess.js @@ -1,3 +1,6 @@ import("system.result"); -result.string("ORGANISATION join CONTACT on (ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null)"); \ No newline at end of file +//ADDRESS is necessary to display standard address fast within organisation lists +result.string("ORGANISATION \n\ + join CONTACT on (ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null)\n\ + left join ADDRESS on (ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID)"); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/orderClauseProcess.js b/entity/Organisation_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4e5e1db97f786170e23f3951f9bf75bcd0f5cadd --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.db"); + +result.object({ + "ORGANISATION.CUSTOMERCODE": db.ASCENDING, + "ORGANISATION.NAME": db.ASCENDING + }); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..beac43f3d912a8f81208580f156bb766178124f7 --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js @@ -0,0 +1,5 @@ +import("PostalAddress_lib"); +import("system.result"); + +var res = AddressUtils.formatOnelineSql(); +result.string(res); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 517e223b8aae896d620243966e506be6400d9497..29f540f5c2b482271c6b30787e99c1e0ecdb7ac8 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -5,6 +5,7 @@ <description>former Pers</description> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Person_entity/documentation.adoc</documentation> + <onValidation>%aditoprj%/entity/Person_entity/onValidation.js</onValidation> <iconId>VAADIN:USERS</iconId> <imageProcess>%aditoprj%/entity/Person_entity/imageProcess.js</imageProcess> <titleProcess>%aditoprj%/entity/Person_entity/titleProcess.js</titleProcess> @@ -156,7 +157,7 @@ <searchable v="true" /> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess> - <onValueChange>%aditoprj%/entity/Person_entity/entityfields/organisation_id/onValueChange.js</onValueChange> + <onValidation>%aditoprj%/entity/Person_entity/entityfields/organisation_id/onValidation.js</onValidation> </entityField> <entityConsumer> <name>PersAddresses</name> @@ -208,12 +209,16 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <dependency> <name>dependency</name> <entityName>Organisation_entity</entityName> - <fieldName>Organisations</fieldName> + <fieldName>WithPersonIdFilter</fieldName> </dependency> <children> <entityParameter> <name>WithPrivate_param</name> </entityParameter> + <entityParameter> + <name>ExcludeOrganisationsByPersonId</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -349,12 +354,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <fieldType>DEPENDENCY_IN</fieldType> <recordContainer>db</recordContainer> <dependencies> - <entityDependency> - <name>0b209ee1-3c13-4660-91c4-4d2a2c6cea77</name> - <entityName>AnyContact_entity</entityName> - <fieldName>Contact</fieldName> - <isConsumer v="false" /> - </entityDependency> <entityDependency> <name>12c5350a-3159-449b-a94e-d57658b4c124</name> <entityName>SalesprojectMember_entity</entityName> @@ -623,6 +622,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>Tasks</name> <title>Tasks</title> <fieldType>DEPENDENCY_OUT</fieldType> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/tasks/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>Task_entity</entityName> @@ -657,6 +657,10 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>ObjectId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/objecttrees/children/objectid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityField> @@ -694,10 +698,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>ContactId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/contactandorganisationaddresses/children/contactid_param/valueProcess.js</valueProcess> </entityParameter> - <entityParameter> - <name>OrganisationId_param</name> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/contactandorganisationaddresses/children/organisationid_param/valueProcess.js</valueProcess> - </entityParameter> </children> </entityConsumer> <entityField> @@ -884,29 +884,37 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <alias>Data_alias</alias> <fromClauseProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <onDBUpdate>%aditoprj%/entity/Person_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate> <linkInformation> <linkInformation> - <name>cb2de42b-de48-4543-91d6-8d00af5c5736</name> + <name>3afdecb0-515e-43d2-872f-04c82ecca9ae</name> <tableName>PERSON</tableName> <primaryKey>PERSONID</primaryKey> <isUIDTable v="false" /> <readonly v="false" /> </linkInformation> <linkInformation> - <name>23fde8db-a3fe-421d-9e39-f6a0294e6883</name> + <name>217d431f-018c-4573-b786-d1b6b88f4b64</name> <tableName>CONTACT</tableName> <primaryKey>CONTACTID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> <linkInformation> - <name>6766787e-d39b-4030-bd26-cacfcd80d386</name> + <name>19877118-eb80-4672-bd73-cf10dbbb052a</name> <tableName>ORGANISATION</tableName> <primaryKey>ORGANISATIONID</primaryKey> <isUIDTable v="false" /> <readonly v="true" /> </linkInformation> + <linkInformation> + <name>64f188c2-e53d-44b5-9980-c867282eff7e</name> + <tableName>ADDRESS</tableName> + <primaryKey>ADDRESSID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> <recordFieldMappings> <dbRecordFieldMapping> @@ -1043,6 +1051,10 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>USER_NEW_CONTACT.value</name> <recordfield>CONTACT.USER_NEW</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ADDRESS_ID.displayValue</name> + <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Person_entity/entityfields/contactandorganisationaddresses/children/organisationid_param/valueProcess.js b/entity/Person_entity/entityfields/contactandorganisationaddresses/children/organisationid_param/valueProcess.js deleted file mode 100644 index a3b647281edc9773de45eec7b7d8afe949f3eba2..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/contactandorganisationaddresses/children/organisationid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.ORGANISATION_ID")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js b/entity/Person_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Person_entity/entityfields/objecttrees/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/organisation_id/onValidation.js b/entity/Person_entity/entityfields/organisation_id/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..daba90e666e30baec493136b062e2f20f1f13cf4 --- /dev/null +++ b/entity/Person_entity/entityfields/organisation_id/onValidation.js @@ -0,0 +1,22 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Entity_lib"); +import("Contact_lib"); + +if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW) +{ + var personId = vars.getString("$field.PERSONID"); + var organisationId = ProcessHandlingUtils.getOnValidationValue("$field.ORGANISATION_ID"); + var contactId = vars.get("$field.CONTACTID");//in EDIT we have to exclude our own CONTACTID since we do not want a message for our own contactentry + + //workaround for organisationId: $local.value will return the name of the organisation which is not what we want + //but the field already contains the changed value; so let's load the field instead of the $local.value-variable + //this is a bug within the ADITO-kernel + //TODO: change the workaround behaviour when $local.value is retrieved correct + organisationId = vars.getString("$field.ORGANISATION_ID"); + + var validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, contactId); + if (validationMsg) + result.string(validationMsg); +} \ No newline at end of file diff --git a/entity/Person_entity/entityfields/organisation_id/onValueChange.js b/entity/Person_entity/entityfields/organisation_id/onValueChange.js deleted file mode 100644 index d24b292520e51b6b67f1595dd215bbf88e2a3bed..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/organisation_id/onValueChange.js +++ /dev/null @@ -1,7 +0,0 @@ -import("system.neon"); -import("system.vars"); - -if(vars.exists("$local.value") && !vars.get("$local.value")) -{ - neon.setFieldValue("$field.ORGANISATION_ID", "0"); -} diff --git a/entity/Person_entity/entityfields/organisation_id/valueProcess.js b/entity/Person_entity/entityfields/organisation_id/valueProcess.js index b570e1812595b86a3ff3891033814fda2f66fdaa..6f44e6e6c6e93c530f1ba2446ad7cb026e04c6ce 100644 --- a/entity/Person_entity/entityfields/organisation_id/valueProcess.js +++ b/entity/Person_entity/entityfields/organisation_id/valueProcess.js @@ -8,8 +8,4 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this. { result.string(vars.get("$param.OrgId_param")); } - else if(!vars.get("$field.ORGANISATION_ID")) - { - result.string("0") - } } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js b/entity/Person_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..03e286d947fe6f5a9aa506ee361e230c43eacd95 --- /dev/null +++ b/entity/Person_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js @@ -0,0 +1,7 @@ +import("system.vars"); +import("system.result"); +import("system.neon"); + +//in mode NEW no record with that PERSONID exists that could be excluded by a database query, so let's ignore that (which means do not pass a value) +if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW) + result.object(vars.get("$field.PERSONID")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/tasks/stateProcess.js b/entity/Person_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a33c7f3e00a9b4fdddcb9834e90446814be4cf5a --- /dev/null +++ b/entity/Person_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if(TaskUtils.hasTasks(vars.get("$field.CONTACTID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Person_entity/imageProcess.js b/entity/Person_entity/imageProcess.js index 9d30ec1ce2a58d9eb87207bef231889d3878863f..07ab8d8c0fdef46bed683cebdd399fa91084d0bb 100644 --- a/entity/Person_entity/imageProcess.js +++ b/entity/Person_entity/imageProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -result.string("TEXT:" + vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME")); \ No newline at end of file +result.string("TEXT:" + (vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME") + " " + vars.getString("$field.ORGANISATION_ID.displayValue")).trim()); \ No newline at end of file diff --git a/entity/Person_entity/onValidation.js b/entity/Person_entity/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..41a2e1e25158de5c2d475b3cb0bcc952b8f70434 --- /dev/null +++ b/entity/Person_entity/onValidation.js @@ -0,0 +1,3 @@ +import("system.vars"); +if (!vars.get("$field.ORGANISATION_ID")) + vars.set("$field.ORGANISATION_ID", "0"); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/fromClauseProcess.js b/entity/Person_entity/recordcontainers/db/fromClauseProcess.js index ce2f7eb850a73316a2aecd84f0ef7c968124d5d9..96d05d16af027f62abf95a8cb65c6d30b71530cd 100644 --- a/entity/Person_entity/recordcontainers/db/fromClauseProcess.js +++ b/entity/Person_entity/recordcontainers/db/fromClauseProcess.js @@ -1,4 +1,7 @@ import("system.vars"); import("system.result"); -result.string("PERSON join CONTACT on (CONTACT.PERSON_ID = PERSON.PERSONID) join ORGANISATION on ORGANISATIONID = ORGANISATION_ID "); \ No newline at end of file +//ADDRESS is necessary to display standard address fast within contact lists +result.string("PERSON \n\ + join CONTACT on (CONTACT.PERSON_ID = PERSON.PERSONID) join ORGANISATION on ORGANISATIONID = ORGANISATION_ID\n\ + left join ADDRESS on (ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID)"); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/orderClauseProcess.js b/entity/Person_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3d8ca41957b958679997fdc3f378c3920c1cb9ac --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,5 @@ +import("system.result"); +import("system.db"); + +result.object({"PERSON.LASTNAME": db.ASCENDING, + "PERSON.FIRSTNAME": db.ASCENDING}); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..beac43f3d912a8f81208580f156bb766178124f7 --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/recordfieldmappings/address_id.displayvalue/expression.js @@ -0,0 +1,5 @@ +import("PostalAddress_lib"); +import("system.result"); + +var res = AddressUtils.formatOnelineSql(); +result.string(res); \ No newline at end of file diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 4ed30005ec6fca26ba1211554a6118a3dca4dc95..f8474184d24ac58559ce37fe1aa4455afc5f16f4 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -395,6 +395,7 @@ <name>Tasks</name> <title>Tasks</title> <fieldType>DEPENDENCY_OUT</fieldType> + <stateProcess>%aditoprj%/entity/Product_entity/entityfields/tasks/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>Task_entity</entityName> diff --git a/entity/Product_entity/entityfields/tasks/stateProcess.js b/entity/Product_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..062f477b61b1ef7467fc25a4b5c84395116c3d29 --- /dev/null +++ b/entity/Product_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if(TaskUtils.hasTasks(vars.get("$field.PRODUCTID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/SalesprojectChart_entity/SalesprojectChart_entity.aod b/entity/SalesprojectChart_entity/SalesprojectChart_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..865b7466894815272dfcdbde917159a2b7c5897f --- /dev/null +++ b/entity/SalesprojectChart_entity/SalesprojectChart_entity.aod @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1"> + <name>SalesprojectChart_entity</name> + <title>Salesproject Charts</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/SalesprojectChart_entity/documentation.adoc</documentation> + <iconId>VAADIN:PIE_CHART</iconId> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>UID</name> + </entityField> + <entityField> + <name>SORTING</name> + <title>Parent</title> + </entityField> + <entityField> + <name>X_PHASE</name> + <title>Phase</title> + </entityField> + <entityField> + <name>Y_COUNT</name> + <title>Count</title> + </entityField> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/SalesprojectChart_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFields> + <element>UID.value</element> + <element>X_PHASE.value</element> + <element>Y_COUNT.value</element> + <element>SORTING.value</element> + </recordFields> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/SalesprojectChart_entity/documentation.adoc b/entity/SalesprojectChart_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..eff361e152326b85d4770132c6e585d2026f3024 --- /dev/null +++ b/entity/SalesprojectChart_entity/documentation.adoc @@ -0,0 +1,3 @@ +== Salesproject Chart == + +This entity provides charts to display the Phases / Status / ... of the Salesproject. \ No newline at end of file diff --git a/entity/SalesprojectChart_entity/recordcontainers/jdito/contentProcess.js b/entity/SalesprojectChart_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e65797a6adb0da41ded6a02f5b1ba74a45d3c7d3 --- /dev/null +++ b/entity/SalesprojectChart_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,34 @@ +import("system.vars"); +import("system.datetime"); +import("system.db"); +import("system.result"); +import("system.translate"); +import("Data_lib"); +import("Keyword_lib"); +import("Money_lib"); +import("KeywordRegistry_basic"); + +// load data + +var phases = db.table("select KEYID, AB_KEYWORD_ENTRY.TITLE, count(PHASE), AB_KEYWORD_ENTRY.SORTING \n\ +from SALESPROJECT join AB_KEYWORD_ENTRY on KEYID = PHASE and CONTAINER = 'SalesprojectPhase' and SORTING <> 7 \n\ +group by KEYID, AB_KEYWORD_ENTRY.TITLE, AB_KEYWORD_ENTRY.SORTING order by SORTING"); + +for(i = 0; i < phases.length; i++){ + if(phases[i][1] == "${SALESPROJECT_OFFER}"){ + phases[i][1] = "Offer"; + } +} + + +result.object(phases); + + + + + + + + + + diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index 556054ab8e9abe699b0acb4f64af6c6c8c1a03d3..ec60c81963ac88e2ef437a9d707a0e7f095a27c2 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -11,12 +11,6 @@ <entityProvider> <name>#PROVIDER</name> <dependencies> - <entityDependency> - <name>525fd920-ea50-45d6-97a8-20e0aaaa830c</name> - <entityName>Offer_entity</entityName> - <fieldName>Salesprojects</fieldName> - <isConsumer v="false" /> - </entityDependency> <entityDependency> <name>497657f7-ebd7-4c9c-b8ab-da447a1556e5</name> <entityName>Order_entity</entityName> @@ -76,6 +70,7 @@ <entityField> <name>SALESPROJECTID</name> <searchable v="false" /> + <state>AUTO</state> </entityField> <entityField> <name>STARTDATE</name> @@ -501,6 +496,7 @@ <name>Tasks</name> <title>Tasks</title> <fieldType>DEPENDENCY_OUT</fieldType> + <stateProcess>%aditoprj%/entity/Salesproject_entity/entityfields/tasks/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>Task_entity</entityName> @@ -521,6 +517,58 @@ </entityParameter> </children> </entityConsumer> + <entityField> + <name>OVERALL_TURNOVER</name> + <title>Turnover actual year</title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/overall_turnover/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>OVERALL_FORECAST</name> + <title>Forecast actual year </title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/overall_forecast/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>OPEN_SALEPROJECTS</name> + <title>Open salesprojects</title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/open_saleprojects/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>SENT_OFFERS</name> + <title>Sent offers</title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/sent_offers/valueProcess.js</valueProcess> + </entityField> + <entityProvider> + <name>openSalesprojects</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>631f55f9-fb0f-4205-bdb8-6e3476268ab4</name> + <entityName>Offer_entity</entityName> + <fieldName>Salesprojects</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + <children> + <entityParameter> + <name>State_param</name> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/opensalesprojects/children/state_param/valueProcess.js</valueProcess> + <expose v="false" /> + </entityParameter> + </children> + </entityProvider> + <entityParameter> + <name>State_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Salesproject_entity/entityfields/open_saleprojects/valueProcess.js b/entity/Salesproject_entity/entityfields/open_saleprojects/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5bad01babc8817805c68c096d802ff22e6c93488 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/open_saleprojects/valueProcess.js @@ -0,0 +1,14 @@ +import("system.datetime"); +import("system.db"); +import("system.result"); +import("system.vars"); +import("Date_lib"); +import("system.logging"); +import("Sql_lib"); +import("system.SQLTYPES") + +var opensp = db.cell("select count(STATE) from SALESPROJECT \n\ +join AB_KEYWORD_ENTRY on KEYID = STATE and CONTAINER = 'SalesprojectState' and TITLE = 'Open' \n\ +group by KEYID, AB_KEYWORD_ENTRY.TITLE"); + +result.string(opensp); diff --git a/entity/Salesproject_entity/entityfields/opensalesprojects/children/state_param/valueProcess.js b/entity/Salesproject_entity/entityfields/opensalesprojects/children/state_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9074d4eece1ed8c26040d657c5c989aa1950ac12 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/opensalesprojects/children/state_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); + +//The Id for the salesproject state keyword OPEN +result.string("483bcaeb-1e5b-4772-b54e-7d7d8aa65712"); \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/overall_forecast/valueProcess.js b/entity/Salesproject_entity/entityfields/overall_forecast/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..55161154b7b13e9c517b1167da8a2899c7a51a11 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/overall_forecast/valueProcess.js @@ -0,0 +1,14 @@ +import("system.datetime"); +import("system.db"); +import("system.result"); +import("system.vars"); +import("Date_lib"); +import("system.logging"); +import("Sql_lib"); +import("system.SQLTYPES") + +var forecast = db.cell(SqlCondition.begin() + .andPrepare("SALESPROJECT_FORECAST.DATE_START", datetime.toDate(vars.get("$sys.date"), "yyyy"), "year(#) = ?", SQLTYPES.INTEGER) + .buildSql("select sum(VOLUME * 1000) from SALESPROJECT_FORECAST", "1=2")); + +result.string(forecast); diff --git a/entity/Salesproject_entity/entityfields/overall_turnover/valueProcess.js b/entity/Salesproject_entity/entityfields/overall_turnover/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1a9825c1ad37a8abfa994b446b0eef293a6eb0ca --- /dev/null +++ b/entity/Salesproject_entity/entityfields/overall_turnover/valueProcess.js @@ -0,0 +1,14 @@ +import("system.datetime"); +import("system.db"); +import("system.result"); +import("system.vars"); +import("Date_lib"); +import("system.logging"); +import("Sql_lib"); +import("system.SQLTYPES") + +var turnover = db.cell(SqlCondition.begin() + .andPrepare("SALESORDER.SALESORDERDATE", datetime.toDate(vars.get("$sys.date"), "yyyy"), "year(#) = ?", SQLTYPES.INTEGER) + .buildSql("select sum(NET + VAT) from SALESORDER", "1=2")); + +result.string(turnover); diff --git a/entity/Salesproject_entity/entityfields/phase/valueProcess.js b/entity/Salesproject_entity/entityfields/phase/valueProcess.js index 49280bb32c5fe3170d06cc0ccc1c36050105bd92..90b1c491d4c722c0d5712e697b0371aea23add3c 100644 --- a/entity/Salesproject_entity/entityfields/phase/valueProcess.js +++ b/entity/Salesproject_entity/entityfields/phase/valueProcess.js @@ -1,6 +1,6 @@ -import("system.neon"); -import("system.vars"); -import("system.result"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) result.string("9f7d1fa9-7c09-4037-8f7c-8458def14d89"); //NQC \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/salesprojectsopen/children/state_param/valueProcess.js b/entity/Salesproject_entity/entityfields/salesprojectsopen/children/state_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e593be26ec8829f70c64b9efa45061cb427cb08b --- /dev/null +++ b/entity/Salesproject_entity/entityfields/salesprojectsopen/children/state_param/valueProcess.js @@ -0,0 +1,5 @@ +import("system.result"); + + +//KeywordId for SalesprojectCompetitionState OPEN +result.string("25b0ac77-ef92-4809-802e-bb9d8782f865") \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/sent_offers/valueProcess.js b/entity/Salesproject_entity/entityfields/sent_offers/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c415d73135ceb0683dd670668442589b62e5660a --- /dev/null +++ b/entity/Salesproject_entity/entityfields/sent_offers/valueProcess.js @@ -0,0 +1,13 @@ +import("system.datetime"); +import("system.db"); +import("system.result"); +import("system.vars"); +import("Date_lib"); +import("system.logging"); +import("Sql_lib"); +import("system.SQLTYPES") + +var sentoffer = db.cell("select count(STATUS) from OFFER join AB_KEYWORD_ENTRY \n\ +on KEYID = STATUS and CONTAINER = 'OfferStatus' and TITLE = 'Sent' group by KEYID, AB_KEYWORD_ENTRY.TITLE"); + +result.string(sentoffer); \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/state/valueProcess.js b/entity/Salesproject_entity/entityfields/state/valueProcess.js index 1bfcc5d651a3031c14925a8d82c1675066107519..abb032b5aee7f5975d2638190fb6f782adc4e219 100644 --- a/entity/Salesproject_entity/entityfields/state/valueProcess.js +++ b/entity/Salesproject_entity/entityfields/state/valueProcess.js @@ -2,5 +2,5 @@ import("system.neon"); import("system.vars"); import("system.result"); -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) result.string("483bcaeb-1e5b-4772-b54e-7d7d8aa65712"); //Open \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/tasks/stateProcess.js b/entity/Salesproject_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8a5375f38fda775fd00271e774f45d992d491a98 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if(TaskUtils.hasTasks(vars.get("$field.SALESPROJECTID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Salesproject_entity/recordcontainers/db/conditionProcess.js b/entity/Salesproject_entity/recordcontainers/db/conditionProcess.js index 6500b695cd9fdcd907e1faa86cbcbee9fcadc2ac..49d846ad22819fbcb59e5dd83febe4a886c64412 100644 --- a/entity/Salesproject_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Salesproject_entity/recordcontainers/db/conditionProcess.js @@ -1,9 +1,21 @@ -import("system.db"); -import("system.result"); -import("system.vars"); -import("Sql_lib"); - -result.string(db.translateCondition( - SqlCondition.begin() - .andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param") - .build("1 = 1"))); \ No newline at end of file +import("system.logging"); +import("system.db"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +if(vars.exists("$param.State_param") && vars.get("$param.State_param") && vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) +{ + result.string(db.translateCondition( + SqlCondition.begin() + .andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param") + .andPrepareVars("SALESPROJECT.STATE", "$param.State_param") + .build("1 = 2"))); +} +else +{ + result.string(db.translateCondition( + SqlCondition.begin() + .andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param") + .build("1 = 1"))); +} \ No newline at end of file diff --git a/entity/StoredSelection_entity/StoredSelection_entity.aod b/entity/StoredSelection_entity/StoredSelection_entity.aod deleted file mode 100644 index e782b82bd5c719c813d7b446f8cedba3043a19b3..0000000000000000000000000000000000000000 --- a/entity/StoredSelection_entity/StoredSelection_entity.aod +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1"> - <name>StoredSelection_entity</name> - <title>Stored selections</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <recordContainer>jdito</recordContainer> - <entityFields> - <entityProvider> - <name>#PROVIDER</name> - </entityProvider> - <entityField> - <name>UID</name> - </entityField> - <entityParameter> - <name>Base64String_param</name> - <expose v="true" /> - <description>PARAMETER</description> - </entityParameter> - <entityProvider> - <name>StoredSelections</name> - <fieldType>DEPENDENCY_IN</fieldType> - <dependencies> - <entityDependency> - <name>1386345f-0ed8-4c82-b96d-a249775314ee</name> - <entityName>Employee_entity</entityName> - <fieldName>StoredSelections</fieldName> - <isConsumer v="false" /> - </entityDependency> - </dependencies> - </entityProvider> - <entityField> - <name>CONTEXT_NAME</name> - <title>Module</title> - <state>READONLY</state> - </entityField> - <entityField> - <name>SELECTION_TITLE</name> - <title>Name</title> - <state>READONLY</state> - </entityField> - </entityFields> - <recordContainers> - <jDitoRecordContainer> - <name>jdito</name> - <contentProcess>%aditoprj%/entity/StoredSelection_entity/recordcontainers/jdito/contentProcess.js</contentProcess> - <recordFields> - <element>UID.value</element> - <element>CONTEXT_NAME.value</element> - <element>SELECTION_TITLE.value</element> - </recordFields> - </jDitoRecordContainer> - </recordContainers> -</entity> diff --git a/entity/StoredSelection_entity/recordcontainers/jdito/contentProcess.js b/entity/StoredSelection_entity/recordcontainers/jdito/contentProcess.js deleted file mode 100644 index cc4302b632d9e783738d848ca60f0f01ebdc058d..0000000000000000000000000000000000000000 --- a/entity/StoredSelection_entity/recordcontainers/jdito/contentProcess.js +++ /dev/null @@ -1,28 +0,0 @@ -import("system.result"); -import("system.pack"); -import("system.util"); -import("system.vars"); - -var records = []; -if (vars.exists("$param.Base64String_param") && vars.get("$param.Base64String_param")) -{ - var codedSelections = pack.gunzip(vars.get("$param.Base64String_param")); - - var selections = new XML(util.decodeBase64String(codedSelections)); - selections = selections.FRAME; - for (let i in selections) - { - context = selections[i]; - var contextName = context.NAME; - if (contextName) - { - var title = context.STORE.(ID == "#STORE_SAVED").ELEMENT.TITLE; - for (let ii in title) - { - records.push([(contextName + title[ii]), contextName, title[ii]]); - } - } - } -} - -result.object(records); \ No newline at end of file diff --git a/entity/Timetracking_entity/entityfields/contact_id/valueProcess.js b/entity/Timetracking_entity/entityfields/contact_id/valueProcess.js index 8df31bc890c107c948cf1cfee8a8e72d23baf156..1e62e7551ccb20b0b0d7aca34f64b6e448b5dda7 100644 --- a/entity/Timetracking_entity/entityfields/contact_id/valueProcess.js +++ b/entity/Timetracking_entity/entityfields/contact_id/valueProcess.js @@ -1,7 +1,7 @@ -import("system.result"); -import("system.neon"); -import("system.vars"); -import("Employee_lib"); - -if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Employee_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) result.string(EmployeeUtils.getCurrentContactId()); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index fd5c8a001733b25ac3c543831ea6ea7a4e63f63d..ba370d00d2a300456d5eb4484ebded89d0846400 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -1020,9 +1020,6 @@ <entry> <key>Seite</key> </entry> - <entry> - <key>Note</key> - </entry> <entry> <key>Senden per E-Mail</key> </entry> @@ -2709,9 +2706,6 @@ <entry> <key>${MIN_MAX_ERROR} field: %0, value: %1, min: %2, max: %3</key> </entry> - <entry> - <key>The title already exists!</key> - </entry> <entry> <key>Password</key> </entry> @@ -2724,15 +2718,6 @@ <entry> <key>Email</key> </entry> - <entry> - <key>Test</key> - </entry> - <entry> - <key>testV</key> - </entry> - <entry> - <key>test</key> - </entry> <entry> <key>{$OBJECTLINK_TYPE}</key> </entry> @@ -2745,9 +2730,6 @@ <entry> <key>Password and confirmation must be the same!</key> </entry> - <entry> - <key>Login</key> - </entry> <entry> <key>Begin</key> </entry> @@ -2766,6 +2748,63 @@ <entry> <key>Username already exists!</key> </entry> + <entry> + <key>Salesproject Phases</key> + </entry> + <entry> + <key>Turnover actual year</key> + </entry> + <entry> + <key>Forecast actual year</key> + </entry> + <entry> + <key>This private person doeas already exist and can not be created once more.</key> + </entry> + <entry> + <key>Everyone</key> + </entry> + <entry> + <key>Project</key> + </entry> + <entry> + <key>Human resources</key> + </entry> + <entry> + <key>Project management</key> + </entry> + <entry> + <key>Office staff</key> + </entry> + <entry> + <key>Field staff</key> + </entry> + <entry> + <key>Resource</key> + </entry> + <entry> + <key>Human Resources</key> + </entry> + <entry> + <key>The title already exists!</key> + </entry> + <entry> + <key>Note</key> + </entry> + <entry> + <key>Email must be unique!</key> + </entry> + <entry> + <key>Project Management</key> + </entry> + <entry> + <key>Support</key> + </entry> + <entry> + <key>{$ADDRESS_IDENTIFIER}</key> + </entry> + <entry> + <key>Salesproject phases</key> + </entry> <entry> <key>Add to Campaign</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 151fcedc4043a8b8a4b7c670a7ec8ec4a413178a..2e09c4d6dd559a75687f9aa482610ba2436d3bf7 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -6,6 +6,10 @@ <country></country> <variant></variant> <keyValueMap> + <entry> + <key>Project management</key> + <value>Projektmanagement</value> + </entry> <entry> <key>Add to Campaign</key> <value>Zu Kampagne hinzufügen</value> @@ -14,14 +18,26 @@ <key>Company</key> <value>Firma</value> </entry> + <entry> + <key>Office staff</key> + <value>Innendienst</value> + </entry> <entry> <key>Confirm password</key> <value>Passwort prüfen</value> </entry> + <entry> + <key>Human Resources</key> + <value>Personal</value> + </entry> <entry> <key>Entrydate (Day)</key> <value>Eingangsdatum (Tag)</value> </entry> + <entry> + <key>Salesproject phases</key> + <value>Vertriebsprojektphasen</value> + </entry> <entry> <key>Turnover</key> <value>Umsatz</value> @@ -30,6 +46,10 @@ <key>Discount %</key> <value>Rabatt %</value> </entry> + <entry> + <key>Email must be unique!</key> + <value>Die E-Mail-Adresse muss eindeutig sein!</value> + </entry> <entry> <key>E-Mail</key> <value>E-Mail</value> @@ -174,10 +194,6 @@ <key>Medium</key> <value>Medium</value> </entry> - <entry> - <key>The title already exists!</key> - <value>Der Titel existiert bereits!</value> - </entry> <entry> <key>Internet</key> <value>Internet</value> @@ -1123,6 +1139,10 @@ <key>My Activities</key> <value>Meine Aktivitäten</value> </entry> + <entry> + <key>Everyone</key> + <value>Jeder</value> + </entry> <entry> <key>Combobox Value</key> <value>Combobox-Wert</value> @@ -1257,6 +1277,10 @@ <entry> <key>ISO 3166-1 alpha-2</key> </entry> + <entry> + <key>Field staff</key> + <value>Außendienst</value> + </entry> <entry> <key>0.00</key> </entry> @@ -1549,10 +1573,6 @@ <entry> <key>Seite</key> </entry> - <entry> - <key>Note</key> - <value>Notiz</value> - </entry> <entry> <key>Senden per E-Mail</key> </entry> @@ -2566,6 +2586,10 @@ <key>Christmas Island</key> <value>Weihnachtsinsel</value> </entry> + <entry> + <key>Project</key> + <value>Projekt</value> + </entry> <entry> <key>Netherlands</key> <value>Niederlande</value> @@ -2662,6 +2686,10 @@ <key>Congo (Democratic Republic of the)</key> <value>Kongo (Demokratische Republik)</value> </entry> + <entry> + <key>Resource</key> + <value>Ressource</value> + </entry> <entry> <key>Greece</key> <value>Griechenland</value> @@ -3498,15 +3526,6 @@ <key>Email</key> <value>E-Mail</value> </entry> - <entry> - <key>Test</key> - </entry> - <entry> - <key>testV</key> - </entry> - <entry> - <key>test</key> - </entry> <entry> <key>{$OBJECTLINK_TYPE}</key> <value>Art</value> @@ -3519,9 +3538,6 @@ <key>Password and confirmation must be the same!</key> <value>Die Passwörter stimmen nicht überein!</value> </entry> - <entry> - <key>Login</key> - </entry> <entry> <key>Begin</key> <value>Beginn</value> @@ -3530,6 +3546,35 @@ <key>Maturity</key> <value>Fällig</value> </entry> + <entry> + <key>This private person doeas already exist and can not be created once more.</key> + <value>Diese Privatperson existiert bereits und kann daher nicht noch ein mal angelegt werden.</value> + </entry> + <entry> + <key>The title already exists!</key> + </entry> + <entry> + <key>Human resources</key> + </entry> + <entry> + <key>Note</key> + </entry> + <entry> + <key>Project Management</key> + </entry> + <entry> + <key>Support</key> + </entry> + <entry> + <key>{$ADDRESS_IDENTIFIER}</key> + <value>Bezeichnung</value> + </entry> + <entry> + <key>Turnover actual year</key> + </entry> + <entry> + <key>Forecast actual year</key> + </entry> <entry> <key>Approved</key> <value>Freigegeben</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index ad028c1ec3980ed92cae71e76b5d14bed37d3ae4..c7875a3cad1059375ced88190a39c35097fcced2 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -2752,15 +2752,6 @@ <entry> <key>Email</key> </entry> - <entry> - <key>Test</key> - </entry> - <entry> - <key>testV</key> - </entry> - <entry> - <key>test</key> - </entry> <entry> <key>{$OBJECTLINK_TYPE}</key> <value>Type</value> @@ -2775,9 +2766,6 @@ <entry> <key>Password and confirmation must be the same!</key> </entry> - <entry> - <key>Login</key> - </entry> <entry> <key>Begin</key> </entry> @@ -2796,6 +2784,58 @@ <entry> <key>Username already exists!</key> </entry> + <entry> + <key>Salesproject Phases</key> + </entry> + <entry> + <key>Turnover actual year</key> + </entry> + <entry> + <key>Forecast actual year</key> + </entry> + <entry> + <key>This private person doeas already exist and can not be created once more.</key> + </entry> + <entry> + <key>Everyone</key> + </entry> + <entry> + <key>Project</key> + </entry> + <entry> + <key>Human resources</key> + </entry> + <entry> + <key>Project management</key> + </entry> + <entry> + <key>Office staff</key> + </entry> + <entry> + <key>Field staff</key> + </entry> + <entry> + <key>Resource</key> + </entry> + <entry> + <key>Human Resources</key> + </entry> + <entry> + <key>Email must be unique!</key> + </entry> + <entry> + <key>Project Management</key> + </entry> + <entry> + <key>Support</key> + </entry> + <entry> + <key>{$ADDRESS_IDENTIFIER}</key> + <value>Identifier</value> + </entry> + <entry> + <key>Salesproject phases</key> + </entry> <entry> <key>Add to Campaign</key> </entry> diff --git a/neonContext/Address/Address.aod b/neonContext/Address/Address.aod index 62cf97f24928e402431a2ac83f30645c2f3ee9aa..87c5beb15bea545ae2a141faac7d78717b994320 100644 --- a/neonContext/Address/Address.aod +++ b/neonContext/Address/Address.aod @@ -3,19 +3,9 @@ <name>Address</name> <title>Addresses</title> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterview>AddressFilter_view</filterview> - <editview>AddressEdit_view</editview> - <preview>AddressEdit_view</preview> + <lookupview>AddressLookup_view</lookupview> <entity>Address_entity</entity> <references> - <neonViewReference> - <name>f36427d6-75b7-4f67-9cd9-e391bca3166e</name> - <view>AddressFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>306f9a88-42be-4838-9698-c6ac5c6a7f57</name> - <view>AddressEdit_view</view> - </neonViewReference> <neonViewReference> <name>0b476864-5342-4cb2-aa0c-f1ab29bb99b4</name> <view>AddressList_view</view> @@ -24,5 +14,9 @@ <name>f4c516c0-b9de-47df-91e4-43bdb3297fe7</name> <view>AdressMultiEdit_view</view> </neonViewReference> + <neonViewReference> + <name>77b182a7-2361-41a7-ae78-dc5285b41b97</name> + <view>AddressLookup_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/Employee/Employee.aod b/neonContext/Employee/Employee.aod index 1d7640c1878336cea3c0cd2eb9b10be458256954..9dd4dd642bc410be26be22a52ccd6fc95ebab569 100644 --- a/neonContext/Employee/Employee.aod +++ b/neonContext/Employee/Employee.aod @@ -1,38 +1,38 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> - <name>Employee</name> - <title>Employee</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <mainview>EmployeeMain_view</mainview> - <filterview>EmployeeFilter_view</filterview> - <editview>EmployeeEdit_view</editview> - <preview>EmployeePreview_view</preview> - <lookupview>EmployeeLookup_view</lookupview> - <entity>Employee_entity</entity> - <references> - <neonViewReference> - <name>51816f14-17da-4c96-80d8-f3b5280863b8</name> - <view>EmployeeFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>91c2bbc7-89fb-4688-881e-6fa21e96b211</name> - <view>EmployeeEdit_view</view> - </neonViewReference> - <neonViewReference> - <name>6a36e3cf-5918-4c60-94d9-a3a7ed50ffce</name> - <view>EmployeePreview_view</view> - </neonViewReference> - <neonViewReference> - <name>215e8e26-662f-45f6-9c61-c0b0b1129e66</name> - <view>EmployeeMain_view</view> - </neonViewReference> - <neonViewReference> - <name>a01b0910-cd32-4fa7-a739-0b9eb19debc2</name> - <view>EmployeePassword_view</view> - </neonViewReference> - <neonViewReference> - <name>3427f53f-9201-495c-a37c-b2c9b33eb123</name> - <view>EmployeeLookup_view</view> - </neonViewReference> - </references> -</neonContext> +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>Employee</name> + <title>Employee</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <mainview>EmployeeMain_view</mainview> + <filterview>EmployeeFilter_view</filterview> + <editview>EmployeeEdit_view</editview> + <preview>EmployeePreview_view</preview> + <lookupview>EmployeeLookup_view</lookupview> + <entity>Employee_entity</entity> + <references> + <neonViewReference> + <name>51816f14-17da-4c96-80d8-f3b5280863b8</name> + <view>EmployeeFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>91c2bbc7-89fb-4688-881e-6fa21e96b211</name> + <view>EmployeeEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>6a36e3cf-5918-4c60-94d9-a3a7ed50ffce</name> + <view>EmployeePreview_view</view> + </neonViewReference> + <neonViewReference> + <name>215e8e26-662f-45f6-9c61-c0b0b1129e66</name> + <view>EmployeeMain_view</view> + </neonViewReference> + <neonViewReference> + <name>a01b0910-cd32-4fa7-a739-0b9eb19debc2</name> + <view>EmployeePassword_view</view> + </neonViewReference> + <neonViewReference> + <name>3427f53f-9201-495c-a37c-b2c9b33eb123</name> + <view>EmployeeLookup_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/EmployeeRole/EmployeeRole.aod b/neonContext/EmployeeRole/EmployeeRole.aod index 28bfe0b0c7e712c468bea65fcabd675c9b7a5839..436cf33ca9e7a829e908e1d8f4a26638703a7c93 100644 --- a/neonContext/EmployeeRole/EmployeeRole.aod +++ b/neonContext/EmployeeRole/EmployeeRole.aod @@ -1,16 +1,16 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> - <name>EmployeeRole</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <entity>EmployeeRole_entity</entity> - <references> - <neonViewReference> - <name>fd4de342-238b-494e-a85b-ff08e3f065b9</name> - <view>EmployeeRoleFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>6ec0af90-47aa-4f94-8e05-7c535bd4c965</name> - <view>EmployeeRoleEdit_view</view> - </neonViewReference> - </references> -</neonContext> +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>EmployeeRole</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>EmployeeRole_entity</entity> + <references> + <neonViewReference> + <name>fd4de342-238b-494e-a85b-ff08e3f065b9</name> + <view>EmployeeRoleFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>6ec0af90-47aa-4f94-8e05-7c535bd4c965</name> + <view>EmployeeRoleEdit_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/ObjectTree/ObjectTree.aod b/neonContext/ObjectTree/ObjectTree.aod index b7ae46a2ca92572cedfa4c0abac241d2b1ed2b73..a8f24a44156098989667e38818ddd4491116b862 100644 --- a/neonContext/ObjectTree/ObjectTree.aod +++ b/neonContext/ObjectTree/ObjectTree.aod @@ -2,11 +2,17 @@ <neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> <name>ObjectTree</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <filterview>ObjectTreeFilter_view</filterview> + <editview>ObjectTreeEdit_view</editview> <entity>ObjectTree_entity</entity> <references> <neonViewReference> <name>0c9fc36e-e3f7-4198-b675-5d9ddb177611</name> - <view>ObjectTree_view</view> + <view>ObjectTreeFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>1122516a-5f1c-4f08-9995-02acaee2a0cd</name> + <view>ObjectTreeEdit_view</view> </neonViewReference> </references> </neonContext> diff --git a/neonContext/Salesproject/Salesproject.aod b/neonContext/Salesproject/Salesproject.aod index feef4560535219df0acd527d75fd4d3a46569d5c..fe73d71fbb68466f3694046457afb8365698187d 100644 --- a/neonContext/Salesproject/Salesproject.aod +++ b/neonContext/Salesproject/Salesproject.aod @@ -30,5 +30,9 @@ <name>d7fb7e2b-c932-4b96-be2c-ae5ec3d36beb</name> <view>SalesprojectCycle_view</view> </neonViewReference> + <neonViewReference> + <name>f93ffaae-a097-41d6-8ca8-fad02323a909</name> + <view>SalesprojectScoreCard_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/StoredSelection/StoredSelection.aod b/neonContext/SalesprojectChart/SalesprojectChart.aod similarity index 62% rename from neonContext/StoredSelection/StoredSelection.aod rename to neonContext/SalesprojectChart/SalesprojectChart.aod index cda8fb531125f8b1ff9b45ab3179e560d8db60f3..7697361d4af7fcd80ceb7836dfa1733febace6ba 100644 --- a/neonContext/StoredSelection/StoredSelection.aod +++ b/neonContext/SalesprojectChart/SalesprojectChart.aod @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> - <name>StoredSelection</name> + <name>SalesprojectChart</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <entity>StoredSelection_entity</entity> + <filterview>SalesprojectChart_view</filterview> + <entity>SalesprojectChart_entity</entity> <references> <neonViewReference> - <name>8ab7727b-5dc7-47bb-9034-079d84ede3a3</name> - <view>StoredSelectionFilter_view</view> + <name>c50b2e10-86ca-4a5b-83d4-946a78c18786</name> + <view>SalesprojectChart_view</view> </neonViewReference> </references> </neonContext> diff --git a/neonView/AddressEdit_view/AddressEdit_view.aod b/neonView/AddressEdit_view/AddressEdit_view.aod deleted file mode 100644 index 55e151a9ebc66f5e1af24812ad49fecbd82e3919..0000000000000000000000000000000000000000 --- a/neonView/AddressEdit_view/AddressEdit_view.aod +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>AddressEdit_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <genericViewTemplate> - <name>Edit</name> - <showDrawer v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>b510378e-dfd3-4cec-bc2e-84b72aebb2b6</name> - <entityField>ADDR_TYPE</entityField> - </entityFieldLink> - <entityFieldLink> - <name>d8a7a16b-9d7f-44d7-bbb1-b0404d5b8b8f</name> - <entityField>COUNTRY</entityField> - </entityFieldLink> - <entityFieldLink> - <name>c70668f3-6722-4a90-86d6-0d89be06dbe1</name> - <entityField>ADDRESS</entityField> - </entityFieldLink> - <entityFieldLink> - <name>0eac157d-de3d-4ff0-9ac2-1927b33c854a</name> - <entityField>BUILDINGNO</entityField> - </entityFieldLink> - <entityFieldLink> - <name>c70677f3-6722-4a90-86d6-0d89be06dbe1</name> - <entityField>ZIP</entityField> - </entityFieldLink> - <entityFieldLink> - <name>fafca9d6-c6dd-4b66-b1ff-1d6ba451827b</name> - <entityField>CITY</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - </children> -</neonView> diff --git a/neonView/AddressList_view/AddressList_view.aod b/neonView/AddressList_view/AddressList_view.aod index 4c155db5b281108f72ce4799f924109087ab815a..0baa8a57551446a1b41fc43aff6da1974c8a0425 100644 --- a/neonView/AddressList_view/AddressList_view.aod +++ b/neonView/AddressList_view/AddressList_view.aod @@ -38,6 +38,10 @@ <name>12727b21-0359-4430-a9c2-54eb48e2e864</name> <entityField>CITY</entityField> </neonTableColumn> + <neonTableColumn> + <name>6af52273-25bf-4286-83cc-217aea94ad09</name> + <entityField>ADDRIDENTIFIER</entityField> + </neonTableColumn> </columns> </titledListViewTemplate> </children> diff --git a/neonView/AddressFilter_view/AddressFilter_view.aod b/neonView/AddressLookup_view/AddressLookup_view.aod similarity index 51% rename from neonView/AddressFilter_view/AddressFilter_view.aod rename to neonView/AddressLookup_view/AddressLookup_view.aod index 4f6d79febe3e5488e1fb90a84140531c996bac5d..84a197811b5c31e788561505537c4b9c354cfeae 100644 --- a/neonView/AddressFilter_view/AddressFilter_view.aod +++ b/neonView/AddressLookup_view/AddressLookup_view.aod @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>AddressFilter_view</name> + <name>AddressLookup_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="true" /> <layout> <boxLayout> <name>layout</name> @@ -10,33 +9,49 @@ </layout> <children> <tableViewTemplate> - <name>Addresses</name> + <name>DataTable</name> <entityField>#ENTITY</entityField> <columns> <neonTableColumn> - <name>852583d4-1883-4b36-963f-6f3a4df63a89</name> + <name>297a27f0-51a0-40d7-a2eb-28fc2b9e5730</name> + <entityField>IS_STANDARD_ICON</entityField> + </neonTableColumn> + <neonTableColumn> + <name>07e3bcf0-30aa-4745-8dd6-ed79dd2d0fa0</name> <entityField>ADDR_TYPE</entityField> </neonTableColumn> <neonTableColumn> - <name>10e9e08f-db9b-4789-a4b4-b2a0a750b069</name> + <name>e6d9ced9-eea3-4cdf-9751-74c8f206282f</name> <entityField>COUNTRY</entityField> </neonTableColumn> <neonTableColumn> - <name>32b8b6f0-bdbc-4a4b-b98c-0a22861b0e6c</name> + <name>570039fc-c27a-4b06-a93e-16cc712a3d0c</name> <entityField>ADDRESS</entityField> </neonTableColumn> <neonTableColumn> - <name>9d93662b-f024-4b0b-a37e-6cc88afb9dd2</name> + <name>26ca52ce-91e7-4e76-a37e-6db28b967beb</name> <entityField>BUILDINGNO</entityField> </neonTableColumn> <neonTableColumn> - <name>10e9e08f-db9b-4789-a4b4-b1a0a750b169</name> + <name>a54d6306-e9be-41db-9d1c-abeebe5ce77b</name> <entityField>ZIP</entityField> </neonTableColumn> <neonTableColumn> - <name>57247c5c-6498-420b-b288-68ca316cf7f2</name> + <name>6a07479c-b4d3-4946-993e-e6ce7dd825ba</name> <entityField>CITY</entityField> </neonTableColumn> + <neonTableColumn> + <name>820b6ffc-7e56-4982-8f39-4443b0ada876</name> + <entityField>STATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>24f73ac8-ac90-4beb-83fe-bdaa2d0806b6</name> + <entityField>ADDRIDENTIFIER</entityField> + </neonTableColumn> + <neonTableColumn> + <name>9651a718-ab01-4c97-8da0-6e7133f26466</name> + <entityField>#PROVIDER</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod index 3f827b56968e1515a287c3bdd093d90f53e48baf..dbec2da120f3c7ad0d96b8e42326b6c48cd6c6e3 100644 --- a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod +++ b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod @@ -36,6 +36,10 @@ <name>fafca2d6-c2dd-4b66-b1ff-1d6ba451827b</name> <entityField>CITY</entityField> </neonTableColumn> + <neonTableColumn> + <name>481496b8-d611-4b4a-9c5e-1d28a7136a2d</name> + <entityField>ADDRIDENTIFIER</entityField> + </neonTableColumn> </columns> </genericMultipleViewTemplate> </children> diff --git a/neonView/EmployeeEdit_view/EmployeeEdit_view.aod b/neonView/EmployeeEdit_view/EmployeeEdit_view.aod index 5dfcad7f88b0b706d27c92a456ae73c154fbbce1..71614eff593bccfb770ea91b005d958a6feecad7 100644 --- a/neonView/EmployeeEdit_view/EmployeeEdit_view.aod +++ b/neonView/EmployeeEdit_view/EmployeeEdit_view.aod @@ -1,60 +1,60 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeeEdit_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <genericViewTemplate> - <name>Generic</name> - <editMode v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>fdd5320e-a8c0-4043-a88e-aeba1ca02cd1</name> - <entityField>UID</entityField> - </entityFieldLink> - <entityFieldLink> - <name>9170856b-45c2-4d8a-864d-4db36bfe4a8c</name> - <entityField>ISACTIVE</entityField> - </entityFieldLink> - <entityFieldLink> - <name>1925ef51-54a8-41e2-aa78-6d95d1ee4b99</name> - <entityField>CONTACT_ID</entityField> - </entityFieldLink> - <entityFieldLink> - <name>7d36467f-8b79-4647-b8e5-5759bdbf37a7</name> - <entityField>FIRSTNAME</entityField> - </entityFieldLink> - <entityFieldLink> - <name>00a2dedb-67f5-4662-b053-bf841b30e365</name> - <entityField>LASTNAME</entityField> - </entityFieldLink> - <entityFieldLink> - <name>6155e6b7-ee2c-45b4-87f5-9e506ffc5775</name> - <entityField>EMAIL_ADDRESS</entityField> - </entityFieldLink> - <entityFieldLink> - <name>8cffaf75-f2dc-42c5-95d7-1ce1e4927d8a</name> - <entityField>DESCRIPTION</entityField> - </entityFieldLink> - <entityFieldLink> - <name>4ad9c1aa-37a9-46f9-a566-94e5be5c2a7f</name> - <entityField>PASSWORD</entityField> - </entityFieldLink> - <entityFieldLink> - <name>5381db3a-762d-439a-b41b-e4e67edc2099</name> - <entityField>CONFIRM_PASSWORD</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - <neonViewReference> - <name>af8112a3-78d3-436f-b665-ebce595a7c24</name> - <entityField>EmployeeRoles</entityField> - <view>EmployeeRoleEdit_view</view> - </neonViewReference> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeeEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Generic</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>1925ef51-54a8-41e2-aa78-6d95d1ee4b99</name> + <entityField>CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>9170856b-45c2-4d8a-864d-4db36bfe4a8c</name> + <entityField>ISACTIVE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>7d36467f-8b79-4647-b8e5-5759bdbf37a7</name> + <entityField>FIRSTNAME</entityField> + </entityFieldLink> + <entityFieldLink> + <name>00a2dedb-67f5-4662-b053-bf841b30e365</name> + <entityField>LASTNAME</entityField> + </entityFieldLink> + <entityFieldLink> + <name>9c030b62-bf17-4be1-bcc6-87b304a618c0</name> + <entityField>TITLE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>6155e6b7-ee2c-45b4-87f5-9e506ffc5775</name> + <entityField>EMAIL_ADDRESS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>8cffaf75-f2dc-42c5-95d7-1ce1e4927d8a</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> + <entityFieldLink> + <name>4ad9c1aa-37a9-46f9-a566-94e5be5c2a7f</name> + <entityField>PASSWORD</entityField> + </entityFieldLink> + <entityFieldLink> + <name>5381db3a-762d-439a-b41b-e4e67edc2099</name> + <entityField>CONFIRM_PASSWORD</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + <neonViewReference> + <name>af8112a3-78d3-436f-b665-ebce595a7c24</name> + <entityField>EmployeeRoles</entityField> + <view>EmployeeRoleEdit_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/EmployeeFilter_view/EmployeeFilter_view.aod b/neonView/EmployeeFilter_view/EmployeeFilter_view.aod index f25bea5ddd67b0be55f5d320f3787636b4314e8d..88171ca8fcb9cc79b14de3c3d8590240268af14a 100644 --- a/neonView/EmployeeFilter_view/EmployeeFilter_view.aod +++ b/neonView/EmployeeFilter_view/EmployeeFilter_view.aod @@ -1,39 +1,39 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeeFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="true" /> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Employees</name> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>15185ef0-5402-43c4-b5c9-1e0e836ef1c3</name> - <entityField>IMAGE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>3e3552f9-9591-45ae-a0bb-a85210c2b382</name> - <entityField>UID</entityField> - </neonTableColumn> - <neonTableColumn> - <name>307dfdad-a0b2-436f-b8a1-9825821dba0c</name> - <entityField>ISACTIVE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>18b974f1-81ea-4ca0-83bf-a1505f763446</name> - <entityField>FIRSTNAME</entityField> - </neonTableColumn> - <neonTableColumn> - <name>27c4199c-157a-4c3e-a851-01aa1d82dfd2</name> - <entityField>LASTNAME</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeeFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Employees</name> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>15185ef0-5402-43c4-b5c9-1e0e836ef1c3</name> + <entityField>IMAGE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>3e3552f9-9591-45ae-a0bb-a85210c2b382</name> + <entityField>TITLE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>307dfdad-a0b2-436f-b8a1-9825821dba0c</name> + <entityField>ISACTIVE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>18b974f1-81ea-4ca0-83bf-a1505f763446</name> + <entityField>FIRSTNAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>27c4199c-157a-4c3e-a851-01aa1d82dfd2</name> + <entityField>LASTNAME</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/EmployeeMain_view/EmployeeMain_view.aod b/neonView/EmployeeMain_view/EmployeeMain_view.aod index da3c34385d7b9283015b3a6f54b0f87271893f1a..1cbb84296df85b58403b1279cf5f4a87241b3118 100644 --- a/neonView/EmployeeMain_view/EmployeeMain_view.aod +++ b/neonView/EmployeeMain_view/EmployeeMain_view.aod @@ -1,43 +1,38 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeeMain_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <masterSlaveLayout> - <name>layout</name> - <master>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</master> - </masterSlaveLayout> - </layout> - <children> - <neonViewReference> - <name>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</name> - <entityField>#ENTITY</entityField> - <view>EmployeePreview_view</view> - </neonViewReference> - <neonViewReference> - <name>79a01c28-1eaa-4974-babd-fb6e4d59471b</name> - <entityField>EmployeeRoles</entityField> - <view>EmployeeRoleFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>7164f8cd-3892-4694-92ad-fc45afac68f1</name> - <entityField>Attributes</entityField> - <view>AttributeRelationFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>68e54801-e68f-4797-97d2-368b4b82a7e4</name> - <entityField>AttributeTree</entityField> - <view>AttributeRelationTree_view</view> - </neonViewReference> - <neonViewReference> - <name>169d3ae7-d688-42fd-9097-77bbd9bfb81f</name> - <entityField>Documents</entityField> - <view>DocumentFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>aaca4c8c-7953-43d8-9390-53b78d86863a</name> - <entityField>StoredSelections</entityField> - <view>StoredSelectionFilter_view</view> - </neonViewReference> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeeMain_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <masterSlaveLayout> + <name>layout</name> + <master>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</master> + </masterSlaveLayout> + </layout> + <children> + <neonViewReference> + <name>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</name> + <entityField>#ENTITY</entityField> + <view>EmployeePreview_view</view> + </neonViewReference> + <neonViewReference> + <name>79a01c28-1eaa-4974-babd-fb6e4d59471b</name> + <entityField>EmployeeRoles</entityField> + <view>EmployeeRoleFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>7164f8cd-3892-4694-92ad-fc45afac68f1</name> + <entityField>Attributes</entityField> + <view>AttributeRelationFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>68e54801-e68f-4797-97d2-368b4b82a7e4</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> + <neonViewReference> + <name>169d3ae7-d688-42fd-9097-77bbd9bfb81f</name> + <entityField>Documents</entityField> + <view>DocumentFilter_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/EmployeePassword_view/EmployeePassword_view.aod b/neonView/EmployeePassword_view/EmployeePassword_view.aod index 7a3c199fcca35cb5f9fca935d3f499b0c3a20fc2..731d112028ca26d6f7c8d66fba730c9a5240f45a 100644 --- a/neonView/EmployeePassword_view/EmployeePassword_view.aod +++ b/neonView/EmployeePassword_view/EmployeePassword_view.aod @@ -1,27 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeePassword_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <genericViewTemplate> - <name>Password</name> - <editMode v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>632294e8-f9ec-4bd1-afe4-87e3b5fc84c4</name> - <entityField>PASSWORD</entityField> - </entityFieldLink> - <entityFieldLink> - <name>66a7726a-c226-4d74-95a4-ea88950920bf</name> - <entityField>CONFIRM_PASSWORD</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeePassword_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Password</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>632294e8-f9ec-4bd1-afe4-87e3b5fc84c4</name> + <entityField>PASSWORD</entityField> + </entityFieldLink> + <entityFieldLink> + <name>66a7726a-c226-4d74-95a4-ea88950920bf</name> + <entityField>CONFIRM_PASSWORD</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/EmployeePreview_view/EmployeePreview_view.aod b/neonView/EmployeePreview_view/EmployeePreview_view.aod index 57ce49321eeebbc1e943e60326600cb928b92344..198c613625f55b8cf69b2094f843b9876ad4fc3e 100644 --- a/neonView/EmployeePreview_view/EmployeePreview_view.aod +++ b/neonView/EmployeePreview_view/EmployeePreview_view.aod @@ -1,46 +1,46 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeePreview_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <cardViewTemplate> - <name>Header</name> - <iconField>IMAGE</iconField> - <titleField>NAME_fieldGroup</titleField> - <subtitleField>UID</subtitleField> - <entityField>#ENTITY</entityField> - </cardViewTemplate> - <genericViewTemplate> - <name>Info</name> - <showDrawer v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>68755289-a351-4915-8626-52f023e237f8</name> - <entityField>ISACTIVE</entityField> - </entityFieldLink> - <entityFieldLink> - <name>a5f8b519-26d8-4824-b9cf-9119c03b1bd8</name> - <entityField>CONTACT_ID</entityField> - </entityFieldLink> - <entityFieldLink> - <name>0bda9209-1437-49eb-98b7-6edea9c6836a</name> - <entityField>DEPARTMENT</entityField> - </entityFieldLink> - <entityFieldLink> - <name>d9786e3d-5364-4075-a08d-0d4ea91c4728</name> - <entityField>EMAIL_ADDRESS</entityField> - </entityFieldLink> - <entityFieldLink> - <name>79cd6a97-6caf-4acb-81af-028b94f33e8f</name> - <entityField>DESCRIPTION</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeePreview_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <cardViewTemplate> + <name>Header</name> + <iconField>IMAGE</iconField> + <titleField>NAME_fieldGroup</titleField> + <subtitleField>TITLE</subtitleField> + <entityField>#ENTITY</entityField> + </cardViewTemplate> + <genericViewTemplate> + <name>Info</name> + <showDrawer v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>68755289-a351-4915-8626-52f023e237f8</name> + <entityField>ISACTIVE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>a5f8b519-26d8-4824-b9cf-9119c03b1bd8</name> + <entityField>CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>0bda9209-1437-49eb-98b7-6edea9c6836a</name> + <entityField>DEPARTMENT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>d9786e3d-5364-4075-a08d-0d4ea91c4728</name> + <entityField>EMAIL_ADDRESS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>79cd6a97-6caf-4acb-81af-028b94f33e8f</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/EmployeeRoleEdit_view/EmployeeRoleEdit_view.aod b/neonView/EmployeeRoleEdit_view/EmployeeRoleEdit_view.aod index f91bb0b4e7ba1e7a54efe308364e6b341095d7b2..8f7c8f87db423237460233b64988a383db6003a7 100644 --- a/neonView/EmployeeRoleEdit_view/EmployeeRoleEdit_view.aod +++ b/neonView/EmployeeRoleEdit_view/EmployeeRoleEdit_view.aod @@ -3,9 +3,9 @@ <name>EmployeeRoleEdit_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> - <boxLayout> + <noneLayout> <name>layout</name> - </boxLayout> + </noneLayout> </layout> <children> <genericMultipleViewTemplate> diff --git a/neonView/EmployeeRoleFilter_view/EmployeeRoleFilter_view.aod b/neonView/EmployeeRoleFilter_view/EmployeeRoleFilter_view.aod index 9fc81ddf21b067bfd7f7653c9d1a8b66f99b4d9a..80d5076129ade0ac6b9dfa8481a146c81c1e3200 100644 --- a/neonView/EmployeeRoleFilter_view/EmployeeRoleFilter_view.aod +++ b/neonView/EmployeeRoleFilter_view/EmployeeRoleFilter_view.aod @@ -1,23 +1,23 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>EmployeeRoleFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Table</name> - <autoNewRow v="true" /> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>ab1c8d39-fc29-42e8-8b8e-3557d544b272</name> - <entityField>ROLE</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>EmployeeRoleFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Table</name> + <autoNewRow v="true" /> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>ab1c8d39-fc29-42e8-8b8e-3557d544b272</name> + <entityField>ROLE</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod b/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod index 83e9082f7f1584e9a4894dd77c267a813beafd87..7f3ae6c82059100ec5d878d094c2b6a53398658b 100644 --- a/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod +++ b/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod @@ -21,6 +21,10 @@ <name>f60a0e0d-c3a9-4ab7-9b52-b33f5bb61d31</name> <entityField>rowIdProxy</entityField> </entityFieldLink> + <entityFieldLink> + <name>04579da5-0609-4a43-97dd-9e773ec1a29b</name> + <entityField>INFO</entityField> + </entityFieldLink> </fields> </genericViewTemplate> </children> diff --git a/neonView/ObjectRelationFilter_view/ObjectRelationFilter_view.aod b/neonView/ObjectRelationFilter_view/ObjectRelationFilter_view.aod index d0895c5772622b5ae8c0bf56410325d0f37b5240..0199c5d9ca0cb5b21d21753de06d4d23125798f3 100644 --- a/neonView/ObjectRelationFilter_view/ObjectRelationFilter_view.aod +++ b/neonView/ObjectRelationFilter_view/ObjectRelationFilter_view.aod @@ -22,6 +22,10 @@ <name>ab25081c-cb63-4d28-87d0-e4c022aac878</name> <entityField>rowIdProxy</entityField> </neonTableColumn> + <neonTableColumn> + <name>a5e8b3d6-ff83-461a-ba28-d67e0df5d93d</name> + <entityField>INFO</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/ObjectTreeEdit_view/ObjectTreeEdit_view.aod b/neonView/ObjectTreeEdit_view/ObjectTreeEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..472f2ae6756a22dc87731ca9a58aebddefba22a3 --- /dev/null +++ b/neonView/ObjectTreeEdit_view/ObjectTreeEdit_view.aod @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>ObjectTreeEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Edit</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>fd656c16-ef80-479f-a106-4741fb86c95f</name> + <entityField>OBJECTRELATIONTYPEID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>81ec0bf6-132c-4046-b770-f65da3cd4b6e</name> + <entityField>TARGET_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>04579da5-0609-4a43-97dd-9e773ec1a29b</name> + <entityField>INFO</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/ObjectTree_view/ObjectTree_view.aod b/neonView/ObjectTreeFilter_view/ObjectTreeFilter_view.aod similarity index 71% rename from neonView/ObjectTree_view/ObjectTree_view.aod rename to neonView/ObjectTreeFilter_view/ObjectTreeFilter_view.aod index d2be4d640df1e12b9e0ccabe2772d46fe3cbea30..36498203200d5587def0786af4a0ec1a15c76ceb 100644 --- a/neonView/ObjectTree_view/ObjectTree_view.aod +++ b/neonView/ObjectTreeFilter_view/ObjectTreeFilter_view.aod @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>ObjectTree_view</name> + <name>ObjectTreeFilter_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> <layout> <boxLayout> <name>layout</name> @@ -11,9 +12,12 @@ <treeViewTemplate> <name>ObjectRelations</name> <parentField>PARENT_ID</parentField> + <favoriteActionGroup1>alter</favoriteActionGroup1> + <nodeExpandedField>EXPANDED</nodeExpandedField> <titleField>TITLE</titleField> - <descriptionField>DESCRIPTION</descriptionField> + <descriptionField>INFO</descriptionField> <iconField>ICON</iconField> + <hideContentSearch v="true" /> <entityField>#ENTITY</entityField> </treeViewTemplate> </children> diff --git a/neonView/OfferitemFilter_view/OfferitemFilter_view.aod b/neonView/OfferitemFilter_view/OfferitemFilter_view.aod index faeaabafb0d244c85c432de22038a96857fe0c57..782aa68ca11efa22d05bcf1a3fba67d2720e4ac2 100644 --- a/neonView/OfferitemFilter_view/OfferitemFilter_view.aod +++ b/neonView/OfferitemFilter_view/OfferitemFilter_view.aod @@ -46,10 +46,6 @@ <name>89fd18d0-f6ee-4323-9277-464dee6da625</name> <entityField>OPTIONAL</entityField> </neonTableColumn> - <neonTableColumn> - <name>a31fd16c-4237-4cd9-a9de-2267f186d342</name> - <entityField>INFO</entityField> - </neonTableColumn> <neonTableColumn> <name>60a36c38-103f-4fdb-9e8a-b8fd6d441f14</name> <entityField>TotalPrice</entityField> diff --git a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod index 994833890782d29453e13c67ed6003d5c104b466..42acbc4358c5d947174cf4c9740b0bd95dfb886d 100644 --- a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod +++ b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod @@ -37,7 +37,7 @@ <columns> <neonTableColumn> <name>2008e7ac-9e6a-4104-9d5b-da60a10a1c02</name> - <entityField>IMAGE</entityField> + <entityField>#IMAGE</entityField> </neonTableColumn> <neonTableColumn> <name>a290a2ca-3236-4eb0-bf51-99f99d8414d6</name> diff --git a/neonView/OrganisationMain_view/OrganisationMain_view.aod b/neonView/OrganisationMain_view/OrganisationMain_view.aod index b8cddb7e650c4318fcb91b17830f4cef59ceaf90..33c7ef256855c1d91ec0170016f587594724fe36 100644 --- a/neonView/OrganisationMain_view/OrganisationMain_view.aod +++ b/neonView/OrganisationMain_view/OrganisationMain_view.aod @@ -53,7 +53,7 @@ <neonViewReference> <name>c82aff98-ede5-4d9e-a902-89f71ed7dbb0</name> <entityField>ObjectTrees</entityField> - <view>ObjectTree_view</view> + <view>ObjectTreeFilter_view</view> </neonViewReference> <neonViewReference> <name>39c98ccb-7f77-4df0-818f-1f302f69fec4</name> diff --git a/neonView/PersonFilter_view/PersonFilter_view.aod b/neonView/PersonFilter_view/PersonFilter_view.aod index a19c9f9769148048416dd7cd0eb1e5eb120790ea..8eacdad7de7323e951cb19a53f568e9883fb908f 100644 --- a/neonView/PersonFilter_view/PersonFilter_view.aod +++ b/neonView/PersonFilter_view/PersonFilter_view.aod @@ -39,7 +39,7 @@ <columns> <neonTableColumn> <name>210cc6ab-5123-4d8a-8f2e-a6cd91d494ef</name> - <entityField>IMAGE</entityField> + <entityField>#IMAGE</entityField> </neonTableColumn> <neonTableColumn> <name>125d04cc-5c7a-4c38-bd0f-b5d02d21067d</name> diff --git a/neonView/PersonMain_view/PersonMain_view.aod b/neonView/PersonMain_view/PersonMain_view.aod index 25df37d62a0216130cfc95f225e8dd86d085fd95..81c60ecc29cb6d4929fc9e8d777ce5efc4887a91 100644 --- a/neonView/PersonMain_view/PersonMain_view.aod +++ b/neonView/PersonMain_view/PersonMain_view.aod @@ -42,7 +42,7 @@ <neonViewReference> <name>cb8ff3df-772b-4c12-8814-f9101295b1ba</name> <entityField>ObjectTrees</entityField> - <view>ObjectTree_view</view> + <view>ObjectTreeFilter_view</view> </neonViewReference> <neonViewReference> <name>be48c6fe-1837-4c40-aef1-130fc1a5c544</name> diff --git a/neonView/PersonSimpleList_view/PersonSimpleList_view.aod b/neonView/PersonSimpleList_view/PersonSimpleList_view.aod index 570e2fae64725087b35b18285e7c46a838a626d9..30b81a27aac3ade30157dd6216b1acad3b3da580 100644 --- a/neonView/PersonSimpleList_view/PersonSimpleList_view.aod +++ b/neonView/PersonSimpleList_view/PersonSimpleList_view.aod @@ -14,7 +14,7 @@ <columns> <neonTableColumn> <name>d6207ade-29e7-4af0-ba5f-e9ddd799de7b</name> - <entityField>IMAGE</entityField> + <entityField>#IMAGE</entityField> </neonTableColumn> <neonTableColumn> <name>1053d3a7-c5ee-4260-86f6-54e820f53e9f</name> diff --git a/neonView/SalesprojectChart_view/SalesprojectChart_view.aod b/neonView/SalesprojectChart_view/SalesprojectChart_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..7b0791b033d56a015d4c91ef98986531deb2998e --- /dev/null +++ b/neonView/SalesprojectChart_view/SalesprojectChart_view.aod @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>SalesprojectChart_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <dashletConfigurations> + <neonDashletConfiguration> + <name>Salesproject phases</name> + <title>Salesproject Phases</title> + <description>Zeigt wie viele Vertriebsprojekte in den einzelnen Vertriebsphasen sind. </description> + <fragment>SalesprojectChart/full</fragment> + <singleton v="true" /> + <icon>VAADIN:FUNNEL</icon> + <categories> + <neonDashletCategory> + <name>salesproject</name> + <title>Salesproject</title> + </neonDashletCategory> + <neonDashletCategory> + <name>chart</name> + <title>Chart</title> + </neonDashletCategory> + </categories> + </neonDashletConfiguration> + </dashletConfigurations> + <layout> + <groupLayout> + <name>layout</name> + </groupLayout> + </layout> + <children> + <singleDataChartViewTemplate> + <name>PhaseFunnelChart</name> + <chartType>FUNNEL</chartType> + <xAxis>X_PHASE</xAxis> + <yAxis>Y_COUNT</yAxis> + <parentField></parentField> + <entityField>#ENTITY</entityField> + </singleDataChartViewTemplate> + <singleDataChartViewTemplate> + <name>PhasePieChart</name> + <chartType>PIE</chartType> + <xAxis>X_PHASE</xAxis> + <yAxis>Y_COUNT</yAxis> + <parentField></parentField> + <entityField>#ENTITY</entityField> + </singleDataChartViewTemplate> + <singleDataChartViewTemplate> + <name>PhasePyramidChart</name> + <chartType>PYRAMID</chartType> + <xAxis>X_PHASE</xAxis> + <yAxis>Y_COUNT</yAxis> + <entityField>#ENTITY</entityField> + </singleDataChartViewTemplate> + </children> +</neonView> diff --git a/neonView/SalesprojectScoreCard_view/SalesprojectScoreCard_view.aod b/neonView/SalesprojectScoreCard_view/SalesprojectScoreCard_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..642117e5d6747dcd2dbd529f0ec29d1f332094a0 --- /dev/null +++ b/neonView/SalesprojectScoreCard_view/SalesprojectScoreCard_view.aod @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>SalesprojectScoreCard_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <dashletConfigurations> + <neonDashletConfiguration> + <name>KeyFigures</name> + <title>Key figures</title> + <description>Kennzahlen</description> + <fragment>Salesproject/full</fragment> + <singleton v="false" /> + <icon>VAADIN:GRID_BIG</icon> + <categories> + <neonDashletCategory> + <name>salesproject</name> + <title>Salesproject</title> + </neonDashletCategory> + </categories> + </neonDashletConfiguration> + </dashletConfigurations> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <scoreCardViewTemplate> + <name>KeyFigures</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>9c2ca675-1a37-4ceb-ad49-279bddc1150b</name> + <entityField>OVERALL_TURNOVER</entityField> + </entityFieldLink> + <entityFieldLink> + <name>23433d4d-94cb-4a25-99c1-88df451fcc34</name> + <entityField>OVERALL_FORECAST</entityField> + </entityFieldLink> + <entityFieldLink> + <name>da6c1a0b-723c-43d4-a168-1732ebe3bd34</name> + <entityField>OPEN_SALEPROJECTS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>c376674f-fe29-4527-a2b3-db67e1dca085</name> + <entityField>SENT_OFFERS</entityField> + </entityFieldLink> + </fields> + </scoreCardViewTemplate> + </children> +</neonView> diff --git a/neonView/StoredSelectionFilter_view/StoredSelectionFilter_view.aod b/neonView/StoredSelectionFilter_view/StoredSelectionFilter_view.aod deleted file mode 100644 index f9352814ab348ec447bc773953efbfdedf91bcd3..0000000000000000000000000000000000000000 --- a/neonView/StoredSelectionFilter_view/StoredSelectionFilter_view.aod +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>StoredSelectionFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Table</name> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>713574de-2d9c-4006-93a3-3860fb145c26</name> - <entityField>CONTEXT_NAME</entityField> - </neonTableColumn> - <neonTableColumn> - <name>4cc4d5ff-24cf-46d9-9941-cda11e445a17</name> - <entityField>SELECTION_TITLE</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> diff --git a/others/db_changes/Data_alias/basic/2019.2/AditoBasic/init_AttributeType.xml b/others/db_changes/Data_alias/basic/2019.2/AditoBasic/init_AttributeType.xml index 99852b24f7249d850ec0f6f8a32fd7503de7a471..d9d8b0d5c9a7af796f4e305693341aeacc76967b 100644 --- a/others/db_changes/Data_alias/basic/2019.2/AditoBasic/init_AttributeType.xml +++ b/others/db_changes/Data_alias/basic/2019.2/AditoBasic/init_AttributeType.xml @@ -17,15 +17,6 @@ <column name="ISACTIVE" valueNumeric="1"/> <column name="ISESSENTIAL" valueNumeric="1"/> </insert> - <insert tableName="AB_KEYWORD_ENTRY"> - <column name="AB_KEYWORD_ENTRYID" value="1fa94dc3-b875-4e95-9ec1-8cb714f058fb"/> - <column name="KEYID" value="MEMO"/> - <column name="TITLE" value="Memo"/> - <column name="CONTAINER" value="AttributeType"/> - <column name="SORTING" valueNumeric="8"/> - <column name="ISACTIVE" valueNumeric="1"/> - <column name="ISESSENTIAL" valueNumeric="1"/> - </insert> <rollback> <delete tableName="AB_KEYWORD_ENTRY"> <where>AB_KEYWORD_ENTRYID = ?</where> @@ -33,12 +24,6 @@ <param value="9d2f9605-1a5e-47d3-8920-168f5637e37f"/> </whereParams> </delete> - <delete tableName="AB_KEYWORD_ENTRY"> - <where>AB_KEYWORD_ENTRYID = ?</where> - <whereParams> - <param value="1fa94dc3-b875-4e95-9ec1-8cb714f058fb"/> - </whereParams> - </delete> </rollback> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/Data_alias/basic/2019.2/AttributeKeyword.xml b/others/db_changes/Data_alias/basic/2019.2/AttributeKeyword.xml index 0186627b55d3410360406bd0a6263d5bbccd04d0..272ae0c6a2922b4096ce2e511adc036fcdb3b88c 100644 --- a/others/db_changes/Data_alias/basic/2019.2/AttributeKeyword.xml +++ b/others/db_changes/Data_alias/basic/2019.2/AttributeKeyword.xml @@ -3,16 +3,16 @@ <changeSet author="s.listl" id="f527a5cc-f1e5-497f-a069-33aee944d421"> <addColumn tableName="AB_ATTRIBUTE"> <column name="KEYWORD_CONTAINER" type="VARCHAR(80)"/> - </addColumn> - <addColumn tableName="AB_ATTRIBUTE"> <column name="ATTRIBUTE_INFO" type="NCLOB"/> - </addColumn> - <addColumn tableName="AB_ATTRIBUTE"> <column name="SORTING" type="INTEGER"/> </addColumn> <addColumn tableName="AB_ATTRIBUTERELATION"> - <column name="MEMO_VALUE" type="NCLOB"/> + <column name="INT_VALUE" type="INTEGER"/> </addColumn> + <dropColumn tableName="AB_ATTRIBUTERELATION"> + <column name="BOOL_VALUE"/> + </dropColumn> + <modifyDataType tableName="AB_ATTRIBUTERELATION" columnName="CHAR_VALUE" newDataType="NVARCHAR(512)"/> <createIndex indexName="IDX_ATTRPARENT" tableName="AB_ATTRIBUTE"> <column name="ATTRIBUTE_PARENT_ID"/> </createIndex> diff --git a/others/db_changes/Data_alias/basic/2019.2/add_ObjectRelation_type.xml b/others/db_changes/Data_alias/basic/2019.2/add_ObjectRelation_type.xml index 1fe970cb978fa75867033eedcd40729919b23316..a4cd984291959325e385d95d8061664927ae2786 100644 --- a/others/db_changes/Data_alias/basic/2019.2/add_ObjectRelation_type.xml +++ b/others/db_changes/Data_alias/basic/2019.2/add_ObjectRelation_type.xml @@ -17,11 +17,15 @@ <column name="SIDE" type="INTEGER"> <constraints nullable="false"/> </column> + <column name="HIERARCHY" type="INTEGER"> + <constraints nullable="false"/> + </column> </createTable> <addColumn tableName="AB_OBJECTRELATION"> <column name="AB_OBJECTRELATIONTYPE1" type="CHAR(36)"/> <column name="AB_OBJECTRELATIONTYPE2" type="CHAR(36)"/> + <column name="INFO" type="NCLOB"/> </addColumn> <dropIndex tableName="AB_OBJECTRELATION" indexName="IDX_AB_OBJECTRELATION_OBJECT1"/> @@ -38,6 +42,7 @@ <column name="RELATION_TITLE" value="parent company"/> <column name="RELATION_TYPE" value="a054875d-b9a2-499d-877b-ccec31358324"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="1"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="259babbd-7827-44d4-b9ec-8245d27b5f70"/> @@ -45,6 +50,7 @@ <column name="RELATION_TITLE" value="subsidiary"/> <column name="RELATION_TYPE" value="a054875d-b9a2-499d-877b-ccec31358324"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="1"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -53,6 +59,7 @@ <column name="RELATION_TITLE" value="parent of"/> <column name="RELATION_TYPE" value="52f3ec58-71d5-469f-85e4-37ef2eeeb3e0"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="b3b85332-1c86-4cd8-a3b9-34c49c51f01a"/> @@ -60,6 +67,7 @@ <column name="RELATION_TITLE" value="child of"/> <column name="RELATION_TYPE" value="52f3ec58-71d5-469f-85e4-37ef2eeeb3e0"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -68,6 +76,7 @@ <column name="RELATION_TITLE" value="supports"/> <column name="RELATION_TYPE" value="5ab4d256-4220-4c28-88d6-1db01e2f4667"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="a51e23c0-d44a-4e39-a79b-7a357fb79cc2"/> @@ -75,6 +84,7 @@ <column name="RELATION_TITLE" value="supported by"/> <column name="RELATION_TYPE" value="5ab4d256-4220-4c28-88d6-1db01e2f4667"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -83,6 +93,7 @@ <column name="RELATION_TITLE" value="supervisor of"/> <column name="RELATION_TYPE" value="4df4160d-6efc-43b3-9b02-710ab3d0228c"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="0a47c346-9b6f-4cdd-8c38-77800d7012f5"/> @@ -90,6 +101,7 @@ <column name="RELATION_TITLE" value="reports to"/> <column name="RELATION_TYPE" value="4df4160d-6efc-43b3-9b02-710ab3d0228c"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -98,6 +110,7 @@ <column name="RELATION_TITLE" value="promotion target of"/> <column name="RELATION_TYPE" value="ddad6aa3-267b-4784-afbb-98242218fcf5"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="e397b595-38ae-4365-908e-75ee388838eb"/> @@ -105,6 +118,7 @@ <column name="RELATION_TITLE" value="solicits"/> <column name="RELATION_TYPE" value="ddad6aa3-267b-4784-afbb-98242218fcf5"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -113,6 +127,7 @@ <column name="RELATION_TITLE" value="competitor"/> <column name="RELATION_TYPE" value="032ebe0a-7204-4eec-82a2-cb13b65850d7"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -121,6 +136,7 @@ <column name="RELATION_TITLE" value="society"/> <column name="RELATION_TYPE" value="9f65f915-2767-40c4-9e7b-e818e915648f"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="fa879afd-b2c5-4eee-9799-d63c6764b348"/> @@ -128,6 +144,7 @@ <column name="RELATION_TITLE" value="member"/> <column name="RELATION_TYPE" value="9f65f915-2767-40c4-9e7b-e818e915648f"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -136,6 +153,7 @@ <column name="RELATION_TITLE" value="acquainted with"/> <column name="RELATION_TYPE" value="84120fad-e7a2-4961-8c29-d00da41efe48"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -144,6 +162,7 @@ <column name="RELATION_TITLE" value="collaboration with"/> <column name="RELATION_TYPE" value="091d866f-67e8-4fd6-afdc-e40d0f2be224"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> @@ -152,6 +171,7 @@ <column name="RELATION_TITLE" value="grandparents of"/> <column name="RELATION_TYPE" value="f36c69c2-6d03-45ef-81a0-f9118ce3f4c6"/> <column name="SIDE" valueNumeric="1"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> <insert tableName="AB_OBJECTRELATIONTYPE"> <column name="AB_OBJECTRELATIONTYPEID" value="a2296f93-2371-4ab8-9f29-ef0795d1e9b2"/> @@ -159,6 +179,7 @@ <column name="RELATION_TITLE" value="ankle of"/> <column name="RELATION_TYPE" value="f36c69c2-6d03-45ef-81a0-f9118ce3f4c6"/> <column name="SIDE" valueNumeric="2"/> + <column name="HIERARCHY" valueNumeric="0"/> </insert> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/Data_alias/basic/2019.2/changelog.xml b/others/db_changes/Data_alias/basic/2019.2/changelog.xml index 7d90410cfa5b2955a1139f901a91e703dc695b43..6009d8e602c66c83705a33922abe05eedc2179cc 100644 --- a/others/db_changes/Data_alias/basic/2019.2/changelog.xml +++ b/others/db_changes/Data_alias/basic/2019.2/changelog.xml @@ -20,7 +20,7 @@ <include relativeToChangelogFile="true" file="data/example_contract/CONTRACT_1002.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_contract/CONTRACT_1003.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_contract/CONTRACT_1004.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_product/PRODUCT_42154311.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_product/PRODUCT_42154311.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesproject/SALESPROJECT_gfk.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesproject/SALESPROJECT_jkl.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_activity/ACTIVITY_gfk.xml" context="example"/> @@ -28,30 +28,30 @@ <include relativeToChangelogFile="true" file="data/example_offer/OFFER_1001.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_offer/OFFER_1002.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_offer/OFFER_1003.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_offer/OFFER_1004.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_offer/OFFER_1004.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1000.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1001.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1002.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1003.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1004.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1005.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1006.xml" context="example"/> - <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1007.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1004.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1005.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1006.xml" context="example"/> + <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1007.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1008.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_salesorder/SALESORDER_1009.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_task/base.xml" context="example"/> - + <include relativeToChangelogFile="true" file="update_TaskType_Task.xml"/> - + <include relativeToChangelogFile="true" file="removeTaskCode.xml"/> - + <include relativeToChangelogFile="true" file="activity_add_parent.xml"/> <include relativeToChangelogFile="true" file="task_add_parent.xml"/> <include relativeToChangelogFile="true" file="create_salutation.xml"/> - + <include relativeToChangelogFile="true" file="drop_estimation_salesproject.xml"/> - + <!--References to the Keyword Values--> <include relativeToChangelogFile="true" file="KeywordRelatedStructureChanges/OfferProbability.xml"/> <include relativeToChangelogFile="true" file="KeywordRelatedStructureChanges/ActivityCategory.xml"/> @@ -65,7 +65,7 @@ <include relativeToChangelogFile="true" file="KeywordRelatedStructureChanges/TaskPriority.xml"/> <include relativeToChangelogFile="true" file="KeywordRelatedStructureChanges/SalesprojectCompetitionState.xml"/> <include relativeToChangelogFile="true" file="KeywordRelatedStructureChanges/SalesProjectCompetitionPhase.xml"/> - + <!--References to the reference files--> <include relativeToChangelogFile="true" file="AditoBasic/init_OfferProbability.xml"/> <include relativeToChangelogFile="true" file="AditoBasic/init_ActivityCategory.xml"/> @@ -83,27 +83,27 @@ <include relativeToChangelogFile="true" file="Contact_add_columns.xml"/> <include relativeToChangelogFile="true" file="SalesOrder_source_offer.xml"/> <include relativeToChangelogFile="true" file="Product_remove_fk.xml"/> - + <include relativeToChangelogFile="true" file="data/example_attribute/Attribute.xml" context="example"/> <include relativeToChangelogFile="true" file="data/example_attribute/AttributeUsage.xml" context="example"/> - + <include relativeToChangelogFile="true" file="drop_contact_id_sp_forecast.xml"/> - + <include relativeToChangelogFile="true" file="fix_sp_phases.xml"/> - + <include relativeToChangelogFile="true" file="drop_pricePolitics-weakness-strength.xml"/> - + <include relativeToChangelogFile="true" file="update_pricelist_keyword.xml"/> - + <include relativeToChangelogFile="true" file="create_taskLink.xml"/> - + <include relativeToChangelogFile="true" file="Offer_terms.xml"/> - + <include relativeToChangelogFile="true" file="add_ObjectRelation_type.xml"/> <include relativeToChangelogFile="true" file="data/AditoBasic/ObjectRelation_exampleData.xml" context="example"/> - + <include relativeToChangelogFile="true" file="Salesproject_add_column.xml"/> - + <include relativeToChangelogFile="true" file="AditoBasic/update_Strength_Weakness.xml"/> <include relativeToChangelogFile="true" file="AditoBasic/init_ContactDepartment.xml"/> <include relativeToChangelogFile="true" file="AditoBasic/init_ContactContactrole.xml"/> @@ -124,7 +124,7 @@ <include relativeToChangelogFile="true" file="offer_add_date_editnew_user_editnew.xml"/> <include relativeToChangelogFile="true" file="attributerelation_add_date_editnew_user_editnew.xml"/> <include relativeToChangelogFile="true" file="communication_add_date_editnew_user_editnew.xml"/> - + <include relativeToChangelogFile="true" file="indicesRefactor/ContactManagement.xml"/> <include relativeToChangelogFile="true" file="indicesRefactor/Keyword.xml"/> <include relativeToChangelogFile="true" file="indicesRefactor/Activity.xml"/> @@ -136,4 +136,3 @@ <include relativeToChangelogFile="true" file="CampaignManagement/create_campaignParticipantLog.xml"/> <include relativeToChangelogFile="true" file="CampaignManagement/create_campaignState.xml"/> <include relativeToChangelogFile="true" file="CampaignManagement/create_campaignStepState.xml"/> -</databaseChangeLog> diff --git a/others/db_changes/Data_alias/basic/2019.2/data/example_attribute/Attribute.xml b/others/db_changes/Data_alias/basic/2019.2/data/example_attribute/Attribute.xml index 28ca84e85fdbc71022177386541f7aa1e0e0cd7d..632b9c9749a3758287c9d0ddfc316b3e6295dc25 100644 --- a/others/db_changes/Data_alias/basic/2019.2/data/example_attribute/Attribute.xml +++ b/others/db_changes/Data_alias/basic/2019.2/data/example_attribute/Attribute.xml @@ -871,7 +871,7 @@ </insert> <insert tableName="AB_ATTRIBUTE"> <column name="AB_ATTRIBUTEID" value="292fae38-6557-466d-8843-3b1b4a1f6599"/> - <column name="ATTRIBUTE_ACTIVE" valueNumeric="0"/> + <column name="ATTRIBUTE_ACTIVE" valueNumeric="1"/> <column name="ATTRIBUTE_LEVEL" valueNumeric="1"/> <column name="ATTRIBUTE_NAME" value="Zahlungskondition"/> <column name="ATTRIBUTE_PARENT_ID" value="ab545654-1fce-4993-b763-0ec469781302"/> @@ -880,7 +880,7 @@ </insert> <insert tableName="AB_ATTRIBUTE"> <column name="AB_ATTRIBUTEID" value="3a6e11fc-b00a-4cf3-975a-a5e8b60fc5cb"/> - <column name="ATTRIBUTE_ACTIVE" valueNumeric="0"/> + <column name="ATTRIBUTE_ACTIVE" valueNumeric="1"/> <column name="ATTRIBUTE_LEVEL" valueNumeric="1"/> <column name="ATTRIBUTE_NAME" value="Lieferkondition"/> <column name="ATTRIBUTE_PARENT_ID" value="ab545654-1fce-4993-b763-0ec469781302"/> diff --git a/process/ActivityTask_lib/ActivityTask_lib.aod b/process/ActivityTask_lib/ActivityTask_lib.aod index 679ece6671ecd25e2a3026d6320beb2b5e21c633..141c9c3f9344db9b60ff2be3992885545ebcb96a 100644 --- a/process/ActivityTask_lib/ActivityTask_lib.aod +++ b/process/ActivityTask_lib/ActivityTask_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>ActivityTask_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/ActivityTask_lib/process.js</process> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index 4228e5d38db37b07d9a0329cc3577b69893815c2..8f7de2b78e5f70871594f05d7cf2f9c83b04c845 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.vars"); import("system.util"); import("system.datetime"); @@ -82,6 +83,25 @@ TaskUtils.createNewTask = function(pRowId, pAdditionalLinks, pParentContext, pPa _ActivityTaskUtils._createNew("Task", pRowId, pAdditionalLinks, pParentContext, pParentId) } +/** + * Create a new task + */ +TaskUtils.hasTasks = function(pRowId, pObjectType) +{ + if (pRowId != "" && pObjectType != "") + { + var cond = SqlCondition.begin().andPrepare("TASKLINK.OBJECT_TYPE", pObjectType) + .andPrepare("TASKLINK.OBJECT_ROWID", pRowId); + var taskCount = db.cell(cond.buildSql("select count(*) from TASKLINK")); + if (taskCount != "0") + return true; + else + return false; + } + else + return true; +} + /** * add the links to the link-table in new mode * diff --git a/process/AddressEntity_lib/AddressEntity_lib.aod b/process/AddressEntity_lib/AddressEntity_lib.aod index adae9b0940c9fb3fc0ebd9325ea4373f2b3c5b64..4ecf49e2e70d3882be5ed8a66b3ec91a4d509593 100644 --- a/process/AddressEntity_lib/AddressEntity_lib.aod +++ b/process/AddressEntity_lib/AddressEntity_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>AddressEntity_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/AddressEntity_lib/process.js</process> diff --git a/process/Appointment_lib/Appointment_lib.aod b/process/Appointment_lib/Appointment_lib.aod index 20497c5ba1cc22dfa08e0ef10c7e96be632119fd..5b832c601af4bab0a69bff58acf1c2427be6911c 100644 --- a/process/Appointment_lib/Appointment_lib.aod +++ b/process/Appointment_lib/Appointment_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Appointment_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Appointment_lib/process.js</process> diff --git a/process/Attribute_lib/Attribute_lib.aod b/process/Attribute_lib/Attribute_lib.aod index 5cc0e19791f3c84678baf8bdaf4acaeeada59846..7d9936e818274c5e11dd7fec0c27953f2d32d4e9 100644 --- a/process/Attribute_lib/Attribute_lib.aod +++ b/process/Attribute_lib/Attribute_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Attribute_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Attribute_lib/process.js</process> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 08b0fba8f927bb1a913d8a2a65c8d4adf20f383a..af3d24d9585b86cd16d243fb69b02a0087e47aaf 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.util"); import("system.datetime"); import("system.translate"); @@ -51,8 +50,8 @@ AttributeUtil.getPossibleAttributes = function (pObjectType, pIncludeGroups, pFi attrCond.andSqlCondition(filteredIdsCondition); } - if (!pIncludeGroups) - attrCond.and("ATTRIBUTE_TYPE != '" + $AttributeTypes.GROUP + "'"); +// if (!pIncludeGroups) +// attrCond.and("ATTRIBUTE_TYPE != '" + $AttributeTypes.GROUP + "'"); var attributes = db.array(db.COLUMN, attrCond.buildSql(attrSql)); @@ -377,8 +376,8 @@ $AttributeTypes.BOOLEAN = { toString : function () {return this.keyword}, keyword : "BOOLEAN", contentType : "BOOLEAN", - databaseField : "BOOL_VALUE", - entityField : "BOOL_VALUE", + databaseField : "INT_VALUE", + entityField : "INT_VALUE", getViewValue : function (pValue) { return pValue == "1" ? translate.text("Yes") : translate.text("No"); @@ -416,14 +415,6 @@ $AttributeTypes.KEYWORD = { return KeywordUtils.getViewValue(pKeyword, pValue); } }; -$AttributeTypes.MEMO = { - toString : function () {return this.keyword}, - keyword : "MEMO", - contentType : "TEXT", - databaseField : "MEMO_VALUE", - entityField : "MEMO_VALUE" -}; - function AttributeTypeUtil () {} diff --git a/process/Binary_lib/Binary_lib.aod b/process/Binary_lib/Binary_lib.aod index 69dcbbe1397df315522d477dc1495e4baf431f6c..39de483b5c216084257d95a007b355a11c1d53c0 100644 --- a/process/Binary_lib/Binary_lib.aod +++ b/process/Binary_lib/Binary_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Binary_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Binary_lib/process.js</process> diff --git a/process/Calendar_lib/Calendar_lib.aod b/process/Calendar_lib/Calendar_lib.aod index e3951f99b38019314fc51ee10cc7cd42b416b480..ba466c5bf5fc50d099a4c5de79e3808744b53b56 100644 --- a/process/Calendar_lib/Calendar_lib.aod +++ b/process/Calendar_lib/Calendar_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Calendar_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Calendar_lib/process.js</process> diff --git a/process/Communication_lib/Communication_lib.aod b/process/Communication_lib/Communication_lib.aod index b1b3026148856104aac1130557a7a5cb1341b53c..a69299aa2aa56c2a3a2b1a4321e8779ff438187b 100644 --- a/process/Communication_lib/Communication_lib.aod +++ b/process/Communication_lib/Communication_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Communication_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Communication_lib/process.js</process> diff --git a/process/Contact_lib/Contact_lib.aod b/process/Contact_lib/Contact_lib.aod index 3a466ec8e60357645490ddb1a290cd7b6008a6f3..ea8e5020017153333df78eddfd6bfd9c415e7208 100644 --- a/process/Contact_lib/Contact_lib.aod +++ b/process/Contact_lib/Contact_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Contact_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Contact_lib/process.js</process> diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index f4d50682682ea63b11f722b56ea83c21de72c396..7539546b86e240ee05c0c28df960fec4ef92a420 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.neon"); import("system.vars"); import("system.result"); @@ -34,6 +35,44 @@ OrganisationUtils.getNameByOrganisationId = function(pOrganisationId) */ function ContactUtils() {} +/* + * validates if a ORGANISATION_ID in a person-contact is correct [=>does not already exist] or not [=>does already exist] + * this is done by checking the database for entires that do already exist with this combination of ORGANISATIONID and PERSONID + * gives different messages for private persons and contacts that do already exist + * + * @param {String} pPersonId the ID of the person that shall be searched in the database + * @param {String} pOrganisationId the ID of the organisation that shall be searched in the database; + * if this is an empty string it will be treated as private-dummy-organisation + * @param {String} [pOwnContactId] the CONTACTID of your current record; this is only needed when in EDIT-mode since you don't want to get a message + * for your own CONTACT; + * (if you do a lookup if a organisation-person-combination does already exist you'l get your own contact which you want to exclude) + * + * @return {String} translated text that describes whats the problem or null if there was no problem and everything is fine + * + */ +ContactUtils.validateIfAlreadyExists = function(pPersonId, pOrganisationId, pOwnContactId) +{ + if (!pPersonId) + return null; + if (pOrganisationId == "") + pOrganisationId = "0"; + var cond = SqlCondition.begin() + .andPrepare("CONTACT.PERSON_ID", pPersonId) + .andPrepare("CONTACT.ORGANISATION_ID", pOrganisationId) + //exclude the own since we do not want a "is not valid"-message for our own entry (on EDIT-mode) + .andPrepareIfSet("CONTACT.CONTACTID", pOwnContactId, "# != ?"); + + var sql = cond.buildSql("select CONTACT.CONTACTID from CONTACT"); + var alreadyExistantContactId = db.cell(sql); + if (alreadyExistantContactId) + if (pOrganisationId.trim() == "0") + return translate.text("This private person doeas already exist and can not be created once more."); + else + return translate.text("This combination of person and organisation does already exist and can not be created once more."); + + return null; +}; + /** * Get the type of contact. <br> * In recordstate NEW or EDIT it loads the person- / orgid from the db.<br> @@ -190,7 +229,7 @@ ContactUtils.getContextByContactId = function(pContactId) * get the person- and org-id from a contact as array * * @param {String} pContactId - * @return {String[]} result as [persid, orgid] if one of them is null in the db, "" will be returned as the id. + * @return {String[]} result as [contactid, persid, orgid] if one of them is null in the db, "" will be returned as the id. */ ContactUtils.getPersOrgIds = function(pContactId) { @@ -201,8 +240,7 @@ ContactUtils.getPersOrgIds = function(pContactId) .buildSql("select CONTACTID, PERSON_ID, ORGANISATION_ID from CONTACT", "1=0")); } - - return ["", ""]; + return []; } /** diff --git a/process/Context_lib/Context_lib.aod b/process/Context_lib/Context_lib.aod index 830f1c42151d18dc0d6303b30214b4e071f2c003..88f0211eacad5423f96a78a8ceaa903a1bf72cdb 100644 --- a/process/Context_lib/Context_lib.aod +++ b/process/Context_lib/Context_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Context_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Context_lib/process.js</process> diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index e08292ee5163cb70023156b4be664f6efd6e7c59..82ea3eef6b21f0e6a8541a7021808c027235e9ed 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -375,14 +375,14 @@ ContextUtils.getNameSql = function(pContextId, pRowId) /** * TODO: !!!temporary function until you can get fields from another Entity!!! */ -ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate, pActive, pWithState) +ContextUtils.getContextDataSql = function(pContextId, pContactId, pWithDate, pActive, pWithState, pExcludedObjectIds) { var selectMap = ContextUtils.getSelectMap(); var ownContextSelector = selectMap[pContextId]; var cond = SqlCondition.begin(); - if (pRowId) + if (pContactId) { - cond.andPrepare(ownContextSelector.tableName + "." + ownContextSelector.contactIdField, pRowId) + cond.andPrepare(ownContextSelector.tableName + "." + ownContextSelector.contactIdField, pContactId) } if (pActive != undefined) @@ -401,6 +401,19 @@ ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate, pActive cond.andSqlCondition(condSub); } } + + if (pExcludedObjectIds) + { + var exludedIdsCond = new SqlCondition() + + pExcludedObjectIds.forEach(function(id) + { + this.andPrepare(ownContextSelector.tableName + "." + ownContextSelector.idField, id, "# <> ?"); + }, exludedIdsCond) + + cond.andSqlCondition(exludedIdsCond); + } + var dateColumn = ""; if (pWithDate === true) dateColumn = ", " + (ownContextSelector.creationDateField || "''"); diff --git a/process/Contract_lib/Contract_lib.aod b/process/Contract_lib/Contract_lib.aod index 380228efe32ff334cc0fa27fc02aa8612a984bd2..f7e066be340112fbe6298f410624cc9ba6284dad 100644 --- a/process/Contract_lib/Contract_lib.aod +++ b/process/Contract_lib/Contract_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Contract_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Contract_lib/process.js</process> diff --git a/process/Data_lib/Data_lib.aod b/process/Data_lib/Data_lib.aod index 31c110aa44acdbe4f27e96eac428e3a6bbff4a4d..7e6dc0e007d710b42680bd618e2e6e4889e0296d 100644 --- a/process/Data_lib/Data_lib.aod +++ b/process/Data_lib/Data_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Data_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Data_lib/process.js</process> diff --git a/process/Date_lib/Date_lib.aod b/process/Date_lib/Date_lib.aod index 14146541257a3980465dbbb65c66c07bd7f028d6..9833cb86c53bc720131800ef98c93138e6b61db2 100644 --- a/process/Date_lib/Date_lib.aod +++ b/process/Date_lib/Date_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Date_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Date_lib/process.js</process> diff --git a/process/Document_lib/Document_lib.aod b/process/Document_lib/Document_lib.aod index f4e3b53c416aaab5a30f3ee690b54a9372a074d6..9f2ede3e40f379602f2d598e9027e4605ab4044c 100644 --- a/process/Document_lib/Document_lib.aod +++ b/process/Document_lib/Document_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Document_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Document_lib/process.js</process> diff --git a/process/Employee_lib/Employee_lib.aod b/process/Employee_lib/Employee_lib.aod index 9c77c83eb023a529ed5b5fd9a4a28fe933b3adfe..1a08f91b6ef81042668340de79dfea0687a520e6 100644 --- a/process/Employee_lib/Employee_lib.aod +++ b/process/Employee_lib/Employee_lib.aod @@ -1,9 +1,9 @@ -<?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> - <name>Employee_lib</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <process>%aditoprj%/process/Employee_lib/process.js</process> - <variants> - <element>LIBRARY</element> - </variants> -</process> +<?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.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>Employee_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/Employee_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/Employee_lib/process.js b/process/Employee_lib/process.js index ef3273b495502a48ea29ed752400895251dd08a8..dac86b25c4f2515a8db0a6b58585a9026a6f1c46 100644 --- a/process/Employee_lib/process.js +++ b/process/Employee_lib/process.js @@ -1,3 +1,5 @@ +import("system.db"); +import("Sql_lib"); import("system.tools"); /** @@ -29,4 +31,83 @@ EmployeeUtils.getCurrentUserName = function () { var user = tools.getCurrentUser(); return user ? user[tools.TITLE] : null; +} + +EmployeeUtils.sliceUserId = function (pUserId) +{ + return pUserId.substr(10, 36); +} + +/** + * generates a username from the firstname and lastname with the given structure + * + * @param {String} pFirstName + * @param {String} pLastName + * @param {String} pStructure the structure of the username, special characters: + * f - one letter of the firstname in lowercase + * F - one letter of the firstname in uppsercase + * l - one letter of the lastname in lowercase + * L - one letter of the lastname in uppsercase + * f+ - the complete firstname in lowercase + * F+ - the complete firstname + * l+ - the complete lastname in lowercae + * L+ - the complete lastname + * + * @return {String} the generated username + */ +EmployeeUtils.generateUserName = function (pFirstName, pLastName, pStructure) +{ + if (!pStructure || (!pFirstName && !pLastName)) + return null; + + var firstNameIndex = 0; + var lastNameIndex = 0; + var userName = pStructure.replace(/(f\+|l\+|f|l)/ig, function (type) + { + switch (type) + { + case "f+": + return pFirstName.toLowerCase() || ""; + case "F+": + return pFirstName || ""; + case "l+": + return pLastName.toLowerCase() || ""; + case "L+": + return pLastName || ""; + case "f": + return pFirstName.charAt(firstNameIndex++).toLowerCase() || ""; + case "F": + return pFirstName.charAt(firstNameIndex++).toUpperCase() || ""; + case "l": + return pLastName.charAt(lastNameIndex++).toLowerCase() || ""; + case "L": + return pLastName.charAt(lastNameIndex++).toUpperCase() || ""; + } + }); + + return userName; +} + +/** + * checks if an employee is used somewhere + * + * @param {String} pContactId the contact id of the user + * + * @return {boolean} if the employee has relations + */ +EmployeeUtils.hasRelations = function (pContactId) +{ + //sql queries with selects on tables where an employee can be used + var queries = [ + SqlCondition.begin() + .andPrepare("ACTIVITY.CREATOR", pContactId) + .buildSql("select 1 from ACTIVITY"), + SqlCondition.begin() + .andPrepare("TIMETRACKING.CONTACT_ID", pContactId) + .buildSql("select 1 from TIMETRACKING") + ]; + return queries.some(function (sql) + { + return db.cell(sql) != ""; + }); } \ No newline at end of file diff --git a/process/Entity_lib/Entity_lib.aod b/process/Entity_lib/Entity_lib.aod index 39459cd9cca28b1773673ea0ec2dd2b463340b8a..d106b77a163c3a6f9266ffd622878cd794b9699a 100644 --- a/process/Entity_lib/Entity_lib.aod +++ b/process/Entity_lib/Entity_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Entity_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Entity_lib/process.js</process> diff --git a/process/IndexSearch_lib/IndexSearch_lib.aod b/process/IndexSearch_lib/IndexSearch_lib.aod index a584c2b2b813278ee81a543ba277362c825026a9..bfc314526ea673c93e94af2e8fae2d019e835386 100644 --- a/process/IndexSearch_lib/IndexSearch_lib.aod +++ b/process/IndexSearch_lib/IndexSearch_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>IndexSearch_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/IndexSearch_lib/process.js</process> diff --git a/process/JditoFilter_lib/JditoFilter_lib.aod b/process/JditoFilter_lib/JditoFilter_lib.aod index fcd05c04eec14b76a0b13a8362a146953961c9c0..39f93d7408ba9b780ffa2103135c3164dee04d68 100644 --- a/process/JditoFilter_lib/JditoFilter_lib.aod +++ b/process/JditoFilter_lib/JditoFilter_lib.aod @@ -1,9 +1,9 @@ -<?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> - <name>JditoFilter_lib</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <process>%aditoprj%/process/JditoFilter_lib/process.js</process> - <variants> - <element>LIBRARY</element> - </variants> -</process> +<?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.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>JditoFilter_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/JditoFilter_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/JditoFilter_lib/process.js b/process/JditoFilter_lib/process.js index f0331604c5ae33e3f6778e7ea1cf274dd8e818d8..64d5ea5a3107407acc64475b059ccb2a721858a7 100644 --- a/process/JditoFilter_lib/process.js +++ b/process/JditoFilter_lib/process.js @@ -80,7 +80,8 @@ JditoFilter.prototype._testValue = function (pRowValue, pFilterValue, pOperator) } /** - * Provides functions for using the filter with jdito recordcontainers + * Provides functions for using the filter with jdito recordcontainers. You should only use this + * if there is no other, faster way to filter the records * * Do not instanciate this! * diff --git a/process/KeywordRegistry_basic/KeywordRegistry_basic.aod b/process/KeywordRegistry_basic/KeywordRegistry_basic.aod index f134eecec0a5f6d23f46e3351e0705400e34e153..f16c2160c96dbf655bd3d9e8c09fa6cdf23fe58f 100644 --- a/process/KeywordRegistry_basic/KeywordRegistry_basic.aod +++ b/process/KeywordRegistry_basic/KeywordRegistry_basic.aod @@ -1,7 +1,9 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>KeywordRegistry_basic</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/KeywordRegistry_basic/process.js</process> - <publishAsWebservice v="true" /> + <variants> + <element>LIBRARY</element> + </variants> </process> diff --git a/process/Keyword_lib/Keyword_lib.aod b/process/Keyword_lib/Keyword_lib.aod index f835319ec09922acdea7725d29eef29edc8c4b1b..2dd2a647ff95df46a7e1b5d118e021129d1d30d7 100644 --- a/process/Keyword_lib/Keyword_lib.aod +++ b/process/Keyword_lib/Keyword_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Keyword_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Keyword_lib/process.js</process> diff --git a/process/Money_lib/Money_lib.aod b/process/Money_lib/Money_lib.aod index e374a767e3e98dff0cc30b6c59535cc312e0919a..9c27e1c6debbf49bc099056bddd3fe16f4243480 100644 --- a/process/Money_lib/Money_lib.aod +++ b/process/Money_lib/Money_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Money_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Money_lib/process.js</process> diff --git a/process/Neon_lib/Neon_lib.aod b/process/Neon_lib/Neon_lib.aod index 7434f563e728bd1e8ec0e98e600938175418b6d2..ace4a1e8ec19c194c1d9e00326013f3656cd35b4 100644 --- a/process/Neon_lib/Neon_lib.aod +++ b/process/Neon_lib/Neon_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Neon_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Neon_lib/process.js</process> diff --git a/process/ObjectRelation_lib/ObjectRelation_lib.aod b/process/ObjectRelation_lib/ObjectRelation_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..e5a4d95eb356b4bf2900d50e7b7a62ed22355697 --- /dev/null +++ b/process/ObjectRelation_lib/ObjectRelation_lib.aod @@ -0,0 +1,9 @@ +<?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.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>ObjectRelation_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/ObjectRelation_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/ObjectRelation_lib/process.js b/process/ObjectRelation_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..1010f1a6586588e2fcff7907712724881a666d4b --- /dev/null +++ b/process/ObjectRelation_lib/process.js @@ -0,0 +1,104 @@ +import("system.logging"); +import("system.db"); + +/** + * Class containing utility functions for ObjectRelations + * do not create an instance of this + * + * @class + */ +function ObjectRelationUtils() {} + +/** + * Get all possible relationTypes by a objectType. + * Normally it only returns the id and title. If you set pFullInfo to true, you will get additional information, too. + * + * @param {String} pObjectType the object type to load the relation types for.] + * @param {Boolean} [pFullInfo=false] return also RELATION_TYPE, direction (normal, reverse, same), hierarchy, OBJECT_TYPE dest, OBJECT_TYPE source, objectrelationtypeId1, objectrelationtypeId2, side, otherSide-RELATION_TYPE + * + * @return {String[][]} + */ +ObjectRelationUtils.getPossibleRelationTypes = function(pObjectType, pFullInfo) +{ + var sql = " from AB_OBJECTRELATIONTYPE main \n\ + left join AB_OBJECTRELATIONTYPE type2 on (type2.AB_OBJECTRELATIONTYPEID <> main.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = main.RELATION_TYPE) \n\ + where case when type2.OBJECT_TYPE is null then main.OBJECT_TYPE else type2.OBJECT_TYPE end = ? " + + // only id and title: + if (pFullInfo == undefined || pFullInfo == false) + { + pFullInfo = []; + + return (db.table( + ["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE" + sql, + [ + [pObjectType, db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]] + ] + ])); + + } + + // full info: + var relationTypes = (db.table( + ["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE, main.RELATION_TYPE, \n\ + case when type2.AB_OBJECTRELATIONTYPEID is null then 'same' \n\ + when main.SIDE = 1 then 'normal'\n\ + else 'reverse'\n\ + end direction,\n\ + main.HIERARCHY, \n\ + type2.OBJECT_TYPE objectType, \n\ + main.OBJECT_TYPE objectType, \n\ + -- typeId of Object2\n\ + case when main.SIDE = 1 then main.AB_OBJECTRELATIONTYPEID\n\ + else type2.AB_OBJECTRELATIONTYPEID end objectrelationtypeId1,\n\ + -- typeId of Object1\n\ + case when type2.AB_OBJECTRELATIONTYPEID is null or main.SIDE = 2 then main.AB_OBJECTRELATIONTYPEID\n\ + else type2.AB_OBJECTRELATIONTYPEID end objectrelationtypeId2, \n\ + main.SIDE, type2.AB_OBJECTRELATIONTYPEID" + sql, + [ + [pObjectType, db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["OBJECT_TYPE"])[0]] + ] + ])); + + return relationTypes; +} + +/** + * Get all possible relationTypes by a objectType. + * returns the id, title, RELATION_TYPE, direction (normal, reverse, same), hierarchy, OBJECT_TYPE dest, OBJECT_TYPE source, objectrelationtypeId1, objectrelationtypeId2, side, otherSide-RELATION_TYPE + * + * @param {String} pObjectTypeId the object type to load the relation types for.] + * + * @return {String[][]} + */ +ObjectRelationUtils.getRelationType = function(pObjectTypeId) +{ + // TODO: funktionen evtl. zusammenfassen + var sql = " from AB_OBJECTRELATIONTYPE main \n\ + left join AB_OBJECTRELATIONTYPE type2 on (type2.AB_OBJECTRELATIONTYPEID <> main.AB_OBJECTRELATIONTYPEID and type2.RELATION_TYPE = main.RELATION_TYPE) \n\ + where main.AB_OBJECTRELATIONTYPEID = ?" + + // full info: + var relationType = (db.array(db.ROW, + ["select main.AB_OBJECTRELATIONTYPEID, main.RELATION_TITLE, main.RELATION_TYPE, \n\ + case when type2.AB_OBJECTRELATIONTYPEID is null then 'same' \n\ + when main.SIDE = 1 then 'normal'\n\ + else 'reverse'\n\ + end direction,\n\ + main.HIERARCHY, \n\ + type2.OBJECT_TYPE objectType, \n\ + main.OBJECT_TYPE objectType, \n\ + -- typeId of Object2\n\ + case when main.SIDE = 1 then main.AB_OBJECTRELATIONTYPEID\n\ + else type2.AB_OBJECTRELATIONTYPEID end objectrelationtypeId1,\n\ + -- typeId of Object1\n\ + case when type2.AB_OBJECTRELATIONTYPEID is null or main.SIDE = 2 then main.AB_OBJECTRELATIONTYPEID\n\ + else type2.AB_OBJECTRELATIONTYPEID end objectrelationtypeId2, \n\ + main.SIDE, type2.AB_OBJECTRELATIONTYPEID" + sql, + [ + [pObjectTypeId, db.getColumnTypes("AB_OBJECTRELATIONTYPE", ["AB_OBJECTRELATIONTYPEID"])[0]], + ] + ])); + + return relationType; +} \ No newline at end of file diff --git a/process/OfferOrder_lib/OfferOrder_lib.aod b/process/OfferOrder_lib/OfferOrder_lib.aod index dc358ccc3bfe40f08780eb51549282611e1eacdc..0df9d9a624d014c6b4583935732acbdea2b2b99e 100644 --- a/process/OfferOrder_lib/OfferOrder_lib.aod +++ b/process/OfferOrder_lib/OfferOrder_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>OfferOrder_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/OfferOrder_lib/process.js</process> diff --git a/process/Offer_lib/Offer_lib.aod b/process/Offer_lib/Offer_lib.aod index ab430b8f762a1e2d01245446b6485cc3a844e4f6..41247d62423c487255eb9fe234106031fd8a1b6f 100644 --- a/process/Offer_lib/Offer_lib.aod +++ b/process/Offer_lib/Offer_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Offer_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Offer_lib/process.js</process> diff --git a/process/Order_lib/Order_lib.aod b/process/Order_lib/Order_lib.aod index 9704443eca2342226d460cf7b8580483aa28e11e..3e225851b15f65e8d77e15182de060a04aee4878 100644 --- a/process/Order_lib/Order_lib.aod +++ b/process/Order_lib/Order_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Order_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Order_lib/process.js</process> diff --git a/process/Organisation_lib/Organisation_lib.aod b/process/Organisation_lib/Organisation_lib.aod index 258d3dcfe721d10a42c7ba666a0aa816ec0e9d47..47bca652458c91d875f43aa22721999afeb471e7 100644 --- a/process/Organisation_lib/Organisation_lib.aod +++ b/process/Organisation_lib/Organisation_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Organisation_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Organisation_lib/process.js</process> diff --git a/process/Person_lib/Person_lib.aod b/process/Person_lib/Person_lib.aod index 53a4220efa399d04c905f051c96d5cfbfc5c9d74..04c0795c9a2fcb6fcdd7f580da9ffe3a2be374e9 100644 --- a/process/Person_lib/Person_lib.aod +++ b/process/Person_lib/Person_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Person_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Person_lib/process.js</process> diff --git a/process/PostalAddress_lib/PostalAddress_lib.aod b/process/PostalAddress_lib/PostalAddress_lib.aod index 71e373b8f529e2373213688ee28cc7640d243329..f7af81f2c9b9cb3ab8b20c4faa523894b5df10f7 100644 --- a/process/PostalAddress_lib/PostalAddress_lib.aod +++ b/process/PostalAddress_lib/PostalAddress_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>PostalAddress_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/PostalAddress_lib/process.js</process> diff --git a/process/PostalAddress_lib/process.js b/process/PostalAddress_lib/process.js index f3f2b67f1bd8e6dd44e583a7c2a9052d2e6ee5d7..bee94a606c965fe9d760c7ada0475ece7858fd8a 100644 --- a/process/PostalAddress_lib/process.js +++ b/process/PostalAddress_lib/process.js @@ -22,14 +22,28 @@ function AddressUtils(){} * @param {String} pBuildingNo * @param {String} pZipCode * @param {String} pCity + * @param {String} pAddressIdentifier * * @return {String} */ -AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZipCode, pCity) +AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZipCode, pCity, pAddressIdentifier) { - return StringUtils.concat(", ", [pCountry, pAddressLine, pBuildingNo, pZipCode, pCity]); + return StringUtils.concat(", ", [pCountry, pAddressLine, pBuildingNo, pZipCode, pCity, pAddressIdentifier]); }; +/** + * format the Address in one line as a sql statement + * + * @return {String} sql expression that can be used within a select statement + */ +AddressUtils.formatOnelineSql = function () +{ + var maskingHelper = new SqlMaskingUtils(); + var sqlExpression = maskingHelper.concat(["ADDRESS.COUNTRY", "ADDRESS.ADDRESS", "ADDRESS.BUILDINGNO", "ADDRESS.ZIP", "ADDRESS.CITY", "ADDRESS.ADDRIDENTIFIER"], ", "); + return sqlExpression; +}; + + /** * returns the formatted address by the ADDRESSID as one line * @@ -45,7 +59,7 @@ AddressUtils.getFormattedOnlineAddressById = function(pAddressId) var addr = ""; if (addrId) { - var select = "select ADDRESS.COUNTRY, ADDRESS.ADDRESS, ADDRESS.BUILDINGNO, ADDRESS.ZIP, ADDRESS.CITY from ADDRESS "; + var select = "select ADDRESS.COUNTRY, ADDRESS.ADDRESS, ADDRESS.BUILDINGNO, ADDRESS.ZIP, ADDRESS.CITY, ADDRESS.ADDRIDENTIFIER from ADDRESS "; var addrData = db.array(db.ROW, SqlCondition.begin() .andPrepare("ADDRESS.ADDRESSID", addrId) diff --git a/process/Product_lib/Product_lib.aod b/process/Product_lib/Product_lib.aod index 3f15eda57c63b66e03045e6bf55e646355106f88..9c72fa0f0cdb72396fc83c73d54fadb87bcfd7ad 100644 --- a/process/Product_lib/Product_lib.aod +++ b/process/Product_lib/Product_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Product_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Product_lib/process.js</process> diff --git a/process/Proto_lib/Proto_lib.aod b/process/Proto_lib/Proto_lib.aod index 53b5288a5b9c43f8f99d547bf9bc00960f4d259c..dd8841dc7aba84fa95c02f339956908458bb7307 100644 --- a/process/Proto_lib/Proto_lib.aod +++ b/process/Proto_lib/Proto_lib.aod @@ -1,7 +1,9 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Proto_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Proto_lib/process.js</process> - <publishAsWebservice v="true" /> + <variants> + <element>LIBRARY</element> + </variants> </process> diff --git a/process/Report_lib/Report_lib.aod b/process/Report_lib/Report_lib.aod index b19c68dfbdd04bf79a54a83ea1fc0fc5db692b01..b847e04de6288a50fd822dffef554f45c285423f 100644 --- a/process/Report_lib/Report_lib.aod +++ b/process/Report_lib/Report_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Report_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Report_lib/process.js</process> diff --git a/process/Salesproject_lib/Salesproject_lib.aod b/process/Salesproject_lib/Salesproject_lib.aod index 13d8c745ea684e5a5bdcedf8dd60cc60c56f8f0f..06956e427082baea872c1f395aca9c5337032e42 100644 --- a/process/Salesproject_lib/Salesproject_lib.aod +++ b/process/Salesproject_lib/Salesproject_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Salesproject_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Salesproject_lib/process.js</process> diff --git a/process/Sql_lib/Sql_lib.aod b/process/Sql_lib/Sql_lib.aod index 87263713d4f8d649bdfb0f7ce55c0c9b57dfd413..be614f7e821c6a2eb65bd21911a0db57c6672077 100644 --- a/process/Sql_lib/Sql_lib.aod +++ b/process/Sql_lib/Sql_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Sql_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Sql_lib/process.js</process> diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 4a64fc6b3797fe984b3bc61c6d7bf638dc82ff0a..ffeaa776d32b61b284bf2447b4ded80a40b4c140 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -204,6 +204,46 @@ SqlCondition.prototype.orPrepare = function(field, value, cond, fieldType) { return this.or(cond); } +/** + * same as the "andPrepare"-function but only applied if the passed "value" is truely + * @param {String | String[]} field the database field as "tablename.columnname"; e.g. "ORGANISATION.NAME" or as array with column-alias: ["ORGANISATION", "NAME", "myorgAlias"] + * @param {String} value the value that shall be set into the prepared statement + * @param {String} [cond="# = ?"] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" + * @param {Numeric | Boolean} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; + * The loaded type is cached if no type is given. So it is also safe to use this in a loop. + * e.g. + * for (...) { + * cond.andPrepare("SALESPROJECT_CLASSIFICATION.TYPE", entry, "# <> ?") + * } + * @return {SqlCondition} current SqlCondition-object + */ +SqlCondition.prototype.andPrepareIfSet = function(field, value, cond, fieldType) { + if (value) + return this.andPrepare(field, value, cond, fieldType); + return this; +} + +/** + * same as the "orPrepare"-function but only applied if the passed "value" is truely + * @param {String | String[]} field the database field as "tablename.columnname"; e.g. "ORGANISATION.NAME" or as array with column-alias: ["ORGANISATION", "NAME", "myorgAlias"] + * @param {String} value the value that shall be set into the prepared statement + * @param {String} [cond="# = ?"] the strucutre of the SQL condition as preparedString, you can use a number sign "#" as placeholder for you fieldname; + * e.g. "# > ?"; escaping the number sign is possible with a backslash "\" + * @param {Numeric | Boolean} [fieldType] SQL-column-type; if the fieldType is not given it's loaded automatically; + * The loaded type is cached if no type is given. So it is also safe to use this in a loop. + * e.g. + * for (...) { + * cond.andPrepare("SALESPROJECT_CLASSIFICATION.TYPE", entry, "# <> ?") + * } + * @return {SqlCondition} current SqlCondition-object + */ +SqlCondition.prototype.orPrepareIfSet = function(field, value, cond, fieldType) { + if (value) + return this.orPrepare(field, value, cond, fieldType); + return this; +} + /** * same as the "andPrepare"-function but with validation of adito-variables functionality * @param {String | String[]} field the database field as "tablename.columnname"; e.g. "ORGANISATION.NAME" or as array with column-alias: ["ORGANISATION", "NAME", "myorgAlias"] @@ -716,7 +756,7 @@ SqlMaskingUtils.prototype.castLob = function(field, targetLength) { res = "DBMS_LOB.SUBSTR(" + field + ", " + targetLength + ", 1)"; break; default: - res = this.cast(field, "varchar", targetLength); + res = this.cast(field, SQLTYPES.VARCHAR, targetLength); break; } return res; diff --git a/process/StandardObject_lib/StandardObject_lib.aod b/process/StandardObject_lib/StandardObject_lib.aod index ae58a214e827cd23f98a3fd6bc43dfd6a230a3a6..94c1fcc045a7d0035211ebd8afb1d46832b39065 100644 --- a/process/StandardObject_lib/StandardObject_lib.aod +++ b/process/StandardObject_lib/StandardObject_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>StandardObject_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/process/StandardObject_lib/documentation.adoc</documentation> diff --git a/process/Timetracking_lib/Timetracking_lib.aod b/process/Timetracking_lib/Timetracking_lib.aod index f993357a8648d4a835f33fc6a82bc08c5a57412c..b514721991f2a2544cf57c10e3bc5d89c0571d7b 100644 --- a/process/Timetracking_lib/Timetracking_lib.aod +++ b/process/Timetracking_lib/Timetracking_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Timetracking_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Timetracking_lib/process.js</process> diff --git a/process/Util_lib/Util_lib.aod b/process/Util_lib/Util_lib.aod index c366112be941a016e291c1ce3312ca531b2cc95c..18ccba5128774c467915662c198183f2f6f93744 100644 --- a/process/Util_lib/Util_lib.aod +++ b/process/Util_lib/Util_lib.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>Util_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Util_lib/process.js</process> diff --git a/process/_test_clientProcess/_test_clientProcess.aod b/process/_test_clientProcess/_test_clientProcess.aod index 3156788d53a7c7c34059887fc15f82746556cedc..f5019c9b8cf2a4ef9af8a2011d967f9f8bf3e421 100644 --- a/process/_test_clientProcess/_test_clientProcess.aod +++ b/process/_test_clientProcess/_test_clientProcess.aod @@ -1,8 +1,11 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>_test_clientProcess</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/_test_clientProcess/process.js</process> <publishAsWebservice v="true" /> <alias>Data_alias</alias> + <variants> + <element>EXECUTABLE</element> + </variants> </process> diff --git a/process/autostartNeon/autostartNeon.aod b/process/autostartNeon/autostartNeon.aod index 6db0d823bdcfd3f4f2665450c8a52274d11cce85..348fc7c6ca8c2be930aa7723be1d1012d813380c 100644 --- a/process/autostartNeon/autostartNeon.aod +++ b/process/autostartNeon/autostartNeon.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>autostartNeon</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/autostartNeon/process.js</process> diff --git a/process/indexsearch_patternextension/indexsearch_patternextension.aod b/process/indexsearch_patternextension/indexsearch_patternextension.aod index 21e2ac8d88f8b88ffad4c83f07ffd79913e49839..44786e98684ee3028b4ef80a8809e874a45f7ba2 100644 --- a/process/indexsearch_patternextension/indexsearch_patternextension.aod +++ b/process/indexsearch_patternextension/indexsearch_patternextension.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>indexsearch_patternextension</name> <majorModelMode>DISTRIBUTED</majorModelMode> </process> diff --git a/process/runIndexer_ws/runIndexer_ws.aod b/process/runIndexer_ws/runIndexer_ws.aod index a3c2f51db788edbbc5345a26e746d15e5d589fc5..3264bb28ba9b6c1c59d25074ff1f807ca770cbe8 100644 --- a/process/runIndexer_ws/runIndexer_ws.aod +++ b/process/runIndexer_ws/runIndexer_ws.aod @@ -1,5 +1,5 @@ <?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.0"> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> <name>runIndexer_ws</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/runIndexer_ws/process.js</process> diff --git a/role/PROJECT_Administrator/PROJECT_Administrator.aod b/role/PROJECT_Administrator/PROJECT_Administrator.aod new file mode 100644 index 0000000000000000000000000000000000000000..49266936de0d7480ee3bcb1c58c4c1d84b0e9a05 --- /dev/null +++ b/role/PROJECT_Administrator/PROJECT_Administrator.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Administrator</name> + <title>Administrator</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Everyone/PROJECT_Everyone.aod b/role/PROJECT_Everyone/PROJECT_Everyone.aod new file mode 100644 index 0000000000000000000000000000000000000000..f14d5573e8636f6ba242e101e0debbafbd7e23ef --- /dev/null +++ b/role/PROJECT_Everyone/PROJECT_Everyone.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Everyone</name> + <title>Everyone</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_FieldStaff/PROJECT_FieldStaff.aod b/role/PROJECT_FieldStaff/PROJECT_FieldStaff.aod new file mode 100644 index 0000000000000000000000000000000000000000..5dafdb429b00e80d5240f8919a1c2807fffc6ad8 --- /dev/null +++ b/role/PROJECT_FieldStaff/PROJECT_FieldStaff.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_FieldStaff</name> + <title>Field staff</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_HumanResources/PROJECT_HumanResources.aod b/role/PROJECT_HumanResources/PROJECT_HumanResources.aod new file mode 100644 index 0000000000000000000000000000000000000000..3f8a7fd6594d4240ab99cefaf74299c5e7f04150 --- /dev/null +++ b/role/PROJECT_HumanResources/PROJECT_HumanResources.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_HumanResources</name> + <title>Human Resources</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Marketing/PROJECT_Marketing.aod b/role/PROJECT_Marketing/PROJECT_Marketing.aod new file mode 100644 index 0000000000000000000000000000000000000000..f28c9ae8f6709bd9259e4c27e44eff8960812378 --- /dev/null +++ b/role/PROJECT_Marketing/PROJECT_Marketing.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Marketing</name> + <title>Marketing</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_OfficeStaff/PROJECT_OfficeStaff.aod b/role/PROJECT_OfficeStaff/PROJECT_OfficeStaff.aod new file mode 100644 index 0000000000000000000000000000000000000000..9b70512446b0341a4d9faf6500f963b548f1c745 --- /dev/null +++ b/role/PROJECT_OfficeStaff/PROJECT_OfficeStaff.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_OfficeStaff</name> + <title>Office staff</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Project/PROJECT_Project.aod b/role/PROJECT_Project/PROJECT_Project.aod new file mode 100644 index 0000000000000000000000000000000000000000..ecc4f7aae414ccb4a5666e7e85517cbb967e2d8a --- /dev/null +++ b/role/PROJECT_Project/PROJECT_Project.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Project</name> + <title>Project</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_ProjectManagement/PROJECT_ProjectManagement.aod b/role/PROJECT_ProjectManagement/PROJECT_ProjectManagement.aod new file mode 100644 index 0000000000000000000000000000000000000000..8016375c8bea14a5dcbf700fef8d73a2594f49eb --- /dev/null +++ b/role/PROJECT_ProjectManagement/PROJECT_ProjectManagement.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_ProjectManagement</name> + <title>Project Management</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Resource/PROJECT_Resource.aod b/role/PROJECT_Resource/PROJECT_Resource.aod new file mode 100644 index 0000000000000000000000000000000000000000..e6904e26c263922ce1ebc0fd76ffb6fd708170fd --- /dev/null +++ b/role/PROJECT_Resource/PROJECT_Resource.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Resource</name> + <title>Resource</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Service/PROJECT_Service.aod b/role/PROJECT_Service/PROJECT_Service.aod new file mode 100644 index 0000000000000000000000000000000000000000..7d586ddd20ca149d4848ed62e3ef19a747831c53 --- /dev/null +++ b/role/PROJECT_Service/PROJECT_Service.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Service</name> + <title>Service</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role> diff --git a/role/PROJECT_Support/PROJECT_Support.aod b/role/PROJECT_Support/PROJECT_Support.aod new file mode 100644 index 0000000000000000000000000000000000000000..39c787876828fb6d9faeb1e18e1270c6a862fad1 --- /dev/null +++ b/role/PROJECT_Support/PROJECT_Support.aod @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<role xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/role/1.2.0"> + <name>PROJECT_Support</name> + <title>Support</title> + <majorModelMode>DISTRIBUTED</majorModelMode> +</role>