Skip to content
Snippets Groups Projects
Commit a64a3b57 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '2021.2.2' into '2021.2'

[Projekt: xRM-ContactManagement][TicketNr.: 2002229][Icon bei der Aktion...

See merge request xrm/basic!1531
parents 6f78e5e8 fffaf87c
No related branches found
No related tags found
No related merge requests found
Showing
with 55 additions and 109 deletions
import("system.vars");
import("system.result");
var variables = {
documentTemplateId: vars.get("$field.DOCUMENTTEMPLATE_ID"),
originUrl: vars.get("$sys.origin")
};
result.string(JSON.stringify(variables));
\ No newline at end of file
import("Context_lib");
import("system.result");
result.string(ContextUtils.getCurrentContextId());
\ No newline at end of file
import("Sql_lib");
import("Util_lib");
import("system.vars");
import("system.result");
import("FilterViewAction_lib");
var context = vars.get("$param.ObjectType_param");
var targets = Utils.parseJSON(vars.get("$param.ObjectIds_param"));
var filter = Utils.parseJSON(vars.get("$param.ObjectFilter_param"));
var personContactIds = [];
targets = FilterViewActionUtils.getUidsBySelectionOrFilter(context, targets, filter).map(function (target)
{
if (Utils.isString(target))
target = [target, context];
if (target[1] == "Person")
personContactIds.push(target[0]);
return target;
});
if (personContactIds.length !== 0)
{
var orgContactIds = newSelect(["anyContact.CONTACTID", "orgContact.CONTACTID"])
.from("CONTACT", "orgContact")
.join("CONTACT", "anyContact.ORGANISATION_ID = orgContact.ORGANISATION_ID and orgContact.PERSON_ID is null", "anyContact")
.where(["CONTACT", "CONTACTID", "anyContact"], personContactIds, SqlBuilder.IN())
.table();
var contactIdMap = new Map(orgContactIds);
targets.forEach(function ([targetId, targetContext, variables], i, allTargets)
{
if (contactIdMap.has(targetId))
{
if (!variables)
variables = {};
variables.attributeRowId = contactIdMap.get(targetId);
variables.attributeContext = "Organisation";
allTargets[i][2] = variables;
}
});
}
result.string(JSON.stringify(targets));
\ No newline at end of file
......@@ -60,7 +60,6 @@
<stateProcess>%aditoprj%/entity/Observation_entity/entityfields/object_type/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Observation_entity/entityfields/object_type/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Observation_entity/entityfields/object_type/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Observation_entity/entityfields/object_type/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>OBJECT_ID</name>
......@@ -142,6 +141,7 @@
<name>OBJECT_FIELD</name>
<title>Fields</title>
<contentType>TEXT</contentType>
<mandatory v="true" />
<dropDownProcess>%aditoprj%/entity/Observation_entity/entityfields/object_field/dropDownProcess.js</dropDownProcess>
<selectionMode>MULTI</selectionMode>
<stateProcess>%aditoprj%/entity/Observation_entity/entityfields/object_field/stateProcess.js</stateProcess>
......
import("system.neon");
import("Observation_lib");
import("system.vars");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
vars.set("$field.OBJECT_FIELD",null);
\ No newline at end of file
......@@ -18,17 +18,6 @@
<titlePlural>Offers</titlePlural>
<recordContainer>db</recordContainer>
<entityFields>
<entityActionField>
<name>export</name>
<title>Export</title>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/export/onActionProcess.js</onActionProcess>
<isMenuAction v="true" />
<isObjectAction v="false" />
<iconId>NEON:EXPORT</iconId>
<stateProcess>%aditoprj%/entity/Offer_entity/entityfields/export/stateProcess.js</stateProcess>
<tooltip>Export fields of this table</tooltip>
<tooltipProcess>%aditoprj%/entity/Offer_entity/entityfields/export/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
......@@ -1067,6 +1056,17 @@
<stateProcess>%aditoprj%/entity/Offer_entity/entityfields/observeactiongroup/children/cancelobservation/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/Offer_entity/entityfields/observeactiongroup/children/cancelobservation/titleProcess.js</titleProcess>
</entityActionField>
<entityActionField>
<name>export</name>
<title>Export</title>
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/observeactiongroup/children/export/onActionProcess.js</onActionProcess>
<isMenuAction v="true" />
<isObjectAction v="false" />
<iconId>NEON:EXPORT</iconId>
<stateProcess>%aditoprj%/entity/Offer_entity/entityfields/observeactiongroup/children/export/stateProcess.js</stateProcess>
<tooltip>Export fields of this table</tooltip>
<tooltipProcess>%aditoprj%/entity/Offer_entity/entityfields/observeactiongroup/children/export/tooltipProcess.js</tooltipProcess>
</entityActionField>
</children>
</entityActionGroup>
<entityActionField>
......
......@@ -220,6 +220,10 @@
<name>ContactsMainCountry_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/communications/children/contactsmaincountry_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>ObjectType_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/communications/children/objecttype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
......@@ -816,7 +820,7 @@
</entityParameter>
<entityField>
<name>Information</name>
<title>Commrestrictions</title>
<title>Information</title>
<color>$priority-high-color</color>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/information/valueProcess.js</valueProcess>
</entityField>
......@@ -1172,13 +1176,6 @@
<tooltip>Export fields of this table</tooltip>
<tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityActionField>
<name>startMarketingWorkflows</name>
<title>Start marketing mailing</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:ENVELOPES</iconId>
</entityActionField>
<entityActionField>
<name>addPlanningToOrganisations</name>
<title>Create planning</title>
......@@ -1336,6 +1333,7 @@
</entityConsumer>
<entityConsumer>
<name>ContactCommunicationSettings</name>
<refreshParent v="true" />
<dependency>
<name>dependency</name>
<entityName>CommunicationSettings_entity</entityName>
......@@ -1477,6 +1475,10 @@
<name>IsQuickEntry_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>OnlyNotInCampaignId_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("system.result");
import("system.translate");
result.string("Kdnr: " + vars.getString("$field.CUSTOMERCODE"));
\ No newline at end of file
result.string(translate.text("Cust.-No.") + ": " + vars.getString("$field.CUSTOMERCODE"));
\ No newline at end of file
import("Bulkmail_lib");
import("system.vars");
BulkMailUtils.openAddRecipientView(vars.get("$sys.currentcontextname"), vars.get("$sys.selection"), vars.get("$sys.filter"));
\ No newline at end of file
if(vars.get("$sys.selectionsRecordsRecipe"))
{
BulkMailUtils.openAddRecipientViewWithRecipe(vars.get("$sys.selectionsRecordsRecipe"));
}
else
{
BulkMailUtils.openAddRecipientView(vars.get("$sys.currentcontextname"), vars.get("$sys.selection"), vars.get("$sys.filter"));
}
\ No newline at end of file
......@@ -2,11 +2,11 @@ import("system.vars");
import("system.neon");
import("Campaign_lib");
var sysSelection = vars.get("$sys.selection");
var selectionsRecordsRecipe = vars.get("$sys.selectionsRecordsRecipe");
if(sysSelection.length > 0) //if data selected -> use selected data
if(selectionsRecordsRecipe) //if data selected -> use selected data
{
CampaignUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), vars.get("$sys.currentcontextname"));
CampaignUtils.addParticipantsByRecordsRecipe(selectionsRecordsRecipe, vars.get("$sys.currentcontextname"));
}
else //else -> use Filtercondition
{
......
import("system.neonFilter");
import("Context_lib");
import("system.vars");
import("system.neon");
var recipe = neonFilter.createEntityRecordsRecipeBuilder().parameters({
"ObjectIds_param": JSON.stringify(vars.get("$sys.selection")),
"ObjectFilter_param": JSON.stringify(vars.get("$sys.filter")),
"ObjectType_param": ContextUtils.getCurrentContextId()
}).toString();
neon.openContextWithRecipe("MarketingWorkflowLauncher", "MarketingWorkflowLauncherEdit_view", recipe, neon.OPERATINGSTATE_VIEW);
......@@ -61,4 +61,14 @@ if (vars.exists("$param.OnlyOwnSupervised_param") && vars.get("$param.OnlyOwnSup
SqlBuilder.EXISTS()
);
}
if (vars.get("$param.OnlyNotInCampaignId_param"))
{
cond.and(null,newSelect("1")
.from("CAMPAIGNPARTICIPANT")
.where("CAMPAIGNPARTICIPANT.CONTACT_ID = CONTACT.CONTACTID")
.and("CAMPAIGNPARTICIPANT.CAMPAIGN_ID","$param.OnlyNotInCampaignId_param"),
SqlBuilder.NOT_EXISTS()
);
}
result.string(cond.toString());
\ No newline at end of file
......@@ -13,7 +13,7 @@ new AttributeRelationQuery(contactId, null, ContextUtils.getCurrentContextId())
.deleteAllAttributes();
newWhere("COMMUNICATION.OBJECT_ROWID", contactId)
.and("COMMUNICATION.OBJECT_TYPE", "Contact").deleteData();
.and("COMMUNICATION.OBJECT_TYPE", "Organisation").deleteData();
newWhere("ADDRESS.CONTACT_ID", contactId).deleteData();
newWhere("COMMUNICATIONSETTINGS.CONTACT_ID", contactId).deleteData();
newWhere("CLASSIFICATIONSTORAGE.OBJECT_ROWID", contactId).deleteData();
......
......@@ -50,7 +50,7 @@ switch (tableName)
return newSelect("COMMUNICATION.OBJECT_ROWID")
.from("COMMUNICATION")
.where("COMMUNICATION.COMMUNICATIONID", id)
.and("COMMUNICATION.OBJECT_TYPE", "Contact")
.and("COMMUNICATION.OBJECT_TYPE", "Organisation")
.arrayColumn();
});
break;
......
import("system.translate");
import("Organisation_lib");
import("KeywordRegistry_basic");
import("system.translate");
......@@ -47,19 +48,19 @@ var querySelect = newSelect([
.join("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null")
.leftJoin("ADDRESS", "standardAddress.ADDRESSID = CONTACT.ADDRESS_ID", "standardAddress")
.leftJoin("COMMUNICATION", newWhere("COMMUNICATION.OBJECT_ROWID = CONTACT.CONTACTID")
.and("COMMUNICATION.OBJECT_TYPE", "Contact")
.and("COMMUNICATION.OBJECT_TYPE", "Organisation")
)
//standardMail is not multi valued and can only old one value (the standard email address)
.leftJoin("COMMUNICATION", newWhere("standardEmail.OBJECT_ROWID = CONTACT.CONTACTID")
.and(["COMMUNICATION", "MEDIUM_ID", "standardEmail"], commMediumMailIds, SqlBuilder.IN())
.and(["COMMUNICATION", "ISSTANDARD", "standardEmail"], "1")
.and(["COMMUNICATION", "OBJECT_TYPE", "standardEmail"], "Contact")
.and(["COMMUNICATION", "OBJECT_TYPE", "standardEmail"], "Organisation")
, "standardEmail")
//standardPhone is not multi valued and can only old one value (the standard phone number)
.leftJoin("COMMUNICATION", newWhere("standardPhone.OBJECT_ROWID = CONTACT.CONTACTID")
.and(["COMMUNICATION", "MEDIUM_ID", "standardPhone"], commMediumPhoneIds, SqlBuilder.IN())
.and(["COMMUNICATION", "ISSTANDARD", "standardPhone"], "1")
.and(["COMMUNICATION", "OBJECT_TYPE", "standardPhone"], "Contact")
.and(["COMMUNICATION", "OBJECT_TYPE", "standardPhone"], "Organisation")
, "standardPhone")
.where("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL())
.and("ORGANISATION.ORGANISATIONID", OrgUtils.getPrivateOrganisationId(), SqlBuilder.NOT_EQUAL())
......
This diff is collapsed.
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