diff --git a/.liquibase/Data_alias/basic/2020.1.1/Notification/changelog.xml b/.liquibase/Data_alias/basic/2020.1.1/Notification/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..1c9de620455f1a0e782540d3ca7e86c1181d8dbb --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.1/Notification/changelog.xml @@ -0,0 +1,6 @@ +<?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"> + <include relativeToChangelogFile="true" file="init_NotificationType.xml"/> + <include relativeToChangelogFile="true" file="insert_NotificationState.xml"/> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.1/Notification/init_NotificationType.xml b/.liquibase/Data_alias/basic/2020.1.1/Notification/init_NotificationType.xml new file mode 100644 index 0000000000000000000000000000000000000000..3d8f901c79b2216826873ea4664e1f1a401652fc --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.1/Notification/init_NotificationType.xml @@ -0,0 +1,85 @@ +<?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="s.pongratz" id="b2894de0-4a19-4fcb-9412-0a5e91bfec80"> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="f862f71e-9155-4e88-8158-170ddfa4dbf3"/> + <column name="KEYID" value="_____SYSTEM_NOTIFICATION_PHONECALL"/> + <column name="TITLE" value="Phonecall"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="0"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="19876b72-cd7d-4916-b853-22c4d9fe49c2"/> + <column name="KEYID" value="_____SYSTEM_NOTIFICATION_EMAIL"/> + <column name="TITLE" value="Email"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="1"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="16f9fbb5-9b8a-4908-babd-06c86032a22b"/> + <column name="KEYID" value="_____SYSTEM_NOTIFICATION_APPOINTMENT"/> + <column name="TITLE" value="Appointment"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="2"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="53458dba-80f5-427c-a44c-3fc8e74f3380"/> + <column name="KEYID" value="_____SYSTEM_NOTIFICATION_TODO"/> + <column name="TITLE" value="ToDo"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="3"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="3d2393b3-ed13-44d6-9a6f-9280d84252cb"/> + <column name="KEYID" value="DownloadReady"/> + <column name="TITLE" value="download ready"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="09ce4611-3254-4590-958a-79178924188b"/> + <column name="KEYID" value="BulkMailSent"/> + <column name="TITLE" value="bulk mail sent"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="5"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="df47c6db-2a72-464a-b155-c4e33a4294ba"/> + <column name="KEYID" value="Leadimport_Notification"/> + <column name="TITLE" value="leadimport notification"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="6"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="58281d88-71a7-4fa7-8ef8-9289fc904697"/> + <column name="KEYID" value="WorkflowNotification"/> + <column name="TITLE" value="workflow notification"/> + <column name="CONTAINER" value="NotificationType"/> + <column name="SORTING" valueNumeric="7"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.1/Notification/insert_NotificationState.xml b/.liquibase/Data_alias/basic/2020.1.1/Notification/insert_NotificationState.xml new file mode 100644 index 0000000000000000000000000000000000000000..35501bf1692b76aa533e32e47930c612f0d97ef2 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.1/Notification/insert_NotificationState.xml @@ -0,0 +1,15 @@ +<?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="s.pongratz" id="b2894de0-4a19-4fcb-9412-0a5e91bfec80"> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="daa6d8d8-fdc6-4fb2-9677-9ccc1f8a9b81"/> + <column name="KEYID" value="TODELETE"/> + <column name="TITLE" value="TODELETE"/> + <column name="CONTAINER" value="NotificationState"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.1/changelog.xml b/.liquibase/Data_alias/basic/2020.1.1/changelog.xml index f5686ce22ccea6e17c577957774efd2009a0dd7f..7070cb88cfdc67dbb126680500fad85499f40887 100644 --- a/.liquibase/Data_alias/basic/2020.1.1/changelog.xml +++ b/.liquibase/Data_alias/basic/2020.1.1/changelog.xml @@ -2,4 +2,5 @@ <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"> <include relativeToChangelogFile="true" file="AlterTablesToDatetime.xml"/> + <include relativeToChangelogFile="true" file="Notification/changelog.xml"/> </databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AddNullableToDateNew.xml b/.liquibase/Data_alias/basic/2020.1.2/AddNullableToDateNew.xml new file mode 100644 index 0000000000000000000000000000000000000000..86989600807b32fba76fc6b052f08f007cb4f390 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AddNullableToDateNew.xml @@ -0,0 +1,13 @@ +<?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 id="0aa81d84-7456-4240-91e0-a915f38abbd7" author="s.pongratz" > + <addNotNullConstraint columnName="DATE_NEW" tableName="CAMPAIGNCOST" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="CAMPAIGNPARTICIPANT" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="CAMPAIGNSTEP" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="DOCUMENTTEMPLATELINK" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="DUPLICATESCANNER" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="DUPLICATESCANNERRESULTFIELDCONFIG" columnDataType="DATETIME" validate="true"/> + <addNotNullConstraint columnName="DATE_NEW" tableName="CAMPAIGN" columnDataType="DATETIME" validate="true"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AlterButtonlabelTitles/AlterButtonLabelTitles.xml b/.liquibase/Data_alias/basic/2020.1.2/AlterButtonlabelTitles/AlterButtonLabelTitles.xml new file mode 100644 index 0000000000000000000000000000000000000000..5bc4d387a4d7bc4cdcc662a0fa1a30bce6ed7580 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AlterButtonlabelTitles/AlterButtonLabelTitles.xml @@ -0,0 +1,18 @@ +<?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="853aca63-8234-4dfd-9fc6-2e8b71af82aa"> + <update tableName="AB_KEYWORD_ENTRY"> + <column name="TITLE" value="Read"/> + <where>AB_KEYWORD_ENTRYID='b5f402a0-29a0-43e9-8db3-454fdbcfc9d1'</where> + </update> + <update tableName="AB_KEYWORD_ENTRY"> + <column name="TITLE" value="New"/> + <where>AB_KEYWORD_ENTRYID='678f61e5-ef27-4e1c-b52b-0e19188b038d'</where> + </update> + <update tableName="AB_KEYWORD_ENTRY"> + <column name="TITLE" value="Archived"/> + <where>AB_KEYWORD_ENTRYID='1c40a2de-e6c1-469b-b324-d7089893ca5c'</where> + </update> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ComunicationMedium_IdDatatype.xml b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ComunicationMedium_IdDatatype.xml new file mode 100644 index 0000000000000000000000000000000000000000..7153295dc12d1b84566a0af057f0f65bf706f3e9 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ComunicationMedium_IdDatatype.xml @@ -0,0 +1,17 @@ +<?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 dbms="derby" author="b.ulrich" id="bd334096-a6ce-4739-b272-753a85ff103e"> + <sql> + ALTER TABLE COMMUNICATION ADD COLUMN MEDIUM_ID_NEW CHAR(36); + UPDATE COMMUNICATION SET MEDIUM_ID_NEW=MEDIUM_ID; + ALTER TABLE COMMUNICATION DROP COLUMN MEDIUM_ID; + RENAME COLUMN COMMUNICATION.MEDIUM_ID_NEW TO MEDIUM_ID; + </sql> + </changeSet> + + <changeSet dbms="!derby" author="b.ulrich" id="17c1eb73-3131-4a2b-bf9a-913590767c79"> + <modifyDataType tableName="COMMUNICATION" columnName="MEDIUM_ID" newDataType="CHAR(36)"/> + </changeSet> + +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_DocumentTemplatePlaceOfUseDatatype.xml b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_DocumentTemplatePlaceOfUseDatatype.xml new file mode 100644 index 0000000000000000000000000000000000000000..2cfda5e78c75dc24d61318c4867d381d01e4105d --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_DocumentTemplatePlaceOfUseDatatype.xml @@ -0,0 +1,19 @@ +<?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 dbms="derby" author="b.ulrich" id="83c25119-cf41-42ab-b42f-370195f9de87"> + <!--not null must be set in derby before adding a primary key constraint--> + <sql> + ALTER TABLE DOCUMENTTEMPLATE ADD COLUMN DOCUMENTTEMPLATEID_NEW CHAR(36); + UPDATE DOCUMENTTEMPLATE SET DOCUMENTTEMPLATEID_NEW=DOCUMENTTEMPLATEID; + ALTER TABLE DOCUMENTTEMPLATE DROP COLUMN DOCUMENTTEMPLATEID; + RENAME COLUMN DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID_NEW TO DOCUMENTTEMPLATEID; + ALTER TABLE DOCUMENTTEMPLATE ALTER COLUMN DOCUMENTTEMPLATEID NOT NULL; + ALTER TABLE DOCUMENTTEMPLATE ADD CONSTRAINT PK_DOCUMENTTEMPLATE_DOCUMENTTEMPLATEID PRIMARY KEY (DOCUMENTTEMPLATEID); + </sql> + </changeSet> + + <changeSet dbms="!derby" author="b.ulrich" id="85ba6a61-9318-4118-ac4c-e33730f6581d"> + <modifyDataType tableName="DOCUMENTTEMPLATE" columnName="DOCUMENTTEMPLATEID" newDataType="CHAR(36)"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ExportTemplateDatatype.xml b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ExportTemplateDatatype.xml new file mode 100644 index 0000000000000000000000000000000000000000..237c9fd9e447f01353d895dba2a7c1123e684471 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/alter_ExportTemplateDatatype.xml @@ -0,0 +1,26 @@ +<?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 dbms="derby" author="b.ulrich" id="9c551ee3-f4f0-46e4-a671-943b58c74432"> + <sql> + ALTER TABLE EXPORTTEMPLATEPLACEOFUSE ADD COLUMN EXPORTTEMPLATE_ID_NEW CHAR(36); + UPDATE EXPORTTEMPLATEPLACEOFUSE SET EXPORTTEMPLATE_ID_NEW=EXPORTTEMPLATE_ID; + ALTER TABLE EXPORTTEMPLATEPLACEOFUSE DROP COLUMN EXPORTTEMPLATE_ID; + RENAME COLUMN EXPORTTEMPLATEPLACEOFUSE.EXPORTTEMPLATE_ID_NEW TO EXPORTTEMPLATE_ID; + ALTER TABLE EXPORTTEMPLATEFIELD ADD COLUMN EXPORTTEMPLATE_ID_NEW CHAR(36); + UPDATE EXPORTTEMPLATEFIELD SET EXPORTTEMPLATE_ID_NEW=EXPORTTEMPLATE_ID; + ALTER TABLE EXPORTTEMPLATEFIELD DROP COLUMN EXPORTTEMPLATE_ID; + RENAME COLUMN EXPORTTEMPLATEFIELD.EXPORTTEMPLATE_ID_NEW TO EXPORTTEMPLATE_ID; + ALTER TABLE EXPORTTEMPLATESELECTION ADD COLUMN EXPORTTEMPLATE_ID_NEW CHAR(36); + UPDATE EXPORTTEMPLATESELECTION SET EXPORTTEMPLATE_ID_NEW=EXPORTTEMPLATE_ID; + ALTER TABLE EXPORTTEMPLATESELECTION DROP COLUMN EXPORTTEMPLATE_ID; + RENAME COLUMN EXPORTTEMPLATESELECTION.EXPORTTEMPLATE_ID_NEW TO EXPORTTEMPLATE_ID; + </sql> + </changeSet> + + <changeSet dbms="!derby" author="b.ulrich" id="a53a2f38-3788-44a2-a151-13b3853ccb74"> + <modifyDataType tableName="EXPORTTEMPLATEPLACEOFUSE" columnName="EXPORTTEMPLATE_ID" newDataType="CHAR(36)"/> + <modifyDataType tableName="EXPORTTEMPLATEFIELD" columnName="EXPORTTEMPLATE_ID" newDataType="CHAR(36)"/> + <modifyDataType tableName="EXPORTTEMPLATESELECTION" columnName="EXPORTTEMPLATE_ID" newDataType="CHAR(36)"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/changelog.xml b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..571beb0ce88383160aafd6aa92cbaa3eac91172f --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/AlterDatatypeOfKeyColumnsToChar/changelog.xml @@ -0,0 +1,7 @@ +<?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"> + <include relativeToChangelogFile="true" file="alter_DocumentTemplatePlaceOfUseDatatype.xml"/> + <include relativeToChangelogFile="true" file="alter_ExportTemplateDatatype.xml"/> + <include relativeToChangelogFile="true" file="alter_ComunicationMedium_IdDatatype.xml"/> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml b/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml new file mode 100644 index 0000000000000000000000000000000000000000..0603638910cfef98114adef301c6cffd487b4260 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml @@ -0,0 +1,11 @@ +<?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 id="3d7f038c-04f1-45a2-9a1c-73c1a8666fea" author="b.ulrich" > + <renameColumn + columnDataType="CHAR(36)" + newColumnName="ORGANISATION_CONTACT_ID" + oldColumnName="ORGANISATION_ID" + tableName="VISITPLANENTRY"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/changelog.xml b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..7696526b5b01d5485e47a5a69bbade95aa0c6317 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml @@ -0,0 +1,8 @@ +<?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"> + <include file="AlterDatatypeOfKeyColumnsToChar/changelog.xml" relativeToChangelogFile="true"/> + <include file="VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml" relativeToChangelogFile="true"/> + <include file="AddNullableToDateNew.xml" relativeToChangelogFile="true" /> + <include file="AlterButtonLabelTitles/AlterButtonLabelTitles.xml" relativeToChangelogFile="true" /> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml index af7e5d06f6b435f4ed23b000313f51c786bc0dfc..76b2a507a6cc1d7a3a10c71d177fcffa55ad4d8d 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml @@ -15,7 +15,7 @@ <column name="ENTRYDATE" valueDate="2020-05-18"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> + <column name="ORGANISATION_CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> <column name ="CONTACT_ID" value="6c612f91-0160-4f09-9103-dccee7f7a6b7"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -25,7 +25,7 @@ <column name="ENTRYDATE" valueDate="2020-05-19"/> <column name="BEGIN_TIME" value="14:00"/> <column name="END_TIME" value="17:00"/> - <column name="ORGANISATION_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/> + <column name="ORGANISATION_CONTACT_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/> <column name ="CONTACT_ID" value="45635aca-7971-43df-a683-c80c86cb58cc"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -35,7 +35,7 @@ <column name="ENTRYDATE" valueDate="2020-05-19"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/> + <column name="ORGANISATION_CONTACT_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/> <column name ="CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -45,7 +45,7 @@ <column name="ENTRYDATE" valueDate="2020-05-20"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="8707accf-b1fd-4bde-97b1-ab44b75f66f9"/> + <column name="ORGANISATION_CONTACT_ID" value="8707accf-b1fd-4bde-97b1-ab44b75f66f9"/> <column name ="CONTACT_ID" value="79ce56fc-0022-4d5c-91b1-080c0f1e2191"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -64,7 +64,7 @@ <column name="ENTRYDATE" valueDate="2020-05-25"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> + <column name="ORGANISATION_CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> @@ -73,7 +73,7 @@ <column name="ENTRYDATE" valueDate="2020-05-26"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fd082db5-be43-4219-a705-588f9c06e59b"/> + <column name="ORGANISATION_CONTACT_ID" value="fd082db5-be43-4219-a705-588f9c06e59b"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> @@ -82,7 +82,7 @@ <column name="ENTRYDATE" valueDate="2020-05-27"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="a3fd3c23-12e1-4820-b76e-2cd70103d94d"/> + <column name="ORGANISATION_CONTACT_ID" value="a3fd3c23-12e1-4820-b76e-2cd70103d94d"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index 50c63b65a63025ae582f679ca7b2051471c3fd9e..a8cc53b406959a8797b32a02af71dd93e1576384 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -13,6 +13,7 @@ <include relativeToChangelogFile="true" file="basic/2020.0.3/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2020.1.0/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2020.1.1/changelog.xml"/> + <include relativeToChangelogFile="true" file="basic/2020.1.2/changelog.xml"/> <!--enable this only when you definetly want to overwrite the existing data with demo records:--> <!--<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>--> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 80c4686210790a754e8528e02b583a833eebcfb3..6e685b98b76ffee42644c33a1e7fe269291ca42a 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -1180,12 +1180,12 @@ <name>MEDIUM_ID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> + <columnType v="1" /> <size v="36" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="true" /> + <index v="false" /> <title>Medium</title> <description></description> <customProperties> @@ -8275,7 +8275,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -8382,13 +8382,13 @@ <entityFieldDb> <name>DOCUMENTTEMPLATEID</name> <dbName></dbName> - <primaryKey v="true" /> + <primaryKey v="false" /> <columnType v="1" /> <size v="36" /> <scale v="0" /> - <notNull v="true" /> - <isUnique v="true" /> - <index v="true" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> <documentation></documentation> <title></title> <description></description> @@ -8560,7 +8560,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -8699,7 +8699,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -8957,7 +8957,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -9312,7 +9312,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -11604,7 +11604,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -11923,7 +11923,7 @@ <columnType v="93" /> <size v="29" /> <scale v="9" /> - <notNull v="false" /> + <notNull v="true" /> <isUnique v="false" /> <index v="false" /> <documentation></documentation> @@ -14019,12 +14019,12 @@ <name>EXPORTTEMPLATE_ID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> + <columnType v="1" /> <size v="36" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="true" /> + <index v="false" /> <documentation></documentation> <title></title> <description></description> @@ -14345,12 +14345,12 @@ <name>EXPORTTEMPLATE_ID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> + <columnType v="1" /> <size v="36" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="true" /> + <index v="false" /> <documentation></documentation> <title></title> <description></description> @@ -14400,12 +14400,12 @@ <name>EXPORTTEMPLATE_ID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> + <columnType v="1" /> <size v="36" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="true" /> + <index v="false" /> <documentation></documentation> <title></title> <description></description> diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index d4c06eaeedeef0b7f545ecd501cc99da61458769..c9558baefe3e2cfb98c86980090279cc36383154 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -611,6 +611,16 @@ <title> number of connections</title> <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/countlinks/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -712,6 +722,15 @@ <name>entryDateDateFormat.value</name> <expression>%aditoprj%/entity/Activity_entity/recordcontainers/db/recordfieldmappings/entrydatedateformat.value/expression.js</expression> </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>ACTIVITY.ACTIVITYID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Activity_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Activity_entity/recordcontainers/db/onDBInsert.js b/entity/Activity_entity/recordcontainers/db/onDBInsert.js index ce851e0d4489f20cf098f2573e0b08dab9cc7665..c50343f5ee151ae93ea0838053e69c138540a21b 100644 --- a/entity/Activity_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Activity_entity/recordcontainers/db/onDBInsert.js @@ -28,9 +28,8 @@ if(vars.exists("$param.VisitPlanEntryId_param") && vars.get("$param.VisitPlanEnt { var values = [$KeywordRegistry.visitPlanEntryStatus$Visitreportcreated()]; var columns = ["STATUS"]; - var columnTypes = db.getColumnTypes("VISITPLANENTRY", columns, db.getCurrentAlias()); var update = newWhere("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$param.VisitPlanEntryId_param")) - .updateData(true, "VISITPLANENTRY", columns, columnTypes, values); + .updateData(true, "VISITPLANENTRY", columns, null, values); } if (vars.exists("$param.InsertLinks_param") && vars.get("$param.InsertLinks_param")) diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index 764fffc4fd77721dcdae4ec59576865446464b97..c9855622f5a88df06c57b8c307adf3df0b6b88e7 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -4,7 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/AnyContact_entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess> - <afterUiInit>%aditoprj%/entity/AnyContact_entity/afterUiInit.js</afterUiInit> + <initFilterProcess>%aditoprj%/entity/AnyContact_entity/initFilterProcess.js</initFilterProcess> <imageProcess>%aditoprj%/entity/AnyContact_entity/imageProcess.js</imageProcess> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/AnyContact_entity/afterUiInit.js b/entity/AnyContact_entity/afterUiInit.js deleted file mode 100644 index ad4324c7682881b8e9ca470e334269ae822ec522..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/afterUiInit.js +++ /dev/null @@ -1,23 +0,0 @@ -import("system.neon"); -import("Keyword_lib"); -import("system.vars"); -import("KeywordRegistry_basic"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": vars.get("$property.STATUS.contentType") -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/AnyContact_entity/initFilterProcess.js b/entity/AnyContact_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..695577262bdb7ee4519993bcaf130262075e81ca --- /dev/null +++ b/entity/AnyContact_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index 28c70af66100db91d5c2b61eea6d9ff584fb5832..c68158fb3304f71cc78829cd7f1490171a04782b 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -183,6 +183,7 @@ <entityParameter> <name>AppointmentState_param</name> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/appointmentlinks/children/appointmentstate_param/valueProcess.js</valueProcess> + <expose v="false" /> </entityParameter> </children> </entityConsumer> diff --git a/entity/Appointment_entity/entityfields/begin/valueProcess.js b/entity/Appointment_entity/entityfields/begin/valueProcess.js index eca54b63828df7f3d8624fd9f8ea12f33358e3d9..87e3ad4739d488a6973d66b2320eac4c6e31dfd4 100644 --- a/entity/Appointment_entity/entityfields/begin/valueProcess.js +++ b/entity/Appointment_entity/entityfields/begin/valueProcess.js @@ -19,8 +19,8 @@ if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$para /** * Sets explicitly the start date when a preset is sent from the core, due to a move or resize event from the user. Do not remove. */ -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.Entry_param")) -{ - var event = JSON.parse(vars.getString("$param.Entry_param")); - result.string(event[calendars.DTSTART]); -} \ No newline at end of file +//if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.Entry_param")) +//{ +// var event = JSON.parse(vars.getString("$param.Entry_param")); +// result.string(event[calendars.DTSTART]); +//} \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/end/valueProcess.js b/entity/Appointment_entity/entityfields/end/valueProcess.js index b953112d2ccabc54e8eebea2d9766346addafcdd..818bd4a4c9e76ed021ca131fe26ffcb03c43e09c 100644 --- a/entity/Appointment_entity/entityfields/end/valueProcess.js +++ b/entity/Appointment_entity/entityfields/end/valueProcess.js @@ -19,8 +19,8 @@ if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$para /** * Sets explicitly the end date when a preset is sent from the core, due to a move or resize event from the user. Do not remove. */ -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.Entry_param")) -{ - var event = JSON.parse(vars.getString("$param.Entry_param")); - result.string(event[calendars.DTEND]); -} \ No newline at end of file +//if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.Entry_param")) +//{ +// var event = JSON.parse(vars.getString("$param.Entry_param")); +// result.string(event[calendars.DTEND]); +//} \ No newline at end of file diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 7e8972a145953d11163f3fccc1879487dea6e31b..e56415a0faf52007f91bcc4e92f9ae20aebfa819 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -13,7 +13,25 @@ import("system.neon"); var appointmentSelect = newSelect("APPOINTMENT_ID").from("AB_APPOINTMENTLINK"); var appointmentUids; -if(vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW && vars.get("$local.idvalues") != null && vars.get("$local.idvalues") != "") +/** + * Will be used, if the user is operating the calendar. + */ +if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) +{ + var entry = JSON.parse(vars.getString("$param.Entry_param")); + + var masterEntry = null; + if (vars.exists("$param.MasterEntry_param") && vars.get("$param.MasterEntry_param") != "") { + masterEntry = JSON.parse(vars.getString("$param.MasterEntry_param")); + } + + //@TODO Icon + result.object([ + buildEntry(entry, masterEntry) + ]); +} + +else if(vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW && vars.get("$local.idvalues") != null && vars.get("$local.idvalues") != "") { var selectedids = vars.get("$local.idvalues"); result.object([buildEntry(calendars.getEntry(selectedids, null, null), null)]); @@ -35,23 +53,6 @@ else if(vars.getString("$param.LinkedObjectId_param") != undefined) appointmentSelect.whereIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", "$param.LinkedObjectId_param") result.object(buildEntriesFromUids(appointmentSelect.table())); } -/** - * Will be used, if the user is operating the calendar. - */ -else if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) -{ - var entry = JSON.parse(vars.getString("$param.Entry_param")); - - var masterEntry = null; - if (vars.exists("$param.MasterEntry_param") && vars.get("$param.MasterEntry_param") != "") { - masterEntry = JSON.parse(vars.getString("$param.MasterEntry_param")); - } - - //@TODO Icon - result.object([ - buildEntry(entry, masterEntry) - ]); -} function buildEntriesFromUids(appointmentUids) { diff --git a/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js b/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js deleted file mode 100644 index 7acb3c80848f54a4c6dfee5efa7a5b8514dd4a71..0000000000000000000000000000000000000000 --- a/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.date")); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js b/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js deleted file mode 100644 index a8a5e28793c742f8f3e10907976e746faf43c67c..0000000000000000000000000000000000000000 --- a/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.user")); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js b/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js index 1d16d29705904d8d5e24c0c3990b0d6b9693bcca..a1ee18e84b4a9407a6334fc9924ef885a41c7176 100644 --- a/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js +++ b/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js @@ -3,7 +3,7 @@ import("system.result"); import("system.vars"); import("system.neon"); -if(vars.get("$sys.selection").length == 1 && (vars.get("$field.ATTRIBUTE_TYPE") == $AttributeTypes.GROUP.toString() || vars.get("$field.ATTRIBUTE_TYPE") == $AttributeTypes.OBJECTSELECTION.toString())) +if(vars.get("$sys.selection").length == 1 && AttributeTypeUtil.isGroupType(vars.get("$field.ATTRIBUTE_TYPE"))) result.string(neon.COMPONENTSTATE_EDITABLE); else result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/date_new/valueProcess.js b/entity/Attribute_entity/entityfields/date_new/valueProcess.js deleted file mode 100644 index 7acb3c80848f54a4c6dfee5efa7a5b8514dd4a71..0000000000000000000000000000000000000000 --- a/entity/Attribute_entity/entityfields/date_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.date")); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/valueProcess.js b/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/valueProcess.js deleted file mode 100644 index dc6dfca332983312b5fc1181f8a357c182ac603f..0000000000000000000000000000000000000000 --- a/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -result.string($KeywordRegistry.attributeType()); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/user_new/valueProcess.js b/entity/Attribute_entity/entityfields/user_new/valueProcess.js deleted file mode 100644 index a8a5e28793c742f8f3e10907976e746faf43c67c..0000000000000000000000000000000000000000 --- a/entity/Attribute_entity/entityfields/user_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.user")); \ No newline at end of file diff --git a/entity/BulkMail_entity/entityfields/content/displayValueProcess.js b/entity/BulkMail_entity/entityfields/content/displayValueProcess.js index 9f3bd46ac569f4ba80d5da76c4f455d8976e1f69..9081043c5eb4d74ae63d2f2f6f947ec6abd4e4b5 100644 --- a/entity/BulkMail_entity/entityfields/content/displayValueProcess.js +++ b/entity/BulkMail_entity/entityfields/content/displayValueProcess.js @@ -13,7 +13,7 @@ if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$field var template = new DocumentTemplate(util.encodeBase64String(vars.get("$field.content")), vars.get("$field.templateType"), undefined, true) var contactId = EmployeeUtils.getCurrentContactId(); - var preview = template.getReplacedContentByContactId(contactId, false, true); + var preview = template.setOptions({onlyBody : true}).getReplacedContentByContactId(contactId); result.string(preview); } \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/campaign_id/onValueChange.js b/entity/CampaignParticipant_entity/entityfields/campaign_id/onValueChange.js index f5f6c5c6594a1a57fb3aaa41b59dfd0768bfc430..6db4d90300246ab7382bfbcf8db4efe6ec9572e7 100644 --- a/entity/CampaignParticipant_entity/entityfields/campaign_id/onValueChange.js +++ b/entity/CampaignParticipant_entity/entityfields/campaign_id/onValueChange.js @@ -2,8 +2,8 @@ import("system.neon"); import("Campaign_lib"); import("system.vars"); -if(vasr.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) { - var stepId = CampaignUtils.getDefaultCampaignStep(vars.get("local.value")); + var stepId = CampaignUtils.getDefaultCampaignStep(vars.get("$local.value")); neon.setFieldValue("$field.CAMPAIGNSTEP_ID", stepId); } \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/participantscommrestiction/children/contactid_param/valueProcess.js b/entity/CampaignParticipant_entity/entityfields/participantscommrestiction/children/contactid_param/valueProcess.js deleted file mode 100644 index f5825a6c09c99e0530939a270bcd81cfbc0c2d5b..0000000000000000000000000000000000000000 --- a/entity/CampaignParticipant_entity/entityfields/participantscommrestiction/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("system.vars"); - -result.string(vars.getString("$field.CONTACT_ID")); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/selectedcampaign/onValueChange.js b/entity/CampaignParticipant_entity/entityfields/selectedcampaign/onValueChange.js deleted file mode 100644 index 2bf64744b6548030c6db0cb825f376192bfdf5e1..0000000000000000000000000000000000000000 --- a/entity/CampaignParticipant_entity/entityfields/selectedcampaign/onValueChange.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.neon"); - - -neon.setFieldValue("$field.SYSTEMTEMPLATE", templateId); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js b/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js index b91c3634ae7fa3229e120ed364433b3f7787b276..04d8b224fd5596fc97753ed1afd61ad16cee5b4c 100644 --- a/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js +++ b/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js @@ -3,5 +3,5 @@ import("system.result"); import("system.vars"); //For creation of new Step in CampaignMainView -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.campaignId_param") && vars.get("$param.campaignId_param")) +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.campaignId_param") && vars.get("$param.campaignId_param") && !vars.get("$this.value")) result.string(vars.get("$param.campaignId_param")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/recordcontainers/db/recordfieldmappings/state.displayvalue/expression.js b/entity/CampaignStep_entity/recordcontainers/db/recordfieldmappings/state.displayvalue/expression.js deleted file mode 100644 index f0e8a44adee3749dafae8e5cba1b67c52701e01a..0000000000000000000000000000000000000000 --- a/entity/CampaignStep_entity/recordcontainers/db/recordfieldmappings/state.displayvalue/expression.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.campaignStepState(), "CAMPAIGNSTEP.STATUS"); -result.string(sql); \ No newline at end of file diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod index 670482332006d4df90769fefe39e6f12635b9b99..d51ee6244bb2873e72c5e62a078332875d1aa70b 100644 --- a/entity/Campaign_entity/Campaign_entity.aod +++ b/entity/Campaign_entity/Campaign_entity.aod @@ -14,6 +14,7 @@ <grantDeleteProcess>%aditoprj%/entity/Campaign_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Campaign_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Campaign_entity/afterUiInit.js</afterUiInit> + <useFavorites v="true" /> <iconId>VAADIN:GROUP</iconId> <imageProcess>%aditoprj%/entity/Campaign_entity/imageProcess.js</imageProcess> <titlePlural>Campaigns</titlePlural> @@ -521,6 +522,16 @@ <name>CAMPAIGN_OBEJCTTYPE</name> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaign_obejcttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -618,6 +629,11 @@ <name>CURRENCY.displayValue</name> <expression>%aditoprj%/entity/Campaign_entity/recordcontainers/db/recordfieldmappings/currency.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>CAMPAIGN.CAMPAIGNID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index 5c0c8448cd84839a753fd36b32d653fcbfc16827..ad05310a9dd5d918ce46a6b17a4ec7564dad10ba 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -8,8 +8,8 @@ <grantUpdateProcess>%aditoprj%/entity/Contact_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDeleteProcess>%aditoprj%/entity/Contact_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Contact_entity/contentTitleProcess.js</contentTitleProcess> - <afterUiInit>%aditoprj%/entity/Contact_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Contact_entity/onValidation.js</onValidation> + <initFilterProcess>%aditoprj%/entity/Contact_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:USERS</iconId> <titlePlural>Contacts</titlePlural> <recordContainer>db</recordContainer> diff --git a/entity/Contact_entity/afterUiInit.js b/entity/Contact_entity/afterUiInit.js deleted file mode 100644 index ad4324c7682881b8e9ca470e334269ae822ec522..0000000000000000000000000000000000000000 --- a/entity/Contact_entity/afterUiInit.js +++ /dev/null @@ -1,23 +0,0 @@ -import("system.neon"); -import("Keyword_lib"); -import("system.vars"); -import("KeywordRegistry_basic"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": vars.get("$property.STATUS.contentType") -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js b/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js index 460b39849d5d34bac95e4b987d28a665b732e860..25f85ab3968071cfcfc4df692b11e5b3cc4f168b 100644 --- a/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js +++ b/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js @@ -3,7 +3,7 @@ import("system.db"); import("system.vars"); import("Contact_lib"); -var organisationId = vars.get("$field.ORGANISATION_ID"); -var res = OrganisationUtils.getNameByOrganisationId(organisationId); +var organisationContactId = vars.get("$field.ORGANISATION_CONTACTID"); +var res = OrganisationUtils.getNameByContactId(organisationContactId); result.string(res); \ No newline at end of file diff --git a/entity/Contact_entity/initFilterProcess.js b/entity/Contact_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..695577262bdb7ee4519993bcaf130262075e81ca --- /dev/null +++ b/entity/Contact_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Contract_entity/Contract_entity.aod b/entity/Contract_entity/Contract_entity.aod index cccbd3df7cfeb22642e01140bc30e3d38954e889..8a6ccfd90c8543b45d997d3017e4425c61ae5141 100644 --- a/entity/Contract_entity/Contract_entity.aod +++ b/entity/Contract_entity/Contract_entity.aod @@ -8,6 +8,7 @@ <contentTitleProcess>%aditoprj%/entity/Contract_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Contract_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Contract_entity/onValidation.js</onValidation> + <useFavorites v="true" /> <iconId>VAADIN:FILE_TEXT</iconId> <titlePlural>Contracts</titlePlural> <recordContainer>db</recordContainer> @@ -387,6 +388,15 @@ <name>CONTRACT_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/contract_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -524,6 +534,15 @@ <isFilterable v="true" /> <filtertype>EXTENDED</filtertype> </consumerMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Contract_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>CONTRACT.CONTRACTID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 3e357fa976f8c85f707e8012240693dd2593acfe..2536bd71731f56f43fd335623b1f8ad5b8c87352 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -8,6 +8,7 @@ <contentTitleProcess>%aditoprj%/entity/DocumentTemplate_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/DocumentTemplate_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/DocumentTemplate_entity/onValidation.js</onValidation> + <useFavorites v="true" /> <iconId>VAADIN:FILE_FONT</iconId> <titlePlural>Document templates</titlePlural> <recordContainer>db</recordContainer> diff --git a/entity/DocumentTemplate_entity/entityfields/content/displayValueProcess.js b/entity/DocumentTemplate_entity/entityfields/content/displayValueProcess.js index 56246f908f33ecb844a4444ac3b6e740a69f5bad..d7715c0880e88f57908a1d752d6e4f03e98d69c9 100644 --- a/entity/DocumentTemplate_entity/entityfields/content/displayValueProcess.js +++ b/entity/DocumentTemplate_entity/entityfields/content/displayValueProcess.js @@ -17,7 +17,7 @@ if (vars.exists("$context.currentTemplateType")) var template = new DocumentTemplate(util.encodeBase64String(vars.get("$field.Content")), type, "unknown", true) var contactId = EmployeeUtils.getCurrentContactId(); - var preview = template.getReplacedContentByContactId(contactId, false, true); + var preview = template.setOptions({onlyBody : true}).getReplacedContentByContactId(contactId); if (type == DocumentTemplate.types.TXT) result.string(text.text2html(preview, false)); diff --git a/entity/Document_entity/Document_entity.aod b/entity/Document_entity/Document_entity.aod index fa1098dc639a05b340f5fc1a6fda4ca95bb2d521..9e489aa2dd1130329252a759b2ddecca7fc7b297 100644 --- a/entity/Document_entity/Document_entity.aod +++ b/entity/Document_entity/Document_entity.aod @@ -118,6 +118,7 @@ <name>IS_MAIN_DOCUMENT</name> <title>Main document</title> <contentType>BOOLEAN</contentType> + <placeholderProcess>%aditoprj%/entity/Document_entity/entityfields/is_main_document/placeholderProcess.js</placeholderProcess> <dropDownProcess>%aditoprj%/entity/Document_entity/entityfields/is_main_document/dropDownProcess.js</dropDownProcess> <valueProcess>%aditoprj%/entity/Document_entity/entityfields/is_main_document/valueProcess.js</valueProcess> <onValueChange>%aditoprj%/entity/Document_entity/entityfields/is_main_document/onValueChange.js</onValueChange> diff --git a/entity/Document_entity/entityfields/is_main_document/placeholderProcess.js b/entity/Document_entity/entityfields/is_main_document/placeholderProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8b541d6a62aef80de1307ed68f9344719ec9febb --- /dev/null +++ b/entity/Document_entity/entityfields/is_main_document/placeholderProcess.js @@ -0,0 +1,4 @@ +import("system.translate"); +import("system.result"); + +result.string(translate.text("Main document")); \ No newline at end of file diff --git a/entity/Email_entity/Email_entity.aod b/entity/Email_entity/Email_entity.aod index 670910b84410344ceb0bc8d6f47d8d1ea5cf3202..f3a15f3c8ad189a57e5dd9c9b3167d59a5043bed 100644 --- a/entity/Email_entity/Email_entity.aod +++ b/entity/Email_entity/Email_entity.aod @@ -124,6 +124,16 @@ <iconId>VAADIN:AT</iconId> <stateProcess>%aditoprj%/entity/Email_entity/entityfields/sendmail/stateProcess.js</stateProcess> </entityActionField> + <entityParameter> + <name>AdditionalPlaceholders_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>OfferId_param</name> + <expose v="true" /> + <mandatory v="true" /> + <documentation>%aditoprj%/entity/Email_entity/entityfields/offerid_param/documentation.adoc</documentation> + </entityParameter> </entityFields> <recordContainers> <datalessRecordContainer> diff --git a/entity/Email_entity/entityfields/offerid_param/documentation.adoc b/entity/Email_entity/entityfields/offerid_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..cc60a8f815575f3ed65faa6cc6634e6878b173c6 --- /dev/null +++ b/entity/Email_entity/entityfields/offerid_param/documentation.adoc @@ -0,0 +1,3 @@ +=OfferId_pram + +optional param needed for the offerEmails, to change the status of the offer \ No newline at end of file diff --git a/entity/Email_entity/entityfields/sendmail/onActionProcess.js b/entity/Email_entity/entityfields/sendmail/onActionProcess.js index 3042a292b76f3871dc01286424cf353a51e85412..74810743f42a7d88c0dfd8989917e0603864ba98 100644 --- a/entity/Email_entity/entityfields/sendmail/onActionProcess.js +++ b/entity/Email_entity/entityfields/sendmail/onActionProcess.js @@ -1,3 +1,5 @@ +import("KeywordRegistry_basic"); +import("Sql_lib"); import("system.translate"); import("ActivityTask_lib"); import("system.neon"); @@ -16,6 +18,16 @@ var notificationMsg = vars.get("$param.NotificationMsg_param"); var notificationTitle = translate.text("Offer status changed"); var subject = vars.get("$field.subject"); +var additionalPlaceholders = null; +if (vars.exists("$param.AdditionalPlaceholders_param") && vars.get("$param.AdditionalPlaceholders_param")) +{ + additionalPlaceholders = JSON.parse(vars.get("$param.AdditionalPlaceholders_param")).map(function (placeholder) + { + //assign the values from the JSON to a new Placeholder, so that the resulting object is an actual instance of Placeholder + return Object.assign(new Placeholder(), placeholder); + }); +} + var eml = EmailWritingUtils.openMailTemplate( vars.get("$field.RECIPIENT"), EmployeeUtils.getCurrentContactId(), @@ -24,9 +36,15 @@ var eml = EmailWritingUtils.openMailTemplate( bindata, attachments, subject, - emailFilename - ); + emailFilename, + additionalPlaceholders +); +if(vars.get("$param.ComingFrom_param") == "Offer") +{ + newWhere("OFFER.OFFERID", vars.get("$param.OfferId_param")) + .updateData(true, "OFFER", ["STATUS"], null, [$KeywordRegistry.offerStatus$sent()]); +} if (notificationMsg) question.showMessage(notificationMsg, question.INFORMATION, notificationTitle); \ No newline at end of file diff --git a/entity/Employee_entity/Employee_entity.aod b/entity/Employee_entity/Employee_entity.aod index d3ae09d5ecc8488205f9cf7d5899dd1f0fa6cfb7..7017e5bde03d7ccd2b48549350046d6b520d90bb 100644 --- a/entity/Employee_entity/Employee_entity.aod +++ b/entity/Employee_entity/Employee_entity.aod @@ -8,6 +8,7 @@ <contentTitleProcess>%aditoprj%/entity/Employee_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Employee_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Employee_entity/onValidation.js</onValidation> + <useFavorites v="true" /> <iconId>VAADIN:USER</iconId> <titlePlural>Employees</titlePlural> <recordContainer>jdito</recordContainer> diff --git a/entity/ExportTemplateField_entity/entityfields/field/dropDownProcess.js b/entity/ExportTemplateField_entity/entityfields/field/dropDownProcess.js index f5b8c998801e7aafdb45582d7a566614367a30a2..3c830477d519292b231f502d1caa9cffc392f984 100644 --- a/entity/ExportTemplateField_entity/entityfields/field/dropDownProcess.js +++ b/entity/ExportTemplateField_entity/entityfields/field/dropDownProcess.js @@ -9,7 +9,7 @@ import("system.text") var placeholders = PlaceholderUtils.getPlaceholders(null, true).map(function (placeholder){ - return [placeholder.placeholderName, placeholder.title || placeholder.placeholderName]; + return [placeholder.getFormattedName(), placeholder.title || placeholder.getFormattedName()]; }) result.object(placeholders); \ No newline at end of file diff --git a/entity/ExportTemplate_entity/ExportTemplate_entity.aod b/entity/ExportTemplate_entity/ExportTemplate_entity.aod index 2ab97cfd7f037e2888077d9df70dac239a206cda..b6614896d8b4cb148f75799a1eac0de2e3719a18 100644 --- a/entity/ExportTemplate_entity/ExportTemplate_entity.aod +++ b/entity/ExportTemplate_entity/ExportTemplate_entity.aod @@ -7,6 +7,7 @@ <grantCreate v="true" /> <grantUpdate v="true" /> <grantDelete v="true" /> + <useFavorites v="true" /> <iconId>NEON:EXPORT</iconId> <titlePlural>Export Templates</titlePlural> <recordContainer>db</recordContainer> diff --git a/entity/KeywordEntry_entity/KeywordEntry_entity.aod b/entity/KeywordEntry_entity/KeywordEntry_entity.aod index 1d23aa80c139ba8f466111374bda9a644bdef202..33635f575600381c7558ab9a11193459f32ac1cb 100644 --- a/entity/KeywordEntry_entity/KeywordEntry_entity.aod +++ b/entity/KeywordEntry_entity/KeywordEntry_entity.aod @@ -577,6 +577,18 @@ <fieldName>KeywordVisitRecommendationPriority</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>54410e7f-e5e6-4dd1-8f60-7864ed907aed</name> + <entityName>WorkflowDefinition_entity</entityName> + <fieldName>CategoryKeyword</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>644a6101-6b11-4998-bd8d-b799c6f376fa</name> + <entityName>Notification_entity</entityName> + <fieldName>TypeKeywords</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Leadimport_entity/Leadimport_entity.aod b/entity/Leadimport_entity/Leadimport_entity.aod index 6f7be5e2f8c7b1c375751375c9971c9697629786..7c0f6c87f129e20b45d5b579da410f6d534a621b 100644 --- a/entity/Leadimport_entity/Leadimport_entity.aod +++ b/entity/Leadimport_entity/Leadimport_entity.aod @@ -10,6 +10,7 @@ <grantDelete v="true" /> <grantDeleteProcess>%aditoprj%/entity/Leadimport_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Leadimport_entity/contentTitleProcess.js</contentTitleProcess> + <useFavorites v="true" /> <iconId>NEON:IMPORT</iconId> <imageProcess>%aditoprj%/entity/Leadimport_entity/imageProcess.js</imageProcess> <titlePlural>Lead Imports</titlePlural> diff --git a/entity/Leadimport_entity/entityfields/leadimportreset/onActionProcess.js b/entity/Leadimport_entity/entityfields/leadimportreset/onActionProcess.js index c7b4f0fdf7661d9430c260c73320cac09a35dec8..e3ab27e0a12c8b09990f1739ec1e11464248d700 100644 --- a/entity/Leadimport_entity/entityfields/leadimportreset/onActionProcess.js +++ b/entity/Leadimport_entity/entityfields/leadimportreset/onActionProcess.js @@ -46,7 +46,7 @@ function _deleteData (pTableName, pleadimportId, pdateADayBefor) { let uTableName = pTableName.charAt(0); newWhere(pTableName + "." + pTableName + "ID", - newSelect(pTableName + "." + pTableName + "ID") + newSelect(uTableName + "." + pTableName + "ID") .from(pTableName, uTableName) .join("LEADLOG", "LEADLOG.DATE_NEW = " + uTableName + ".DATE_NEW") .where(uTableName + ".USER_NEW = LEADLOG.USER_NEW") diff --git a/entity/Leadimport_entity/entityfields/load_data/onActionProcess.js b/entity/Leadimport_entity/entityfields/load_data/onActionProcess.js index b5d208a6e86d2d4ae9a17889a9cde267e1a8ad28..578e9f6edf7d93f92b2ba3dce605ab89deabd360 100644 --- a/entity/Leadimport_entity/entityfields/load_data/onActionProcess.js +++ b/entity/Leadimport_entity/entityfields/load_data/onActionProcess.js @@ -34,7 +34,6 @@ if (binMetadatas.length > 0) var insertTable = "LEADTEMP"; var insertCols = LeadImportUtils.leadTempColumns(); - var insertTypes = db.getColumnTypes(insertTable, insertCols); var insertVals = []; var toInsert = []; @@ -53,7 +52,7 @@ if (binMetadatas.length > 0) } insertVals.push(importDate, util.getNewUUID(), importName, i.toString(), assignmentRowId);//push other necessary data for the insert - toInsert.push([insertTable, insertCols, insertTypes, insertVals]); + toInsert.push([insertTable, insertCols, null, insertVals]); } db.inserts(toInsert); @@ -62,9 +61,8 @@ if (binMetadatas.length > 0) var updTable = "LEADIMPORT"; var updCols = ["STATUS"]; - var updTypes = db.getColumnTypes(updTable, updCols); - db.updateData(updTable, updCols, updTypes, [$KeywordRegistry.importStatus$loaded()], newWhere([updTable, "LEADIMPORTID"], assignmentRowId).build()); + db.updateData(updTable, updCols, null, [$KeywordRegistry.importStatus$loaded()], newWhere([updTable, "LEADIMPORTID"], assignmentRowId).build()); neon.refreshAll(); diff --git a/entity/Letter_entity/Letter_entity.aod b/entity/Letter_entity/Letter_entity.aod index 8bab19f92a2debbaf0ff15063e43609467f98db8..42b787aba50fed27e48bcf4adacbb4875786be2a 100644 --- a/entity/Letter_entity/Letter_entity.aod +++ b/entity/Letter_entity/Letter_entity.aod @@ -72,6 +72,10 @@ <state>DISABLED</state> <stateProcess>%aditoprj%/entity/Letter_entity/entityfields/downloadletterandcreateactivity/stateProcess.js</stateProcess> </entityActionField> + <entityParameter> + <name>AdditionalPlaceholders_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <datalessRecordContainer> diff --git a/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js b/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js index 840d399140a26629f7d42a2dce81995ac1758d39..0c453f91c3e8e31847be4c6cca575257597a7650 100644 --- a/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js +++ b/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js @@ -6,12 +6,22 @@ import("system.vars"); import("system.text"); import("DocumentTemplate_lib"); import("KeywordRegistry_basic"); +import("Placeholder_lib"); var template = DocumentTemplate.getSelectedTemplate(vars.get("$field.DOCUMENT_TEMPLATE"), new FileUpload(vars.get("$field.bindata"))); if (template) { var contactId = vars.get("$param.ContactId_param"); - var content = template.getReplacedContentByContactId(contactId, true); + var additionalPlaceholders = null; + if (vars.exists("$param.AdditionalPlaceholders_param") && vars.get("$param.AdditionalPlaceholders_param")) + { + additionalPlaceholders = JSON.parse(vars.get("$param.AdditionalPlaceholders_param")).map(function (placeholder) + { + //assign the values from the JSON to a new Placeholder, so that the resulting object is an actual instance of Placeholder + return Object.assign(new Placeholder(), placeholder); + }); + } + var content = template.setOptions({base64 : true}).getReplacedContentByContactId(contactId, additionalPlaceholders); if (template.type) neon.download(content, template.filename); diff --git a/entity/Notification_entity/Notification_entity.aod b/entity/Notification_entity/Notification_entity.aod index 05ab81cea74020a8b9ef2aa3bfa4266073bcda10..3f08a4f669f0e68b3182f2d392daab2235930c23 100644 --- a/entity/Notification_entity/Notification_entity.aod +++ b/entity/Notification_entity/Notification_entity.aod @@ -69,6 +69,7 @@ <entityField> <name>TYPECODE</name> <title>Type</title> + <consumer>TypeKeywords</consumer> <groupable v="true" /> <displayValueProcess>%aditoprj%/entity/Notification_entity/entityfields/typecode/displayValueProcess.js</displayValueProcess> </entityField> @@ -104,7 +105,7 @@ <title>set Read</title> <description></description> <onActionProcess>%aditoprj%/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js</onActionProcess> - <isSelectionAction v="true" /> + <isSelectionAction v="false" /> <iconId>VAADIN:OPEN_BOOK</iconId> <tooltip></tooltip> <tooltipProcess>%aditoprj%/entity/Notification_entity/entityfields/setnotificationstate/children/setread/tooltipProcess.js</tooltipProcess> @@ -155,11 +156,27 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>TypeKeywords</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Notification_entity/entityfields/typekeywords/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> <name>db</name> <alias>_____SYSTEMALIAS</alias> + <maximumDbRows v="200" /> + <isPageable v="false" /> <fromClauseProcess>%aditoprj%/entity/Notification_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Notification_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Notification_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> diff --git a/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js b/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js index 608c454e87cb33460b61a4999fb77372ccaab864..b852c1b08913071a50ffe07144d41b38bb75d0d7 100644 --- a/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js +++ b/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js @@ -1,11 +1,20 @@ +import("Sql_lib"); import("system.vars"); import("system.tools"); import("system.notification"); import("system.neon"); +import("KeywordRegistry_basic"); var user = tools.getCurrentUser(); var selectedNotifications = vars.get("$sys.selection"); +if (selectedNotifications.length == 0){ + selectedNotifications = newSelect("ASYS_NOTIFICATIONS.ID") + .from("ASYS_NOTIFICATIONS") + .where("ASYS_NOTIFICATIONS.STATE", [notification.STATE_SEEN.toString(), notification.STATE_UNSEEN.toString()], SqlBuilder.IN()) + .arrayColumn(); +} + for(var i = 0; i < selectedNotifications.length; i++) notification.updateUserNotificationState(user["name"], selectedNotifications[i], notification.STATE_CONFIRMED); diff --git a/entity/Notification_entity/entityfields/state/displayValueProcess.js b/entity/Notification_entity/entityfields/state/displayValueProcess.js index fcd088324b80387634096e3d62a49a2e82974495..277c05aab18dbce9a8a0a5f7bc078c8ada84c94d 100644 --- a/entity/Notification_entity/entityfields/state/displayValueProcess.js +++ b/entity/Notification_entity/entityfields/state/displayValueProcess.js @@ -1,24 +1,6 @@ -import("system.translate"); +import("Keyword_lib"); import("system.result"); import("system.vars"); +import("KeywordRegistry_basic"); -var value = vars.get("$field.STATE"); - -switch(value) -{ - case "SEEN": - result.string(translate.text("Seen")); - break; - case "CONFIRMED": - result.string(translate.text("Confirmed")); - break; - case "TODELETE": - result.string(translate.text("To Delete")); - break; - case "ARCHIVE": - result.string(translate.text("Archive")); - break; - default: - result.string(translate.text("Unseen")); - break; -} \ No newline at end of file +result.string(KeywordUtils.getViewValue($KeywordRegistry.notificationState(), vars.get("$field.STATE"))); \ No newline at end of file diff --git a/entity/Notification_entity/entityfields/statekeywords/children/containername_param/valueProcess.js b/entity/Notification_entity/entityfields/statekeywords/children/containername_param/valueProcess.js index a5407effb79841e7d2492e6f27f3ce81bfa33a51..f39ea4075a7d01b5ebcd3b54a316ce20694c3e79 100644 --- a/entity/Notification_entity/entityfields/statekeywords/children/containername_param/valueProcess.js +++ b/entity/Notification_entity/entityfields/statekeywords/children/containername_param/valueProcess.js @@ -1,4 +1,5 @@ import("system.result"); +import("KeywordRegistry_basic"); -result.string("NotificationState"); \ No newline at end of file +result.string($KeywordRegistry.notificationState()); \ No newline at end of file diff --git a/entity/Notification_entity/entityfields/typecode/displayValueProcess.js b/entity/Notification_entity/entityfields/typecode/displayValueProcess.js index 76e8d769dc2a82a791668c8df8783f1bfee95141..fcf893072cda6e8d5248ec3392af95b9c2feb13c 100644 --- a/entity/Notification_entity/entityfields/typecode/displayValueProcess.js +++ b/entity/Notification_entity/entityfields/typecode/displayValueProcess.js @@ -1,28 +1,6 @@ +import("Keyword_lib"); import("system.result"); -import("system.translate"); import("system.vars"); +import("KeywordRegistry_basic"); -var PREFIX = "_____SYSTEM_"; -var typecode = vars.get("$field.TYPECODE"); - -switch(typecode) -{ - case PREFIX + "NOTIFICATION_PHONECALL": - result.string(translate.text("Phonecall")); - break; - - case PREFIX + "NOTIFICATION_EMAIL": - result.string(translate.text("Email")); - break; - - case PREFIX + "NOTIFICATION_APPOINTMENT": - result.string(translate.text("Appointment")); - break; - - case PREFIX + "NOTIFICATION_TODO": - result.string(translate.text("Todo")); - break; - - default: - result.string(typecode); -} \ No newline at end of file +result.string(KeywordUtils.getViewValue($KeywordRegistry.notificationType(), vars.get("$field.TYPECODE"))); \ No newline at end of file diff --git a/entity/Notification_entity/entityfields/typekeywords/children/containername_param/valueProcess.js b/entity/Notification_entity/entityfields/typekeywords/children/containername_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8ccc4158b03124fe0be85ad1ffaeeca86efb0fb2 --- /dev/null +++ b/entity/Notification_entity/entityfields/typekeywords/children/containername_param/valueProcess.js @@ -0,0 +1,5 @@ +import("system.result"); +import("KeywordRegistry_basic"); + + +result.string($KeywordRegistry.notificationType()); \ No newline at end of file diff --git a/entity/Notification_entity/recordcontainers/db/onDBDelete.js b/entity/Notification_entity/recordcontainers/db/onDBDelete.js index 05d1a30c0a4efc49d64aab055ed9b58109aba6f6..54618e0f77334d441107ac955591986a7540f4d0 100644 --- a/entity/Notification_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Notification_entity/recordcontainers/db/onDBDelete.js @@ -1,5 +1,7 @@ import("system.vars"); import("system.notification"); -// Deletes notificationContents from its table, if there are no -notification.deleteContentIfOrphan(vars.get("$field.ID"), vars.get("$field.CONTENTID")); \ No newline at end of file +// Deletes notificationContents from its table, if there are no user notification left +// Only AppointmentContents need to stay, because they would appear again after every deletion. +if(vars.get("$field.TYPECODE") != "_____SYSTEM_NOTIFICATION_APPOINTMENT") + notification.deleteContentIfOrphan(vars.get("$field.ID"), vars.get("$field.CONTENTID")); \ 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 55ac5773b3cb1302c26846d766e066c70d64222f..4ea71164c3cd8f2f93b39be55a3555cbf9b8090a 100644 --- a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js @@ -234,7 +234,7 @@ function _getEntryData(pObjectId, pDirection, pRelationType1, pRelationType2, pP if (pRelationType1 == undefined || pRelationType2 == undefined) return []; - var [myNum, otherNum] = pDirection == "normal" ? [2, 1] : [1, 2]; + var [myNum, otherNum] = pDirection == "normal" ? [1, 2] : [2, 1]; onConditionForRelationTypeJoin = newWhere("AB_OBJECTRELATIONTYPEID = AB_OBJECTRELATIONTYPE" + myNum) .and("AB_OBJECTRELATION.AB_OBJECTRELATIONTYPE1", pRelationType1) diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 11d49333e178a1925bef305a548c2f526aa61a7b..ef4dc76656ae23282b3d30e6b56db39c4c223e06 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -12,6 +12,7 @@ <contentTitleProcess>%aditoprj%/entity/Offer_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Offer_entity/afterUiInit.js</afterUiInit> <afterOperatingState>%aditoprj%/entity/Offer_entity/afterOperatingState.js</afterOperatingState> + <useFavorites v="true" /> <iconId>VAADIN:CART</iconId> <titlePlural>Offers</titlePlural> <recordContainer>db</recordContainer> @@ -1027,6 +1028,16 @@ <name>OFFER_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/offer_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -1265,6 +1276,15 @@ <recordfield>OFFER.NET</recordfield> <aggregateType>SUM</aggregateType> </aggregateFieldDbMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Offer_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>OFFER.OFFER_ID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js b/entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js index fbd11f7034742ee93fa02bf571013cf7cfcafe3a..108e16a1568111f622d71415968423884be95d78 100644 --- a/entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js +++ b/entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js @@ -6,9 +6,11 @@ import("system.translate"); import("Offer_lib"); import("Email_lib"); import("Sql_lib"); +import("MimeType_lib"); +import("Placeholder_lib"); -var offerReport = new Object(); -var attachmentArray = new Array(); +var offerReport = {}; +var attachmentArray = []; var notificationMsg = translate.text("The status of the offer was changed to \"Sent\"."); var contactId = vars.get("$field.CONTACT_ID"); var arrayReport = OfferUtils.buildOfferReport(vars.get("$field.OFFERID")); @@ -17,13 +19,13 @@ var emailFilename = translate.text("Offerrequest"); if (vars.get("$field.CONTACT_ID") == null || "") contactId = vars.get("$field.CONTACT_ORG_ID"); offerReport.content = arrayReport[1]; -offerReport.contentType = "application/pdf"; +offerReport.contentType = MimeTypes.PDF(); offerReport.filename = translate.text("Offer No.") + vars.get("$field.#CONTENTTITLE") + ".pdf"; attachmentArray[0] = offerReport; -EmailWritingUtils.sendReportAsMail(contactId, attachmentArray, "Offer", notificationMsg, emailFilename); - -newWhere("OFFER.OFFERID", "$field.OFFERID") - .updateData(true, "OFFER", ["STATUS"], null, [$KeywordRegistry.offerStatus$sent()]); - +var additionalPlaceholders = [ + new Placeholder("offerCode", Placeholder.types.FIXEDVALUE, vars.get("$field.FullOfferCode")) +]; +var offerId = vars.get("$field.OFFERID") +EmailWritingUtils.sendReportAsMail(contactId, attachmentArray, "Offer", notificationMsg, emailFilename, additionalPlaceholders, offerId); \ No newline at end of file diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index bf6651801aed2c5efdb408ce8a6c8fa9ed737556..e040ec1ef9823a19ad1b056cbeeffe22d6c32e9c 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -7,6 +7,7 @@ <grantDeleteProcess>%aditoprj%/entity/Order_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Order_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Order_entity/afterUiInit.js</afterUiInit> + <useFavorites v="true" /> <iconId>VAADIN:DOLLAR</iconId> <titlePlural>Receipts</titlePlural> <recordContainer>db</recordContainer> @@ -991,6 +992,16 @@ <name>ORDER_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/Order_entity/entityfields/order_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -1205,6 +1216,15 @@ <name>ISOLANGUAGE.displayValue</name> <expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/isolanguage.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>SALESORDER.SALESORDERID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 414ff2eb81e92fcd7606f0e8d6fe8696cb414819..cbd7cb44ef5d77d0e3656bfe5867f3c3f68ce8f8 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -9,6 +9,7 @@ <contentTitleProcess>%aditoprj%/entity/Organisation_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Organisation_entity/afterUiInit.js</afterUiInit> <afterOperatingState>%aditoprj%/entity/Organisation_entity/afterOperatingState.js</afterOperatingState> + <initFilterProcess>%aditoprj%/entity/Organisation_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:BUILDING</iconId> <imageProcess>%aditoprj%/entity/Organisation_entity/imageProcess.js</imageProcess> <titlePlural>Companies</titlePlural> @@ -788,7 +789,7 @@ <title>Turnover Current Year</title> <contentType>NUMBER</contentType> <outputFormat>#,##0.00€</outputFormat> - <groupable v="true" /> + <groupable v="false" /> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnovercurrentyear/valueProcess.js</valueProcess> </entityField> <entityField> @@ -796,7 +797,7 @@ <title>Turnover Last Year</title> <contentType>NUMBER</contentType> <outputFormat>#,##0.00€</outputFormat> - <groupable v="true" /> + <groupable v="false" /> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverlastyear/valueProcess.js</valueProcess> </entityField> <entityField> @@ -804,6 +805,7 @@ <title>Turnover change</title> <colorProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverpercentdiff/colorProcess.js</colorProcess> <contentType>TEXT</contentType> + <groupable v="false" /> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverpercentdiff/valueProcess.js</valueProcess> </entityField> <entityField> @@ -1103,9 +1105,15 @@ <iconId>NEON:TACKED</iconId> </entityActionField> <entityField> - <name>ORGANISATION_OBJECTTYPE</name> - <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisation_objecttype/valueProcess.js</valueProcess> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -1312,6 +1320,15 @@ <name>STANDARD_ZIP.value</name> <recordfield>ADDRESS.ZIP</recordfield> </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>ORGANISATION.ORGANISATIONID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Organisation_entity/afterUiInit.js b/entity/Organisation_entity/afterUiInit.js index 669f54dbb747c656a7723b9795e3e10875eade5c..d529418d07b0567a96364d831a8a27194c2eca23 100644 --- a/entity/Organisation_entity/afterUiInit.js +++ b/entity/Organisation_entity/afterUiInit.js @@ -1,30 +1,7 @@ -import("Keyword_lib"); -import("KeywordRegistry_basic"); -import("system.neon"); -import("system.vars"); -import("Context_lib"); -import("Attribute_lib"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": vars.get("$property.STATUS.contentType") -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); -} +import("system.neon"); +import("system.vars"); +import("Context_lib"); +import("Attribute_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); \ No newline at end of file diff --git a/entity/Organisation_entity/initFilterProcess.js b/entity/Organisation_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..26ce7fa02bbaeaa2d25db318aa011b67278354cc --- /dev/null +++ b/entity/Organisation_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); +import("system.result"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/PermissionCalendar_entity/PermissionCalendar_entity.aod b/entity/PermissionCalendar_entity/PermissionCalendar_entity.aod index 8bd374fd3485951d6ff0cef39ff55d465a66f135..c2faec477ab09d9a7d1b57c5c8f74b8f4bf4fc19 100644 --- a/entity/PermissionCalendar_entity/PermissionCalendar_entity.aod +++ b/entity/PermissionCalendar_entity/PermissionCalendar_entity.aod @@ -90,20 +90,22 @@ <description></description> <children> <entityActionField> - <name>addNewUserPermissionDealerAction</name> - <title>Add new User Permission</title> - <onActionProcess>%aditoprj%/entity/PermissionCalendar_entity/entityfields/addactions/children/addnewuserpermissiondealeraction/onActionProcess.js</onActionProcess> + <name>receiveNewUserPermissionDealerAction</name> + <title>Receive new User Permission</title> + <onActionProcess>%aditoprj%/entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewuserpermissiondealeraction/onActionProcess.js</onActionProcess> <isMenuAction v="true" /> <isObjectAction v="false" /> <isSelectionAction v="false" /> + <iconId>VAADIN:USER</iconId> <state>AUTO</state> <tooltip></tooltip> </entityActionField> <entityActionField> - <name>addNewDepartmentPermissionDealterAction</name> - <title>Add new Department Permission</title> - <onActionProcess>%aditoprj%/entity/PermissionCalendar_entity/entityfields/addactions/children/addnewdepartmentpermissiondealteraction/onActionProcess.js</onActionProcess> + <name>receiveNewDepartmentPermissionDealterAction</name> + <title>Receive new Department Permission</title> + <onActionProcess>%aditoprj%/entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewdepartmentpermissiondealteraction/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> + <iconId>VAADIN:GROUP</iconId> <state>AUTO</state> </entityActionField> </children> diff --git a/entity/PermissionCalendar_entity/entityfields/addactions/children/addnewdepartmentpermissiondealteraction/onActionProcess.js b/entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewdepartmentpermissiondealteraction/onActionProcess.js similarity index 100% rename from entity/PermissionCalendar_entity/entityfields/addactions/children/addnewdepartmentpermissiondealteraction/onActionProcess.js rename to entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewdepartmentpermissiondealteraction/onActionProcess.js diff --git a/entity/PermissionCalendar_entity/entityfields/addactions/children/addnewuserpermissiondealeraction/onActionProcess.js b/entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewuserpermissiondealeraction/onActionProcess.js similarity index 100% rename from entity/PermissionCalendar_entity/entityfields/addactions/children/addnewuserpermissiondealeraction/onActionProcess.js rename to entity/PermissionCalendar_entity/entityfields/addactions/children/receivenewuserpermissiondealeraction/onActionProcess.js diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 828766d541a77c594a9f9c4d3daea43416012465..907d1408a4c2c5606ddcc61e47249d015939e3e3 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -13,6 +13,7 @@ <afterUiInit>%aditoprj%/entity/Person_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Person_entity/onValidation.js</onValidation> <afterOperatingState>%aditoprj%/entity/Person_entity/afterOperatingState.js</afterOperatingState> + <initFilterProcess>%aditoprj%/entity/Person_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:USERS</iconId> <imageProcess>%aditoprj%/entity/Person_entity/imageProcess.js</imageProcess> <usePermissions v="false" /> @@ -192,7 +193,7 @@ <name>ContactId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/communications/children/contactid_param/valueProcess.js</valueProcess> <expose v="false" /> - <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. + <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. Usually this is used for filtering COMMUNICATION-entries by a specified contact or creating a new entry that is related to a contact.</description> </entityParameter> <entityParameter> @@ -413,7 +414,7 @@ <name>ContactId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/phonecommunications/children/contactid_param/valueProcess.js</valueProcess> <expose v="false" /> - <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. + <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. Usually this is used for filtering COMMUNICATION-entries by a specified contact or creating a new entry that is related to a contact.</description> </entityParameter> </children> @@ -431,7 +432,7 @@ <name>ContactId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/emailcommunications/children/contactid_param/valueProcess.js</valueProcess> <expose v="false" /> - <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. + <description>This parameter is used for specifing a related &quot;CONTACTID&quot; to a COMMUNICATION-entry. Usually this is used for filtering COMMUNICATION-entries by a specified contact or creating a new entry that is related to a contact.</description> </entityParameter> </children> @@ -1267,9 +1268,15 @@ </children> </entityProvider> <entityField> - <name>PERSON_OBJECTTYPE</name> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/person_objecttype/valueProcess.js</valueProcess> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -1555,6 +1562,15 @@ <name>CONTACTROLE.displayValue</name> <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>PERSON.PERSONID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Person_entity/afterUiInit.js b/entity/Person_entity/afterUiInit.js index e756cf590afbc22dfff0537787df1a139a3d47ff..d529418d07b0567a96364d831a8a27194c2eca23 100644 --- a/entity/Person_entity/afterUiInit.js +++ b/entity/Person_entity/afterUiInit.js @@ -1,30 +1,7 @@ -import("Keyword_lib"); -import("KeywordRegistry_basic"); -import("system.neon"); -import("system.vars"); -import("Context_lib"); -import("Attribute_lib"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": vars.get("$property.STATUS.contentType") -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); -} +import("system.neon"); +import("system.vars"); +import("Context_lib"); +import("Attribute_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); \ No newline at end of file diff --git a/entity/Person_entity/initFilterProcess.js b/entity/Person_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..26ce7fa02bbaeaa2d25db318aa011b67278354cc --- /dev/null +++ b/entity/Person_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); +import("system.result"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Prod2prod_entity/onInsert.js b/entity/Prod2prod_entity/onInsert.js index af42dcad8f1805fec826a4dfb7d84ec57b217643..d11203f6249b0b7d30c523abe19cf4ac6b577e12 100644 --- a/entity/Prod2prod_entity/onInsert.js +++ b/entity/Prod2prod_entity/onInsert.js @@ -16,6 +16,4 @@ var vals = [ vars.get("$field.UID") , vars.get("$field.OPTIONAL") , vars.get("$field.TAKEPRICE") ]; -var colTypes = db.getColumnTypes("PROD2PROD", cols); - -db.insertData("PROD2PROD", cols, colTypes, vals); \ No newline at end of file +db.insertData("PROD2PROD", cols, null, vals); \ No newline at end of file diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 54a47d4ae7e5fb27771c8cf09885b29d03fc50fd..6c336478ef376f314f41afa97e366710b7bc489b 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -10,6 +10,7 @@ <grantDeleteProcess>%aditoprj%/entity/Product_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Product_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Product_entity/afterUiInit.js</afterUiInit> + <useFavorites v="true" /> <iconId>VAADIN:HAMMER</iconId> <imageProcess>%aditoprj%/entity/Product_entity/imageProcess.js</imageProcess> <titlePlural>Products</titlePlural> @@ -461,6 +462,16 @@ <name>PRODUCT_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/Product_entity/entityfields/product_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -585,6 +596,15 @@ <isFilterable v="true" /> <filtertype>EXTENDED</filtertype> </consumerMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Product_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>PRODUCT.PRODUCTID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index 4df695970c02455fad11399033a3d684eee926d1..ea43f8afdd9ea59bd50ddb6c36dd45bafaa638a5 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -9,6 +9,7 @@ <element>Product_entity</element> </siblings> <onValidation>%aditoprj%/entity/Productprice_entity/onValidation.js</onValidation> + <useFavorites v="true" /> <titlePlural>Prices</titlePlural> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/QuickEntry_entity/recordcontainers/jdito/onInsert.js b/entity/QuickEntry_entity/recordcontainers/jdito/onInsert.js index e0891f1fe607eda473e4993d2e8b8cf1d9e5a513..aa0f51c76fd12f0f2b68af5357d04ea7f1303952 100644 --- a/entity/QuickEntry_entity/recordcontainers/jdito/onInsert.js +++ b/entity/QuickEntry_entity/recordcontainers/jdito/onInsert.js @@ -1,91 +1,62 @@ import("Sql_lib"); -import("system.db"); -import("system.vars"); import("KeywordRegistry_basic"); +import("system.entities"); +import("system.vars"); -//TODO: use writeEntity when available //TODO: duplicate check var rowdata = vars.get("$local.rowdata"); -var organisationId = rowdata["ORGANISATION_ID.value"]; +var organisationId = "0"; var userNew = rowdata["USER_NEW.value"]; var dateNew = rowdata["DATE_NEW.value"]; -var contactCols = [ - "CONTACTID", - "ORGANISATION_ID", - "PERSON_ID", - "STATUS", - "ISOLANGUAGE", - "ADDRESS_ID", - "USER_NEW", - "DATE_NEW" -]; -var contactVals = [ - rowdata["UID.value"], - organisationId, - "", - $KeywordRegistry.contactStatus$active(), - rowdata["ISOLANGUAGE.value"], - "", - userNew, - dateNew -]; - if (rowdata["ORGANISATION_NAME.value"]) { - var orgCols = [ - "ORGANISATIONID", - "NAME", - "USER_NEW", - "DATE_NEW" - ]; - var orgVals = [ - organisationId, - rowdata["ORGANISATION_NAME.value"], - userNew, - dateNew - ]; - db.insertData("ORGANISATION", orgCols, null, orgVals); - - db.insertData("CONTACT", contactCols, null, contactVals); -} -else -{ - contactVals[1] = "0"; //"private" if no company is given + let configOrg = entities.createConfigForAddingRows(); + organisationId = rowdata["ORGANISATION_ID.value"]; + configOrg.entity("Organisation_entity"); + configOrg.fieldValues({ + "ORGANISATIONID": organisationId, + "ORGANISATION_ID": organisationId, + "CONTACTID" : rowdata["UID.value"], + "NAME": rowdata["ORGANISATION_NAME.value"], + "USER_NEW": userNew, + "DATE_NEW": dateNew, + "USER_NEW_CONTACT": userNew, + "DATE_NEW_CONTACT" : dateNew, + "STATUS" : $KeywordRegistry.contactStatus$active(), + "ISOLANGUAGE" : rowdata["ISOLANGUAGE.value"] + }); + + entities.createRow(configOrg); } if (rowdata["LASTNAME.value"]) { - var personCols = [ - "PERSONID", - "FIRSTNAME", - "LASTNAME", - "SALUTATION", - "TITLE", - "GENDER", - "USER_NEW", - "DATE_NEW" - ]; - var gender = newSelect("SEX") - .from("SALUTATION") - .whereIfSet("SALUTATION.SALUTATION", rowdata["PERSON_SALUTATION.value"]) - .cell(true); - - var personVals = [ - rowdata["PERSON_ID.value"], - rowdata["FIRSTNAME.value"] || "", - rowdata["LASTNAME.value"], - rowdata["PERSON_SALUTATION.value"] || "", - rowdata["PERSON_TITLE.value"] || "", - gender, - userNew, - dateNew - ]; - db.insertData("PERSON", personCols, null, personVals); - - contactVals[0] = rowdata["PERSON_CONTACT_ID.value"]; - contactVals[2] = rowdata["PERSON_ID.value"]; - - db.insertData("CONTACT", contactCols, null, contactVals); + let gender = newSelect("SEX") + .from("SALUTATION") + .whereIfSet("SALUTATION.SALUTATION", rowdata["PERSON_SALUTATION.value"]) + .cell(true); + + let configPer = entities.createConfigForAddingRows(); + configPer.entity("Person_entity"); + configPer.fieldValues({ + "PERSON_ID" : rowdata["PERSON_ID.value"], + "PERSONID": rowdata["PERSON_ID.value"], + "FIRSTNAME": rowdata["FIRSTNAME.value"] || "", + "LASTNAME" : rowdata["LASTNAME.value"], + "SALUTATION": rowdata["PERSON_SALUTATION.value"] || "", + "TITLE": rowdata["PERSON_TITLE.value"] || "", + "GENDER": gender, + "USER_NEW": userNew, + "DATE_NEW": dateNew, + "USER_NEW_CONTACT": userNew, + "DATE_NEW_CONTACT" : dateNew, + "CONTACTID": rowdata["PERSON_CONTACT_ID.value"], + "ORGANISATION_ID": organisationId, + "STATUS" : $KeywordRegistry.contactStatus$active(), + "ISOLANGUAGE": rowdata["ISOLANGUAGE.value"] + }); + + entities.createRow(configPer); } \ No newline at end of file diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index 0c1444f2e900770553a72960461306354215d863..2c5b4e88d58f9275bb82fbb89150e513362331bf 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -12,6 +12,7 @@ <afterUiInit>%aditoprj%/entity/Salesproject_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Salesproject_entity/onValidation.js</onValidation> <afterOperatingState>%aditoprj%/entity/Salesproject_entity/afterOperatingState.js</afterOperatingState> + <useFavorites v="true" /> <iconId>VAADIN:BOOK_DOLLAR</iconId> <titlePlural>Sales Projects</titlePlural> <recordContainer>db</recordContainer> @@ -627,7 +628,7 @@ <entityField> <name>ClassificationResult</name> <title>Classification</title> - <groupable v="true" /> + <groupable v="false" /> <state>READONLY</state> <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/classificationresult/valueProcess.js</valueProcess> </entityField> @@ -753,6 +754,16 @@ <name>SALESPROJECT_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/salesproject_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -880,6 +891,15 @@ <isFilterable v="true" /> <isLookupFilter v="true" /> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>SALESPROJECT.SALESPROJECTID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Salesproject_entity/onValidation.js b/entity/Salesproject_entity/onValidation.js index e0b1e589a7543108c938f3dbb1d9c75b58908753..c9618796815b4f0e83c28c43a12320cd981a3ed9 100644 --- a/entity/Salesproject_entity/onValidation.js +++ b/entity/Salesproject_entity/onValidation.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.result"); import("Date_lib"); import("system.vars"); @@ -6,4 +7,6 @@ var startDate = vars.get("$field.STARTDATE"); var endDate = vars.get("$field.ENDDATE"); if (!DateUtils.validateBeginnBeforeEnd(startDate, endDate)) - result.string(DateUtils.getValidationFailString()); \ No newline at end of file + result.string(DateUtils.getValidationFailString()); +else if(!vars.get("$field.PROJECTTITLE") && vars.get("$field.PROJECTTYPE") && vars.exists("$param.PresetTitle_param")) + result.string(translate.text("The Sales Project can only be filled when a company has been specified")); \ No newline at end of file diff --git a/entity/SupportTicket_entity/SupportTicket_entity.aod b/entity/SupportTicket_entity/SupportTicket_entity.aod index 8438598fe4cef2fb64e270de2534fb747a749e9c..095a43105ba22ad9cf6ee5aaa8a995437064e110 100644 --- a/entity/SupportTicket_entity/SupportTicket_entity.aod +++ b/entity/SupportTicket_entity/SupportTicket_entity.aod @@ -7,6 +7,7 @@ <contentTitleProcess>%aditoprj%/entity/SupportTicket_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/SupportTicket_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/SupportTicket_entity/onValidation.js</onValidation> + <useFavorites v="true" /> <iconId>VAADIN:CHAT</iconId> <titlePlural>Support Tickets</titlePlural> <recordContainer>db</recordContainer> @@ -399,6 +400,16 @@ <name>SUPPORTTICKET_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/supportticket_objecttype/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -531,6 +542,15 @@ <name>TASK_PARENT_CONTEXT.value</name> <recordfield>TASK.PARENT_CONTEXT</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>TICKET.TICKETID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Task_entity/Task_entity.aod b/entity/Task_entity/Task_entity.aod index aa736a459ee93a5fe679f9fcf01cc8c1a86545a4..64f381e93f98b991c2c8502acfc95780050d98c6 100644 --- a/entity/Task_entity/Task_entity.aod +++ b/entity/Task_entity/Task_entity.aod @@ -8,6 +8,7 @@ <contentTitleProcess>%aditoprj%/entity/Task_entity/contentTitleProcess.js</contentTitleProcess> <afterUiInit>%aditoprj%/entity/Task_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Task_entity/onValidation.js</onValidation> + <initFilterProcess>%aditoprj%/entity/Task_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:TASKS</iconId> <iconIdProcess>%aditoprj%/entity/Task_entity/iconIdProcess.js</iconIdProcess> <titlePlural>Tasks</titlePlural> @@ -453,6 +454,16 @@ <iconId>VAADIN:CURLY_BRACKETS</iconId> <stateProcess>%aditoprj%/entity/Task_entity/entityfields/openadminview/stateProcess.js</stateProcess> </entityActionField> + <entityField> + <name>COUNT</name> + <title>Count</title> + <contentType>NUMBER</contentType> + </entityField> + <entityAggregateField> + <name>COUNT_aggregate</name> + <parentField>COUNT</parentField> + <title>Count</title> + </entityAggregateField> </entityFields> <recordContainers> <dbRecordContainer> @@ -570,6 +581,15 @@ <name>TYPE.value</name> <recordfield>TASK.KIND</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COUNT.value</name> + <expression>%aditoprj%/entity/Task_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression> + </dbRecordFieldMapping> + <aggregateFieldDbMapping> + <name>COUNT_aggregate.value</name> + <recordfield>TASK.TASKID</recordfield> + <aggregateType>COUNT</aggregateType> + </aggregateFieldDbMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Task_entity/afterUiInit.js b/entity/Task_entity/afterUiInit.js index 566c37e5652d388bc77fea8c23183811a2da9f3c..2f108ba446930b67156ba07b5e880b1ff371117a 100644 --- a/entity/Task_entity/afterUiInit.js +++ b/entity/Task_entity/afterUiInit.js @@ -1,31 +1,6 @@ import("system.neon"); import("system.vars"); -import("system.neon"); import("ActivityTask_lib"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); -var recordState = vars.get("$sys.recordstate"); -if(recordState == neon.OPERATINGSTATE_NEW) -{ - TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.PARENT_CONTEXT", "$field.PARENT_ID"); -} -else if (recordState != neon.OPERATINGSTATE_SEARCH) -{ - var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.taskStatus$ended(), - "contenttype": vars.get("$property.STATUS.contentType") - }; - statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), statusFilterElement.key); - - var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] - }; - filter = JSON.stringify(filter); - neon.setFilter("#ENTITY", filter); -} \ No newline at end of file +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.PARENT_CONTEXT", "$field.PARENT_ID"); \ No newline at end of file diff --git a/entity/Task_entity/initFilterProcess.js b/entity/Task_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..39b6e0b2e29be0e89c1cf8279ab9c9ae93a74ab9 --- /dev/null +++ b/entity/Task_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusEnded = $KeywordRegistry.taskStatus$ended(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusEnded, + value: KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), statusEnded) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/UnlinkedMailMappingWrapper_entity/recordcontainers/dummyjdito/onUpdate.js b/entity/UnlinkedMailMappingWrapper_entity/recordcontainers/dummyjdito/onUpdate.js index f6cc9442f35488dd9da83caac5ccfc035569b55d..1910f493948e777cbf153d2fc3dcacd413a0666c 100644 --- a/entity/UnlinkedMailMappingWrapper_entity/recordcontainers/dummyjdito/onUpdate.js +++ b/entity/UnlinkedMailMappingWrapper_entity/recordcontainers/dummyjdito/onUpdate.js @@ -16,7 +16,6 @@ var changedRows = vars.get("$field.UnlinkedMailMappingLinks.insertedRows"); var communicationsToInsert = []; var communicationCols = ["COMMUNICATIONID", "ADDR", "CONTACT_ID", "ISSTANDARD", "MEDIUM_ID", "USER_NEW", "DATE_NEW"]; -var communicationTypes = db.getColumnTypes("COMMUNICATION", communicationCols); if (changedRows.length > 0) { @@ -51,7 +50,7 @@ if (changedRows.length > 0) { var standardFlag = contactRows[i]["STANDARD_EMAIL_COMMUNICATION"] ? "0" : "1";//when no standard mail exists already: set it var vals = [util.getNewUUID(), emailAddrToAdd, contactId, standardFlag, $KeywordRegistry.communicationMedium$mail(), vars.get("$sys.user"), datetime.date()]; - communicationsToInsert.push(["COMMUNICATION", communicationCols, communicationTypes, vals]); + communicationsToInsert.push(["COMMUNICATION", communicationCols, null, vals]); //TODO: insert the COMM via a entities.***-method when available } } diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod index 46740270752b5207fb8b62d480d5ebf3c57259e9..1af833e9b8e4f3713455bea35ac9402bc3d1e732 100644 --- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod +++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod @@ -30,14 +30,14 @@ <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js</displayValueProcess> </entityField> <entityField> - <name>ORGANISATION_ID</name> - <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc</documentation> + <name>ORGANISATION_CONTACT_ID</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc</documentation> <title>Organisation</title> <consumer>Organisations</consumer> <mandatory v="true" /> - <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js</stateProcess> - <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>ENTRYDATE</name> @@ -247,10 +247,10 @@ <name>END_TIME.value</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> - <name>ORGANISATION_ID.value</name> + <name>ORGANISATION_CONTACT_ID.value</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> - <name>ORGANISATION_ID.displayValue</name> + <name>ORGANISATION_CONTACT_ID.displayValue</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>CONTACT_ID.value</name> diff --git a/entity/VisitPlanEntry_entity/documentation.adoc b/entity/VisitPlanEntry_entity/documentation.adoc index fe840f04ecae1b740eca60633420ce2d1f362c95..13c58c22da0edc3d1657fcdc58b7043705a181e2 100644 --- a/entity/VisitPlanEntry_entity/documentation.adoc +++ b/entity/VisitPlanEntry_entity/documentation.adoc @@ -2,7 +2,8 @@ For storing Visitentries with their information(date, time, contact, and most importantly: it's Status). Linked to VisitPlanEmployeeWeek_entity so you only see the entries in the chosen week. -ORGANISATION_ID is used to store the company that's being visited, CONTACT_ID to Store the Point-of-Contact, +ORGANISATION_CONTACT_ID is used to store the company that's being visited, +CONTACT_ID to Store the Point-of-Contact, since you are normally visiting one specific person. Keep in mind, that only the organization is important for the visitRecommendations and not the Point of Contact. \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js index 03f6b8014252f4c2405882dda74d4955d797c27f..bf3542dc528bf679b61175ff20d1e2cec67e3e60 100644 --- a/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js @@ -3,7 +3,7 @@ import("system.result"); import("Contact_lib"); import("system.vars"); -var orgId = vars.get("$field.ORGANISATION_ID"); +var orgId = vars.get("$field.ORGANISATION_CONTACT_ID"); var contactId = vars.get("$field.CONTACT_ID"); var orgContactId = ContactUtils.getPersOrgIds(contactId)[2]; diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js index fe203ca7a71f6d00e5a41fc9b1d2447822c43177..0c443c043435687de4551ffd16df721652c159e0 100644 --- a/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js @@ -12,6 +12,6 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.v .from("CONTACT") .where("CONTACT.CONTACTID", contactId) .cell(); - neon.setFieldValue("$field.ORGANISATION_ID", orgId); + neon.setFieldValue("$field.ORGANISATION_CONTACT_ID", orgId); result.string(vars.get("$param.ContactId_param")); } \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js index 0af8e295e63255fb7540147e6904e87cc65eb4fa..5fdb3779fc2b8699a502c17353bbf34ff9a59bb1 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js @@ -17,7 +17,7 @@ var pointOfContact = newSelect("CONTACT.CONTACTID", db.getCurrentAlias()) .leftJoin("AB_ATTRIBUTE", "AB_ATTRIBUTE.AB_ATTRIBUTEID = AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID") .leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") .where("AB_ATTRIBUTE.AB_ATTRIBUTEID", $AttributeRegistry.visitPlanPointOfContact()) - .and("CONTACT.CONTACTID", vars.get("$field.ORGANISATION_ID")) + .and("CONTACT.CONTACTID", vars.get("$field.ORGANISATION_CONTACT_ID")) .cell(); var context; @@ -25,7 +25,7 @@ if(pointOfContact) links.push([ContactUtils.getContextByContactId(pointOfContact), pointOfContact]); else { - var contactId = vars.get("$field.ORGANISATION_ID"); + var contactId = vars.get("$field.ORGANISATION_CONTACT_ID"); context = ContactUtils.getContextByContactId(contactId); if(context == 'Person') { diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js index e9a7e5846d28fb6ffb8fcd6d7878ff3ea199d5f9..bb1a4df11bb2d14a9114c2844cc3ba14df5c79dd 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js @@ -28,7 +28,6 @@ var mailAffectedUser = []; var uidAppointment; var values; var columns; -var columnTypes; var update; var i; @@ -40,8 +39,8 @@ var entryDateAsLong = selectionRowData[0].ENTRYDATE; var entryDate = datetime.toDate(entryDateAsLong, "dd-MM-yyyy"); var startTime = selectionRowData[0].BEGIN_TIME; var endTime = selectionRowData[0].END_TIME; -var organisation_id = selectionRowData[0].ORGANISATION_ID; -var organisationName = OrganisationUtils.getNameByOrganisationId(organisation_id); +var organisationContact_id = selectionRowData[0].ORGANISATION_CONTACT_ID; +var organisationName = OrganisationUtils.getNameByContactId(organisationContact_id); var contact_id = selectionRowData[0].CONTACT_ID; var contactName = ContactUtils.getFullTitleByContactId(contact_id); var contactMail = CommUtil.getStandardSubSqlMail(contact_id) @@ -53,9 +52,9 @@ var department = contactData[0]; var contactRole = contactData[1]; var addressId = newSelect("CONTACT.ADDRESS_ID") .from("CONTACT") - .where("CONTACT.CONTACTID", organisation_id) + .where("CONTACT.CONTACTID", organisationContact_id) .cell(); -var organisationAddress = new AddrObject(organisation_id); +var organisationAddress = new AddrObject(organisationContact_id); var organisationAddressFormatted = organisationAddress.getFormattedAddress(false, "{salutation_name}\n {street} {buildingno}\n {country_short} - {zip} {city}"); var contactCommunication = newSelect("COMMUNICATION.MEDIUM_ID, COMMUNICATION.ADDR") .from("COMMUNICATION") @@ -99,27 +98,24 @@ columns = ["AB_APPOINTMENTLINK_ID", "APPOINTMENT_ID", "OBJECT_TYPE", "OBJECT_ROWID"] - -columnTypes = db.getColumnTypes("AB_APPOINTMENTLINK", columns, db.getCurrentAlias()); values = [util.getNewUUID(), uidAppointment[0], "Organisation", - organisation_id] -insert = db.insertData("AB_APPOINTMENTLINK", columns, columnTypes, values) + organisationContact_id] +insert = db.insertData("AB_APPOINTMENTLINK", columns, null, values) values = [util.getNewUUID(), uidAppointment[0], "Person", contact_id] -insert = db.insertData("AB_APPOINTMENTLINK", columns, columnTypes, values) +insert = db.insertData("AB_APPOINTMENTLINK", columns, null, values) values = [$KeywordRegistry.visitPlanEntryStatus$Appointmentarranged(), uidAppointment[0]]; columns = ["STATUS", "APPOINTMENT_ID"]; -columnTypes = db.getColumnTypes("VISITPLANENTRY", columns, db.getCurrentAlias()); update = newWhere("VISITPLANENTRY.VISITPLANENTRYID", uid) - .updateData(true, "VISITPLANENTRY", columns, columnTypes, values); + .updateData(true, "VISITPLANENTRY", columns, null, values); neon.setFieldValue("$field.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()); neon.refreshAll(); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js index b926fc89ff6515951fc64f5cec927a60f8434174..dc5b0f07067f9de2b8ea08deebdb04d1940ce157 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js @@ -59,7 +59,7 @@ if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) var childAddresses = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") .from("ADDRESS") .leftJoin("VISITPLANENTRY", "ADDRESS.ADDRESSID = (select ADDRESS_ID from CONTACT where CONTACT.CONTACTID \n\ - = VISITPLANENTRY.ORGANISATION_ID)") + = VISITPLANENTRY.ORGANISATION_CONTACT_ID)") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", entryid) .and("VISITPLANENTRY.ENTRYDATE", entrydateDB) .table(); diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js similarity index 74% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js index 4a069cec9dd05ddca04014ff4a5a534e07aff0fc..a5833c922a458e88908fd9b6a1f529d12ed6f498 100644 --- a/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js @@ -3,7 +3,7 @@ import("system.db"); import("system.vars"); import("Contact_lib"); -var contactid = vars.get("$field.ORGANISATION_ID"); +var contactid = vars.get("$field.ORGANISATION_CONTACT_ID"); var res = ContactUtils.getFullTitleByContactId(contactid); result.string(res); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js index ec94b86401b566ada90ac2bd3f2d2c43bf78c950..e6afefc86171adad8a87dcf4e7570253fa9faa66 100644 --- a/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js @@ -4,6 +4,6 @@ import("Sql_lib"); var contactIdArray = newSelect("CONTACT.CONTACTID") .from("CONTACT") - .where("CONTACT.ORGANISATION_ID", vars.get("$field.ORGANISATION_ID"), SqlBuilder.NOT_EQUAL()) + .where("CONTACT.ORGANISATION_ID", vars.get("$field.ORGANISATION_CONTACT_ID"), SqlBuilder.NOT_EQUAL()) .arrayColumn() result.object(contactIdArray) \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js index 9711f6208cf7dff928ac21b7b0a8cfc89f4b57e1..ce8bb62314fa0a0ae0023f81b31d95a3871bd812 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js @@ -16,7 +16,7 @@ var items = []; var group = []; var entryData = ""; -var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_ID, CONTACT_ID,STATUS, VISITPLANEMPLOYEEWEEK_ID, APPOINTMENT_ID") +var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_CONTACT_ID, CONTACT_ID,STATUS, VISITPLANEMPLOYEEWEEK_ID, APPOINTMENT_ID") .from("VISITPLANENTRY"); if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) @@ -46,11 +46,11 @@ if(entryData.length > 0) { for(var i = 0; i < entryData.length; i++) { - var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid; - [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid] = entryData[i] + var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisationContact_id, contact_id, status, visitplanemployeeweek_id, appointmentid; + [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisationContact_id, contact_id, status, visitplanemployeeweek_id, appointmentid] = entryData[i] var contactname = db.cell(PersUtils.getResolvingDisplaySubSql("'" + contact_id + "'")); - var orgname = OrganisationUtils.getNameByOrganisationId(organisation_id); + var orgname = OrganisationUtils.getNameByContactId(organisationContact_id); var parentName = translate.text(datetime.toDate(entryDateRaw, "EEEE")); entryDate = datetime.toDate(entryDateRaw, "dd.MM.yyyy"); @@ -58,7 +58,7 @@ if(entryData.length > 0) var alias = SqlUtils.getSystemAlias(); items.push([visitPlanEntryId, false, parentName + "#" + entryDate, "", beginn_time - , end_time, organisation_id, orgname, contact_id, contactname, entryDateRaw, status, visitplanemployeeweek_id, appointmentid, statusDisplay]); + , end_time, organisationContact_id, orgname, contact_id, contactname, entryDateRaw, status, visitplanemployeeweek_id, appointmentid, statusDisplay]); if(!vars.get("$local.idvalues")) { diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js index c0f1048f2920e1035145fc0c8ac1dfb49f915cc3..513409e05735c092c8170ae3dc7184dc1c7e0933 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js @@ -42,10 +42,8 @@ else "VISITPLAN_YEAR", "CONTACT_ID", ]; - - var columnTypesWeek = db.getColumnTypes("VISITPLANEMPLOYEEWEEK", columnsWeek, db.getCurrentAlias()); - insertData.push(["VISITPLANEMPLOYEEWEEK", columnsWeek, columnTypesWeek, valuesWeek]); + insertData.push(["VISITPLANEMPLOYEEWEEK", columnsWeek, null, valuesWeek]); visitPlanEmployeeWeekID = newWeekId; } @@ -58,7 +56,7 @@ var valuesEntry = [ rowData["ENTRYDATE.value"], rowData["BEGIN_TIME.value"], rowData["END_TIME.value"], - rowData["ORGANISATION_ID.value"], + rowData["ORGANISATION_CONTACT_ID.value"], rowData["CONTACT_ID.value"], visitPlanEmployeeWeekID, rowData["STATUS.value"] @@ -69,15 +67,12 @@ var columnsEntry = [ "ENTRYDATE", "BEGIN_TIME", "END_TIME", - "ORGANISATION_ID", + "ORGANISATION_CONTACT_ID", "CONTACT_ID", "VISITPLANEMPLOYEEWEEK_ID", "STATUS" ]; - -var columnTypesEntry = db.getColumnTypes("VISITPLANENTRY", columnsEntry, db.getCurrentAlias()); - -insertData.push(["VISITPLANENTRY", columnsEntry, columnTypesEntry, valuesEntry]) +insertData.push(["VISITPLANENTRY", columnsEntry, null, valuesEntry]) db.inserts(insertData); diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js index 412b3644103fb32f8c640a802d03e2c8ef5782da..c22eeca42034c0676686e931650daeb0b22b5bb1 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js @@ -10,7 +10,7 @@ var values = [ rowData["ENTRYDATE.value"], rowData["BEGIN_TIME.value"], rowData["END_TIME.value"], - rowData["ORGANISATION_ID.value"], + rowData["ORGANISATION_CONTACT_ID.value"], rowData["STATUS"] ]; @@ -18,12 +18,10 @@ var columns = [ "ENTRYDATE", "BEGIN_TIME", "END_TIME", - "ORGANISATION_ID", + "ORGANISATION_CONTACT_ID", "STATUS" ]; -var columnTypes = db.getColumnTypes("VISITPLANENTRY", columns, db.getCurrentAlias()); - var cond = newWhere("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$field.UID")).toString(); -db.updateData("VISITPLANENTRY", columns, columnTypes, values, cond); +db.updateData("VISITPLANENTRY", columns, null, values, cond); diff --git a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js index 26a88f95717ce53ce1723ca71443089d0e3a1540..4ec4a7d08e7f192053d1446f0a3ed507f8bde9ae 100644 --- a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js @@ -47,12 +47,12 @@ if(idValues == false) "visitPlanFrequency.ID_VALUE", "'VISITFREQUENCY '", activitySubQuery, "CONTACTID", newSelect("min(ENTRYDATE)") .from("VISITPLANENTRY") - .where("CONTACT.CONTACTID", "VISITPLANENTRY.ORGANISATION_ID") + .where("CONTACT.CONTACTID", "VISITPLANENTRY.ORGANISATION_CONTACT_ID") .and(newWhere("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged())) .and("VISITPLANENTRY.ENTRYDATE", newSelect("min(vp.ENTRYDATE)") .from("VISITPLANENTRY", "vp") - .where(["VISITPLANENTRY", "ORGANISATION_ID", "vp"], "visitplanentry.ORGANISATION_ID") + .where(["VISITPLANENTRY", "ORGANISATION_CONTACT_ID", "vp"], "visitplanentry.ORGANISATION_CONTACT_ID") .and(["VISITPLANENTRY", "ENTRYDATE", "vp"], datetime.today()) .and(newWhere(["VISITPLANENTRY", "STATUS", "vp"], $KeywordRegistry.visitPlanEntryStatus$planned()) @@ -80,7 +80,7 @@ var recommendationSQLData = newSelect(["VISITRECOMMENDATIONID", "VISITRECOMMENDA newSelect("min(ENTRYDATE)") .from("VISITPLANENTRY") - .where("VISITPLANENTRY.ORGANISATION_ID", "VISITRECOMMENDATION.CONTACT_ID") + .where("VISITPLANENTRY.ORGANISATION_CONTACT_ID = VISITRECOMMENDATION.CONTACT_ID") .and("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()) .and("VISITPLANENTRY.entrydate", datetime.today(), SqlBuilder.GREATER()) @@ -89,7 +89,7 @@ var recommendationSQLData = newSelect(["VISITRECOMMENDATIONID", "VISITRECOMMENDA newSelect("VISITRECOMMENDATION.CONTACT_ID") .from("VISITPLANEMPLOYEEWEEK, VISITPLANENTRY") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", "VISITPLANEMPLOYEEWEEKID") - .and("VISITRECOMMENDATION.CONTACT_ID", "VISITPLANENTRY.ORGANISATION_ID") + .and("VISITRECOMMENDATION.CONTACT_ID = VISITPLANENTRY.ORGANISATION_CONTACT_ID") .and(newWhere("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged())) .and("VISITPLANENTRY.entrydate", newSelect("min(vp.entrydate)") diff --git a/entity/VisitRecommendation_entity/recordcontainers/jdito/onInsert.js b/entity/VisitRecommendation_entity/recordcontainers/jdito/onInsert.js index f362c1d033e797fd7ea14b2d7e1ea613f7661752..1da186c5ef681fd19c07d840b01e23304d33dba9 100644 --- a/entity/VisitRecommendation_entity/recordcontainers/jdito/onInsert.js +++ b/entity/VisitRecommendation_entity/recordcontainers/jdito/onInsert.js @@ -24,6 +24,4 @@ var columns = [ "INFO" ]; -var columnTypes = db.getColumnTypes("VISITRECOMMENDATION", columns, db.getCurrentAlias()); - -db.insertData("VISITRECOMMENDATION", columns, columnTypes, values); \ No newline at end of file +db.insertData("VISITRECOMMENDATION", columns, null, values); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod index 8af4e2662c3bff047edbda513cd485ad41cc2295..4bfb7356f1f86c2afd0227d9931f1b4563acffe2 100644 --- a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod +++ b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod @@ -7,7 +7,7 @@ <grantCreateProcess>%aditoprj%/entity/WorkflowDefinition_entity/grantCreateProcess.js</grantCreateProcess> <grantDelete v="false" /> <contentTitleProcess>%aditoprj%/entity/WorkflowDefinition_entity/contentTitleProcess.js</contentTitleProcess> - <afterUiInit>%aditoprj%/entity/WorkflowDefinition_entity/afterUiInit.js</afterUiInit> + <useFavorites v="true" /> <iconId>VAADIN:DROP</iconId> <titlePlural>Workflow definitions</titlePlural> <recordContainer>jdito</recordContainer> @@ -35,6 +35,7 @@ <name>openModeler</name> <title>Open modeler</title> <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> <iconId>VAADIN:EXTERNAL_LINK</iconId> <stateProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/stateProcess.js</stateProcess> </entityActionField> @@ -42,6 +43,7 @@ <name>createModel</name> <title>Create model</title> <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/tableactions/children/createmodel/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> <iconId>NEON:PLUS</iconId> </entityActionField> </children> @@ -49,11 +51,14 @@ <entityField> <name>CATEGORY</name> <title>Category</title> + <consumer>CategoryKeyword</consumer> + <groupable v="true" /> </entityField> <entityField> <name>ISACTIVE</name> <title>Active</title> <contentType>BOOLEAN</contentType> + <groupable v="true" /> <dropDownProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/isactive/dropDownProcess.js</dropDownProcess> <stateProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/isactive/stateProcess.js</stateProcess> </entityField> @@ -218,6 +223,20 @@ <name>WORKFLOWDEFINITION_OBJECTTYPE</name> <valueProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/workflowdefinition_objecttype/valueProcess.js</valueProcess> </entityField> + <entityConsumer> + <name>CategoryKeyword</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/categorykeyword/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> @@ -228,6 +247,7 @@ <contentProcess>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js</contentProcess> <onInsert>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js</onInsert> <onUpdate>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js</onUpdate> + <onDelete>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/onDelete.js</onDelete> <recordFieldMappings> <jDitoRecordFieldMapping> <name>UID.value</name> @@ -242,6 +262,9 @@ <isFilterable v="true" /> <isLookupFilter v="true" /> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>CATEGORY.displayValue</name> + </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>KEY.value</name> <isFilterable v="true" /> diff --git a/entity/WorkflowDefinition_entity/afterUiInit.js b/entity/WorkflowDefinition_entity/afterUiInit.js deleted file mode 100644 index 7199fd35b05e991cb7f35e577f1a7e593a28c60e..0000000000000000000000000000000000000000 --- a/entity/WorkflowDefinition_entity/afterUiInit.js +++ /dev/null @@ -1,20 +0,0 @@ -import("system.neon"); -import("system.vars"); -import("system.translate"); - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW && vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET) -{ - var filterOnlyUnfinished = { - type : "group", - operator : "AND", - childs : [{ - type : "row", - name : "ISFINISHED", - operator : "EQUAL", - value : translate.text("No"), - key : "false", - contenttype : "BOOLEAN" - }] - }; - neon.setFilter("Instances", JSON.stringify(filterOnlyUnfinished)); -} \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/categorykeyword/children/containername_param/valueProcess.js b/entity/WorkflowDefinition_entity/entityfields/categorykeyword/children/containername_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d79eb290d58d4f19fbd534e91b252388749224ce --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/categorykeyword/children/containername_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("KeywordRegistry_basic"); + +result.string($KeywordRegistry.workflowCategory()); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js index aff0261cf5187f58d2b66bafd7d223034036e2a4..bec4b9a0b8c4954217e7d33ed77af5640f95311f 100644 --- a/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js @@ -5,6 +5,7 @@ import("system.result"); import("Workflow_lib"); import("system.workflow"); import("JditoFilter_lib"); +import("KeywordData_lib"); //immediately invoked function is used so that a return statement can be utilized to end the function at any point result.object((function () @@ -16,7 +17,9 @@ result.object((function () var excludeVersion = vars.get("$param.CurrentVersion_param"); var context = vars.get("$param.Context_param"); var idvalues = vars.get("$local.idvalues"); - + + var categoryMap = KeywordData.getKeyIdMap($KeywordRegistry.workflowCategory()); + var workflowDefs; if (idvalues) @@ -48,6 +51,7 @@ result.object((function () def.id, def.name, def.category, + categoryMap[def.category] || "", def.key, def.version, def.active, @@ -73,14 +77,14 @@ result.object((function () { filterFn = function (currDef) { - return newestVersions[currDef[3]] == currDef[4] && (possibleKeysMap ? possibleKeysMap[currDef[3]] : true); + return newestVersions[currDef[4]] == currDef[5] && (possibleKeysMap ? possibleKeysMap[currDef[4]] : true); }; } else { filterFn = function (currDef) { - return excludeVersion != currDef[4]; + return excludeVersion != currDef[5]; }; } diff --git a/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js b/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js index 2afd61402ee0fab203bf051660b1c227da1cdfdd..3dcde8317a8ad1ae4767f4e51f12535bb29d9656 100644 --- a/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js @@ -4,11 +4,14 @@ import("system.workflow"); import("Document_lib"); var rowdata = vars.get("$local.rowdata"); +var changedFields = vars.get("$local.changed"); -if (vars.get("$local.changed").indexOf("ISACTIVE.value") !== -1) +if (changedFields.includes("ISACTIVE.value")) workflow.setProcessActive(rowdata["UID.value"], rowdata["ISACTIVE.value"] == "true"); - +if (changedFields.includes("CATEGORY.value")) + workflow.setProcessDefinitionCategory(rowdata["UID.value"], rowdata["CATEGORY.value"]); + var upload = new FileUpload(vars.get("$field.FILEUPLOAD")); if (upload.isFilled()) { diff --git a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod index 37c5a337ba3fef1c5b2d8e9c3574bbea5404ef21..765793b9f379e0c813bca3b508491cf0dcba0421 100644 --- a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod +++ b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod @@ -5,6 +5,7 @@ <documentation>%aditoprj%/entity/WorkflowInstance_entity/documentation.adoc</documentation> <title>Workflow instance</title> <contentTitleProcess>%aditoprj%/entity/WorkflowInstance_entity/contentTitleProcess.js</contentTitleProcess> + <initFilterProcess>%aditoprj%/entity/WorkflowInstance_entity/initFilterProcess.js</initFilterProcess> <titlePlural>Workflow instances</titlePlural> <recordContainer>jdito</recordContainer> <entityFields> diff --git a/entity/WorkflowInstance_entity/initFilterProcess.js b/entity/WorkflowInstance_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..80a38560e27c2236fec97c140cbce55462a7c809 --- /dev/null +++ b/entity/WorkflowInstance_entity/initFilterProcess.js @@ -0,0 +1,17 @@ +import("system.result"); +import("system.translate"); + +var filterOnlyUnfinished = { + type : "group", + operator : "AND", + childs : [{ + type : "row", + name : "ISFINISHED", + operator : "EQUAL", + value : translate.text("No"), + key : "false", + contenttype : "BOOLEAN" + }] +}; + +result.string(JSON.stringify(filterOnlyUnfinished)); \ No newline at end of file diff --git a/entity/WorkflowTask_entity/WorkflowTask_entity.aod b/entity/WorkflowTask_entity/WorkflowTask_entity.aod index f5bcf9949894d5335e68613b990e62b9066e0208..3ffbe846c77cc3e4d64c7ed734ff2399dc30450a 100644 --- a/entity/WorkflowTask_entity/WorkflowTask_entity.aod +++ b/entity/WorkflowTask_entity/WorkflowTask_entity.aod @@ -27,6 +27,7 @@ </entityField> <entityField> <name>FORMDEFINITION</name> + <valueProcess>%aditoprj%/entity/WorkflowTask_entity/entityfields/formdefinition/valueProcess.js</valueProcess> </entityField> <entityField> <name>FORMRESULT</name> @@ -257,9 +258,6 @@ <isFilterable v="true" /> <isLookupFilter v="true" /> </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>FORMDEFINITION.value</name> - </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>FORMRESULT.value</name> </jDitoRecordFieldMapping> diff --git a/entity/WorkflowTask_entity/entityfields/formdefinition/valueProcess.js b/entity/WorkflowTask_entity/entityfields/formdefinition/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc3f05f70c0f41c45cc8b15489f265bfd8695d4 --- /dev/null +++ b/entity/WorkflowTask_entity/entityfields/formdefinition/valueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.vars"); +import("system.workflow"); +import("system.neon"); + +//the value of this field can be set by the onValueChange process of FORMRESULT + +if (vars.get("$this.value") == null) + result.string(workflow.getFormProperties(vars.get("$field.UID"))); \ No newline at end of file diff --git a/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js index de6e83f10c3755c6281daacaedff352aeb93ba55..ed15981f641e6ef0941c2d5298ba177b24c8a080 100644 --- a/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js @@ -96,7 +96,6 @@ result.object((function () task.processDefinitionId, task.processInstanceId, Date.parse(task.createTime).toString(), - workflow.getFormProperties(task.id) || "", "", variables.USER_ID || "", task.description || "", diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index f32d5f97f0963a35286bac0842e7f823d580201a..d339195f21f074660303e10b1a80ce278c3bb123 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -6833,6 +6833,48 @@ <entry> <key>send mail</key> </entry> + <entry> + <key>and open modeler</key> + </entry> + <entry> + <key>Create model</key> + </entry> + <entry> + <key>Edit workflow</key> + </entry> + <entry> + <key>Receive new Department Permission</key> + </entry> + <entry> + <key>Receive new User Permission</key> + </entry> + <entry> + <key>workflow notification</key> + </entry> + <entry> + <key>Permission received</key> + </entry> + <entry> + <key>leadimport notification</key> + </entry> + <entry> + <key>granted permission</key> + </entry> + <entry> + <key>bulk mail sent</key> + </entry> + <entry> + <key>download ready</key> + </entry> + <entry> + <key>Total in euros</key> + </entry> + <entry> + <key>Workflow Model</key> + </entry> + <entry> + <key>The Sales Project can only be filled when a company has been specified</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 7d8ec08a7b60354c748b9a25bfb6c35dd7a7c297..a132152c5028d6e84f533b84d53bb64e431762fa 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -5062,7 +5062,7 @@ </entry> <entry> <key>Read</key> - <value>gelesen</value> + <value>Gelesen</value> </entry> <entry> <key>Permission Set ID</key> @@ -6737,7 +6737,7 @@ </entry> <entry> <key>archive</key> - <value>archivieren</value> + <value>Archivieren</value> </entry> <entry> <key>Bangladesh</key> @@ -8187,7 +8187,6 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Send email</key> - <value>E-Mail losschicken</value> </entry> <entry> <key>Activites</key> @@ -8265,6 +8264,10 @@ Bitte Datumseingabe prüfen</value> <key>Contactreport</key> <value>Kontaktbericht</value> </entry> + <entry> + <key>The Sales Project can only be filled when a company has been specified</key> + <value>Das Vertriebsprojekt kann nur ausgefüllt werden, wenn eine Firma angegeben ist</value> + </entry> <entry> <key>Appointment planned</key> <value>Termin vereinbart</value> @@ -8734,41 +8737,76 @@ Bitte Datumseingabe prüfen</value> <key>Valid from (as </key> <value>gültig ab (in </value> </entry> + <entry> + <key>workflow notification</key> + <value>Workflow Benachrichtigung</value> + </entry> + <entry> + <key>leadimport notification</key> + <value>Leadimport Benachrichtigung</value> + </entry> + <entry> + <key>bulk mail sent</key> + <value>Serienmail versendet</value> + </entry> + <entry> + <key>download ready</key> + <value>Download bereit</value> + </entry> <entry> <key>No new recipients found that can be added to the bulk mail.</key> <value>Keine neuen Empfänger, die zur Serienmail hinzugefügt werden können, gefunden.</value> </entry> <entry> - <key>Add Recipients</key> - <value>Empfänger hinzufügen</value> + <key>Permission received</key> + <value>erhaltene Berechtigung</value> </entry> <entry> - <key>Add Participants</key> - <value>Teilnehmer hinzufügen</value> + <key>leadimport notification</key> </entry> <entry> - <key>Download letter and create Activity</key> - <value>Brief herunterladen und Aktivität erstellen</value> + <key>granted permission</key> + <value>vergebene Berechtigung</value> </entry> <entry> - <key>and open Report</key> - <value>und Report öffnen</value> + <key>bulk mail sent</key> </entry> <entry> - <key>export</key> + <key>download ready</key> </entry> <entry> - <key>export using the selected template</key> - <value>Mit der ausgewählten Vorlage Exportieren</value> + <key>Receive new Department Permission</key> + <value>Neue Abteilungs-Berechtigung erhalten</value> + </entry> + <entry> + <key>Receive new User Permission</key> + <value>Neue Benutzer-Berechtigung erhalten</value> + </entry> + <entry> + <key>export</key> </entry> <entry> <key>No new recipients found that can be added to the serial letter.</key> <value>Keine neuen Empfänger, die zum Serienbrief werden können, gefunden.</value> </entry> + <entry> + <key>No new recipients found that can be added to the bulk mail.</key> + <value>Keine neuen Empfänger, die zur Serienmail hinzugefügt werden können, gefunden.</value> + </entry> + <entry> + <key>export using the selected template</key> + <value>Mit der ausgewählten Vorlage Exportieren</value> + </entry> <entry> <key>send mail</key> <value>E-Mail losschicken</value> </entry> + <entry> + <key>Total in euros</key> + </entry> + <entry> + <key>Workflow Model</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 40c367a50dbcf0c18340e45272f77ed124779931..dd32b2a7b3caf16d762271d43e41d228628bf79d 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -6899,6 +6899,48 @@ <entry> <key>send mail</key> </entry> + <entry> + <key>Receive new Department Permission</key> + </entry> + <entry> + <key>Receive new User Permission</key> + </entry> + <entry> + <key>and open modeler</key> + </entry> + <entry> + <key>Create model</key> + </entry> + <entry> + <key>Edit workflow</key> + </entry> + <entry> + <key>workflow notification</key> + </entry> + <entry> + <key>Permission received</key> + </entry> + <entry> + <key>leadimport notification</key> + </entry> + <entry> + <key>granted permission</key> + </entry> + <entry> + <key>bulk mail sent</key> + </entry> + <entry> + <key>download ready</key> + </entry> + <entry> + <key>Total in euros</key> + </entry> + <entry> + <key>Workflow Model</key> + </entry> + <entry> + <key>The Sales Project can only be filled when a company has been specified</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/CampaignStep/CampaignStep.aod b/neonContext/CampaignStep/CampaignStep.aod index 99969c1dc8f63c8de66e18866f2b7eae6560f02e..6e9810b632fff5969a2b21be2d6dc11816966bb8 100644 --- a/neonContext/CampaignStep/CampaignStep.aod +++ b/neonContext/CampaignStep/CampaignStep.aod @@ -45,9 +45,5 @@ <name>99367402-93e6-49d4-b60c-143b6e71df00</name> <view>CampaignStepsGantt_view</view> </neonViewReference> - <neonViewReference> - <name>f146ea29-77d2-4141-b04a-36c29594e670</name> - <view>CampaignStepMembers_view</view> - </neonViewReference> </references> </neonContext> diff --git a/neonContext/Product/Product.aod b/neonContext/Product/Product.aod index 455bfd342154a96988ccb39462c28d9f9ddee768..7d36aaa10f0f067db17fc1a209b7905efb611917 100644 --- a/neonContext/Product/Product.aod +++ b/neonContext/Product/Product.aod @@ -8,7 +8,7 @@ <filterView>ProductFilter_view</filterView> <editView>ProductEdit_view</editView> <previewView>ProductPreview_view</previewView> - <lookupView>ProductFilter_view</lookupView> + <lookupView>ProductLookup_view</lookupView> <entity>Product_entity</entity> <references> <neonViewReference> @@ -27,5 +27,9 @@ <name>5580ead4-2257-4cdb-a3ac-5e7067c4c1ab</name> <view>ProductPreview_view</view> </neonViewReference> + <neonViewReference> + <name>ec872778-87d1-4070-a3da-3808da326119</name> + <view>ProductLookup_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/ActivityFilter_view/ActivityFilter_view.aod b/neonView/ActivityFilter_view/ActivityFilter_view.aod index 09f94a720facdac4607c2410d50b3fe9ddcaf64f..0d59f1b7b3c98f9bf630fee21e641c2801b5022b 100644 --- a/neonView/ActivityFilter_view/ActivityFilter_view.aod +++ b/neonView/ActivityFilter_view/ActivityFilter_view.aod @@ -116,5 +116,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>fce2e978-e34d-4c6d-84f0-94d698ae793e</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod index 23c9de063b24cd94a46c4d2e998832ff9c752798..727a644d89918b72ba8e573978d45cf9f7118157 100644 --- a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod +++ b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod @@ -27,6 +27,7 @@ <organizerField>ORGANIZER</organizerField> <ownerField>OWNER</ownerField> <categoriesField>CATEGORIES</categoriesField> + <recurrenceIdField>RECURRENCEID</recurrenceIdField> <favoriteActionGroup1>PartStatActionGroup</favoriteActionGroup1> <favoriteActionGroup2>seriesActionGroup</favoriteActionGroup2> <entityField>#ENTITY</entityField> diff --git a/neonView/CampaignFilter_view/CampaignFilter_view.aod b/neonView/CampaignFilter_view/CampaignFilter_view.aod index a30c1ab9f1f355ef861347d260fd2e120700499d..0dcb198305db9a4021ace200c99df40b0018904d 100644 --- a/neonView/CampaignFilter_view/CampaignFilter_view.aod +++ b/neonView/CampaignFilter_view/CampaignFilter_view.aod @@ -128,5 +128,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>945f1bdd-ae16-4f02-b3ec-d7bdd331adf0</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod index 7d4a4e5d2a84ef5c9f155fc6f2d4b9bd223fc1e8..3dde5d4e26421ec75dbe34bc35a40fdb4fd0d3f2 100644 --- a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod +++ b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod @@ -4,7 +4,7 @@ <title></title> <description></description> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="false" /> + <filterable v="true" /> <layout> <groupLayout> <name>layout</name> @@ -15,8 +15,8 @@ <name>ParticipantsTable</name> <favoriteActionGroup1>FilterViewActionGroup</favoriteActionGroup1> <entityField>#ENTITY</entityField> - <isCreatable v="false" /> - <isEditable v="false" /> + <isCreatable v="true" /> + <isEditable v="true" /> <columns> <neonTableColumn> <name>1bd3a82e-89c1-4b3b-809b-b9bac7f78e58</name> diff --git a/neonView/CampaignStepMembers_view/CampaignStepMembers_view.aod b/neonView/CampaignStepMembers_view/CampaignStepMembers_view.aod deleted file mode 100644 index f66c1629d8103d1a135369cb9f519652a2750500..0000000000000000000000000000000000000000 --- a/neonView/CampaignStepMembers_view/CampaignStepMembers_view.aod +++ /dev/null @@ -1,5 +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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> - <name>CampaignStepMembers_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> -</neonView> diff --git a/neonView/ContractFilter_view/ContractFilter_view.aod b/neonView/ContractFilter_view/ContractFilter_view.aod index f92d2bd17a33c1a20b623fd4e43c14114962124e..b43c2f7fa56d7f2d30204d9369376914532022b8 100644 --- a/neonView/ContractFilter_view/ContractFilter_view.aod +++ b/neonView/ContractFilter_view/ContractFilter_view.aod @@ -116,5 +116,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>5c0ec615-90ec-460b-b63f-bd4939ac3e09</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/NotificationFilter_view/NotificationFilter_view.aod b/neonView/NotificationFilter_view/NotificationFilter_view.aod index cc12313a6470ee4aa7d9a2a6ac1a905f942ab28f..ad8f7064c22fdcd7b6a025dda196786f126ed985 100644 --- a/neonView/NotificationFilter_view/NotificationFilter_view.aod +++ b/neonView/NotificationFilter_view/NotificationFilter_view.aod @@ -28,11 +28,13 @@ <children> <timelineViewTemplate> <name>NotificationTimeline</name> - <dateField>CREATEDATE</dateField> + <favoriteActionGroup1>setNotificationState</favoriteActionGroup1> + <dateField>CREATIONDATE</dateField> <titleField>CAPTION</titleField> <descriptionField>DESCRIPTION</descriptionField> <iconIdField>ICON</iconIdField> <entityField>#ENTITY</entityField> + <isEditable v="false" /> </timelineViewTemplate> <tableViewTemplate> <name>NotificationTable</name> @@ -71,7 +73,9 @@ </tableViewTemplate> <treeTableViewTemplate> <name>NotificationTreeTable</name> + <favoriteActionGroup1>setNotificationState</favoriteActionGroup1> <entityField>#ENTITY</entityField> + <isEditable v="false" /> <columns> <neonTreeTableColumn> <name>c8799a54-569a-4667-9bdd-aa11a2f6e21e</name> diff --git a/neonView/OfferFilter_view/OfferFilter_view.aod b/neonView/OfferFilter_view/OfferFilter_view.aod index 28fb45b5ae0dc0f8a90f1205e21d0d28f7c25652..0a1ab5740c5a8ae675bc91f798159175c3fdee75 100644 --- a/neonView/OfferFilter_view/OfferFilter_view.aod +++ b/neonView/OfferFilter_view/OfferFilter_view.aod @@ -136,5 +136,31 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChartCount</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>4bbc9650-47fd-4a59-8e1e-bb60ceb85795</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChartSum</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Total in euros</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>e5d14506-5205-43d0-89cb-416bf6debd25</name> + <entityField>NET</entityField> + <aggregateEntityField>NET_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/OrderFilter_view/OrderFilter_view.aod b/neonView/OrderFilter_view/OrderFilter_view.aod index 6c1a61083eee585b71fe7f577ebac63b47d25263..8986ad83d38ead3ea35912d1be6ddfa5f3068bbc 100644 --- a/neonView/OrderFilter_view/OrderFilter_view.aod +++ b/neonView/OrderFilter_view/OrderFilter_view.aod @@ -120,5 +120,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>b4aa7cf1-5e25-4042-9430-b54a22dd83cf</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/OrderitemFilter_view/OrderitemFilter_view.aod b/neonView/OrderitemFilter_view/OrderitemFilter_view.aod index e6eaeeb9f9ee7a2ca057202848bb3b97657f9382..5879614ec37bdf2d2ec54e12e0dbf57a17d05042 100644 --- a/neonView/OrderitemFilter_view/OrderitemFilter_view.aod +++ b/neonView/OrderitemFilter_view/OrderitemFilter_view.aod @@ -11,7 +11,7 @@ <children> <tableViewTemplate> <name>Orderitems</name> - <inlineEdit v="true" /> + <inlineEdit v="false" /> <entityField>#ENTITY</entityField> <autoNewRow v="true" /> <columns> diff --git a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod index 960c454e103af41d7e9cf5740ae51aec1b1047f5..1cc87b9732a33851587d07a0ca3950c4d1c8d8c1 100644 --- a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod +++ b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod @@ -134,5 +134,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>52be5c1a-4e19-4f03-862b-a9d68e15778f</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/PermissionCalendarFilterDrawer_view/PermissionCalendarFilterDrawer_view.aod b/neonView/PermissionCalendarFilterDrawer_view/PermissionCalendarFilterDrawer_view.aod index 32b319f4445dd4838b972b11db7c6193c7833b35..bea5b5d3b4c83c14236e3e3ee1164389370c87fd 100644 --- a/neonView/PermissionCalendarFilterDrawer_view/PermissionCalendarFilterDrawer_view.aod +++ b/neonView/PermissionCalendarFilterDrawer_view/PermissionCalendarFilterDrawer_view.aod @@ -5,7 +5,7 @@ <layout> <drawerLayout> <name>layout</name> - <layoutCaption>of other on this employee's calendar</layoutCaption> + <layoutCaption>Permission received</layoutCaption> <fixedDrawer v="true" /> </drawerLayout> </layout> diff --git a/neonView/PermissionCalendarFilterReverse_view/PermissionCalendarFilterReverse_view.aod b/neonView/PermissionCalendarFilterReverse_view/PermissionCalendarFilterReverse_view.aod index df480a219c345fe0847a2ebdf5c5f62479108e60..ae077ac28d6a0d93a8073361d0467f7abc3a6478 100644 --- a/neonView/PermissionCalendarFilterReverse_view/PermissionCalendarFilterReverse_view.aod +++ b/neonView/PermissionCalendarFilterReverse_view/PermissionCalendarFilterReverse_view.aod @@ -7,12 +7,14 @@ <layout> <drawerLayout> <name>layout</name> - <layoutCaption>of this employee on the calendar of others</layoutCaption> + <layoutCaption>granted permission</layoutCaption> + <fixedDrawer v="true" /> </drawerLayout> </layout> <children> <tableViewTemplate> <name>PermissionCalendarFilterReverseTable</name> + <favoriteActionGroup1>AddReverseAction</favoriteActionGroup1> <entityField>#ENTITY</entityField> <isCreatable v="false" /> <isDeletable v="false" /> diff --git a/neonView/PersonFilter_view/PersonFilter_view.aod b/neonView/PersonFilter_view/PersonFilter_view.aod index 3de6433f11f0721a7a9d21644f7201c33dd0c364..8eaea8f8294ba09c4a94f70dc4b0930a20357b0c 100644 --- a/neonView/PersonFilter_view/PersonFilter_view.aod +++ b/neonView/PersonFilter_view/PersonFilter_view.aod @@ -148,5 +148,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>79379ca4-70f2-40c9-8af2-05cbe26e8916</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/ProductFilter_view/ProductFilter_view.aod b/neonView/ProductFilter_view/ProductFilter_view.aod index 3f86ddd7ed38a5909124edfb0004546921b8305e..87133854a0bf04645764e64768e6037d069b48b9 100644 --- a/neonView/ProductFilter_view/ProductFilter_view.aod +++ b/neonView/ProductFilter_view/ProductFilter_view.aod @@ -117,5 +117,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>8e435e30-bd06-4172-81ea-4cd40cb835f2</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/ProductLookup_view/ProductLookup_view.aod b/neonView/ProductLookup_view/ProductLookup_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..e038ed3765c689f36212619cc246abf2196bd6f9 --- /dev/null +++ b/neonView/ProductLookup_view/ProductLookup_view.aod @@ -0,0 +1,52 @@ +<?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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> + <name>ProductLookup_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/neonView/ProductLookup_view/documentation.adoc</documentation> + <layout> + <noneLayout> + <name>layout</name> + </noneLayout> + </layout> + <children> + <tableViewTemplate> + <name>table</name> + <titleField>PRODUCTNAME</titleField> + <subtitleField>PRODUCTCODE</subtitleField> + <entityField>#ENTITY</entityField> + <linkedColumns> + <element>PRODUCTNAME</element> + </linkedColumns> + <columns> + <neonTableColumn> + <name>6d4cafea-bc73-4df1-949e-1aba224780ed</name> + <entityField>#IMAGE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>ef5fa8f0-7a72-4201-ad2e-44496490d2b2</name> + <entityField>PRODUCTCODE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>35834ce8-cd8b-452f-b558-484d2a3a8f02</name> + <entityField>PRODUCTNAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>f125dbe5-3f46-46dc-b037-4765b115997f</name> + <entityField>GROUPCODEID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>40b14795-afcb-4ae5-b5df-cd667a5b8219</name> + <entityField>STATUS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>86fce471-6d2e-4066-9bdb-2ed04f940f7d</name> + <entityField>CONTACT_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>2a2e74e4-dc45-4133-92d6-f2797fc3dcd7</name> + <entityField>UNIT</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/ProductLookup_view/documentation.adoc b/neonView/ProductLookup_view/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..38d4dc8ee1b0f1fd3d772287075d7adb212b09df --- /dev/null +++ b/neonView/ProductLookup_view/documentation.adoc @@ -0,0 +1,3 @@ +== ProductLookup_view + +Needed, because using the normal filterview as the lookup would result in the tileTemplate being used as the lookup. \ No newline at end of file diff --git a/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod b/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod index 920128f5ff6cb8f4bb2f8378f524c6b4528e3240..6bfac93548e2b901c3d7952818fa6d21bb0c987a 100644 --- a/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod +++ b/neonView/SalesprojectFilter_view/SalesprojectFilter_view.aod @@ -136,5 +136,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>170e3be6-41e5-4e75-b772-a97312e83268</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/SupportTicketFilter_view/SupportTicketFilter_view.aod b/neonView/SupportTicketFilter_view/SupportTicketFilter_view.aod index ed3af83d74e6237cd4298704707bde0e2f485502..f233e247a8ea243775ec164648f5d61952f791fd 100644 --- a/neonView/SupportTicketFilter_view/SupportTicketFilter_view.aod +++ b/neonView/SupportTicketFilter_view/SupportTicketFilter_view.aod @@ -139,5 +139,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>43e0d3fc-2556-4da9-985f-f46919755ebf</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/TaskFilter_view/TaskFilter_view.aod b/neonView/TaskFilter_view/TaskFilter_view.aod index 83268457a49e851f0329c787d3b4e498adb9a620..e42baf0ab3dbc846a09889295e65fd2bf9e2df07 100644 --- a/neonView/TaskFilter_view/TaskFilter_view.aod +++ b/neonView/TaskFilter_view/TaskFilter_view.aod @@ -135,5 +135,18 @@ </neonTreeTableColumn> </columns> </treeTableViewTemplate> + <dynamicMultiDataChartViewTemplate> + <name>DynamicMultiDataChart</name> + <chartType>COLUMN</chartType> + <yAxisLabel>Count</yAxisLabel> + <entityField>#ENTITY</entityField> + <columns> + <neonDynamicMultiDataChartColumn> + <name>aad9359c-9d5c-480e-9671-68933a08d615</name> + <entityField>COUNT</entityField> + <aggregateEntityField>COUNT_aggregate</aggregateEntityField> + </neonDynamicMultiDataChartColumn> + </columns> + </dynamicMultiDataChartViewTemplate> </children> </neonView> diff --git a/neonView/WorkflowDefinitionFilter_view/WorkflowDefinitionFilter_view.aod b/neonView/WorkflowDefinitionFilter_view/WorkflowDefinitionFilter_view.aod index a4e33a131b80ffae09321355f1d9a5f6e4d9f621..41ffef96290756599469bfd2da5878612c27a6d2 100644 --- a/neonView/WorkflowDefinitionFilter_view/WorkflowDefinitionFilter_view.aod +++ b/neonView/WorkflowDefinitionFilter_view/WorkflowDefinitionFilter_view.aod @@ -9,32 +9,6 @@ </groupLayout> </layout> <children> - <tableViewTemplate> - <name>Table</name> - <favoriteActionGroup1>tableActions</favoriteActionGroup1> - <entityField>#ENTITY</entityField> - <linkedColumns> - <element>NAME</element> - </linkedColumns> - <columns> - <neonTableColumn> - <name>6a40b78d-422e-4b3f-9d94-c330cf51996d</name> - <entityField>NAME</entityField> - </neonTableColumn> - <neonTableColumn> - <name>5d90aabb-74a9-40f2-bb57-6bf9e5302ed3</name> - <entityField>CATEGORY</entityField> - </neonTableColumn> - <neonTableColumn> - <name>faf08eb7-7076-4872-975d-c38a399a1b98</name> - <entityField>VERSION</entityField> - </neonTableColumn> - <neonTableColumn> - <name>1e1ed75f-a1de-4abb-b81e-6033de520f32</name> - <entityField>ISACTIVE</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> <tilesViewTemplate> <name>Tiles</name> <iconField>DIAGRAM</iconField> @@ -42,6 +16,7 @@ <subtitleField>KEY</subtitleField> <descriptionField>DESCRIPTION</descriptionField> <infoTopField>VERSION_TITLE</infoTopField> + <infoBottomField>CATEGORY</infoBottomField> <favoriteActionGroup1>tableActions</favoriteActionGroup1> <entityField>#ENTITY</entityField> <isCreatable v="true" /> diff --git a/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod b/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod index 0d2cd4622489b17425f3bea8fdd6e426d73e9186..7f955c5616034ee3bc71ca328f071c2c5857c6cb 100644 --- a/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod +++ b/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod @@ -20,7 +20,7 @@ <favoriteViewTemplate> <name>Favorites</name> <objectType>WORKFLOWDEFINITION_OBJECTTYPE</objectType> - <rowId>#UID</rowId> + <rowId>UID</rowId> <entityField>#ENTITY</entityField> <title>favorites</title> </favoriteViewTemplate> @@ -42,6 +42,10 @@ <name>9ae7bada-afb2-48d4-9aa0-b2bd5bd17379</name> <entityField>ISACTIVE</entityField> </entityFieldLink> + <entityFieldLink> + <name>f5a0addd-becc-4c4f-b381-65612127acaf</name> + <entityField>CATEGORY</entityField> + </entityFieldLink> <entityFieldLink> <name>6b06cf99-37b1-4901-a502-81bb590faa92</name> <entityField>DESCRIPTION</entityField> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index 0e23cd7b6c2028c7812508707862273ad150795b..b3b2b927cbb84804190b0474f677228f7671704d 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -89,17 +89,16 @@ ActivityUtils.insertNewActivity = function(pDataPreset, pActivityLinks, pDocumen _addActivityCol("RESPONSIBLE", dataPreset.responsibleContactId); _addActivityCol("SUBJECT", dataPreset.subject); - insertStatements.push(["ACTIVITY", activityColumns, db.getColumnTypes("ACTIVITY", activityColumns, dbAlias), activityValues]); + insertStatements.push(["ACTIVITY", activityColumns, null, activityValues]); if (pActivityLinks) { var activityLinkColumns = ["ACTIVITYLINKID", "ACTIVITY_ID", "DATE_NEW", "USER_NEW", "OBJECT_TYPE", "OBJECT_ROWID"]; - var activityLinkColumnTypes = db.getColumnTypes("ACTIVITYLINK", activityLinkColumns, dbAlias); var activityLinkValues; for (var i = 0, l = pActivityLinks.length; i < l; i++) { activityLinkValues = [util.getNewUUID(), activityId, creationDate, creationUser, pActivityLinks[i][0], pActivityLinks[i][1]]; - insertStatements.push(["ACTIVITYLINK", activityLinkColumns, activityLinkColumnTypes, activityLinkValues]); + insertStatements.push(["ACTIVITYLINK", activityLinkColumns, null, activityLinkValues]); } } diff --git a/process/Address_lib/process.js b/process/Address_lib/process.js index d68036c8e52c9e9d3b2248892b57a104eced03bb..ecd34ddbbcc7821e3781a340ba8e55588bfcb4ea 100644 --- a/process/Address_lib/process.js +++ b/process/Address_lib/process.js @@ -168,12 +168,12 @@ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) case Placeholder.types.SQLPART: //sql part fields.push( pConfig[i].valueDefinition ); output.push([pos++, pConfig[i].type]); - header.push( pConfig[i].placeholderName ); + header.push( pConfig[i].getFormattedName() ); break; case Placeholder.types.SQLPARTFUNCTION: // adito SQL functions fields.push("(" + pConfig[i].valueDefinition.call() + ")"); output.push([pos++, pConfig[i].type]); - header.push( pConfig[i].placeholderName ); + header.push( pConfig[i].getFormattedName() ); break; case Placeholder.types.ADDRESSFORMAT: if ( posaddrfields == -1 ) @@ -184,7 +184,7 @@ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) pos += addrfields.length; } output.push([posaddrfields, pConfig[i].type, pConfig[i].valueDefinition]); - header.push( pConfig[i].placeholderName ); + header.push( pConfig[i].getFormattedName() ); break; case "afunction": // adito functions @@ -192,7 +192,7 @@ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) { fields.push( "'" + evalScript("Address_lib.fetchAddressData", vars.resolveVariables(pConfig[i].valueDefinition), {}, ["Attribute_lib", "Sql_lib", "Keyword_lib", "Person_lib"], true).replace(new RegExp("'","g"), "''") + "'" ); output.push([pos++, pConfig[i].type]); - header.push( pConfig[i].placeholderName ); + header.push( pConfig[i].getFormattedName() ); } catch( err ) { @@ -209,7 +209,7 @@ function fetchAddressData( pCondition, pConfig, AddressID, pPerson) configJSON.localVars]); output.push([pos++, pConfig[i].type]); - header.push( pConfig[i].placeholderName ); + header.push( pConfig[i].getFormattedName() ); break; } } diff --git a/process/AttributeFilter_lib/process.js b/process/AttributeFilter_lib/process.js index 5b093fee0e2d95cd7ccb60bf5851513fcc3f7e74..81a5208ba9200da0a4296046c55485446b2f78a5 100644 --- a/process/AttributeFilter_lib/process.js +++ b/process/AttributeFilter_lib/process.js @@ -1,3 +1,4 @@ +import("Util_lib"); import("system.SQLTYPES"); import("system.translate"); import("Entity_lib"); @@ -154,7 +155,7 @@ AttributeFilterExtensionMaker.getFilterValues = function(pFilter) var attrType = name.type; if (attrType == $AttributeTypes.VOID.toString()) attrType = $AttributeTypes.BOOLEAN.toString(); - var res = AttributeUtil.getPossibleListValues(attributeId, attrType); + var res = AttributeUtil.getPossibleListValues(attributeId, attrType, true); if (res == null) res = []; return res; diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 40eed67b874f583649eda1b1369df0ea870e9921..50538848d38e22732586409983d01761b12734a3 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -148,7 +148,7 @@ AttributeUtil.getPossibleListValues = function (pAttributeId, pAttributeType, pI { var attributeId = pAttributeId; var attrType = pAttributeType.trim(); - var onlyActives = (pIncludeInactives == undefined ? false : pIncludeInactives); + var onlyActives = !pIncludeInactives; if (attrType == $AttributeTypes.COMBO.toString()) { var valuesSelect = newSelect("AB_ATTRIBUTEID, ATTRIBUTE_NAME") @@ -1224,7 +1224,6 @@ AttributeUsageUtil.insertChildrenUsages = function (pAttributeId, pObjectType) return; var table = "AB_ATTRIBUTEUSAGE"; var columns = ["AB_ATTRIBUTEUSAGEID", "AB_ATTRIBUTE_ID", "OBJECT_TYPE", "MAX_COUNT"]; - var types = db.getColumnTypes(table, columns); var inserts = []; _addInserts(pAttributeId, pObjectType); @@ -1250,7 +1249,7 @@ AttributeUsageUtil.insertChildrenUsages = function (pAttributeId, pObjectType) ? "1" : ""; let values = [util.getNewUUID(), row[0], pObjectType, maxCount]; - inserts.push([table, columns, types, values]); + inserts.push([table, columns, null, values]); } _addInserts(row[0], pObjectType); }); diff --git a/process/Communication_lib/process.js b/process/Communication_lib/process.js index c9f1422579317ca168f8bd4c641258a9143fcba1..055813cf362081fd583c1d8d2cd33fb0b4c0c4c4 100644 --- a/process/Communication_lib/process.js +++ b/process/Communication_lib/process.js @@ -70,14 +70,13 @@ CommUtil.setStandardForCategory = function(pAffectedRowId, pNewStandardCommId, p var statements = []; var cols = ["ISSTANDARD"]; - var types = db.getColumnTypes("COMMUNICATION", cols); //set current standard comm-record as non-standard var cond = newWhere("ISSTANDARD = 1") .and("COMMUNICATION.CONTACT_ID", pAffectedRowId) .and("COMMUNICATION.MEDIUM_ID", mediumIds, SqlBuilder.IN()); - statements.push(["COMMUNICATION", cols, types, ["0"], cond.build()]); + statements.push(["COMMUNICATION", cols, null, ["0"], cond.build()]); //pNewStandardCommId can be an empty string if the standard has to only be removed if (pNewStandardCommId != "") @@ -88,7 +87,7 @@ CommUtil.setStandardForCategory = function(pAffectedRowId, pNewStandardCommId, p .and("COMMUNICATION.CONTACT_ID", pAffectedRowId) .and("COMMUNICATION.MEDIUM_ID", mediumIds, SqlBuilder.IN()); - statements.push(["COMMUNICATION", cols, types, ["1"], cond.build()]); + statements.push(["COMMUNICATION", cols, null, ["1"], cond.build()]); } count = db.updates(statements); diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index 83ad817a1b9487b240e512d26d127e7f2b6a74e8..59bed651862041d08e72db34ad3256cab51d8acc 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -593,20 +593,6 @@ ContextUtils.getSelectMap = function() $KeywordRegistry.taskStatus$customerChecks(), ]) .setCreationDateField("TASK.START_DATE") - ,"SupportTicket": ContextSelector.create("TICKET", "TICKETID", "TASK.SUBJECT") - .setJoinExpression("left join TASK on TASK.TASKID = TICKET.TASK_ID left join TASKLINK on TASKLINK.TASK_ID = TASK.TASKID") - .setCondition(newWhere("TICKET.TICKETTYPE", $KeywordRegistry.ticketType$supportTicket())) - .setContactIdField("TASKLINK.OBJECT_ROWID") - .setStateField("TASK.STATUS") - .setActiveStates([ - $KeywordRegistry.taskStatus$new(), - $KeywordRegistry.taskStatus$unassigned(), - $KeywordRegistry.taskStatus$assigned(), - $KeywordRegistry.taskStatus$inProgress(), - $KeywordRegistry.taskStatus$waiting(), - $KeywordRegistry.taskStatus$customerChecks(), - ]) - .setCreationDateField("TASK.START_DATE") ,"BulkMail" : ContextSelector.create("BULKMAIL", "BULKMAILID", "NAME") ,"SerialLetter" : ContextSelector.create("SERIALLETTER", "SERIALLETTERID", "TITLE") ,"Leadimport": ContextSelector.create("LEADIMPORT", "LEADIMPORTID") diff --git a/process/DocumentTemplate_lib/DocumentTemplate_lib.aod b/process/DocumentTemplate_lib/DocumentTemplate_lib.aod index 9f4fede55f117c4fea142e84087e26eb4bd91be1..f7dede09487b8661444e1673ef88ecca8b415c21 100644 --- a/process/DocumentTemplate_lib/DocumentTemplate_lib.aod +++ b/process/DocumentTemplate_lib/DocumentTemplate_lib.aod @@ -2,6 +2,7 @@ <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>DocumentTemplate_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/process/DocumentTemplate_lib/documentation.adoc</documentation> <process>%aditoprj%/process/DocumentTemplate_lib/process.js</process> <variants> <element>LIBRARY</element> diff --git a/process/DocumentTemplate_lib/documentation.adoc b/process/DocumentTemplate_lib/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..547a9f00eb224a20d88876f161c2f94cc8088230 --- /dev/null +++ b/process/DocumentTemplate_lib/documentation.adoc @@ -0,0 +1,76 @@ += DocumentTemplate + +This document explains the functions of the class `DocumentTemplate` and how to use it. Note that it does not cover every single method with the respective parameters in detail. + +== Introduction + +A DocumentTemplate is a template for generating individualized documents by filling the placeholders inside the template with data. It supports the following file types and formats: + +* txt +* html +* eml +* odt +* docx +* docm +* simple strings + +== Usage + +=== Creating a new DocumentTemplate instance + +The most basic way to create a DocumentTemplate is by simply using the constructor, for example: +[source,js] +---- +var myTemplate = new DocumentTemplate(myEncodedHtml, DocumentTemplate.types.HTML); +---- + +The parameters `pTemplateContent` and `pType` are mandatory, the others are not required for every use case. A new instance of DocumentTemplate can also be created by using these static functions for special situations: + +* *DocumentTemplate.fromUpload:* Constructs a template from the given FileUpload object. +* *DocumentTemplate.loadTemplate:* Creates a template from a document stored in the database. + +=== Generating a document and filling placeholders + +Placeholders can be replaced by invoking the method `.getReplacedContent`. It only takes one parameter `pReplacements` which has to be an object with the placeholder as keys and the replacement data as values, like this: +[source,js] +---- +var replacements = { + "{@firstname@}" : "Joseph", + "{@lastname@}" : "Juster" +}; +var myContent = myTemplate.getReplacedContent(replacements); +---- + +It's also possible to use contact data with the functions `.getReplacedContentByContactId` (for a single contactId) and `.getReplacedContentByContactIds` (for multiple contactIds at once). If these functions are used, all placeholders defined in the libraries `Placeholder_lib` and `CustomPlaceholder_lib` are available. +To add extra placeholders that are not necessarily related to the contact, you can put them in the parameter `pAdditionalPlaceholders` which has to be an array of Placeholder objects. For placeholders unrelated to contact data, use these Placeholder types: + +* *FIXEDVALUE:* A fixed value that is stored inside the Placeholder object, useful for data that is already available when you define the placeholder (e. g. entity fields). +* *CALLBACKFUNCTION:* A callback-function inside the Placeholder object that returns the replacement value, it will be called with the contactId as first argument. You can use this type to resolve the placeholder depending on the contactId or to avoid unnecessary code execution because the function will only be called if the placeholder is actually used inside the template. + +Here's an example for the usage of `pAdditionalPlaceholders`: +[source,js] +---- +var getProductCountFn = function (pContactId) +{ + ... //fancy code +} +var additionalPlaceholders = [ + new Placeholder("offercode", Placeholder.types.FIXEDVALUE, vars.get("$field.FullOfferCode")), + new Placeholder("productCount", Placeholder.types.CALLBACKFUNCTION, getProductCountFn) +]; +var myContent = myTemplate.getReplacedContentByContactId(vars.get("$field.CONTACTID"), additionalPlaceholders); +---- + +=== Document generation options + +Some aspects of the behavior of the document generation can be controlled by setting the `options` property of the DocumentTemplate with `.setOptions`. Available options differ depending on the DocumentTemplate type, that's why the options are wrapped inside an object. These options can currently be used: +[%header,cols="1,3,2"] +|=== +| Option | Description | Supported types +| base64 | Controls if the replaced content will be base64-encoded | txt, html, eml +| onlyBody | If set to true, only the body of an eml will be used as content | eml +|=== + +When a new DocumentTemplate is created, a default set of options will be loaded depending on the type. + +//TODO: explain subtemplates, serial letters, (bulk-)emails \ No newline at end of file diff --git a/process/DocumentTemplate_lib/process.js b/process/DocumentTemplate_lib/process.js index ae3c193044abef89337c2be2e823dc4020ce1008..4ced5f9f03a66cdd93fd5b3836ab474107fa8017 100644 --- a/process/DocumentTemplate_lib/process.js +++ b/process/DocumentTemplate_lib/process.js @@ -29,14 +29,6 @@ import("Util_lib"); * Object for working with document templates, holds the content and type of the template. * Provides functions to replace placeholders in the content. * - * @class - */ -var DocumentTemplate = (function () -{ - -/** - * constructor for DocumentTemplate - * * @param {String} pTemplateContent content, as base64 string (except for DocumentTemplate.types.PLAIN, then it's a normal string) * @param {String} pType type of the template, use the DocumentTemplate.types constants here * @param {String} [pFilename=undefined] file name of the template @@ -44,19 +36,24 @@ var DocumentTemplate = (function () * @param {String} [pTemplateId=undefined] Provide it, if you have it, because this enables the template to load attachments associated by this ID * @param {String} [pMimeType=undefined] mimetype of the content. Only an additional information. Not mandatory. */ -function DocumentTemplate(pTemplateContent, pType, pFilename, pResolveSubtemplates, pTemplateId, pMimeType) +function DocumentTemplate (pTemplateContent, pType, pFilename, pResolveSubtemplates, pTemplateId, pMimeType) { this.content = pTemplateContent; this.type = pType; + this.options = DocumentTemplate.types.getDefaultTypeOptions(pType); this.filename = pFilename; this.templateId = pTemplateId; this.mimeType = pMimeType; - this._stringCache = null; this._attachmentCache = null; - this._subtemplatedContent = null; + this._subtemplateResolvedContent = null; + //cache used for .toString + this._stringCache = { + onlyContent : null, + withSubtemplatesResolved : null + }; if (pResolveSubtemplates) - this._resolveEmbeddedTemplate(); + this._resolveSubtemplates(); } /** @@ -64,18 +61,40 @@ function DocumentTemplate(pTemplateContent, pType, pFilename, pResolveSubtemplat */ DocumentTemplate.prototype.toString = function (pWithSubtemplates) { - if (this._stringCache == null) + var stringCachePosition = pWithSubtemplates ? "withSubtemplatesResolved" : "onlyContent"; + if (this._stringCache[stringCachePosition] == null) { - var content = this._getTemplatedContent(pWithSubtemplates); + var content = pWithSubtemplates && this._subtemplateResolvedContent || this.content; if (this.type == DocumentTemplate.types.PLAIN) - this._stringCache = content; + this._stringCache[stringCachePosition] = content; else - this._stringCache = text.parseDocument(content); + this._stringCache[stringCachePosition] = text.parseDocument(content); } - return this._stringCache; + return this._stringCache[stringCachePosition]; } -DocumentTemplate.prototype._resolveEmbeddedTemplate = function () +/** + * Defines options for the DocumentTemplate, the given options will be appended to the existing options and options that + * already exist will be overridden. The options that can be used may vary depending on the type of the DocumentTemplate, + * that's why they are wrapped inside an object. + * + * @param {Object} pOptions The options to set for the object. Some options only affect special types, for example: + * <ul> + * <li>base64 (boolean): If the replaced content should be base 64 encoded (does not work for docx and odt, these are always encoded)</li> + * <li>onlyBody (boolean): If set to true, only use the body of an eml (option only for eml)</li> + * </ul> + * @return {DocumentTemplate} current object + */ +DocumentTemplate.prototype.setOptions = function (pOptions) +{ + Object.assign(this.options, pOptions); + return this; +} + +/** + * resolves sub-template placeholders + */ +DocumentTemplate.prototype._resolveSubtemplates = function () { // currently we support only txt and html as others would need special caution. if (this.content != null && (this.type == DocumentTemplate.types.TXT || this.type == DocumentTemplate.types.HTML)) @@ -115,13 +134,6 @@ DocumentTemplate.prototype._resolveEmbeddedTemplate = function () } } -DocumentTemplate.prototype._getTemplatedContent = function (pWithSubtemplates) { - if (this._subtemplatedContent != null && pWithSubtemplates) - return this._subtemplatedContent; - else - return this.content; -} - /** * @return {DocumentTemmplate[]} if the templateId exists, it returns all attachments associated by the id as DocumentTemplate array else it just returns an empty array. */ @@ -223,7 +235,7 @@ DocumentTemplate.types = { * chooses the type depending on the extension in the metadata. If the extension doesn't work, try mimetype * @param {String[]} pBinaryMetadata the binary metadata from system.db */ - fromBinaryMetadata: function(pBinaryMetadata) + fromBinaryMetadata : function (pBinaryMetadata) { let filename = pBinaryMetadata[db.BINARY_FILENAME].split("."); let type = DocumentTemplate.types.fromFileExtension(filename[filename.length - 1]); @@ -231,6 +243,42 @@ DocumentTemplate.types = { type = DocumentTemplate.types.fromMimeType(pBinaryMetadata[db.BINARY_MIMETYPE]); return type; + }, + /** + * Returns the default options for the given type. + * + * @param {String} pType the type + * @return {Object} object containing the default options + */ + getDefaultTypeOptions : function (pType) + { + switch (pType) + { + case this.EML: + return { + base64 : false, + onlyBody : false, + placeholderRegExp : /\{\s*(=\r?\n)?@(.(?!{@)|(\r?\n))+?@\s*(=\r?\n)?\}/gi, + parsePlaceholderFn : function (pPlaceholder) + { + return pPlaceholder.replace(/\s*(=\r?\n)?/, ""); + } + }; + case this.TXT: + case this.HTML: + return { + base64 : false + }; + case this.DOCX: + case this.DOCM: + return { + startDelimiter : "{@", + endDelimiter : "@}" + }; + case this.ODT: + default: + return {}; + } } }; @@ -341,22 +389,19 @@ DocumentTemplate.getSelectedTemplate = function (pTemplateId, pDocumentUpload, p * replace function for the type. * * @param {Object} pReplacements map, the structure is {placeholder : value} - * @param {Boolean} pEncoded if the replaced content should be base64 encoded - * (doesn't affect odt/docx) - * @param {Boolean} [pEmlOnlyBody=false] if true for eml's only the body is parsed (e.g. for previews. Note that eml-bodies are not editable!) * * @return {String} the replaced content */ -DocumentTemplate.prototype.getReplacedContent = function (pReplacements, pEncoded, pEmlOnlyBody) +DocumentTemplate.prototype.getReplacedContent = function (pReplacements) { // if there exists a _subtemplatedContent we use it because then I assume that the replacements are already based on content + subtemplates - var content = this._getTemplatedContent(true); + var content = this._subtemplateResolvedContent || this.content; switch (this.type) { case DocumentTemplate.types.EML: let emlContent - if (pEmlOnlyBody) + if (this.options.onlyBody) { // get only body and treat it as html (next case) var email = Email.fromRFC(content); @@ -365,8 +410,8 @@ DocumentTemplate.prototype.getReplacedContent = function (pReplacements, pEncode else { emlContent = util.decodeBase64String(content); - emlContent = TemplateHelper._replaceText(emlContent, pReplacements, TemplateHelper._getSpecialRegexp(this)); - if (pEncoded) + emlContent = this._replaceText(emlContent, pReplacements); + if (this.options.base64) emlContent = util.encodeBase64String(emlContent); return emlContent; } @@ -376,18 +421,18 @@ DocumentTemplate.prototype.getReplacedContent = function (pReplacements, pEncode pReplacements[i] = text.text2html(pReplacements[i], false); case DocumentTemplate.types.TXT: let decodedContent = util.decodeBase64String(content); - let encodedContent = TemplateHelper._replaceText(decodedContent, pReplacements, TemplateHelper._getSpecialRegexp(this)); - if (pEncoded) + let encodedContent = this._replaceText(decodedContent, pReplacements); + if (this.options.base64) encodedContent = util.encodeBase64String(encodedContent); return encodedContent; case DocumentTemplate.types.ODT: - return TemplateHelper._getReplacedODT(this, pReplacements); + return this._getReplacedODT(pReplacements); case DocumentTemplate.types.DOCX: case DocumentTemplate.types.DOCM: - return TemplateHelper._getReplacedDOCX(this, pReplacements); + return this._getReplacedDOCX(pReplacements); case DocumentTemplate.types.PLAIN: - let plainText = TemplateHelper._replaceText(this.content, pReplacements, TemplateHelper._getSpecialRegexp(this)); - if (pEncoded) + let plainText = this._replaceText(this.content, pReplacements); + if (this.options.base64) plainText = util.encodeBase64String(plainText); return plainText; default: @@ -397,11 +442,17 @@ DocumentTemplate.prototype.getReplacedContent = function (pReplacements, pEncode /** * replaces the placeholders with data from one contact and returns the result + * + * @param {String} pContactId contact id + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. + * + * @return {String} replaced content */ -DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, pEncoded, pEmlOnlyBody) +DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, pAdditionalPlaceholders) { - var replacements = TemplateHelper._getReplacementsByContactIds(this, [pContactId]); - var content = this.getReplacedContent(replacements[pContactId], pEncoded, pEmlOnlyBody); + var replacements = this.getReplacementsByContactIds([pContactId], pAdditionalPlaceholders)[pContactId]; + var content = this.getReplacedContent(replacements); return content; } @@ -410,17 +461,18 @@ DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, * replaces the placeholders with data from the contacts and returns the result * * @param {Array} pContactIds contact ids - * @param {boolean} pEncoded if the replaced content should be base64 encoded + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. * * @return {Object} replaced content for every contactId */ -DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactIds, pEncoded) +DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactIds, pAdditionalPlaceholders) { - var replacements = TemplateHelper._getReplacementsByContactIds(this, pContactIds); + var replacements = this.getReplacementsByContactIds(pContactIds, pAdditionalPlaceholders); var contents = {}; for (let contactId in replacements) { - contents[contactId] = this.getReplacedContent(replacements[contactId], pEncoded); + contents[contactId] = this.getReplacedContent(replacements[contactId]); } return contents; } @@ -432,6 +484,8 @@ DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactId * @param {Array} pContactIds contact ids * @param {Object[][][]} pTableData Table data for the document, as a three-dimensional array * of objects (dimensions are: document, table in that document, rows of the table). For the format, see example. + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. * * @example * var contacts = newSelect("FIRSTNAME, LASTNAME") @@ -458,15 +512,16 @@ DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactId * * @return {Object} the content of the replaced ODT */ -DocumentTemplate.prototype.getSerialLetterByContactIds = function (pContactIds, pTableData) +DocumentTemplate.prototype.getSerialLetterByContactIds = function (pContactIds, pTableData, pAdditionalPlaceholders) { if (this.type == DocumentTemplate.types.ODT) { - let replacements = TemplateHelper._getReplacementsByContactIds(this, pContactIds); - let replaceArray = []; - for (let i = 0, l = pContactIds.length; i < l; i++) - replaceArray.push(replacements[pContactIds[i]]); - return TemplateHelper._getReplacedODT(this, replaceArray, pTableData); + let replacements = this.getReplacementsByContactIds(pContactIds, pAdditionalPlaceholders); + let replaceArray = pContactIds.map(function (contactId) + { + return replacements[contactId]; + }); + return this._getReplacedODT(replaceArray, pTableData); } question.showMessage(DocumentTemplate.getSerialLetterODTOnlyMessage(), question.INFORMATION, translate.text("Action not supported")) @@ -482,15 +537,18 @@ DocumentTemplate.getSerialLetterODTOnlyMessage = function() * Replaces the placeholders with data from the contacts and returns the resulting Emails. * * @param {Array} pContactIds contact ids + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. * * @return {Object} Object containing the contact ids as keys and the corresponding Email * objects as values */ -DocumentTemplate.prototype.getReplacedEmailsByContactIds = function (pContactIds) +DocumentTemplate.prototype.getReplacedEmailsByContactIds = function (pContactIds, pAdditionalPlaceholders) { var emailObjects = {}; var isEML = this.type == DocumentTemplate.types.EML; - var emailContents = this.getReplacedContentByContactIds(pContactIds, isEML); + this.setOptions({base64 : isEML}); + var emailContents = this.getReplacedContentByContactIds(pContactIds, pAdditionalPlaceholders); for (contactId in emailContents) { @@ -514,15 +572,18 @@ DocumentTemplate.prototype.getReplacedEmailsByContactIds = function (pContactIds } /** - * Provides functions for the DocumentTemplate object that aren't accessible from outside + * replaces placeholders in the given string */ -function TemplateHelper () {} -TemplateHelper._replaceText = function (pText, pReplacements, pSpecialCharFilterRegexpPart) +DocumentTemplate.prototype._replaceText = function (pText, pReplacements) { - if (pSpecialCharFilterRegexpPart == undefined) pSpecialCharFilterRegexpPart = ""; + var placeholderRegExp = this.options.placeholderRegExp || PlaceholderUtils.getRegexpMatchAll(); + var that = this; - pText = pText.replace(new RegExp(PlaceholderUtils.getRegexpMatchAll(pSpecialCharFilterRegexpPart), "gi"), function(pFound) { - let foundFiltered = pFound.replace(new RegExp(pSpecialCharFilterRegexpPart, "gi"),""); + pText = pText.replace(placeholderRegExp, function (pFound) + { + let foundFiltered = typeof that.options.parsePlaceholderFn === "function" + ? that.options.parsePlaceholderFn(pFound) + : pFound; return pReplacements[foundFiltered] ? pReplacements[foundFiltered] : pFound; }); @@ -530,70 +591,89 @@ TemplateHelper._replaceText = function (pText, pReplacements, pSpecialCharFilter } /** - * @param {DocumentTemplate} pTemplate * @param {String[]} pForcedPlaceholders these placeholders are always loaded - * @return {Object[]} all placeholders needed in this template or null, if + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. + * @return {Object[]} all placeholders needed in this template * @private */ -TemplateHelper._getRequiredPlaceholders = function (pTemplate, pForcedPlaceholders) +DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlaceholders, pAdditionalPlaceholders) { - var content = ""; - content = pTemplate.toString(true); - - // get special regexp (e.g. to filter '=' in emls) - var filterRegexpPart = TemplateHelper._getSpecialRegexp(pTemplate); + var content = this.toString(true); var placeholders = PlaceholderUtils.getPlaceholders(); + if (pAdditionalPlaceholders) + placeholders = placeholders.concat(pAdditionalPlaceholders); - var placeholderCleanRegexp = new RegExp(filterRegexpPart, "gi"); - // get all placeholders which matches the placeholder pattern - var foundPlaceholders = content.match(new RegExp(PlaceholderUtils.getRegexpMatchAll(TemplateHelper._getSpecialRegexp(pTemplate)), "gi")); + var foundPlaceholders = content.match(this.options.placeholderRegExp || PlaceholderUtils.getRegexpMatchAll()); if (foundPlaceholders == null) foundPlaceholders = []; // clean placeholder from the spechial strings (e.g. to filter '=' in emls) - foundPlaceholders = foundPlaceholders.map(function(pFound) { - return pFound.replace(placeholderCleanRegexp,""); - }); + if (typeof this.options.parsePlaceholderFn === "function") + foundPlaceholders = foundPlaceholders.map(this.options.parsePlaceholderFn); // filter the possible placeholders by all placeholders found - placeholders = placeholders.filter(function(pPlaceholder) + placeholders = placeholders.filter(function(placeholder) { - return foundPlaceholders.indexOf(pPlaceholder.placeholderName) != -1 || pForcedPlaceholders.indexOf(pPlaceholder.placeholderName) >= 0; + return foundPlaceholders.includes(placeholder.getFormattedName()) || pForcedPlaceholders.includes(placeholder.getFormattedName()); }); return placeholders; } /** - * Builds an object with the placeholder data for multiple contacts + * Builds an object with the placeholder replacement data for multiple contacts * - * @param {DocumentTemplate} pTemplate document template * @param {Array} pContactIds contact ids + * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the + * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. * * @return {Object} Object containing the data. The structure is like {contactId : {placeholderName : replacementValue, ...}, ...} - * - * @private */ -TemplateHelper._getReplacementsByContactIds = function (pTemplate, pContactIds) +DocumentTemplate.prototype.getReplacementsByContactIds = function (pContactIds, pAdditionalPlaceholders) { - var config = TemplateHelper._getRequiredPlaceholders(pTemplate, ["{@firstname@}", "{@lastname@}"]); + var placeholders = this._getRequiredPlaceholders(["{@firstname@}", "{@lastname@}"], pAdditionalPlaceholders); + var contactPlaceholders = []; + var additionalPlaceholders = {}; + placeholders.forEach(function (placeholder) + { + switch (placeholder.type) + { + case Placeholder.types.ADDRESSFORMAT: + case Placeholder.types.SQLPART: + case Placeholder.types.SQLPARTFUNCTION: + contactPlaceholders.push(placeholder); + break; + case Placeholder.types.FIXEDVALUE: + case Placeholder.types.CALLBACKFUNCTION: + additionalPlaceholders[placeholder.getFormattedName()] = placeholder; + } + }); var contactIdPlaceholder = new Placeholder("contactId", Placeholder.types.SQLPART, "CONTACT.CONTACTID"); - config = [contactIdPlaceholder].concat(config); - - var addressData = getAddressesData(pContactIds, config, EmployeeUtils.getCurrentContactId()); //TODO: add sender selection + contactPlaceholders = [contactIdPlaceholder].concat(contactPlaceholders); + + var addressData = getAddressesData(pContactIds, contactPlaceholders, EmployeeUtils.getCurrentContactId()); //TODO: add sender selection var replacements = {}; var placeholderNames = addressData[0]; var contactIdIndex = placeholderNames.indexOf(contactIdPlaceholder.toString()); for (let i = 1; i < addressData.length; i++) { let contactId = addressData[i][contactIdIndex]; - for (let ii = 0, ll = placeholderNames.length; ii < ll; ii++) + if (!(contactId in replacements)) + replacements[contactId] = {}; + placeholderNames.forEach(function (placeholderName, ii) { - if (!(contactId in replacements)) - replacements[contactId] = {}; - replacements[contactId][placeholderNames[ii]] = addressData[i][ii]; + replacements[contactId][placeholderName] = addressData[i][ii]; + }); + for (let placeholderName in additionalPlaceholders) + { + var placeholder = additionalPlaceholders[placeholderName]; + if (placeholder.type === Placeholder.types.FIXEDVALUE) + replacements[contactId][placeholderName] = placeholder.valueDefinition; + else if (placeholder.type === Placeholder.types.CALLBACKFUNCTION) + replacements[contactId][placeholderName] = placeholder.valueDefinition(contactId); } } return replacements; @@ -602,7 +682,6 @@ TemplateHelper._getReplacementsByContactIds = function (pTemplate, pContactIds) /* * replaces a given Odt-File on the server and returns the replaced base64-file * - * @param {DocumentTemplate} pTemplate document template * @param {Object} pReplacements map of placeholders and replacements * @param {Array} pTableData * @@ -610,22 +689,32 @@ TemplateHelper._getReplacementsByContactIds = function (pTemplate, pContactIds) * * @private */ -TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) +DocumentTemplate.prototype._getReplacedODT = function (pReplacements, pTableData) { - var filename = pTemplate.filename; + var filename = this.filename; if (!filename) filename = "dummyname.odt"; + var that = this; + //save the file on the server so it can be unzipped via pack.getFromZip var serverFilePath = vars.get("$sys.servertemp") + "/clientid_" + (vars.exists("$sys.clientid") ? vars.get("$sys.clientid") : 0) + "/" + util.getNewUUID() + "/" + filename.replace(/\\/g, "/"); - fileIO.storeData(serverFilePath, pTemplate.content, util.DATA_BINARY, false); - if (!_replaceODTFile(pReplacements, serverFilePath, pTableData)) - return null; + fileIO.storeData(serverFilePath, this.content, util.DATA_BINARY, false); + var replacedFileData = null; + try + { + if (!_replaceODTFile(pReplacements, serverFilePath, pTableData)) + return null; - var replacedFileData = fileIO.getData(serverFilePath, util.DATA_BINARY); - fileIO.remove(serverFilePath); + replacedFileData = fileIO.getData(serverFilePath, util.DATA_BINARY); + + } + finally + { + fileIO.remove(serverFilePath); + } return replacedFileData; @@ -643,7 +732,7 @@ TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) var senderRelId = EmployeeUtils.getCurrentContactId(); if (senderRelId == null) return false; - if (pReplacements.length === undefined) + if (!Array.isArray(pReplacements)) pReplacements = [pReplacements]; if (!pTableData) pTableData = []; @@ -697,7 +786,7 @@ TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) { let tableRowData = tableData[rowIndex]; - currentBody += TemplateHelper._replaceText(tableRow, tableRowData); + currentBody += that._replaceText(tableRow, tableRowData); } currentBody += afterTable; } @@ -724,39 +813,25 @@ TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) /* * This function is used to replace placeholders via DocXTemplater * - * @param {DocumentTemplate} pTemplate document template * @param {Object} pReplacements - Must contain an object, which holds the placeholders * * @return {String} returns the modified document in a BASE64 coded string * * @private */ -TemplateHelper._getReplacedDOCX = function (pTemplate, pReplacements) +DocumentTemplate.prototype._getReplacedDOCX = function (pReplacements) { var replacements = {}; + var startDelimiter = this.options.startDelimiter; + var endDelimiter = this.options.endDelimiter; for (let placeholder in pReplacements) //removes the prefix and postfix, the process needs it like this - replacements[placeholder.slice(2, -2)] = pReplacements[placeholder]; + replacements[placeholder.slice(startDelimiter.length, -endDelimiter.length)] = pReplacements[placeholder]; - var documentData = DocxtemplaterUtils.generateDocument(pTemplate.content, replacements, "{@", "@}"); + var documentData = DocxtemplaterUtils.generateDocument(this.content, replacements, startDelimiter, endDelimiter); return documentData; } -TemplateHelper._getSpecialRegexp = function (pTemplate) -{ - switch (pTemplate.type) - { - case DocumentTemplate.types.EML: - return "\\s*(=\\r?\\n)?"; - default: - return ""; - } -} - - return DocumentTemplate; - -})(); - /** * functions for working with letters (mails) */ diff --git a/process/DocxTemplater_lib/process.js b/process/DocxTemplater_lib/process.js index e9cd6c748fa3f8ba17d1c5c13795ee659ab3459d..8306c0421438b2cdc1e8f38940979b25bb0ba41e 100644 --- a/process/DocxTemplater_lib/process.js +++ b/process/DocxTemplater_lib/process.js @@ -85,7 +85,7 @@ function _getAutoNewLineModule() if (value == null) value = options.nullGetter(part); else - value = value.replace(/(\r\n)|(\n)|(\r)/g, "\n<w:br/>"); + value = value.replace(/(\r\n)|(\n)|(\r)/g, "</w:t></w:r><w:r><w:br/></w:r><w:r><w:t xml:space=\"preserve\">"); return { value: value diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js index d14798db16fadb33871b64b0a2dd879987fec383..34ae40ebfa34a87d89f1a84131521b9220e36b06 100644 --- a/process/Email_lib/process.js +++ b/process/Email_lib/process.js @@ -28,9 +28,10 @@ function EmailWritingUtils () {} * @param {Array} [pAttachments] attachments in a array (base64 encoded). * @param {String} pSubject an optional subject. * @param {String} [pEmailFilename] filename of the email. + * @param {Placeholder[]} [pAdditionalPlaceholders] additional placeholders * @return {Array} the eml document as array with [filename, base64] */ -EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId, pTemplateId, pRecipientContactId, pBindata, pAttachments, pSubject, pEmailFilename) +EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId, pTemplateId, pRecipientContactId, pBindata, pAttachments, pSubject, pEmailFilename, pAdditionalPlaceholders) { if (pToRecipients && typeof(pToRecipients) == "string") pToRecipients = [pToRecipients]; @@ -39,7 +40,7 @@ EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId, if (pTemplateId || (pBindata.bindata != "" && pBindata.bindata != null)) { - email = Email.fromTemplate(pTemplateId, pRecipientContactId, pBindata); + email = Email.fromTemplate(pTemplateId, pRecipientContactId, pBindata, pAdditionalPlaceholders); if (!email) email = new Email(); } @@ -76,15 +77,19 @@ EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId, * @param {String} pNotificationMsg message which will be shown after the operation is done. * @param {String} pComingFrom source from where you started (e.g. "Person", "Organisation" ) * @param {String} pEmailFilename optional file name of the email. + * @param {String} [pAdditionalPlaceholders] additional placeholders for the email + * @param {String} [pOfferId] optional needed for the offerEmails, to change the status of the offer */ -EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComingFrom, pAttachmentArray, pNotificationMsg, pEmailFilename) +EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComingFrom, pAttachmentArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId) { var params = { "ContactId_param" : pToContactId, "Attachments_param" : JSON.stringify(pAttachmentArray), "ComingFrom_param" : pComingFrom, "NotificationMsg_param" : pNotificationMsg, - "EmailFilename" : pEmailFilename + "EmailFilename" : pEmailFilename, + "AdditionalPlaceholders_param" : JSON.stringify(pAdditionalPlaceholders), + "OfferId_param" : pOfferId }; if (pToEmailAddress) @@ -107,14 +112,16 @@ EmailWritingUtils.getMailbridgeAddress = function () * @param {Array} pReportArray array with reports. * @param {String} pNotificationMsg message which will be shown after the operation is done. * @param {String} pEmailFilename optional file name of the email. + * @param {String} [pAdditionalPlaceholders] additional placeholders for the email + * @param {String} [pOfferId] optional needed for the offerEmails, to change the status of the offer * Report have to be a object with these attrs: content (base64 encoded report), contentType (mimeType of the report), filename (complete filename with filending) */ -EmailWritingUtils.sendReportAsMail = function (pRecipient, pReportArray, pComingFrom, pNotificationMsg, pEmailFilename) +EmailWritingUtils.sendReportAsMail = function (pRecipient, pReportArray, pComingFrom, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId) { var pRecpientEmail = newSelect("COMMUNICATION.ADDR").from("COMMUNICATION") .where("COMMUNICATION.CONTACT_ID", pRecipient).and("COMMUNICATION.MEDIUM_ID", "COMMEMAIL").cell(); - EmailWritingUtils.openNewMail(pRecipient, pRecpientEmail, pComingFrom, pReportArray, pNotificationMsg, pEmailFilename); + EmailWritingUtils.openNewMail(pRecipient, pRecpientEmail, pComingFrom, pReportArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId); } /** @@ -166,9 +173,10 @@ Email.fromRFC = function (pBase64RFC) * @param {String} [pTemplateId] UUID of the explicit template which shall used. (optional) * @param {String} [pContactId] (required) * @param {String} [pBindata] (required) + * @param {Placeholder[]} [pAdditionalPlaceholders] additional placeholders * @return {Email} a new Email object */ -Email.fromTemplate = function (pTemplateId, pContactId, pBindata) +Email.fromTemplate = function (pTemplateId, pContactId, pBindata, pAdditionalPlaceholders) { var template; @@ -184,7 +192,7 @@ Email.fromTemplate = function (pTemplateId, pContactId, pBindata) return null; } - return template.getReplacedEmailsByContactIds([pContactId])[pContactId]; + return template.getReplacedEmailsByContactIds([pContactId], pAdditionalPlaceholders)[pContactId]; } /** diff --git a/process/EwsClient_lib/process.js b/process/EwsClient_lib/process.js index 41e53a9c9a5c655caa888aedc765eaaef4535c98..2de3addde44d76ac3ad80c4f264e837fc6d90e45 100644 --- a/process/EwsClient_lib/process.js +++ b/process/EwsClient_lib/process.js @@ -290,10 +290,8 @@ EwsClientCalendarPermissionUtils.writePermissions = function(pExchangeAliasName) var dbChangeUser = "server";//vars.get("$sys.user") does not work on the serverside (executing from the manager) //todo: check if this is a bug var updateCalCols = new Array("USER_EDIT", "DATE_EDIT", "PERMISSION"); - var updateCalTypes = db.getColumnTypes("AB_PERMISSIONCALENDAR", updateCalCols); var insertCalCols = new Array("AB_PERMISSIONCALENDARID", "DATE_NEW","USER_NEW", "PERMISSIONPROCURER_ROWID", "PERMISSIONPROCURER_TYPE", "PERMISSIONDEALER_ROWID", "PERMISSIONDEALER_TYPE", "PERMISSION"); - var insertCalTypes = db.getColumnTypes("AB_PERMISSIONCALENDAR", insertCalCols); var vals; var right; @@ -332,14 +330,14 @@ EwsClientCalendarPermissionUtils.writePermissions = function(pExchangeAliasName) { vals = [dbChangeUser, datetime.date(), right]; newWhere("AB_PERMISSIONCALENDAR.AB_PERMISSIONCALENDARID", existingPermission[0]) - .updateData(true, "AB_PERMISSIONCALENDAR", updateCalCols, updateCalTypes, vals); + .updateData(true, "AB_PERMISSIONCALENDAR", updateCalCols, null, vals); } } else { vals = [util.getNewUUID(), datetime.date(), dbChangeUser, exchangeUserMap[qualified], $KeywordRegistry.permissionCalendarType$user(), exchangeUserMap[owner], $KeywordRegistry.permissionCalendarType$user(), right]; - db.insertData("AB_PERMISSIONCALENDAR", insertCalCols, insertCalTypes, vals); + db.insertData("AB_PERMISSIONCALENDAR", insertCalCols, null, vals); } } } diff --git a/process/ExportTemplate_lib/process.js b/process/ExportTemplate_lib/process.js index 0272a91c61e87df64f2112201d4bc984e941bcd8..a8c09911551c8dfd933e082febebfac8d3a25dd3 100644 --- a/process/ExportTemplate_lib/process.js +++ b/process/ExportTemplate_lib/process.js @@ -71,7 +71,7 @@ ExportTemplateUtils.buildExport = function (pExportTemplateId, pSelection, pComi var affectedPlaceholders = []; for (var i = 0; i < fields.length; i++) { var placeholderField = placeholders.find(function(placeholder){ - return placeholder.placeholderName == fields[i]; + return placeholder.getFormattedName() == fields[i]; }) if(placeholderField) affectedPlaceholders.push(placeholderField); diff --git a/process/ImporterCustomMappingFunctions_lib/documentation.adoc b/process/ImporterCustomMappingFunctions_lib/documentation.adoc index d7b37a3ee864c754d0e95bef5eb16b05c1be0c4c..79b5fa0c4b922278597493db352141aa7f1a1314 100644 --- a/process/ImporterCustomMappingFunctions_lib/documentation.adoc +++ b/process/ImporterCustomMappingFunctions_lib/documentation.adoc @@ -94,11 +94,10 @@ function iUpdateContact(pObject) { var alias = this.Config.AliasTo; //this gets the selected alias var columns = ["STATUS"]; - var types = db.getColumnTypes("CONTACT", columns, alias); var values = ["CONTACTSTATREVIEW "]; var condition = "CONTACTID = '" + pObject.contactID + "'"; - this.updateData("CONTACT", columns, types, values, condition, alias); + this.updateData("CONTACT", columns, null, values, condition, alias); } catch(ex) //If it fails it will not update but continue the rest { diff --git a/process/ImporterMappingFunctions_lib/process.js b/process/ImporterMappingFunctions_lib/process.js index a5746a0276df1bc7963975598a51395c10e741b1..27a4b5725fbfc5be68e9d42c5a498c3d132d8a25 100644 --- a/process/ImporterMappingFunctions_lib/process.js +++ b/process/ImporterMappingFunctions_lib/process.js @@ -145,7 +145,7 @@ function iAttribute(pObject) var parent = "NULL"; // select ab_attributeid from AB_ATTRIBUTE where ATTRIBUTE_NAME = 'Subordinate campaign of' and attribute_parent_id is null id = newSelect(ab_attributeId, alias).from(ab_attribute).where(attribute_name, attributes[i]) - .and(attribute_parent_id + "is null").cell(); + .and(attribute_parent_id + " is null").cell(); } else { diff --git a/process/JditoFilter_lib/process.js b/process/JditoFilter_lib/process.js index 9e6137b3ebbc088ec3a49495ac7a8b138cd5c7bd..d24d07552af5498326763f378b323980a41d0737 100644 --- a/process/JditoFilter_lib/process.js +++ b/process/JditoFilter_lib/process.js @@ -1,6 +1,7 @@ import("system.tools"); import("system.logging"); import("Sql_lib"); +import("system.datetime"); /** * object for filtering records @@ -117,6 +118,8 @@ JditoFilter.prototype.checkRecord = function (pRow) case "TIMEFRAME_EQUAL": case "TIMEFRAME_COMING": case "TIMEFRAME_PAST": + var [start, end] = datetime.resolveRelativeDateExpression(pFilterValue); + return pRowValue >= start && pRowValue <= end; } } } @@ -211,16 +214,163 @@ JditoFilterUtils.filterRecords = function (pColumns, pRecords, pFilter, pCustomC */ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColumnOrFnMap) { - var condition = newWhere(); + var filterTranslator = new FilterSqlTranslator(pFilter) + .table(pTable, pTableAlias); - var ignoreCase = JditoFilterUtils.isUserIgnoreCase(); - - if (!pFilter) + if (pColumnOrFnMap) + { + for (let fieldName in pColumnOrFnMap) + { + var columnOrFn = pColumnOrFnMap[fieldName]; + if (typeof columnOrFn === "function") + filterTranslator.addSpecialFieldConditionFn(fieldName, columnOrFn); + else + filterTranslator.addSqlFieldMapping(fieldName, columnOrFn); + } + } + return filterTranslator.getSqlCondition(); +} + +/** + * @return {boolean} the selectionIgnoreCase property of the current user, defaults to true + */ +JditoFilterUtils.isUserIgnoreCase = function () +{ + var user = tools.getCurrentUser(); + var ignoreCase = user ? user[tools.PARAMS][tools.SELECTION_IGNORECASE] : ""; + return ignoreCase == "" || /true/i.test(ignoreCase); +} + +/** + * Object for translating a filter object to a sql condition. + * + * @param {Object} pFilter the filter object that should be used + * @param {String} pTable the database table to build the condition for + */ +function FilterSqlTranslator (pFilter, pTable) +{ + this._filter = null; + this.filter(pFilter); + this._table = pTable; + this._tableAlias = null; + this._dbAlias = null; + this._sqlFieldMappings = {}; + this._fieldConditionFns = {}; + this._ignoreCase = JditoFilterUtils.isUserIgnoreCase(); +} + +/** + * Sets the filter of the object + * + * @param {Object} pFilter the filter object that should be used + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.filter = function (pFilter) +{ + if (pFilter) + { + if (typeof pFilter !== "object") + throw new TypeError("FilterSqlTranslator: Wrong type for the filter, expected 'object' but got '" + (typeof pFilter) + "'"); + this._filter = pFilter.filter || pFilter; + } + return this; +} + +/** + * Sets the filter of the object + * + * @param {String} pFilter the filter object that should be used as JSON string + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.filterJSON = function (pFilter) +{ + return this.filter(JSON.parse(pFilter)); +} + +/** + * Sets the table of the object + * + * @param {String} pTable the database table to build the condition for + * @param {String} [pTableAlias] the alias of the table + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.table = function (pTable, pTableAlias) +{ + this._table = pTable; + if (pTableAlias) + this._tableAlias = pTableAlias; + return this; +} + +/** + * Adds a special database field mapping for the given field that will be used for the sql condition + * + * @param {String} pFieldName the field name + * @param {String|String[]} pDBField the database field ("TABLE.COLUMN" or ["TABLE", "COLUMN", "alias"]) + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.addSqlFieldMapping = function (pFieldName, pDBField) +{ + this._sqlFieldMappings[pFieldName] = pDBField; + return this; +} + +/** + * Adds a special function for building the condition for the given field. The function must return a sql condition (SqlBuilder or String) + * + * @param {String} pFieldName the field name + * @param {Function} pConditionFn a function that generates the condition + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.addSpecialFieldConditionFn = function (pFieldName, pConditionFn) +{ + this._fieldConditionFns[pFieldName] = pConditionFn; + return this; +} + +/** + * Sets the database alias + * + * @param {String} pAlias the alias to be used + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.dbAlias = function (pAlias) +{ + this._dbAlias = pAlias; + return this; +} + +/** + * Changes whether the condition should be case-insensitive for text + * + * @param {boolean} [pIgnoreCase=true] if it should be case-insensitive + * @return {FilterSqlTranslator} current object + */ +FilterSqlTranslator.prototype.ignoreCase = function (pIgnoreCase) +{ + //"", 0 , false -> false, everything else is considered true + this._ignoreCase = pIgnoreCase != false; + return this; +} + +/** + * Builds the sql condition from the filter + * + * @return {SqlBuilder} the sql condition + */ +FilterSqlTranslator.prototype.getSqlCondition = function () +{ + var condition = new SqlBuilder(this._dbAlias).where(); + if (!this._filter) return condition; - if (!pColumnOrFnMap) - pColumnOrFnMap = {}; - _addCondition.call(condition, pFilter, pFilter.operator); + var table = this._table; + var tableAlias = this._tableAlias; + var ignoreCase = this._ignoreCase; + var sqlFieldMappings = this._sqlFieldMappings; + var fieldConditionFns = this._fieldConditionFns; + + _addCondition.call(condition, this._filter, this._filter.operator); return condition; @@ -230,47 +380,61 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu { if (pFilter.type == "row") { - if (pFilter.name in pColumnOrFnMap) + var sqlField, condition; + var filterValue = (pFilter.key || pFilter.value); + if (pFilter.name in fieldConditionFns) { - pFilter.name = pColumnOrFnMap[pFilter.name]; + var conditionFn = fieldConditionFns[pFilter.name]; + + condition = conditionFn.call(null, filterValue, pFilter.operator); + if (pOperator == "AND") + this.andIfSet(condition); + else if (pOperator == "OR") + this.orIfSet(condition); + + return; + } + + if (pFilter.name in sqlFieldMappings) + { + sqlField = sqlFieldMappings[sqlField]; //possibility to explicitly set the value to null/false so that the field is ignored - if (pFilter.name === null || pFilter.name === false) + if (sqlField === null || sqlField === false) return; } - else if (pTable && pTableAlias) - pFilter.name = [pTable, pFilter.name, pTableAlias]; - else if (pTable) - pFilter.name = pTable + "." + pFilter.name; - - pFilter.value = (pFilter.key || pFilter.value); + else if (table && tableAlias) + sqlField = [table, pFilter.name, tableAlias]; + else if (table) + sqlField = table + "." + pFilter.name; - var condition; - if (typeof(pFilter.name) === "function") + var generatedCondition = _getCondition(filterValue, pFilter.operator, sqlField); + if (generatedCondition instanceof SqlBuilder || typeof generatedCondition === "string") { - condition = pFilter.name.call(null, pFilter.value, pFilter.operator); if (pOperator == "AND") - this.andIfSet(condition); + this.andIfSet(generatedCondition); else if (pOperator == "OR") - this.orIfSet(condition); + this.orIfSet(generatedCondition); } else { - let isStringType, filterValue; - [condition, filterValue, isStringType] = _getCondition(pFilter.value, pFilter.operator); + var isStringType = pFilter.contenttype != "NUMBER" + && pFilter.contenttype != "DATE" + && pFilter.contenttype != "BOOLEAN"; + [condition, filterValue] = generatedCondition; if (isStringType && ignoreCase) condition = condition.replace("#", "UPPER(#)").replace("?", "UPPER(?)"); - + if (pOperator == "AND") - this.andIfSet(pFilter.name, filterValue, condition); + this.andIfSet(sqlField, filterValue, condition); else if (pOperator == "OR") - this.orIfSet(pFilter.name, filterValue, condition); + this.orIfSet(sqlField, filterValue, condition); } } else if (pFilter.type == "group") { - let subCondition = newWhere(); - let operator = pFilter.operator; + var subCondition = newWhere(); + var operator = pFilter.operator; pFilter.childs.forEach(function (cond) { _addCondition.call(subCondition, cond, operator); @@ -282,45 +446,41 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu } } - //returns [condition, value with wildcards, is a string type] depending on the operator - function _getCondition (pValue, pOperator) + //returns [condition, value with wildcards] depending on the operator + function _getCondition (pValue, pOperator, pField) { switch (pOperator) { case "CONTAINS": - return [SqlBuilder.LIKE(), "%" + pValue + "%", true]; + return [SqlBuilder.LIKE(), "%" + pValue + "%"]; case "CONTAINSNOT": - return [SqlBuilder.NOT_LIKE(), "%" + pValue + "%", true]; + return [SqlBuilder.NOT_LIKE(), "%" + pValue + "%"]; case "STARTSWITH": - return [SqlBuilder.LIKE(), pValue + "%", true]; + return [SqlBuilder.LIKE(), pValue + "%"]; case "ENDSWITH": - return [SqlBuilder.LIKE(), "%" + pValue, true]; + return [SqlBuilder.LIKE(), "%" + pValue]; case "EQUAL": - return [SqlBuilder.EQUAL(), pValue, true]; + return [SqlBuilder.EQUAL(), pValue]; case "NOT_EQUAL": - return [SqlBuilder.NOT_EQUAL(), pValue, true]; + return [SqlBuilder.NOT_EQUAL(), pValue]; case "LESS": - return [SqlBuilder.LESS(), pValue, false]; + return [SqlBuilder.LESS(), pValue]; case "LESS_OR_EQUAL": - return [SqlBuilder.LESS_OR_EQUAL(), pValue, false]; + return [SqlBuilder.LESS_OR_EQUAL(), pValue]; case "GREATER": - return [SqlBuilder.GREATER(), pValue, false]; + return [SqlBuilder.GREATER(), pValue]; case "GREATER_OR_EQUAL": - return [SqlBuilder.GREATER_OR_EQUAL(), pValue, false]; + return [SqlBuilder.GREATER_OR_EQUAL(), pValue]; case "ISNULL": - return ["# is null", pValue, false]; + return pField + " is null"; case "ISNOTNULL": - return ["# is not null", pValue, false]; + return pField + " is not null"; + case "TIMEFRAME_EQUAL": + case "TIMEFRAME_COMING": + case "TIMEFRAME_PAST": + var [start, end] = datetime.resolveRelativeDateExpression(pValue); + return newWhere(pField, start, SqlBuilder.GREATER_OR_EQUAL()) + .and(pField, end, SqlBuilder.LESS_OR_EQUAL()); } } -} - -/** - * @return {boolean} the selectionIgnoreCase property of the current user, defaults to true - */ -JditoFilterUtils.isUserIgnoreCase = function () -{ - var user = tools.getCurrentUser(); - var ignoreCase = user ? user[tools.PARAMS][tools.SELECTION_IGNORECASE] : ""; - return ignoreCase == "" || /true/i.test(ignoreCase); -} +} \ No newline at end of file diff --git a/process/KeywordData_lib/process.js b/process/KeywordData_lib/process.js index 9997efa52934025c8d61e7cd6eb8414737af9fe8..a4fbd6bd4e44b0b1068e110f60e27107bceb47ee 100644 --- a/process/KeywordData_lib/process.js +++ b/process/KeywordData_lib/process.js @@ -20,7 +20,7 @@ KeywordData.getSimpleData = function (pKeywordContainer, pLocale, pOnlyActives) var identifier = "KeywordSimpleData_" + pKeywordContainer + flags; var cache = new CachedData(identifier, true, pLocale); return cache.load(function (pTranslationNecessary, pLocale){ - var keywordEntrySelect = newSelect("AB_KEYWORD_ENTRY.KEYID, AB_KEYWORD_ENTRY.TITLE") + var keywordEntrySelect = newSelect("AB_KEYWORD_ENTRY.KEYID, AB_KEYWORD_ENTRY.TITLE", "Data_alias") .from("AB_KEYWORD_ENTRY") .orderBy("AB_KEYWORD_ENTRY.SORTING asc, AB_KEYWORD_ENTRY.TITLE asc") .where("AB_KEYWORD_ENTRY.CONTAINER", pKeywordContainer); diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index b53349181660fe4f0829d5fa6f8b7e03e755f735..b4d74a2a8f0cb51a439f5c8991d3d1e54a77602b 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -284,4 +284,9 @@ $KeywordRegistry.visitPlanEntryStatus$Visitreportcreated = function(){return $Ke $KeywordRegistry.visitRecommendationPrioSource = function(){return $KeywordRegistry._autoPad("VisitRecommendationPrioSource");}; $KeywordRegistry.visitRecommendationPrioSource$visitFrequency = function(){return $KeywordRegistry._autoPad("VISITFREQUENCY");}; -$KeywordRegistry.visitRecommendationPrioSource$manual = function(){return $KeywordRegistry._autoPad("MANUAL");}; \ No newline at end of file +$KeywordRegistry.visitRecommendationPrioSource$manual = function(){return $KeywordRegistry._autoPad("MANUAL");}; + +$KeywordRegistry.workflowCategory = function(){return "WorkflowCategory";}; + +$KeywordRegistry.notificationState = function () { return "NotificationState";}; +$KeywordRegistry.notificationType = function () { return "NotificationType";}; diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index bfc4a50283b447f3395af80a3ad50b0d4eaabd5f..9e8c67db437a23fc1982105c53e5140bce6dcfe5 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -92,7 +92,6 @@ LeadImportUtils.loadImportFile = function(pBinId, pFieldSep, pFieldLimit, pRecor var toInsert = []; var insertTable = "IMPORTFIELD"; var insertCols = ["IMPORTFIELDID", "FIELDNAME", "LEADIMPORT_ID", "DATE_NEW", "USER_NEW", "FIELDNUMBER"]; - var insertTypes = db.getColumnTypes(insertTable, insertCols); var insertVals = []; var sentenceSeparator = ExportTemplateUtils.getSentenceSeparator(pRecordSep); var fieldSeparator = ExportTemplateUtils.getFieldSeparator(pFieldSep); @@ -117,7 +116,7 @@ LeadImportUtils.loadImportFile = function(pBinId, pFieldSep, pFieldLimit, pRecor for (i = 0; i < table[0].length; i++) { insertVals = [util.getNewUUID(), table[0][i], pLeadImportId, vars.getString("$sys.date"), vars.getString("$sys.user"), i.toString()]; - toInsert.push([insertTable, insertCols, insertTypes, insertVals]); + toInsert.push([insertTable, insertCols, null, insertVals]); } db.inserts(toInsert); } diff --git a/process/OfferOrder_lib/process.js b/process/OfferOrder_lib/process.js index fe3e80e78fe3ccc0625b8e5cdfb68b02141f8624..f33eba68fa16f14af4e88b25b3102a64e3da4d04 100644 --- a/process/OfferOrder_lib/process.js +++ b/process/OfferOrder_lib/process.js @@ -75,7 +75,6 @@ function ItemUtils(pOfferOrderId, pTableName) { this._updateReOrgItemChangesInDB = function(compTree) { var statements = []; var cols = ["ITEMSORT", "ITEMPOSITION"]; - var colTypes = db.getColumnTypes(this.tableName + "ITEM", cols); var oiTree = this.ItemTree; for (var oiid in compTree) { @@ -83,7 +82,7 @@ function ItemUtils(pOfferOrderId, pTableName) { //check if itemsort/pos has been changed if (oiTree[oiid].itemsort != compTree[oiid].itemsort || oiTree[oiid].pos != compTree[oiid].pos) { var vals = [compTree[oiid].itemsort, compTree[oiid].pos]; - statements.push([this.tableName + "ITEM", cols, colTypes, vals, newWhere([this.tableName + "ITEM", this.tableName + "ITEMID"], oiid).build()]); + statements.push([this.tableName + "ITEM", cols, null, vals, newWhere([this.tableName + "ITEM", this.tableName + "ITEMID"], oiid).build()]); } } } @@ -221,7 +220,6 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c columns = columns.concat(additionalProductInfo.map(function(item) {return item[0][1]})); - var colTypes = db.getColumnTypes(table, columns); if (partsList.root != undefined) // if product has a parts list { @@ -273,7 +271,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c // add aditional details .concat(additionalProductInfo.map(function(item) {return ProductDetails[item[1][0]]})); - statements.push([table, columns, colTypes, vals]); + statements.push([table, columns, null, vals]); insertedItemIds.push(newid); __itemInsertStatement(partsList[p2pid], newid); diff --git a/process/Placeholder_lib/process.js b/process/Placeholder_lib/process.js index d6028a429c4158197cedfdc5f11e8f9ffe68c5e6..4f271fa114efc53ff3bb909ea0d4692436e8cead 100644 --- a/process/Placeholder_lib/process.js +++ b/process/Placeholder_lib/process.js @@ -68,7 +68,7 @@ PlaceholderUtils.getPlaceholders = function (pLocale, pIsExportTemplateField) if(placeholders[i]["target"] != "RECIPIENT"){ placeholders.splice(i, 1); i--} - else if(placeholders[i]["placeholderName"] == "{@letterSalutation@}"){ + else if(placeholders[i].getFormattedName() == "{@letterSalutation@}"){ placeholders.splice(i, 1); i--} } @@ -106,11 +106,12 @@ PlaceholderUtils.getPlaceholders = function (pLocale, pIsExportTemplateField) /** * Returns the placeholder with the required prefix and postfix added. - * This function defines the format for placeholders. + * + * @deprecated */ PlaceholderUtils.formatPlaceholder = function (pPlaceholder) { - return "{@" + pPlaceholder + "@}"; + return Placeholder.getDefaultStartDelimiter() + pPlaceholder + Placeholder.getDefaultEndDelimiter(); } /** @@ -120,14 +121,9 @@ PlaceholderUtils.formatPlaceholder = function (pPlaceholder) * return "my special replacement" * }); */ -PlaceholderUtils.getRegexpMatchAll = function (pSpecialCharFilterRegexpPart) +PlaceholderUtils.getRegexpMatchAll = function () { - if (pSpecialCharFilterRegexpPart == undefined) - { - pSpecialCharFilterRegexpPart = ""; - } - - return "{" + pSpecialCharFilterRegexpPart + "@(.(?!{@)|(\\r?\\n))+?@" + pSpecialCharFilterRegexpPart + "}"; + return /\{@(.(?!{@)|(\r?\n))+?@\}/gi; } /** @@ -141,16 +137,42 @@ PlaceholderUtils.getRegexpMatchAll = function (pSpecialCharFilterRegexpPart) */ function Placeholder (pName, pType, pValueDef, pTarget, pTitle) { - this.placeholderName = PlaceholderUtils.formatPlaceholder(pName); + this.startDelimiter = Placeholder.getDefaultStartDelimiter(); + this.endDelimiter = Placeholder.getDefaultEndDelimiter(); + this.placeholderName = pName; this.type = pType; this.target = pTarget || Placeholder.targets.RECIPIENT; this.valueDefinition = pValueDef; this.title = pTitle; } +/** + * Returns the default placeholder start delimiter + */ +Placeholder.getDefaultStartDelimiter = function () +{ + return "{@"; +} + +/** + * Returns the default placeholder end delimiter + */ +Placeholder.getDefaultEndDelimiter = function () +{ + return "@}"; +} + +/** + * Returns the placeholderName with startDelimiter and endDelimiter added + */ +Placeholder.prototype.getFormattedName = function () +{ + return this.startDelimiter + this.placeholderName + this.endDelimiter; +} + Placeholder.prototype.toString = function () { - return this.placeholderName; + return this.getFormattedName(); } /** @@ -170,7 +192,15 @@ Placeholder.types = { /** * function that returns a sub-sql */ - SQLPARTFUNCTION : "SQLPARTFUNCTION" + SQLPARTFUNCTION : "SQLPARTFUNCTION", + /** + * a predefined value, useful for own implementations of special placeholders + */ + FIXEDVALUE : "FIXEDVALUE", + /** + * functions that returns the value for the placeholder + */ + CALLBACKFUNCTION : "CALLBACKFUNCTION" }; /** diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index d49860b7ac46e5f1f8d093310260d8406de9b0e0..ee03a52bec3a0052633d48aace52aeb834a107da 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -283,8 +283,21 @@ ProductUtils.getProductDetails = function(pid, priceListFilter, additionalProduc return priceLists[list]; } //customer deposited price list (defined by Attribute) - if (priceListFilter.priceList != "" && priceListFilter.priceList == priceLists[list].priceList) { - return priceLists[list]; + if (priceListFilter.priceList != "") { + var res; + var escape; + // runs trough the possible pricelists to find the one with the correct pricelist ("-type"). + // e.g: PRICELISTSERVICE, PRICELISTSPECIAL, PRICELISTKEY, PRICELISTDEFAULT + for(var index in priceLists) + { + + if (priceLists[index]["priceList"] == priceListFilter.priceList) + { + res = priceLists[index]; //The first time the condition is true the correct pricelist is found. + break; // The object is ordered by fromQuantity descending so we have to stop after the condition is true + } + } + return res; } //default price list if (priceLists[list].priceList == $KeywordRegistry.productPricelist$standardList()) { diff --git a/process/StandardObject_lib/process.js b/process/StandardObject_lib/process.js index 6eaf4aa07bd1023fd90e769f333f6034cf5f7893..59729e43a414845f43e95e3e5c8c5a0e98d6e11d 100644 --- a/process/StandardObject_lib/process.js +++ b/process/StandardObject_lib/process.js @@ -219,7 +219,7 @@ StandardObject.prototype._setContactStandardAddress = function (pAddressID, pCon db.updateData( "CONTACT", ["ADDRESS_ID"], - db.getColumnTypes("CONTACT", ["ADDRESS_ID"]), + null, [pAddressID], newWhere("CONTACT.CONTACTID", pContactID).build()); } @@ -288,7 +288,7 @@ StandardObject.prototype._setStandardCommunication = function (pCommunicationID, db.updateData( "COMMUNICATION", ["ISSTANDARD"], - db.getColumnTypes("COMMUNICATION", ["ISSTANDARD"]), + null, [pValue], newWhere("COMMUNICATION.COMMUNICATIONID", pCommunicationID).build()); } diff --git a/process/ctiServerEvents/process.js b/process/ctiServerEvents/process.js index ecb4f7e36158f19b8473870b9b5c2f280934b8dd..e0df2b323d8dc904b125b3c44fc12db5a50a5fe2 100644 --- a/process/ctiServerEvents/process.js +++ b/process/ctiServerEvents/process.js @@ -62,6 +62,8 @@ var ringingHandlerFn = function() var affectedContext = this.contactsCall[0].PERSON_ID.trim() == "" ? "Organisation" : "Person"; notificationConfig.linkInfo(text.encodeMS([affectedContext, affectedContactId])); } + + notificationConfig.initialState(notification.STATE_CONFIRMED); notification.addNotificationWith(notificationConfig);