diff --git a/.liquibase/Data_alias/basic/2020.0.2/Memberroles/extend_keword_memberroles.xml b/.liquibase/Data_alias/basic/2020.0.2/Memberroles/extend_keword_memberroles.xml index 83e825733c4970c00e13f6f072a06b263a858869..05e3ec24cb9cdeac9f10dabc1fdd674b7650ef1f 100644 --- a/.liquibase/Data_alias/basic/2020.0.2/Memberroles/extend_keword_memberroles.xml +++ b/.liquibase/Data_alias/basic/2020.0.2/Memberroles/extend_keword_memberroles.xml @@ -1,6 +1,6 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <changeSet author="s.pongratz" id="28627941-6c9b-46e8-922a-b4660b33723c"> + <changeSet author="s.pongratz" id="c30bc71b-fcef-4ae6-9356-207adaca9dbd"> <!--Atribute--> <insert tableName="AB_KEYWORD_ATTRIBUTE"> <column name="AB_KEYWORD_ATTRIBUTEID" value="08fcb5db-531d-4a83-8c6e-b9c9c95dcb16"/> diff --git a/.liquibase/Data_alias/basic/2021.0.0/MissingIndizes/add_MissingIndizes.xml b/.liquibase/Data_alias/basic/2021.0.0/MissingIndizes/add_MissingIndizes.xml new file mode 100644 index 0000000000000000000000000000000000000000..b86da6372b514d898bc54f5883b43fc579d7a057 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.0.0/MissingIndizes/add_MissingIndizes.xml @@ -0,0 +1,37 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="b.ulrich" id="50062c3c-f2db-4be1-854f-fc44110fd160"> + <createIndex tableName="VISITRECOMMENDATION" indexName="IDX_VISITRECOMMEND_CONPERS_ID"> + <column name="CONTACT_PERSON_ID"/> + </createIndex> + <createIndex tableName="DISTRICTCONTACT" indexName="IDX_DISTRTCON_ADVCONTACTID_ID"> + <column name="ADVISER_CONTACT_ID"/> + </createIndex> + <createIndex tableName="DISTRICTCONTACT" indexName="IDX_DISTRTCON_DISTRICT_ID"> + <column name="DISTRICT_ID"/> + </createIndex> + <createIndex tableName="DISTRICTCONTACT" indexName="IDX_DISTRTCON_CONTACT_ID"> + <column name="CONTACT_ID"/> + </createIndex> + <createIndex tableName="KNOWLEDGELINK" indexName="IDX_KNOWLEDELINK_ROW_ID"> + <column name="ROW_ID"/> + </createIndex> + <createIndex tableName="KNOWLEDGEMANAGEMENT" indexName="IDX_KNOWLEDEMNGMT_AUTHCON_ID"> + <column name="AUTHOR_CONTACT_ID"/> + </createIndex> + <createIndex tableName="KNOWLEDGEMANAGEMENT" indexName="IDX_KNOWLEDEMNGMT_RESCON_ID"> + <column name="RESPONSIBLE_CONTACT_ID"/> + </createIndex> + <createIndex tableName="KNOWLEDGEMANAGEMENTTAGMODERATION" indexName="IDX_KNOWLEDEMNGMTMOD_ATTR_ID"> + <column name="AB_ATTRIBUTE_ID"/> + </createIndex> + <createIndex tableName="OBSERVATION" indexName="IDX_OBSERVATION_OBSERVATION_ID"> + <column name="OBSERVATION_ID"/> + </createIndex> + <createIndex tableName="OBSERVATION" indexName="IDX_OBSERVATION_OBJECT_ID"> + <column name="OBJECT_ID"/> + </createIndex> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.0/changelog.xml b/.liquibase/Data_alias/basic/2021.0.0/changelog.xml index 880c8dd5ca400d68c8a32b58afbea516abe7396c..1da82e64a25c0f231270dba3ef316a91bd4032d4 100644 --- a/.liquibase/Data_alias/basic/2021.0.0/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.0.0/changelog.xml @@ -8,4 +8,5 @@ <include relativeToChangelogFile="true" file="Address/addLatLonIndizes.xml"/> <include relativeToChangelogFile="true" file="District/changelog.xml"/> <include relativeToChangelogFile="true" file="alter_Order_info.xml"/> + <include relativeToChangelogFile="true" file="MissingIndizes/add_MissingIndizes.xml"/> </databaseChangeLog> \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 53752a827ac04089ca5a1e482f38dc329e8b10a1..128bba355293614b9fb7db5ce6b9a2cb91b16d5a 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -1285,7 +1285,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <title>${COMM_ADDRESS}</title> <description></description> <customProperties> @@ -7042,7 +7042,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title>{$OBJECTLINK_OBJECT}</title> <description></description> @@ -7077,7 +7077,7 @@ <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title>Appointment Id</title> <description></description> @@ -14281,7 +14281,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14322,7 +14322,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14607,7 +14607,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14662,7 +14662,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14801,7 +14801,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14815,7 +14815,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14919,7 +14919,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -14975,7 +14975,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15051,7 +15051,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15169,7 +15169,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15183,7 +15183,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15239,7 +15239,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15253,7 +15253,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15627,7 +15627,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -15887,8 +15887,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -15943,8 +15943,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16012,9 +16012,9 @@ <name>VALID_FROM</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> - <size v="36" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16026,9 +16026,9 @@ <name>VALID_UNTIL</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> - <size v="36" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16119,7 +16119,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -16147,7 +16147,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title>District</title> <description></description> @@ -16173,7 +16173,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -16195,8 +16195,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16209,8 +16209,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16223,8 +16223,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16251,8 +16251,8 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="93" /> - <size v="19" /> - <scale v="0" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -16561,7 +16561,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -16623,7 +16623,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -16756,7 +16756,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -17005,7 +17005,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -17507,7 +17507,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <description></description> </entityFieldDb> @@ -17546,7 +17546,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <description></description> </entityFieldDb> diff --git a/entity/Activity_entity/entityfields/openadminview/onActionProcess.js b/entity/Activity_entity/entityfields/openadminview/onActionProcess.js index 2421bcf840468a2ac89ea751cec95d99dea8c1a9..0723fb5772c2503dc64fbca951dc124fe6c0769a 100644 --- a/entity/Activity_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Activity_entity/entityfields/openadminview/onActionProcess.js @@ -4,8 +4,8 @@ import("Context_lib"); AdminViewUtils.open("ACTIVITYID", [ ["PARENT_ID", vars.get("$field.PARENT_ID")], ["PARENT_CONTEXT", vars.get("$field.PARENT_CONTEXT")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], ["USER_NEW", vars.get("$field.USER_NEW")], ["USER_EDIT", vars.get("$field.USER_EDIT")] ]); \ No newline at end of file diff --git a/entity/AdminViewRow_entity/AdminViewRow_entity.aod b/entity/AdminViewRow_entity/AdminViewRow_entity.aod index 943047aa8b6b32f47bf88d976d1b770d2c9d12df..3f9d543bd0a8d273b1bc7efcd7016912edea94d5 100644 --- a/entity/AdminViewRow_entity/AdminViewRow_entity.aod +++ b/entity/AdminViewRow_entity/AdminViewRow_entity.aod @@ -18,6 +18,7 @@ <entityField> <name>VALUE</name> <contentTypeProcess>%aditoprj%/entity/AdminViewRow_entity/entityfields/value/contentTypeProcess.js</contentTypeProcess> + <displayValueProcess>%aditoprj%/entity/AdminViewRow_entity/entityfields/value/displayValueProcess.js</displayValueProcess> </entityField> <entityParameter> <name>Rows_param</name> diff --git a/entity/AdminViewRow_entity/entityfields/value/displayValueProcess.js b/entity/AdminViewRow_entity/entityfields/value/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f0f30ab1f978226833d3f947417717bcaf3a8c8c --- /dev/null +++ b/entity/AdminViewRow_entity/entityfields/value/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("Attribute_lib"); +import("system.result"); + + +result.string(AttributeTypeUtil.getAttributeViewValue(vars.get("$field.CONTENTTYPE"), vars.get("$field.VALUE"), null)); \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod index 07fdff425ad86523870a472d32839725ed9bdeac..19a9716e888eb80a204d2bb2a3901750e4d244b7 100644 --- a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod +++ b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod @@ -28,6 +28,7 @@ <element>PROCESS_SETVALUE</element> <element>RECORD</element> </onValueChangeTypes> + <onValidation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js</onValidation> </entityField> <entityField> <name>CAMPAIGNSTEP_ID</name> @@ -60,11 +61,6 @@ </entityConsumer> <entityConsumer> <name>CampaignStepConsumer</name> - <dependency> - <name>dependency</name> - <entityName>CampaignStep_entity</entityName> - <fieldName>CampaignSteps</fieldName> - </dependency> <children> <entityParameter> <name>campaignId_param</name> @@ -72,6 +68,11 @@ <expose v="true" /> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>CampaignStep_entity</entityName> + <fieldName>CampaignSteps</fieldName> + </dependency> </entityConsumer> <entityField> <name>UID</name> diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..c84027b8fee4b1faaeaa73067205a136f7ce68ba --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js @@ -0,0 +1,19 @@ +import("system.vars"); +import("system.result"); +import("Sql_lib"); +import("system.translate"); + +let participants = JSON.parse(vars.get("$param.campaignParticipantsRowIds_param")); +if(participants.length > 0) +{ + let thisParticipantCount = newSelect("count('')").from("CAMPAIGNPARTICIPANT") + .where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", vars.get("$field.CAMPAIGN_ID")) + .and( + "CAMPAIGNPARTICIPANT.CONTACT_ID", + participants, + SqlBuilder.IN() + ).cell(); + + if(parseInt(thisParticipantCount) > 0) + result.string(translate.text("Participant is already participating")); +} diff --git a/entity/Campaign_entity/entityfields/openadminview/onActionProcess.js b/entity/Campaign_entity/entityfields/openadminview/onActionProcess.js index e499f2c9eb69997395c5227e2df347b3dc86441d..3c00c1e0ff2dc159fc564be0e981aa9e9194443d 100644 --- a/entity/Campaign_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Campaign_entity/entityfields/openadminview/onActionProcess.js @@ -3,8 +3,8 @@ import("Context_lib"); AdminViewUtils.open("CAMPAIGNID", [ ["EMPLOYEE_CONTACT_ID", vars.get("$field.EMPLOYEE_CONTACT_ID")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], ["USER_NEW", vars.get("$field.USER_NEW")], ["USER_EDIT", vars.get("$field.USER_EDIT")] ]); \ No newline at end of file diff --git a/entity/ClassificationGrading_entity/ClassificationGrading_entity.aod b/entity/ClassificationGrading_entity/ClassificationGrading_entity.aod index e241fcca9eb7eeeb5e1feb15dbdc0a07f56df8c0..81876c26e624810fd02f57d640df8fbc10bcc132 100644 --- a/entity/ClassificationGrading_entity/ClassificationGrading_entity.aod +++ b/entity/ClassificationGrading_entity/ClassificationGrading_entity.aod @@ -41,7 +41,6 @@ <children> <entityParameter> <name>ClassificationTypeId_param</name> - <valueProcess>%aditoprj%/entity/ClassificationGrading_entity/entityfields/classificationgradings/children/classificationtypeid_param/valueProcess.js</valueProcess> <expose v="true" /> </entityParameter> </children> diff --git a/entity/Classification_entity/Classification_entity.aod b/entity/Classification_entity/Classification_entity.aod index 7982c0fd617494431e6d766947deed920e121b6f..0934836f181842f38e69f2df623a6991680f64c1 100644 --- a/entity/Classification_entity/Classification_entity.aod +++ b/entity/Classification_entity/Classification_entity.aod @@ -41,6 +41,7 @@ </entityParameter> <entityProvider> <name>Classifications</name> + <documentation>%aditoprj%/entity/Classification_entity/entityfields/classifications/documentation.adoc</documentation> <dependencies> <entityDependency> <name>6274acfa-3dbf-4a9b-8926-2a2d1ff80d6d</name> diff --git a/entity/Classification_entity/entityfields/classifications/documentation.adoc b/entity/Classification_entity/entityfields/classifications/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..622e58880338d8c9605a79aadf41c95b02a9db9b --- /dev/null +++ b/entity/Classification_entity/entityfields/classifications/documentation.adoc @@ -0,0 +1,3 @@ +=Classifications provider +Provider for all the modules that you want to use the classification for. +The tree gets build using the ObjectRowId_param and ObjectType_param so you can see all the classifications for e.g organisation x or salesproject y. \ No newline at end of file diff --git a/entity/CommRestriction_Entity/CommRestriction_Entity.aod b/entity/CommRestriction_Entity/CommRestriction_Entity.aod index af5659bb88ee1ee264431feddb0a1ff3b529578a..b1604aa94b0cfb68fd202ff113e3586b76268cfa 100644 --- a/entity/CommRestriction_Entity/CommRestriction_Entity.aod +++ b/entity/CommRestriction_Entity/CommRestriction_Entity.aod @@ -5,6 +5,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/CommRestriction_Entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/CommRestriction_Entity/contentTitleProcess.js</contentTitleProcess> + <contentTitleProcess>%aditoprj%/entity/CommRestriction_Entity/contentTitleProcess.js</contentTitleProcess> <titlePlural>Advertising bans</titlePlural> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/ExportTemplate_entity/entityfields/openadminview/onActionProcess.js b/entity/ExportTemplate_entity/entityfields/openadminview/onActionProcess.js index 34ed41f947d2483b4ed77b2b949dcc8d435338be..a19f58f080757e5cb8ad9f147beee77a0edb6258 100644 --- a/entity/ExportTemplate_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/ExportTemplate_entity/entityfields/openadminview/onActionProcess.js @@ -1,4 +1,9 @@ import("system.vars"); import("Context_lib"); -AdminViewUtils.open("EXPORTTEMPLATEID", ["DATE_NEW", "DATE_EDIT", "USER_NEW", "USER_EDIT"]); \ No newline at end of file +AdminViewUtils.open("EXPORTTEMPLATEID", [ + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], + ["USER_NEW", vars.get("$field.USER_NEW"), "DATE"], + ["USER_EDIT", vars.get("$field.USER_EDIT"), "DATE"] +]); \ No newline at end of file diff --git a/entity/ImportField_Entity/ImportField_Entity.aod b/entity/ImportField_Entity/ImportField_Entity.aod index 98e67835fe5b72426e734a6ad809647ae9ff9948..fb47af9cfe9e5cc16060f6155577916e6a0fd57b 100644 --- a/entity/ImportField_Entity/ImportField_Entity.aod +++ b/entity/ImportField_Entity/ImportField_Entity.aod @@ -3,6 +3,9 @@ <name>ImportField_Entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/ImportField_Entity/documentation.adoc</documentation> + <siblings> + <element>Leadimport_entity</element> + </siblings> <grantCreate v="false" /> <grantDelete v="false" /> <contentTitleProcess>%aditoprj%/entity/ImportField_Entity/contentTitleProcess.js</contentTitleProcess> diff --git a/entity/Leadimport_entity/Leadimport_entity.aod b/entity/Leadimport_entity/Leadimport_entity.aod index 8c953c11449eb6ea743aacc9520ee0718ab26114..1036476970eb43d306f04b06c997b1c99d3afc60 100644 --- a/entity/Leadimport_entity/Leadimport_entity.aod +++ b/entity/Leadimport_entity/Leadimport_entity.aod @@ -5,6 +5,9 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Leadimport_entity/documentation.adoc</documentation> <icon>NEON:IMPORT</icon> + <siblings> + <element>ImportField_Entity</element> + </siblings> <grantUpdate v="true" /> <grantUpdateProcess>%aditoprj%/entity/Leadimport_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDelete v="true" /> @@ -65,6 +68,7 @@ <name>STATUS</name> <title>Status</title> <consumer>KeywordImportStatus</consumer> + <groupable v="true" /> <state>READONLY</state> <valueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/status/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/status/displayValueProcess.js</displayValueProcess> @@ -74,6 +78,7 @@ <title>Import date</title> <contentType>DATE</contentType> <resolution>DAY</resolution> + <groupable v="false" /> <valueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/leadimport_date/valueProcess.js</valueProcess> </entityField> <entityField> @@ -97,6 +102,7 @@ <isObjectAction v="false" /> <isSelectionAction v="false" /> <iconId>VAADIN:INBOX</iconId> + <stateProcess>%aditoprj%/entity/Leadimport_entity/entityfields/transferdata/stateProcess.js</stateProcess> </entityActionField> <entityField> <name>SENTENCESEPARATOR</name> @@ -104,6 +110,7 @@ <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/Leadimport_entity/entityfields/sentenceseparator/dropDownProcess.js</dropDownProcess> <textInputAllowed v="true" /> + <displayValueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/sentenceseparator/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>FIELDSEPARATOR</name> @@ -111,6 +118,7 @@ <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/Leadimport_entity/entityfields/fieldseparator/dropDownProcess.js</dropDownProcess> <textInputAllowed v="true" /> + <displayValueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/fieldseparator/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>FIELDDELIMITERS</name> @@ -118,10 +126,12 @@ <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/Leadimport_entity/entityfields/fielddelimiters/dropDownProcess.js</dropDownProcess> <textInputAllowed v="true" /> + <displayValueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/fielddelimiters/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>IMPORTSOURCE</name> <title>Import source</title> + <groupable v="true" /> <mandatory v="true" /> </entityField> <entityConsumer> @@ -176,11 +186,7 @@ </entityProvider> <entityConsumer> <name>ImportFieldID</name> - <dependency> - <name>dependency</name> - <entityName>ImportField_Entity</entityName> - <fieldName>LeadImportIds</fieldName> - </dependency> + <onValidation>%aditoprj%/entity/Leadimport_entity/entityfields/importfieldid/onValidation.js</onValidation> <children> <entityParameter> <name>LeadImportID</name> @@ -358,6 +364,13 @@ <name>#PROVIDER_AGGREGATES</name> <useAggregates v="true" /> </entityProvider> + <entityActionField> + <name>ReloadTransferdData</name> + <title>Search for new Entries</title> + <onActionProcess>%aditoprj%/entity/Leadimport_entity/entityfields/reloadtransferddata/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:REFRESH</iconId> + </entityActionField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Leadimport_entity/entityfields/fielddelimiters/displayValueProcess.js b/entity/Leadimport_entity/entityfields/fielddelimiters/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..60728b855572f3068a1d7296e2a9e23550eb97d5 --- /dev/null +++ b/entity/Leadimport_entity/entityfields/fielddelimiters/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.translate"); +import("system.vars"); +import("system.result"); + +result.string(translate.text(vars.get("$this.value"))); \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/fieldseparator/displayValueProcess.js b/entity/Leadimport_entity/entityfields/fieldseparator/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..60728b855572f3068a1d7296e2a9e23550eb97d5 --- /dev/null +++ b/entity/Leadimport_entity/entityfields/fieldseparator/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.translate"); +import("system.vars"); +import("system.result"); + +result.string(translate.text(vars.get("$this.value"))); \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/importfieldid/onValidation.js b/entity/Leadimport_entity/entityfields/importfieldid/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..a49ff8581aa41f29208cda5ef0f8bab7b990d3eb --- /dev/null +++ b/entity/Leadimport_entity/entityfields/importfieldid/onValidation.js @@ -0,0 +1,60 @@ +import("system.translate"); +import("system.result"); +import("Sql_lib"); +import("system.vars"); + +var attributeChanges = { + "LASTNAME" : [], + "NAME" : [] +}; + +var idMapping = {}; +var consumerField = "ImportFieldID"; +var changedRows = vars.get("$field." + consumerField + ".changedRows"); + +newSelect(["IMPORTFIELD.MAPPINGFIELD", "IMPORTFIELD.IMPORTFIELDID"]) + .from("IMPORTFIELD") + .where("IMPORTFIELD.LEADIMPORT_ID", "9f77f90f-cc49-456f-8d20-2fa86bf6fdf4") + .and( + newWhere("IMPORTFIELD.MAPPINGFIELD", "LASTNAME") + .or("IMPORTFIELD.MAPPINGFIELD", "NAME")) + .table() + .forEach(function (row) { + _addNewID(row[0], row[1]); + }); + +if (changedRows) +{ + changedRows.forEach(function (row) + { + if (!idMapping[row.IMPORTFIELDID]) + { + _addNewID(row.MAPPINGFIELD, row.IMPORTFIELDID); + } + else + { + var index = attributeChanges[idMapping[row.IMPORTFIELDID]].indexOf(row.IMPORTFIELDID); + if (index > -1) + { + attributeChanges[idMapping[row.IMPORTFIELDID]].splice(index, 1); + _addNewID(row.MAPPINGFIELD, row.IMPORTFIELDID); + } + } + + }); +} + +if (!attributeChanges.NAME.length && !attributeChanges.LASTNAME.length) +{ + result.string(translate.text("The Import Fields \"Lastname\" or \"Organisation\" have to be mapped!")); +} + +function _addNewID (pMappingField, pImportId) +{ + if (attributeChanges[pMappingField]) + { + attributeChanges[pMappingField].push(pImportId); + idMapping[pImportId] = pMappingField; + } +} + \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/reloadtransferddata/onActionProcess.js b/entity/Leadimport_entity/entityfields/reloadtransferddata/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..859ea6ca00cc4430746641e87e886e9c0bfa073c --- /dev/null +++ b/entity/Leadimport_entity/entityfields/reloadtransferddata/onActionProcess.js @@ -0,0 +1,2 @@ +import("system.neon"); +neon.refresh(); \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/sentenceseparator/displayValueProcess.js b/entity/Leadimport_entity/entityfields/sentenceseparator/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..60728b855572f3068a1d7296e2a9e23550eb97d5 --- /dev/null +++ b/entity/Leadimport_entity/entityfields/sentenceseparator/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.translate"); +import("system.vars"); +import("system.result"); + +result.string(translate.text(vars.get("$this.value"))); \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/sentenceseparator/dropDownProcess.js b/entity/Leadimport_entity/entityfields/sentenceseparator/dropDownProcess.js index b955dae75d3b2e600f98bdae783e378cff727af3..6ba802190fa0bc641f9a6c53aa6b8fdf9f1250c7 100644 --- a/entity/Leadimport_entity/entityfields/sentenceseparator/dropDownProcess.js +++ b/entity/Leadimport_entity/entityfields/sentenceseparator/dropDownProcess.js @@ -1,4 +1,6 @@ import("system.translate"); import("system.result"); -result.object([["carriage return and line feed", translate.text("carriage return and line feed")]]) \ No newline at end of file +result.object([ + ["carriage return and line feed", translate.text("carriage return and line feed")] +]); \ No newline at end of file diff --git a/entity/Leadimport_entity/entityfields/transferdata/stateProcess.js b/entity/Leadimport_entity/entityfields/transferdata/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ed97ad26cf42805e0645ab99f863379278539ea2 --- /dev/null +++ b/entity/Leadimport_entity/entityfields/transferdata/stateProcess.js @@ -0,0 +1,19 @@ +import("Sql_lib"); +import("system.result"); +import("system.vars"); +import("Leadimport_lib"); +import("system.neon"); + +let leadimportID = vars.get("$field.LEADIMPORTID"); +let count = newSelect(["count(*)"]) + .from("IMPORTFIELD") + .where("IMPORTFIELD.LEADIMPORT_ID", leadimportID) + .and( + newWhere("IMPORTFIELD.MAPPINGFIELD", "LASTNAME") + .or("IMPORTFIELD.MAPPINGFIELD", "NAME") + ).cell(); + +if (count > 0) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Leadimport_entity/recordcontainers/db/onDBUpdate.js b/entity/Leadimport_entity/recordcontainers/db/onDBUpdate.js index 276fa07844206e963e7c366faa238498602abebd..408e3da8f19a03687ee4d6292046c387cde1e56a 100644 --- a/entity/Leadimport_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Leadimport_entity/recordcontainers/db/onDBUpdate.js @@ -6,42 +6,53 @@ import("KeywordRegistry_basic"); import("Keyword_lib"); import("Binary_lib"); import("Leadimport_lib"); +import("ExportTemplate_lib"); +import("Binary_lib"); +import("Document_lib"); +import("Sql_lib"); import("system.db"); import("system.vars"); -import("system.util"); -import("Document_lib"); + + +var binId; +var assignmentRowId = vars.get("$field.LEADIMPORTID"); +var binMetadata = db.getBinaryMetadata("LEADIMPORT", "IMPORTFILE", assignmentRowId, false, SqlUtils.getBinariesAlias(), ""); // "FILE NOT CHANGED" is set in the value process of the field to indicate that the user didn't upload a new file if (vars.get("$field.bindata") != "FILE NOT CHANGED") { - var assignmentRowId = vars.get("$field.LEADIMPORTID"); - var bindata = DocumentUtil.getBindataFromUpload(vars.get("$field.bindata")); - var filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.bindata")); - - var fieldSep = ExportTemplateUtils.getFieldSeparator(vars.get("$field.FIELDSEPARATOR")); - var fieldLimit = ExportTemplateUtils.getFieldDeLimiter(vars.get("$field.FIELDDELIMITERS")); - var recordSep = ExportTemplateUtils.getSentenceSeparator(vars.get("$field.SENTENCESEPARATOR")); - + let bindata = DocumentUtil.getBindataFromUpload(vars.get("$field.bindata")); + let filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.bindata")); + if(bindata != '' && filename != '') { var mimeType = DocumentUtil.getMimeTypeFromUpload(vars.get("$field.bindata")); if (mimeType == "application/vnd.ms-excel" || mimeType == "text/csv") { - - var binMetadata = db.getBinaryMetadata("LEADIMPORT", "IMPORTFILE", assignmentRowId, false, SqlUtils.getBinariesAlias(), ""); - if (binMetadata.length > 0) { + if (binMetadata.length > 0) + { db.updateBinary(binMetadata[0].id, "", bindata, filename, "", "MAINDOCUMENT", SqlUtils.getBinariesAlias()); - LeadImportUtils.loadImportFile(binMetadata[0].id, fieldSep, fieldLimit, recordSep, assignmentRowId, true, true); + binId = binMetadata[0].id; } else { - var documentId = SingleBinaryUtils.insertMainDocument("LEADIMPORT", "IMPORTFILE", assignmentRowId, bindata, filename, "", SqlUtils.getBinariesAlias()); - LeadImportUtils.loadImportFile(documentId, fieldSep, fieldLimit, recordSep, assignmentRowId, false, true); + binId = SingleBinaryUtils.insertMainDocument("LEADIMPORT", "IMPORTFILE", assignmentRowId, bindata, filename, "", SqlUtils.getBinariesAlias()); } } } +} +else if (binMetadata.length > 0) +{ + binId = binMetadata[0].id; +} + +if (binId) +{ + var fieldSep = ExportTemplateUtils.getFieldSeparator(vars.get("$field.FIELDSEPARATOR")); + var fieldLimit = ExportTemplateUtils.getFieldDeLimiter(vars.get("$field.FIELDDELIMITERS")); + var recordSep = ExportTemplateUtils.getSentenceSeparator(vars.get("$field.SENTENCESEPARATOR")); - neon.refreshAll(); + LeadImportUtils.loadImportFile(binId, fieldSep, fieldLimit, recordSep, assignmentRowId, true, true); } WorkflowSignalSender.updated(); diff --git a/entity/Observation_entity/Observation_entity.aod b/entity/Observation_entity/Observation_entity.aod index abbabad7d380f1201e926ddceb58f84ef41e68a1..d1c037dc9b942c90284c4e50fc61c64ad13b1c51 100644 --- a/entity/Observation_entity/Observation_entity.aod +++ b/entity/Observation_entity/Observation_entity.aod @@ -4,6 +4,7 @@ <title>Observation</title> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Observation_entity/documentation.adoc</documentation> + <title>Observation</title> <titlePlural>Observations</titlePlural> <recordContainer>db</recordContainer> <entityFields> @@ -84,6 +85,11 @@ <valueProcess>%aditoprj%/entity/Observation_entity/entityfields/priokeywords/children/containername_param/valueProcess.js</valueProcess> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> </entityConsumer> <entityConsumer> <name>Ussers</name> @@ -106,6 +112,11 @@ <valueProcess>%aditoprj%/entity/Observation_entity/entityfields/objectproxyconsumer/children/entity_param/valueProcess.js</valueProcess> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>ObjectProxy_entity</entityName> + <fieldName>FilteredObjects</fieldName> + </dependency> </entityConsumer> <entityField> <name>TRIGGEREVENTUPDATE</name> @@ -195,6 +206,11 @@ <valueProcess>%aditoprj%/entity/Observation_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js</valueProcess> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>Context_entity</entityName> + <fieldName>Exclusive</fieldName> + </dependency> </entityConsumer> <entityField> <name>OBSERVATION_ID</name> @@ -228,6 +244,7 @@ <recordContainers> <dbRecordContainer> <name>db</name> + <alias>Data_alias</alias> <isPageable v="false" /> <hasDependentRecords v="true" /> <conditionProcess>%aditoprj%/entity/Observation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> diff --git a/entity/Offer_entity/entityfields/openadminview/onActionProcess.js b/entity/Offer_entity/entityfields/openadminview/onActionProcess.js index 9257ff40784f0d506f2b68484ae292b951c069bd..a6781db7db09cfa1e51de183d2f14ed06cba737e 100644 --- a/entity/Offer_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Offer_entity/entityfields/openadminview/onActionProcess.js @@ -6,8 +6,8 @@ result.string(AdminViewUtils.open("OFFERID", [ ["CONTACT_ID", vars.get("$field.CONTACT_ID")], ["CONTACT_ORG_ID", vars.get("$field.CONTACT_ORG_ID")], ["CONTACT_PERSON_ID", vars.get("$field.CONTACT_PERSON_ID")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], ["USER_NEW", vars.get("$field.USER_NEW")], ["USER_EDIT", vars.get("$field.USER_EDIT")] ])); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/openadminview/onActionProcess.js b/entity/Organisation_entity/entityfields/openadminview/onActionProcess.js index 8a1b220f1e40e5d36f51e6d5afec394b6d9f8b52..dead60a3cae8657e02ea12b39ca0226f6a427755 100644 --- a/entity/Organisation_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/openadminview/onActionProcess.js @@ -4,9 +4,9 @@ import("Context_lib"); AdminViewUtils.open("CONTACTID", [ ["ORGANISATION_ID", vars.get("$field.ORGANISATION_ID")], ["ADDRESS_ID", vars.get("$field.ADDRESS_ID")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], - ["DATE_NEW_CONTACT", vars.get("$field.DATE_NEW_CONTACT")], + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], + ["DATE_NEW_CONTACT", vars.get("$field.DATE_NEW_CONTACT"), "DATE"], ["USER_NEW", vars.get("$field.USER_NEW")], ["USER_EDIT", vars.get("$field.USER_EDIT")], ["USER_NEW_CONTACT", vars.get("$field.USER_NEW_CONTACT")], diff --git a/entity/Person_entity/entityfields/openadminview/onActionProcess.js b/entity/Person_entity/entityfields/openadminview/onActionProcess.js index b56b52a65ff35e86346bb7966b3cca71e3bed711..8d0d6178c38495c99041a7f7bbc5859000549aae 100644 --- a/entity/Person_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Person_entity/entityfields/openadminview/onActionProcess.js @@ -5,9 +5,9 @@ AdminViewUtils.open("CONTACTID", [ ["PERSON_ID", vars.get("$field.PERSON_ID")], ["ORGANISATION_ID", vars.get("$field.ORGANISATION_ID")], ["ADDRESS_ID", vars.get("$field.ADDRESS_ID")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], - ["DATE_NEW_CONTACT", vars.get("$field.DATE_NEW_CONTACT")], + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], + ["DATE_NEW_CONTACT", vars.get("$field.DATE_NEW_CONTACT"), "DATE"], ["USER_NEW", vars.get("$field.USER_NEW")], ["USER_EDIT", vars.get("$field.USER_EDIT")], ["USER_NEW_CONTACT", vars.get("$field.USER_NEW_CONTACT")], diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index aebfbe30a70972ae9be881e2674ed9f685d73419..efb013f5cdcba22abc918fdef8c12724361d9968 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -41,7 +41,7 @@ <entityField> <name>ADVERTISING</name> <title>Advertising material</title> - <contentType>BOOLEAN</contentType> + <contentType>TEXT</contentType> <dropDownProcess>%aditoprj%/entity/Product_entity/entityfields/advertising/dropDownProcess.js</dropDownProcess> <valueProcess>%aditoprj%/entity/Product_entity/entityfields/advertising/valueProcess.js</valueProcess> </entityField> diff --git a/entity/Product_entity/entityfields/openadminview/onActionProcess.js b/entity/Product_entity/entityfields/openadminview/onActionProcess.js index f3bc924625a437b26dbcb3a019d95a4535c99637..7506bf94163c4b2c8e915acc21932da4ee548889 100644 --- a/entity/Product_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Product_entity/entityfields/openadminview/onActionProcess.js @@ -3,8 +3,8 @@ import("Context_lib"); AdminViewUtils.open("PRODUCTID", [ ["CONTACT_ID", vars.get("$field.CONTACT_ID")], - ["DATE_NEW", vars.get("$field.DATE_NEW")], - ["DATE_EDIT", vars.get("$field.DATE_EDIT")], - ["USER_NEW", vars.get("$field.USER_NEW")], - ["USER_EDIT", vars.get("$field.USER_EDIT")] + ["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"], + ["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"], + ["USER_NEW", vars.get("$field.USER_NEW"), "DATE"], + ["USER_EDIT", vars.get("$field.USER_EDIT"), "DATE"] ]); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 7fa729d04454f39ba0ddc079d7f64358dbc6eaa4..299c0f1cfc39f23bb30ac19aa8a28e7376065546 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -7866,6 +7866,27 @@ <entry> <key>No file selected.</key> </entry> + <entry> + <key>auto</key> + </entry> + <entry> + <key>District assigned</key> + </entry> + <entry> + <key>District Responsibles</key> + </entry> + <entry> + <key>Show my district assignments with status review</key> + </entry> + <entry> + <key>Payment Address</key> + </entry> + <entry> + <key>manual</key> + </entry> + <entry> + <key>Adviser status</key> + </entry> <entry> <key>refresh classifications</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index eeb0d827e44eece5703b085d9e35b107bc4c16e8..73c6dc0746ed75bcd22e5b9c7056ecb8bae9bddc 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -10364,6 +10364,27 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Responsible Districts</key> </entry> + <entry> + <key>auto</key> + </entry> + <entry> + <key>District assigned</key> + </entry> + <entry> + <key>District Responsibles</key> + </entry> + <entry> + <key>Show my district assignments with status review</key> + </entry> + <entry> + <key>Payment Address</key> + </entry> + <entry> + <key>manual</key> + </entry> + <entry> + <key>Adviser status</key> + </entry> <entry> <key>refresh classifications</key> <value>Klassifizierungen neuberechnen</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index d98310a5d1c81b881eef33fc0dbdc4070657c6be..7abfa3ff7e1e50d9effdbadb2acdab65b57de905 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -7947,6 +7947,27 @@ <entry> <key>No file selected.</key> </entry> + <entry> + <key>auto</key> + </entry> + <entry> + <key>District assigned</key> + </entry> + <entry> + <key>District Responsibles</key> + </entry> + <entry> + <key>Show my district assignments with status review</key> + </entry> + <entry> + <key>Payment Address</key> + </entry> + <entry> + <key>manual</key> + </entry> + <entry> + <key>Adviser status</key> + </entry> <entry> <key>refresh classifications</key> </entry> diff --git a/neonView/KeywordEntryFilter_view/KeywordEntryFilter_view.aod b/neonView/KeywordEntryFilter_view/KeywordEntryFilter_view.aod index 091a43796153c65012b497455bb993be85873a3f..f8742663636cd3fa2aef8b5aa0037649574fff70 100644 --- a/neonView/KeywordEntryFilter_view/KeywordEntryFilter_view.aod +++ b/neonView/KeywordEntryFilter_view/KeywordEntryFilter_view.aod @@ -12,7 +12,7 @@ <treeTableViewTemplate> <name>EntriesTreeTable</name> <nodeExpandedField></nodeExpandedField> - <hideActions v="true" /> + <hideActions v="false" /> <hideContentSearch v="false" /> <entityField>#ENTITY</entityField> <defaultGroupFields> diff --git a/neonView/LeadimportLeadFilter_view/LeadimportLeadFilter_view.aod b/neonView/LeadimportLeadFilter_view/LeadimportLeadFilter_view.aod index 12e2ebd9e98a6a97a17ce7fc6fa70d3d7e417037..619914749e604c8777dead8285f7107834d55d75 100644 --- a/neonView/LeadimportLeadFilter_view/LeadimportLeadFilter_view.aod +++ b/neonView/LeadimportLeadFilter_view/LeadimportLeadFilter_view.aod @@ -17,6 +17,7 @@ <actions> <element>LeadimportReset</element> <element>TransferData</element> + <element>ReloadTransferdData</element> </actions> <entityField>#ENTITY</entityField> <devices> diff --git a/process/Dependency_lib/process.js b/process/Dependency_lib/process.js index cd11ecdecab1d9f9b2163a0349810d27188a8e21..e8967c862a7420d9c411fe3067ac16899dce9451 100644 --- a/process/Dependency_lib/process.js +++ b/process/Dependency_lib/process.js @@ -1,4 +1,5 @@ import("Sql_lib"); +import("system.favorite"); function Dependency(){} @@ -228,6 +229,20 @@ Dependency.mapping = function () }, "getUIDsfn" : Dependency.defaultFunctionForRelation("ACTIVITYLINK", "OBJECT_ROWID", "SALESORDERID", "Order", "SALESORDER", "ACTIVITY_ID") }, + "Organisation_entity" : { + "options" : { + "isObservable" : true + }, + "getUIDsfn" : function (pRowData, pChangedData) { + var tableField = "SALESORDER.CONTACT_ID"; + var res = []; + if (pRowData[tableField]) + res.push(pRowData[tableField]) + if (pChangedData[tableField] && pChangedData[tableField] != pRowData[tableField]) + res.push(pChangedData[tableField]) + return res; + } + }, "Task_entity" : { "options" : { "isObservable" : true @@ -707,42 +722,6 @@ Dependency.mapping = function () "getUIDsfn" : Dependency.defaultFunctionForField("LEAD.LEADIMPORT_ID") } } - ,"Order_entity": { - "Organisation_entity" : { - "options" : { - "isObservable" : true - }, - "getUIDsfn" : function (pRowData, pChangedData) { - var tableField = "SALESORDER.CONTACT_ID"; - var res = []; - if (pRowData[tableField]) - res.push(pRowData[tableField]) - if (pChangedData[tableField] && pChangedData[tableField] != pRowData[tableField]) - res.push(pChangedData[tableField]) - return res; - } - } - } - ,"AttributeRelation_entity": { - "Organisation_entity" : { - "options" : { - "isObservable" : true - }, - "getUIDsfn" : Dependency.defaultFunctionForRelation("AB_ATTRIBUTERELATION", "AB_ATTRIBUTERELATIONID", "AB_ATTRIBUTERELATIONID", "Organisation") - }, - "Activity_entity" : { - "options" : { - "isObservable" : true - }, - "getUIDsfn" : Dependency.defaultFunctionForRelation("AB_ATTRIBUTERELATION", "AB_ATTRIBUTERELATIONID", "AB_ATTRIBUTERELATIONID", "Activity") - }, - "Salesproject_entity" : { - "options" : { - "isObservable" : true - }, - "getUIDsfn" : Dependency.defaultFunctionForRelation("AB_ATTRIBUTERELATION", "AB_ATTRIBUTERELATIONID", "AB_ATTRIBUTERELATIONID", "Salesproject") - } - } }; }; /** diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index de9d13b2c7bb525960c5503b3e20eb28d9f2190d..422506bef5bea01bb6500bd075ec70a66f6b172a 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -154,7 +154,7 @@ LeadImportUtils.loadImportFile = function(pBinId, pFieldSep, pFieldLimit, pRecor LeadImportUtils.importData = function(pDataFields, pDataTypes, pFieldDef, pFieldValues, pImportDefID, pAttrObject, pSource, pUser, pDate) { var LeadValues = LeadImportUtils.setValues(pDataFields["LEAD"], pFieldDef, pFieldValues); // set the Lead values - + var orgid = ""; var persid = ""; var persContactId = ""; diff --git a/process/importLead_serverProcess/process.js b/process/importLead_serverProcess/process.js index 35ac42b2b31f5cd4b801573bd295413747352f42..96f94dc8f09a1f7b2b868f99015e839e65025b46 100644 --- a/process/importLead_serverProcess/process.js +++ b/process/importLead_serverProcess/process.js @@ -1,3 +1,4 @@ +import("system.question"); import("system.logging"); import("system.notification"); import("system.translate"); @@ -66,133 +67,136 @@ var posOrgName = getFieldPos(ImportFieldDef, "NAME"); var posOrginfo = getFieldPos(ImportFieldDef, "INFO"); // Data without headline -var dsanz = 1; +var dataRowIndex = 1; // set the mappings LeadImportUtils.mapping = LeadImportUtils.getMapping(importdefid); - -try +if (FieldDef.filter(function (fieldDef) { return (fieldDef[1] == "LASTNAME" || fieldDef[1] == "NAME"); }).length > 0) { - for (; dsanz < data.length; dsanz++) + try { - //iterate over the fielddefinitions and set the values - var impvalues = LeadImportUtils.addArray(data[dsanz], source); - impvalues.push(ImportDate); - - // if there is no BUILDINGNO the select it from the ADDRESS - if (noBuildingNr) + for (; dataRowIndex < data.length; dataRowIndex++) { - var pos = addressPos[0]; - var buildingNr = ""; - var address = impvalues[pos]; - - if (address != "") + //iterate over the fielddefinitions and set the values + var impvalues = LeadImportUtils.addArray(data[dataRowIndex], source); + impvalues.push(ImportDate); + + // if there is no BUILDINGNO the select it from the ADDRESS + if (noBuildingNr) { - // split ADDRESS and BUILDINGNO - var arr = address.match(/^[^0-9]+|[0-9]+.*$/g); - - //Regexp can throw an error - then the array is empty - if (arr && arr[0]) + var pos = addressPos[0]; + var buildingNr = ""; + var address = impvalues[pos]; + + if (address != "") { - impvalues[pos] = arr[0].replace(/(^\s+)|(\s+$)/g,""); - if (arr[1]) buildingNr = arr[1]; + // split ADDRESS and BUILDINGNO + var arr = address.match(/^[^0-9]+|[0-9]+.*$/g); + + //Regexp can throw an error - then the array is empty + if (arr && arr[0]) + { + impvalues[pos] = arr[0].replace(/(^\s+)|(\s+$)/g,""); + if (arr[1]) buildingNr = arr[1]; + } } + impvalues.push(buildingNr); } - impvalues.push(buildingNr); - } - // if there is no COUNTRY then COUNTRY = DE - if (noCountry) impvalues.push("DE"); + // if there is no COUNTRY then COUNTRY = DE + if (noCountry) impvalues.push("DE"); - // if a ORGNAME is declared frequently - if (posOrgName.length > 1) - { - for (posanz = 1; posanz < posOrgName.length; posanz++) - { - if (impvalues[posOrgName[posanz]] != "") - impvalues[posOrgName[0]] += "\n" + impvalues[posOrgName[posanz]]; //impvalues[ posOrgName[ posanz ]] ist das Import-Datum + // if a ORGNAME is declared frequently + if (posOrgName.length > 1) + { + for (posanz = 1; posanz < posOrgName.length; posanz++) + { + if (impvalues[posOrgName[posanz]] != "") + impvalues[posOrgName[0]] += "\n" + impvalues[posOrgName[posanz]]; //impvalues[ posOrgName[ posanz ]] ist das Import-Datum + } } - } - // if a ORGINFO is declared frequently - if (posOrginfo.length > 1) - { - for (posanz = 1; posanz < posOrginfo.length; posanz++) + // if a ORGINFO is declared frequently + if (posOrginfo.length > 1) { - if (impvalues[posOrginfo[posanz]] != "" ) - impvalues[posOrginfo[0]] += "\n" + impvalues[posOrginfo[posanz]]; + for (posanz = 1; posanz < posOrginfo.length; posanz++) + { + if (impvalues[posOrginfo[posanz]] != "" ) + impvalues[posOrginfo[0]] += "\n" + impvalues[posOrginfo[posanz]]; + } } - } - //get the position of the COUNTRY - var countrypos = getFieldPos (FieldDef, "COUNTRY")[0]; + //get the position of the COUNTRY + var countrypos = getFieldPos (FieldDef, "COUNTRY")[0]; - //check the COUNTRY - impvalues[countrypos] = LeadImportUtils.checkCountry(impvalues[countrypos]); + //check the COUNTRY + impvalues[countrypos] = LeadImportUtils.checkCountry(LeadImportUtils.getMappedOutputvalue("COUNTRY", impvalues[countrypos])); - if (!(getFieldPos(ImportFieldDef, "ISOLANGUAGE").length == 0)){ - //get the position of the ISOLANGUAGE - var isolanguepos = getFieldPos (FieldDef, "ISOLANGUAGE")[0]; + if (!(getFieldPos(ImportFieldDef, "ISOLANGUAGE").length == 0)){ + //get the position of the ISOLANGUAGE + var isolanguepos = getFieldPos (FieldDef, "ISOLANGUAGE")[0]; - //mapp and check the ISOLANGUAGE - impvalues[isolanguepos] = LeadImportUtils.getMappedOutputvalue("ISOLANGUAGE", impvalues[isolanguepos]); - impvalues[isolanguepos] = LeadImportUtils.checkISOLanguage(impvalues[isolanguepos]); - } + //mapp and check the ISOLANGUAGE + impvalues[isolanguepos] = LeadImportUtils.getMappedOutputvalue("ISOLANGUAGE", impvalues[isolanguepos]); + impvalues[isolanguepos] = LeadImportUtils.checkISOLanguage(impvalues[isolanguepos]); + } - try//import data - { - var dupCheck = LeadImportUtils.importData(DataFields, DataTypes, FieldDef, impvalues, importdefid, AttrObject, source, user, currDate); + try//import data + { + var dupCheck = LeadImportUtils.importData(DataFields, DataTypes, FieldDef, impvalues, importdefid, AttrObject, source, user, currDate); - allContactData[dupCheck[0]] = [dupCheck[1], dupCheck[2]]; //persObj, orgObj - } - catch(ex)//if error increase the errorCount and write a rhinoException into the string for the error file - { - var exeption = "Zeile " + dsanz + ": " + logging.toLogString(ex.rhinoException != undefined ? ex.rhinoException : ex, true) + "\r\n"; - exeptions = exeptions + exeption; - errorCount++; - logging.log(exeption); + allContactData[dupCheck[0]] = [dupCheck[1], dupCheck[2]]; //persObj, orgObj + } + catch(ex)//if error increase the errorCount and write a rhinoException into the string for the error file + { + var exeption = "Zeile " + dataRowIndex + ": " + logging.toLogString(ex.rhinoException != undefined ? ex.rhinoException : ex, true) + "\r\n"; + exeptions = exeptions + exeption; + errorCount++; + logging.log(exeption); + } } } -} -catch(err) -{ - errorCount++; - logging.log(err); -} + catch(err) + { + errorCount++; + logging.log(err); + } -try -{ - LeadImportUtils.scanLeadDups(allContactData);//search for duplicates -} -catch (err) -{ - logging.log(err); -} + try + { + LeadImportUtils.scanLeadDups(allContactData);//search for duplicates + } + catch (err) + { + logging.log(err); + } -var rows = eMath.subInt(dsanz, 1); -rows = eMath.subInt(rows, errorCount);//datasetcount - errors = inserts + var rows = eMath.subInt(dataRowIndex, 1); + rows = eMath.subInt(rows, errorCount);//datasetcount - errors = inserts -var updTable = "LEADIMPORT"; -var updFields =["IMPORT_DATE", "DATE_EDIT", "USER_EDIT", "STATUS"]; -var updVals = [ImportDate, currDate, user, $KeywordRegistry.importStatus$transfered()]; + var updTable = "LEADIMPORT"; + var updFields =["IMPORT_DATE", "DATE_EDIT", "USER_EDIT", "STATUS"]; + var updVals = [ImportDate, currDate, user, $KeywordRegistry.importStatus$transfered()]; -var logTable = "LEADLOG"; -var logFields =["LEADLOGID", "ROWSINSERTED", "IMPORTERRORS", "LEADIMPORT_ID", "IMPORTSOURCE", "USER_NEW", "DATE_NEW"]; -var logVals = [util.getNewUUID(), rows, errorCount, importdefid, source, user, currDate]; + var logTable = "LEADLOG"; + var logFields =["LEADLOGID", "ROWSINSERTED", "IMPORTERRORS", "LEADIMPORT_ID", "IMPORTSOURCE", "USER_NEW", "DATE_NEW"]; + var logVals = [util.getNewUUID(), rows, errorCount, importdefid, source, user, currDate]; -db.insertData(logTable, logFields, null, logVals); -newWhere("LEADIMPORT.LEADIMPORTID", importdefid) + db.insertData(logTable, logFields, null, logVals); + newWhere("LEADIMPORT.LEADIMPORTID", importdefid) .updateData(true, updTable, updFields, null, updVals); -newWhere("LEADTEMP.ROW_ID", importdefid) + newWhere("LEADTEMP.ROW_ID", importdefid) .deleteData(true, "LEADTEMP");//delete existing temp data -if(exeptions != "")//insert error document - db.insertBinary("LEADLOG", "ERRORLOG", logVals[0], - "", util.encodeBase64String(exeptions, "UTF-8"), "Error-Log " + source + " " + datetime.toDate(currDate, "dd.MM.yyyy HH:mm") , "", "", SqlUtils.getBinariesAlias()); + if(exeptions != "")//insert error document + db.insertBinary("LEADLOG", "ERRORLOG", logVals[0], + "", util.encodeBase64String(exeptions, "UTF-8"), "Error-Log " + source + " " + datetime.toDate(currDate, "dd.MM.yyyy HH:mm") , "", "", SqlUtils.getBinariesAlias()); -if (userId)// if there is an user - show a notification to this user when the import is complete -{ - var description = translate.withArguments("%0 leads imported, %1 errors", [rows, errorCount]); - notification.addNotification(util.getNewUUID(), null, null, null, "LeadImport_Notification", null, notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [userId], importName, description); + if (userId)// if there is an user - show a notification to this user when the import is complete + { + var description = translate.withArguments("%0 leads imported, %1 errors", [rows, errorCount]); + var linkInfo = text.encodeMS(["Leadimport",importdefid ]) + notification.addNotification(util.getNewUUID(), linkInfo, null, null, "LeadImport_Notification", notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [userId], importName, description, null ); + } }