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

merged origin/2020.1 into master

parents efe5a81d f6e2ffd0
No related branches found
No related tags found
No related merge requests found
<?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>campaignParticipantMessage_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<noneLayout>
<name>layout</name>
</noneLayout>
</layout>
<children>
<genericViewTemplate>
<name>Message_view</name>
<hideLabels v="true" />
<hideEmptyFields v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>bc1db862-a448-47f6-b534-2ce28dc993a8</name>
<entityField>campaignParticipantMessage</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
......@@ -393,6 +393,38 @@ BulkMailUtils.copy = function(pBulkMailId)
};
neon.openContext("BulkMail", null, null, neon.OPERATINGSTATE_NEW, params);
}
/**
* Adds contacts or organistaions to a bulk mail by contactIds.<br>
*
* @param {String} pContactIds <p>
* The contact ids as JSON array.<br>
*/
BulkMailUtils.addParticipantsByRowIds = function(pContactIds)
{
var params = {
"ContactIds_param" : pContactIds
};
neon.openContext("BulkMailAddRecipients", "BulkMailAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
}
/**
* Adds contacts or organistaions to a bulk mail by condition (filter).<br>
*
* @param {String} pCondition <p>
* Contact ids.
* @param {String} pSourceTableName <p>
* The source table.<br>
*/
BulkMailUtils.addParticipantsByCondition = function(pCondition, pSourceTableName)
{
var params = {
"ContactIds_param" : pCondition,
"comingFrom_param" : pSourceTableName}
neon.openContext("BulkMailAddRecipients", "BulkMailAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
}
function SerialLetterUtils () {}
......@@ -551,4 +583,34 @@ SerialLetterUtils.getSerialLetterTemplate = function (pLetterId, pDocumentTempla
if (!template.type)
template = DocumentTemplate.loadTemplate(pDocumentTemplateId);
return template;
}
/**
* Adds contacts or organistaions to a serial letter by contactIds.<br>
*
* @param {String} pContactIds <p>
* The contact ids as JSON array.<br>
*/
SerialLetterUtils.addParticipantsByRowIds = function(pContactIds)
{
var params = {
"ContactIds_param" : pContactIds
};
neon.openContext("SerialLetterAddRecipients", "SerialLetterAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
}
/**
* Adds contacts or organistaions to a serial letter by condition (filter).<br>
*
* @param {String} pCondition <p>
* Contact ids.
* @param {String} pSourceTableName <p>
* The source table.<br>
*/
SerialLetterUtils.addParticipantsByCondition = function(pCondition, pSourceTableName)
{
var params = {
"ContactIds_param" : pCondition,
"comingFrom_param" : pSourceTableName}
neon.openContext("SerialLetterAddRecipients", "SerialLetterAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
}
\ No newline at end of file
......@@ -693,5 +693,5 @@ _CampaignUtils._openAddParticipantContext = function(pContext, pTargetDataExpres
params["isUpdate_param"] = false;
params["dataSourceTableName_param"] = pSourceTableName;
neon.openContext(pContext, "CampaignAddParticipantsEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
neon.openContext(pContext, pView, null, neon.OPERATINGSTATE_VIEW, params);
}
\ No newline at end of file
import("system.neon");
import("system.vars");
import("Address_lib");
import("Keyword_lib");
import("KeywordRegistry_basic");
......@@ -51,17 +53,7 @@ ExportTemplateUtils.buildExport = function (pExportTemplateId, pSelection, pComi
selection = [];
selection = JSON.parse(pSelection); //makes an array of the ContactIds/OrganisationIds of the selected data
}
else
{
filteredIdcondition = JSON.parse(selection).condition;
if(comingFrom == "Person")
selection = ExportTemplateUtils.contactIdsFilter(filteredIdcondition); //selects all ContactIds of the filtered data
else if(comingFrom == "Organisation")
selection = ExportTemplateUtils.contactIdsOrganisationFilter(filteredIdcondition); //selects all OrganisationIds of the filtered data
else
throw new Error(translate.text("pComingFrom is not defined. 'ExportTemplateUtils.buildExport:66'"));
}
if(filename == null || filename == undefined || filename.trim() == "") //if the user didn't choose a filename => generate one automatically
filename = ExportTemplateUtils.getExportFileName(templateTitle, "UTC");
filename += ".csv";
......@@ -94,7 +86,7 @@ ExportTemplateUtils.buildExport = function (pExportTemplateId, pSelection, pComi
return {content : csvTable,
filename : filename
};
}
};
/**
* Gets an Array of all the Fields of a ExportTemplate using it's unique exportTemplateId.
......@@ -111,7 +103,7 @@ ExportTemplateUtils.getTemplateFields = function (pExportTemplateId)
.where("EXPORTTEMPLATEFIELD.EXPORTTEMPLATE_ID", pExportTemplateId)
.orderBy("EXPORTTEMPLATEFIELD.SORTING")
.arrayColumn();
}
};
/**
* Generates a practical filename, with the templateName, and the date + time of the download, using it's unique exportTemplateId.
......@@ -128,45 +120,7 @@ ExportTemplateUtils.getExportFileName = function (pTemplateTitle, pTimeZone)
var exportFileName = pTemplateTitle + "_" + datetime.toDate(datetime.date(), "dd.MM.yyyy.HH:mm:ss", pTimeZone);
return exportFileName;
}
/**
* Generates an Array of all the contactIds using the filtercondition
*
* @param {String} pCondition the condition of the filter
*
* @return {Array} all the contactids limited by the filtercondition
*/
ExportTemplateUtils.contactIdsFilter = function (pCondition)
{
let query = newSelect("CONTACT.CONTACTID").from("CONTACT");
query.join("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID")
.leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID")
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.where(pCondition);
return query.arrayColumn();
}
/**
* Generates an Array of all the organisationIds (=contactIds of the organisations) using the filtercondition
*
* @param {String} pCondition the condition of the filter
*
* @return {Array} all the organisationids (=contactIds of the organisations) limited by the filtercondition
*/
ExportTemplateUtils.contactIdsOrganisationFilter = function (pCondition)
{
let query = newSelect("ORGANISATION.ORGANISATIONID").from("ORGANISATION");
query.leftJoin("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID")
.leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID")
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.where(pCondition);
return query.arrayColumn();
}
};
/**
* Gets the title, language, sentenceseparator, fieldseparator and fielddelimiter of an export template using it's unique Id
......@@ -184,7 +138,7 @@ ExportTemplateUtils.getTemplateData = function (pExportTemplateId)
.arrayRow();
data[1] = LanguageKeywordUtils.Iso2FromIso3(data[1]) //needed to get the language in the right format
return data;
}
};
/**
* Converts the sentence separator in the correct character if one of the keys is being used
......@@ -202,7 +156,7 @@ ExportTemplateUtils.getSentenceSeparator = function (pSentenceSeparator)
return "\r\n";
else
return pSentenceSeparator;
}
};
/**
* Converts the field separator in the correct character if one of the keys is being used
......@@ -224,7 +178,7 @@ ExportTemplateUtils.getFieldSeparator = function (pFieldSeparator)
return ";";
else
return pFieldSeparator;
}
};
/**
* Converts the field delimiter in the correct character if one of the keys is being used
......@@ -242,7 +196,7 @@ ExportTemplateUtils.getFieldDeLimiter = function (pFieldDeLimiter)
return "\"";
else
return pFieldDeLimiter;
}
};
/**
* Gets the Title of a Template
......@@ -257,4 +211,36 @@ ExportTemplateUtils.getExportTemplateTitle = function (pExportTemplateId)
.from("EXPORTTEMPLATE")
.where("EXPORTTEMPLATE.EXPORTTEMPLATEID", pExportTemplateId)
.cell(true);
}
\ No newline at end of file
};
/**
* Export contacts or organistaions by contactIds.<br>
*
* @param {String} pRowIds <p>
* The contact ids as JSON array.<br>
* @param {String} pSourceTableName <p>
* The source table.<br>
*/
ExportTemplateUtils.addParticipantsByRowIds = function (pRowIds, pSourceTableName)
{
var params = {
"selectedData_param" : pRowIds,
"comingFrom_param" : pSourceTableName}
neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
};
/**
* Export contacts or organistaions by condition (filter).<br>
*
* @param {String} pCondition <p>
* Contact ids.
* @param {String} pSourceTableName <p>
* The source table.<br>
*/
ExportTemplateUtils.addParticipantsByCondition = function (pCondition, pSourceTableName)
{
var params = {
"selectedData_param" : pCondition,
"comingFrom_param" : pSourceTableName}
neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params);
};
\ No newline at end of file
import("system.neon");
import("Sql_lib");
/**
* Methods to help build filterCondition statements.
* Do not create an instance of this!
......
<?xml version="1.0" encoding="UTF-8"?>
<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>FilterviewMenuAction_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/FilterviewMenuAction_lib/process.js</process>
<variants>
<element>LIBRARY</element>
</variants>
</process>
import("system.neon");
import("Sql_lib");
/**
* Methods for the menu actions in the filterview.
* Do not create an instance of this!
*
* @class
*/
function FilterviewMenuActionUtils() {}
/**
* Generates an Array of all the contactIds using the filtercondition
*
* @param {Condition} pCondition the condition of the filter
*
* @return {Array} all the contactids limited by the filtercondition
*/
FilterviewMenuActionUtils.contactIdsFilter = function (pCondition)
{
let query = newSelect("distinct CONTACT.CONTACTID").from("CONTACT");
query.join("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID")
.leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID")
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.where(pCondition);
return query.arrayColumn();
};
/**
* Generates an Array of all the organisationIds using the filtercondition
*
* @param {String} pCondition the condition of the filter
*
* @return {Array} all the organisationids (=contactIds of the organisations) limited by the filtercondition
*/
FilterviewMenuActionUtils.organisationIdsFilter = function (pCondition)
{
let query = newSelect("distinct ORGANISATION.ORGANISATIONID").from("ORGANISATION");
query.leftJoin("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID")
.leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID")
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.where(pCondition);
return query.arrayColumn();
};
/**
* Retuns the componentstate using the rowcount.
* (used for the menu actions)
*
* @param {pDataRowCount} pDataRowCount data row count (vars.get("$sys.datarowcount");)
*
* @return {String} componentstate
*/
FilterviewMenuActionUtils.getComponentStateByRowCount = function(pDataRowCount)
{
if(pDataRowCount > 0)
return neon.COMPONENTSTATE_EDITABLE;
else
return neon.COMPONENTSTATE_DISABLED;
};
\ No newline at end of file
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