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

#1058030 comments added

parent 1942f283
No related branches found
No related tags found
No related merge requests found
......@@ -155,8 +155,9 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pTestRecipients)
/**
* Opens a context to select a bulk mail to add recipients to.<br>
*
* @param {String[]} pContactIds <p>
* Recipients that should be added.<br>
* @param {String} pContext the context of the contacts (Person or Organisation)
* @param {String[]} pContactIds Recipients that should be added.<br>
* @param {String|Object} pFilter the filter for the contacts that should be used if no contact is selected
*/
BulkMailUtils.openAddRecipientView = function (pContext, pContactIds, pFilter)
{
......@@ -425,11 +426,11 @@ SerialLetterUtils.addRecipients = function (pSerialLetterId, pContactIds)
}
/**
* Opens a context to select a serial letter<br>
* to add recipients to.<br>
* Opens a context to select a serial letter to add recipients to.<br>
*
* @param {String[]} pContactIds <p>
* Recipients that should be added.<br>
* @param {String} pContext the context of the contacts (Person or Organisation)
* @param {String[]} pContactIds Recipients that should be added.<br>
* @param {String|Object} pFilter the filter for the contacts that should be used if no contact is selected
*/
SerialLetterUtils.openAddRecipientView = function (pContext, pContactIds, pFilter)
{
......
......@@ -3,6 +3,7 @@
<name>FilterViewAction_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/FilterViewAction_lib/process.js</process>
<alias>Data_alias</alias>
<variants>
<element>LIBRARY</element>
</variants>
......
......@@ -12,6 +12,13 @@ import("system.entities");
*/
function FilterViewActionUtils() {}
/**
* Loads all uids of the given context that can be found when the given filter is applied.
*
* @param {String} pContext the context
* @param {String|Object} pFilter the filter to apply (content of "$sys.filter")
* @return {String[]} all uids that could be found
*/
FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter)
{
if (Utils.isString(pFilter))
......@@ -20,7 +27,8 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter)
//uids from Person and Organisation are loaded with simple sql queries because that's much faster than over the entity'
if (pContext == "Person" && "condition" in pFilter)
{
return newSelect("CONTACT.CONTACTID")
return new SqlBuilder()
.selectDistinct("CONTACT.CONTACTID")
.from("PERSON")
.join("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID")
.join("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID")
......@@ -30,7 +38,8 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter)
}
if (pContext == "Organisation" && "condition" in pFilter)
{
return newSelect("CONTACT.CONTACTID")
return new SqlBuilder()
.selectDistinct("CONTACT.CONTACTID")
.from("PERSON")
.join("CONTACT", newWhere("ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID").and("CONTACT.PERSON_ID is null"))
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
......@@ -51,6 +60,15 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter)
});
}
/**
* Loads uids depending on the given context, selection and filter. If there are uids in the given selection, these will be returned, otherwise
* the context and filter are used for getting the uids.
*
* @param {String} pContext the context
* @param {String[]} pSelection selected uids ("$sys.selection")
* @param {String|Object} pFilter the filter ("$sys.filter")
* @return {String[]} the uids that should be used
*/
FilterViewActionUtils.getUidsBySelectionOrFilter = function (pContext, pSelection, pFilter)
{
if (Utils.isNullOrEmpty(pSelection) && pFilter)
......
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