diff --git a/entity/Contact_entity/entityfields/organisation_contactid/onValidation.js b/entity/Contact_entity/entityfields/organisation_contactid/onValidation.js index 94865c1d50a90d9c07c3cc5edd7ad5bded069ab4..dafb89230293e4d8aa9e53674947fe00cfd21bd0 100644 --- a/entity/Contact_entity/entityfields/organisation_contactid/onValidation.js +++ b/entity/Contact_entity/entityfields/organisation_contactid/onValidation.js @@ -5,9 +5,10 @@ import("system.db"); import("system.vars"); import("Entity_lib"); import("Sql_lib"); +import("Organisation_lib"); var personId = vars.getString("$field.PERSON_ID"); -var organisationId; +var organisationId, validationMsg; var orgContactId = vars.get("$local.value"); var organisationIds = ContactUtils.getPersOrgIds(orgContactId) @@ -19,8 +20,19 @@ if (organisationIds.length > 0 && organisationIds[2]) if (vars.get("$field.CONTACTID")) contactId = vars.get("$field.CONTACTID"); - var validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, contactId); + validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, contactId); if (validationMsg) result.string(validationMsg); } - +else +{ + var privateCount = newSelect("count(*)") + .from("CONTACT") + .where("CONTACT.ORGANISATION_ID", OrgUtils.getPrivateOrganisationId()) + .and("CONTACT.CONTACTID", vars.get("$param.OwnContactId_param")) + .cell(); + if(privateCount > 0) + validationMsg = translate.text("A person can only have one private Contact."); + if(validationMsg) + result.string(validationMsg) +} \ No newline at end of file diff --git a/entity/Contact_entity/onValidation.js b/entity/Contact_entity/onValidation.js index ef3e299e677759fc8fe8b0237ee9fe27d6c4723f..6ba91bd92983f4cc209d5f95f3972dc45cd5a089 100644 --- a/entity/Contact_entity/onValidation.js +++ b/entity/Contact_entity/onValidation.js @@ -1,8 +1,9 @@ +import("Organisation_lib"); import("system.vars"); import("system.neon"); //TODO: workaround till there exists somtehing that can be done "beforeSave"; a validation of the whole entity is done before saving so let's use this process at the moment if(!vars.get("$field.ORGANISATION_ID")) { - neon.setFieldValue("$field.ORGANISATION_ID", "0"); + neon.setFieldValue("$field.ORGANISATION_ID", OrgUtils.getPrivateOrganisationId()); } \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index a0cab0ed38f8cac0717b78828f6ea4abbc9583b0..b93533604a7cf8e699e5e14c65845f98daf6efbf 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -7368,6 +7368,54 @@ <entry> <key>Mark all cached record containers as invalid</key> </entry> + <entry> + <key>%0 of the chosen records are already recipients.</key> + </entry> + <entry> + <key>Set missing address locations</key> + </entry> + <entry> + <key>Set all address locations</key> + </entry> + <entry> + <key>Shows the number of Activities of the Grouped Fields</key> + </entry> + <entry> + <key>The status of the offer was changed to \"sent\".</key> + </entry> + <entry> + <key>Sales Staff Activity</key> + </entry> + <entry> + <key>Titel</key> + </entry> + <entry> + <key>Month</key> + </entry> + <entry> + <key>Responsible Department</key> + </entry> + <entry> + <key>Shows the different conversion rates of the sales project phases</key> + </entry> + <entry> + <key>FavoriteFilter_view</key> + </entry> + <entry> + <key>Salesproject Convertion Rates</key> + </entry> + <entry> + <key>The status of the order was changed to \"sent\".</key> + </entry> + <entry> + <key>Conversion Rate</key> + </entry> + <entry> + <key>AB_KEYWORD_ENTRYID</key> + </entry> + <entry> + <key>A person can only have one private Contact.</key> + </entry> <entry> <key>Linked in (Person)</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index ab88dccfb93a59ed3e662b8eb04158063f99eb50..3ca1a4994f769baab13afe8bf6219d01fbee245c 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -2669,6 +2669,10 @@ <key>Fiji</key> <value>Fidschi</value> </entry> + <entry> + <key>A person can only have one private Contact.</key> + <value>Eine Person kann nur einen privaten Kontakt haben.</value> + </entry> <entry> <key>Guinea</key> <value>Guinea</value> @@ -9463,6 +9467,39 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Xing (Person)</key> </entry> + <entry> + <key>Date must not be in the future</key> + </entry> + <entry> + <key>Shows the number of Activities of the Grouped Fields</key> + </entry> + <entry> + <key>Sales Staff Activity</key> + </entry> + <entry> + <key>Month</key> + </entry> + <entry> + <key>Responsible Department</key> + </entry> + <entry> + <key>Shows the different conversion rates of the sales project phases</key> + </entry> + <entry> + <key>Salesproject Convertion Rates</key> + </entry> + <entry> + <key>Date has to be in the selected calendar week!</key> + </entry> + <entry> + <key>50-99 D€</key> + </entry> + <entry> + <key>Conversion Rate</key> + </entry> + <entry> + <key>AB_KEYWORD_ENTRYID</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 f98137326948a38a8c7269c5d48d10226044324e..794e1fefaaf6c96e96f4b1c6c8236b5f7c1089f0 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -7453,19 +7453,19 @@ <key>Current Recipients</key> </entry> <entry> - <key>Date (Month)</key> + <key>The status of the offer was changed to \"sent\".</key> </entry> <entry> - <key>Date (Year)</key> + <key>The status of the order was changed to \"sent\".</key> </entry> <entry> - <key>Date (Day)</key> + <key>Conversion Rate</key> </entry> <entry> - <key>Grant new User Permission</key> + <key>AB_KEYWORD_ENTRYID</key> </entry> <entry> - <key>%0 of the chosen records are already recipients.</key> + <key>A person can only have one private Contact.</key> </entry> <entry> <key>Linked in (Person)</key>