Skip to content
Snippets Groups Projects
Commit b30b1c8e authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix offer

parent f352f3de
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.6"> <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.6">
<name>AnyContact_entity</name> <name>AnyContact_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess> <contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
<entityFields> <entityFields>
<entityProvider> <entityProvider>
<name>#PROVIDER</name> <name>#PROVIDER</name>
<dependencies> <dependencies>
<entityDependency> <entityDependency>
<name>5d8b421e-a234-4d03-bfec-ed01f464a54c</name> <name>5d8b421e-a234-4d03-bfec-ed01f464a54c</name>
<entityName>Contract_entity</entityName> <entityName>Contract_entity</entityName>
<fieldName>Relations</fieldName> <fieldName>Relations</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency> <entityDependency>
<name>94e4fa2c-7525-49f9-b933-353d200b829c</name> <name>94e4fa2c-7525-49f9-b933-353d200b829c</name>
<entityName>Offer_entity</entityName> <entityName>Offer_entity</entityName>
<fieldName>Relations</fieldName> <fieldName>Relations</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency> <entityDependency>
<name>f1f7d959-ecb5-4438-9762-fc11f1bc5334</name> <name>f1f7d959-ecb5-4438-9762-fc11f1bc5334</name>
<entityName>Order_entity</entityName> <entityName>Order_entity</entityName>
<fieldName>Relations</fieldName> <fieldName>Relations</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency> <entityDependency>
<name>336fdc6b-05f8-40bc-89ba-d4ab98bd6948</name> <name>336fdc6b-05f8-40bc-89ba-d4ab98bd6948</name>
<entityName>CampaignParticipant_entity</entityName> <entityName>CampaignParticipant_entity</entityName>
<fieldName>AnyContacts</fieldName> <fieldName>AnyContacts</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
</dependencies> </dependencies>
</entityProvider> </entityProvider>
<entityField> <entityField>
<name>ADDRESS_ID</name> <name>ADDRESS_ID</name>
<title>standard address</title> <title>standard address</title>
<searchable v="false" /> <searchable v="false" />
<displayValueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/address_id/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/address_id/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>LANGUAGE</name> <name>LANGUAGE</name>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>ORGANISATION_ID</name> <name>ORGANISATION_ID</name>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_ID</name> <name>PERSON_ID</name>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>CONTACTID</name> <name>CONTACTID</name>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>STATUS</name> <name>STATUS</name>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>contactType</name> <name>contactType</name>
<description>Relation type. Value is based on the existance or non-existance of ORGANISATION_ID and PERSON_ID. <description>Relation type. Value is based on the existance or non-existance of ORGANISATION_ID and PERSON_ID.
See ContactUtils.getRelationTypeByPersOrg for possible values</description> See ContactUtils.getRelationTypeByPersOrg for possible values</description>
<contentType>NUMBER</contentType> <contentType>NUMBER</contentType>
<searchable v="false" /> <searchable v="false" />
<valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/contactType/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/contactType/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>ORGANISATION_NAME</name> <name>ORGANISATION_NAME</name>
<title>Organisation name</title> <title>Organisation name</title>
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_FIRSTNAME</name> <name>PERSON_FIRSTNAME</name>
<title>Firstname</title> <title>Firstname</title>
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_LASTNAME</name> <name>PERSON_LASTNAME</name>
<title>Lastname</title> <title>Lastname</title>
</entityField> </entityField>
<entityField> <entityField>
<name>IMAGE</name> <name>IMAGE</name>
<contentType>IMAGE</contentType> <contentType>IMAGE</contentType>
<searchable v="false" /> <searchable v="false" />
<valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/image/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/image/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>STANDARD_EMAIL_COMMUNICATION</name> <name>STANDARD_EMAIL_COMMUNICATION</name>
<title>standard email</title> <title>standard email</title>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>STANDARD_PHONE_COMMUNICATION</name> <name>STANDARD_PHONE_COMMUNICATION</name>
<title>Phone</title> <title>Phone</title>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>RELATIONSHIP</name> <name>RELATIONSHIP</name>
<description>TODO: Beziehung zu der Relation 1024846 (z.B. per Ampelsystem)</description> <description>TODO: Beziehung zu der Relation 1024846 (z.B. per Ampelsystem)</description>
<searchable v="false" /> <searchable v="false" />
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_MIDDLENAME</name> <name>PERSON_MIDDLENAME</name>
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_TITLE</name> <name>PERSON_TITLE</name>
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_SALUTATION</name> <name>PERSON_SALUTATION</name>
</entityField> </entityField>
<entityField> <entityField>
<name>PERSON_FULL_NAME</name> <name>PERSON_FULL_NAME</name>
<title>Person</title> <title>Person</title>
<valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/person_full_name/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/person_full_name/valueProcess.js</valueProcess>
</entityField> </entityField>
</entityFields> <entityParameter>
<recordContainers> <name>ContactId_param</name>
<dbRecordContainer> <expose v="true" />
<name>db</name> </entityParameter>
<alias>Data_alias</alias> <entityProvider>
<fromClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <name>OnlySameCompany</name>
<conditionProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <dependencies>
<orderClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <entityDependency>
<linkInformation> <name>28b19d6b-237c-4268-b6c6-323df408c94a</name>
<linkInformation> <entityName>Offer_entity</entityName>
<name>7b3fa460-44a1-40f3-89e3-1625ce9c6bb3</name> <fieldName>AnyContacts</fieldName>
<tableName>CONTACT</tableName> <isConsumer v="false" />
<primaryKey>CONTACTID</primaryKey> </entityDependency>
<isUIDTable v="true" /> </dependencies>
<readonly v="false" /> <children>
</linkInformation> <entityParameter>
<linkInformation> <name>ContactId_param</name>
<name>6786a204-2cea-42ae-857d-4335bad6b5e4</name> <expose v="true" />
<tableName>ORGANISATION</tableName> <mandatory v="true" />
<primaryKey>ORGANISATIONID</primaryKey> </entityParameter>
<isUIDTable v="false" /> </children>
<readonly v="true" /> </entityProvider>
</linkInformation> </entityFields>
<linkInformation> <recordContainers>
<name>d15ccb84-6928-4c44-b940-0f5d04826b55</name> <dbRecordContainer>
<tableName>PERSON</tableName> <name>db</name>
<primaryKey>PERSONID</primaryKey> <alias>Data_alias</alias>
<isUIDTable v="false" /> <fromClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<readonly v="true" /> <conditionProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
</linkInformation> <orderClauseProcess>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<linkInformation> <linkInformation>
<name>b778622f-449a-4185-b7cb-9b373ba4024f</name> <linkInformation>
<tableName>ADDRESS</tableName> <name>7b3fa460-44a1-40f3-89e3-1625ce9c6bb3</name>
<primaryKey>ADDRESSID</primaryKey> <tableName>CONTACT</tableName>
<isUIDTable v="false" /> <primaryKey>CONTACTID</primaryKey>
<readonly v="true" /> <isUIDTable v="true" />
</linkInformation> <readonly v="false" />
</linkInformation> </linkInformation>
<recordFieldMappings> <linkInformation>
<dbRecordFieldMapping> <name>6786a204-2cea-42ae-857d-4335bad6b5e4</name>
<name>ADDRESS_ID.value</name> <tableName>ORGANISATION</tableName>
<recordfield>CONTACT.ADDRESS_ID</recordfield> <primaryKey>ORGANISATIONID</primaryKey>
</dbRecordFieldMapping> <isUIDTable v="false" />
<dbRecordFieldMapping> <readonly v="true" />
<name>LANGUAGE.value</name> </linkInformation>
<recordfield>CONTACT.LANGUAGE</recordfield> <linkInformation>
</dbRecordFieldMapping> <name>d15ccb84-6928-4c44-b940-0f5d04826b55</name>
<dbRecordFieldMapping> <tableName>PERSON</tableName>
<name>ORGANISATION_ID.value</name> <primaryKey>PERSONID</primaryKey>
<recordfield>CONTACT.ORGANISATION_ID</recordfield> <isUIDTable v="false" />
</dbRecordFieldMapping> <readonly v="true" />
<dbRecordFieldMapping> </linkInformation>
<name>PERSON_ID.value</name> <linkInformation>
<recordfield>CONTACT.PERSON_ID</recordfield> <name>b778622f-449a-4185-b7cb-9b373ba4024f</name>
</dbRecordFieldMapping> <tableName>ADDRESS</tableName>
<dbRecordFieldMapping> <primaryKey>ADDRESSID</primaryKey>
<name>CONTACTID.value</name> <isUIDTable v="false" />
<recordfield>CONTACT.CONTACTID</recordfield> <readonly v="true" />
</dbRecordFieldMapping> </linkInformation>
<dbRecordFieldMapping> </linkInformation>
<name>STATUS.value</name> <recordFieldMappings>
<recordfield>CONTACT.STATUS</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>ADDRESS_ID.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.ADDRESS_ID</recordfield>
<name>ORGANISATION_NAME.value</name> </dbRecordFieldMapping>
<recordfield>ORGANISATION.NAME</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>LANGUAGE.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.LANGUAGE</recordfield>
<name>PERSON_FIRSTNAME.value</name> </dbRecordFieldMapping>
<recordfield>PERSON.FIRSTNAME</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>ORGANISATION_ID.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.ORGANISATION_ID</recordfield>
<name>PERSON_LASTNAME.value</name> </dbRecordFieldMapping>
<recordfield>PERSON.LASTNAME</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>PERSON_ID.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.PERSON_ID</recordfield>
<name>STANDARD_EMAIL_COMMUNICATION.value</name> </dbRecordFieldMapping>
<expression>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/recordfieldmappings/standard_email_communication.value/expression.js</expression> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>CONTACTID.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.CONTACTID</recordfield>
<name>STANDARD_PHONE_COMMUNICATION.value</name> </dbRecordFieldMapping>
<expression>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/recordfieldmappings/standard_phone_communication.value/expression.js</expression> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>STATUS.value</name>
<dbRecordFieldMapping> <recordfield>CONTACT.STATUS</recordfield>
<name>RELATIONSHIP.value</name> </dbRecordFieldMapping>
<recordfield>CONTACT.RELATIONSHIP</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>ORGANISATION_NAME.value</name>
<dbRecordFieldMapping> <recordfield>ORGANISATION.NAME</recordfield>
<name>PERSON_MIDDLENAME.value</name> </dbRecordFieldMapping>
<recordfield>PERSON.MIDDLENAME</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>PERSON_FIRSTNAME.value</name>
<dbRecordFieldMapping> <recordfield>PERSON.FIRSTNAME</recordfield>
<name>PERSON_TITLE.value</name> </dbRecordFieldMapping>
<recordfield>PERSON.TITLE</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>PERSON_LASTNAME.value</name>
<dbRecordFieldMapping> <recordfield>PERSON.LASTNAME</recordfield>
<name>PERSON_SALUTATION.value</name> </dbRecordFieldMapping>
<recordfield>PERSON.SALUTATION</recordfield> <dbRecordFieldMapping>
</dbRecordFieldMapping> <name>STANDARD_EMAIL_COMMUNICATION.value</name>
</recordFieldMappings> <expression>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/recordfieldmappings/standard_email_communication.value/expression.js</expression>
</dbRecordContainer> </dbRecordFieldMapping>
</recordContainers> <dbRecordFieldMapping>
</entity> <name>STANDARD_PHONE_COMMUNICATION.value</name>
<expression>%aditoprj%/entity/AnyContact_entity/recordcontainers/db/recordfieldmappings/standard_phone_communication.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>RELATIONSHIP.value</name>
<recordfield>CONTACT.RELATIONSHIP</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PERSON_MIDDLENAME.value</name>
<recordfield>PERSON.MIDDLENAME</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PERSON_TITLE.value</name>
<recordfield>PERSON.TITLE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PERSON_SALUTATION.value</name>
<recordfield>PERSON.SALUTATION</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.db"); import("system.db");
import("system.result"); import("system.result");
import("Sql_lib"); import("Sql_lib");
import("Contact_lib");
var orgContactId;
if (vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param"))
{
var contactId = vars.get("$param.ContactId_param");
var ids = ContactUtils.getPersOrgIds(contactId);
if (ids.length >= 3 && ids[2])
{
orgContactId = ids[2];
}
}
//exclude private organisation //exclude private organisation
var cond = SqlCondition.begin() var cond = SqlCondition.begin()
.andPrepare("CONTACT.ORGANISATION_ID", "0", "# != ?") .andSqlCondition(SqlCondition.begin()
.orSqlCondition(SqlCondition.begin() .andPrepare("CONTACT.ORGANISATION_ID", "0", "# != ?")
.andPrepare("CONTACT.ORGANISATION_ID", "0") .orSqlCondition(SqlCondition.begin()
.and("CONTACT.PERSON_ID is not null") .andPrepare("CONTACT.ORGANISATION_ID", "0")
); .and("CONTACT.PERSON_ID is not null")
)
)
.andPrepareIfSet("CONTACT.ORGANISATION_ID", orgContactId);
result.string(db.translateCondition(cond.build())); result.string(db.translateCondition(cond.build()));
\ No newline at end of file
This diff is collapsed.
import("system.result");
import("system.vars");
var contactId = "";
if (vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) {
contactId = vars.get("$param.ContactId_param");
}
else if ((vars.exists("$param.ObjectType_param")
&& vars.get("$param.ObjectType_param")
&& vars.exists("$param.ObjectRowId_param")
&& vars.get("$param.ObjectRowId_param")))
{
contactId = ContextUtils.getContactId(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"));
}
if (contactId)
result.string(contactId);
\ No newline at end of file
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
import("system.neon"); import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT ||
(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")))
result.string(neon.COMPONENTSTATE_READONLY); result.string(neon.COMPONENTSTATE_READONLY);
\ No newline at end of file
import("system.logging"); import("system.logging");
import("system.neon"); import("system.neon");
import("system.db"); import("system.db");
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
import("Sql_lib"); import("Sql_lib");
import("Context_lib"); import("Context_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
var contactId = ""; var contactId = "";
if ((!vars.exists("$param.ContactId_param") || !vars.get("$param.ContactId_param")) if ((!vars.exists("$param.ContactId_param") || !vars.get("$param.ContactId_param"))
&& (vars.exists("$param.ObjectType_param") && (vars.exists("$param.ObjectType_param")
&& vars.get("$param.ObjectType_param") && vars.get("$param.ObjectType_param")
&& vars.exists("$param.ObjectRowId_param") && vars.exists("$param.ObjectRowId_param")
&& vars.get("$param.ObjectRowId_param"))) && vars.get("$param.ObjectRowId_param")))
{ {
contactId = ContextUtils.getContactId(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param")) contactId = ContextUtils.getContactId(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"))
} else if (vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) { } else if (vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) {
contactId = vars.get("$param.ContactId_param"); contactId = vars.get("$param.ContactId_param");
}
}
if (contactId) if (contactId)
{ {
var relData = db.array(db.ROW, "select LANGUAGE from CONTACT where CONTACTID = '" + contactId + "'"); var relData = db.array(db.ROW, "select LANGUAGE from CONTACT where CONTACTID = '" + contactId + "'");
if(relData[0] != "") if(relData[0] != "")
neon.setFieldValue("field.LANGUAGE", relData[0]); neon.setFieldValue("field.LANGUAGE", relData[0]);
result.string(contactId); result.string(contactId);
} }
\ No newline at end of file
import("system.neon"); import("system.neon");
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
import("Entity_lib"); import("Entity_lib");
switch (vars.get("$sys.recordstate")) switch (vars.get("$sys.recordstate"))
{ {
case neon.OPERATINGSTATE_NEW: case neon.OPERATINGSTATE_NEW:
//only EDITABLE if $field.CONTACT_ID is set //only EDITABLE if $field.CONTACT_ID is set and not objectrowid preset
if(ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTACT_ID"))) if(vars.get("$field.CONTACT_ID") && !(vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param") && vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param")))
result.object(neon.COMPONENTSTATE_EDITABLE); result.object(neon.COMPONENTSTATE_EDITABLE);
else else
result.object(neon.COMPONENTSTATE_READONLY); result.object(neon.COMPONENTSTATE_READONLY);
break; break;
default: default:
result.object(neon.COMPONENTSTATE_READONLY); result.object(neon.COMPONENTSTATE_READONLY);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment