Skip to content
Snippets Groups Projects
Commit 33e37d2b authored by Mohamed Mansour's avatar Mohamed Mansour
Browse files

merged origin/master into Receipt

parents ebae5e57 2c66b3a1
No related branches found
No related tags found
No related merge requests found
Showing
with 1272 additions and 1159 deletions
......@@ -4,4 +4,6 @@
<include relativeToChangelogFile="true" file="update_attribute_Ticket_Support_Product.xml"/>
<include relativeToChangelogFile="true" file="alter_SerialLetter.xml"/>
<include relativeToChangelogFile="true" file="insert_SerialLetterStatus_keyword.xml"/>
<include relativeToChangelogFile="true" file="insert_AttributeType_Theme_keyword.xml"/>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="s.listl" id="ec0f5419-353e-4643-8f08-03651d530401">
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="49dc7423-21c7-47b1-ac1e-b01e8eb5c822"/>
<column name="KEYID" value="THEME "/>
<column name="TITLE" value="Theme"/>
<column name="CONTAINER" value="AttributeType"/>
<column name="SORTING" valueNumeric="11"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="1"/>
</insert>
<update tableName="AB_KEYWORD_ENTRY">
<column name="ISACTIVE" valueNumeric="1" />
<where>AB_KEYWORD_ENTRYID = ?</where>
<whereParams>
<param value="75a67526-6b7c-400d-b958-e1f8f45466aa"/>
</whereParams>
</update>
</changeSet>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="s.listl" id="4c5659dd-16cb-435a-b573-74bc697989d1">
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="8898350e-fd68-45b5-97d6-618d867e53b7"/>
<column name="KEYID" value="SERIALLETTERNOTSENT "/>
<column name="TITLE" value="Not sent"/>
<column name="CONTAINER" value="SerialLetterStatus"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="f2fb362a-97d3-4c1d-8496-20abc99973ec"/>
<column name="KEYID" value="SERIALLETTERSENT "/>
<column name="TITLE" value="Sent"/>
<column name="CONTAINER" value="SerialLetterStatus"/>
<column name="SORTING" valueNumeric="2"/>
<column name="ISACTIVE" valueNumeric="1"/>
</insert>
</changeSet>
</databaseChangeLog>
......@@ -4,6 +4,7 @@
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Activity_entity/documentation.adoc</documentation>
<title>Activity</title>
<grantDeleteProcess>%aditoprj%/entity/Activity_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/Activity_entity/contentTitleProcess.js</contentTitleProcess>
<afterUiInit>%aditoprj%/entity/Activity_entity/afterUiInit.js</afterUiInit>
<iconId>VAADIN:HOURGLASS_END</iconId>
......@@ -114,6 +115,10 @@
<name>AssignmentTable_param</name>
<valueProcess>%aditoprj%/entity/Activity_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>AssignmentName_param</name>
<valueProcess>%aditoprj%/entity/Activity_entity/entityfields/documents/children/assignmentname_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
......
import("Document_lib");
import("system.vars");
import("system.result");
result.string(!DocumentUtil.hasDocuments("ACTIVITY", null, vars.get("$field.ACTIVITYID")));
\ No newline at end of file
This diff is collapsed.
......@@ -12,11 +12,7 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.r
{
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
var parentType = AttributeUtil.getAttributeType(vars.get("$field.ATTRIBUTE_PARENT_ID"));
if (parentType == $AttributeTypes.COMBO || parentType == $AttributeTypes.VOID)
{
state = neon.COMPONENTSTATE_READONLY;
}
else if (AttributeTypeUtil.isGroupType(type))
if (AttributeTypeUtil.isGroupType(type))
{
var hasSubordinate = db.cell(SqlCondition.begin()
.andPrepareVars("AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID", "$field.UID")
......
......@@ -7,10 +7,7 @@ import("Attribute_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.ATTRIBUTE_PARENT_ID") != "")
{
var type = AttributeUtil.getAttributeType(vars.get("$field.ATTRIBUTE_PARENT_ID"));
if (type == $AttributeTypes.COMBO)
result.string($AttributeTypes.COMBOVALUE);
else if (type == $AttributeTypes.VOID)
result.string($AttributeTypes.VOID);
else if (vars.get("$this.value") == $AttributeTypes.COMBOVALUE)
result.string("");
var possibleTypes = AttributeTypeUtil.getPossibleChildren(type);
if (possibleTypes && possibleTypes.length === 1)
result.string(possibleTypes[0]);
}
\ No newline at end of file
import("system.translate");
import("Context_lib");
import("system.vars");
import("system.result");
import("Keyword_lib");
import("Attribute_lib");
var res = [];
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
var getDropDownFn = type && $AttributeTypes[type] && $AttributeTypes[type].getDropDownDefinitions;
if (getDropDownFn instanceof Function)
res = getDropDownFn.call();
result.object(res);
import("system.translate");
import("Context_lib");
import("system.vars");
import("system.result");
import("Keyword_lib");
import("Attribute_lib");
var res = [];
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
var getDropDownFn = type && $AttributeTypes[type] && $AttributeTypes[type].getDropDownDefinitions;
if (getDropDownFn instanceof Function)
res = getDropDownFn.call();
result.object(res);
import("system.translate");
import("system.neon");
import("system.vars");
import("system.result");
import("Attribute_lib");
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
if (type == $AttributeTypes.KEYWORD)
result.string(translate.text("Keyword"));
else if (type == $AttributeTypes.OBJECTSELECTION)
result.string(translate.text("Module"));
import("system.translate");
import("system.neon");
import("system.vars");
import("system.result");
import("Attribute_lib");
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
if (type == $AttributeTypes.KEYWORD)
result.string(translate.text("Keyword"));
else if (type == $AttributeTypes.OBJECTSELECTION)
result.string(translate.text("Module"));
import("system.translate");
import("system.neon");
import("system.vars");
import("system.result");
import("Attribute_lib");
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
if (type == $AttributeTypes.KEYWORD)
result.string(translate.text("Keyword"));
else if (type == $AttributeTypes.OBJECTSELECTION)
result.string(translate.text("Module"));
import("system.translate");
import("system.neon");
import("system.vars");
import("system.result");
import("Attribute_lib");
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
if (type == $AttributeTypes.KEYWORD)
result.string(translate.text("Keyword"));
else if (type == $AttributeTypes.OBJECTSELECTION)
result.string(translate.text("Module"));
import("system.logging");
import("system.db");
import("system.neon");
import("system.result");
import("system.vars");
import("Attribute_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
{
var possibleTypes;
if (vars.get("$field.ATTRIBUTE_PARENT_ID"))
{
var type = AttributeUtil.getAttributeType(vars.get("$field.ATTRIBUTE_PARENT_ID"));
possibleTypes = AttributeTypeUtil.getPossibleChildren(type);
}
if (!possibleTypes)
{
possibleTypes = [];
for (let attrType in $AttributeTypes)
if ($AttributeTypes[attrType].toString() != $AttributeTypes.COMBOVALUE.toString())
possibleTypes.push($AttributeTypes[attrType].toString());
}
logging.log(JSON.stringify(possibleTypes, null, "\t"))
result.object(possibleTypes);
}
\ No newline at end of file
import("system.translate");
import("Util_lib");
import("JditoFilter_lib");
import("KeywordRegistry_basic");
import("Keyword_lib");
import("system.db");
import("system.vars");
import("system.result");
import("Sql_lib");
import("Attribute_lib");
var getGroups = vars.exists("$param.GetGroups_param") && vars.get("$param.GetGroups_param");
var objectType = vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param");
var parentType = vars.exists("$param.AttrParentType_param") && vars.get("$param.AttrParentType_param");
var fetchUsages = true;
var translateName = false;
var sqlSelect = "select AB_ATTRIBUTEID, ATTRIBUTE_PARENT_ID, ATTRIBUTE_NAME, ATTRIBUTE_ACTIVE, DROPDOWNDEFINITION, DROPDOWNFILTER, SORTING, ATTRIBUTE_TYPE, "
+ KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.attributeType(), "ATTRIBUTE_TYPE") //3
+ ", '', '', '' from AB_ATTRIBUTE";
var sqlOrder = " order by ATTRIBUTE_PARENT_ID asc, SORTING asc";
var condition = SqlCondition.begin();
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues"))
{
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", vars.get("$local.idvalues"));
}
else if (getGroups) //if getGroups == true, it is the lookup for selecting the superordinate attribute
{
//this condition filters out the own id and the children to prevent loops
var isGroupCondition = SqlCondition.begin();
for (let type in $AttributeTypes)
if ($AttributeTypes[type].isGroup)
{
isGroupCondition.orPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes[type]);
}
condition.andSqlCondition(SqlCondition.begin()
.andSqlCondition(isGroupCondition)
.andPrepareVars("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$param.AttrParentId_param", "# != ?")
.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")), null, true)
);
}
else if (objectType) //if there's an objectType, it comes from the AttributeRelation entity (lookup for the attribute selection)
{
var filteredAttributes = null;
if (vars.exists("$param.FilteredAttributeIds_param") && vars.getString("$param.FilteredAttributeIds_param")) {
filteredAttributes = JSON.parse(vars.getString("$param.FilteredAttributeIds_param"));
}
var attributeCount;
if (vars.exists("$param.AttributeCount_param") && vars.get("$param.AttributeCount_param"))
attributeCount = JSON.parse(vars.getString("$param.AttributeCount_param"));
var ids = AttributeUtil.getPossibleAttributes(objectType, false, filteredAttributes, attributeCount);
if (ids.length > 0)
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", ids);
else // do not return anything, if parameter is there but an empty array
condition.and("1=2");
fetchUsages = false;
translateName = true;
}
else if (parentType) //condition for all subordinate attributes of an attribute (for the tree of subordinate attributes in an attribute)
{
if (AttributeTypeUtil.isGroupType(parentType))
{
var parentId = vars.exists("$param.AttrParentId_param") && vars.get("$param.AttrParentId_param");
if (parentId)
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")));
}
else
condition.and("1=2");
translateName = true;
}
//when there are filters selected, add them to the conditon
if (vars.exists("$local.filter") && vars.get("$local.filter"))
{
var filter = vars.get("$local.filter");
if (filter.filter)
condition.andSqlCondition(JditoFilterUtils.getSqlCondition(filter.filter, "AB_ATTRIBUTE"));
}
var usages;
if (fetchUsages) //this query is only necessary in Attribute, not in AttributeRelation
{
var usagesSelect = "select AB_ATTRIBUTE_ID, OBJECT_TYPE from AB_ATTRIBUTEUSAGE \n\
join AB_ATTRIBUTE on AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID";
var usageTbl = db.table(condition.buildSql(usagesSelect, "1=1"));
usages = {};
for (let i = 0, l = usageTbl.length; i < l; i++)
{
let attrId = usageTbl[i][0];
if (attrId in usages)
usages[attrId].push(usageTbl[i][1]);
else
usages[attrId] = [usageTbl[i][1]];
}
}
var attributes = db.table(condition.buildSql(sqlSelect, "1=1", sqlOrder));
var allNames = db.table("select AB_ATTRIBUTEID, ATTRIBUTE_PARENT_ID, ATTRIBUTE_NAME from AB_ATTRIBUTE");
var attrNameData = {};
for (let i = 0, l = allNames.length; i < l; i++)
{
attrNameData[allNames[i][0]] = [
allNames[i][1],
translateName
? translate.text(allNames[i][2])
: allNames[i][2]
];
}
var nameCache = {};
result.object(_buildAttributeTable(attributes, usages));
//sorts the records in a way that a tree can be built and adds values
function _buildAttributeTable (pAttributes, pUsages)
{
var rows = {};
var allIds = {};
//fills the allIds object, the object is used for checking if a parent exists in the array
for (let i = 0, l = pAttributes.length; i < l; i++)
allIds[pAttributes[i][0]] = true;
var arrayIndex = 0;
do {
var oldIndex = arrayIndex;
pAttributes.forEach(function (row)
{
//item will be added if the id is not already in the object and
//the parent is already added (or the parent is not in the array)
if (!(row[0] in this) && (row[1] in this || !allIds[row[1]]))
this[row[0]] = {
data : row,
index : arrayIndex++
};
}, rows);
} while (oldIndex != arrayIndex); //stops the loop when no new items were added so that recursive relations between attributes don't cause an infinite loop
var displaySimpleName = vars.exists("$param.DisplaySimpleName_param") && vars.get("$param.DisplaySimpleName_param");
var sortedArray = new Array(Object.keys(rows).length);
for (let i in rows)
{
let rowData = rows[i].data;
if (pUsages && rowData[7].trim() != $AttributeTypes.COMBOVALUE && i in pUsages)
{
rowData[9] = pUsages[i].map(function (usage)
{
return translate.text(usage);
}).join(", ");
}
rowData[10] = _getFullName(rowData[1]); //parent full name
rowData[11] = _getFullName(rowData[0], displaySimpleName);
sortedArray[rows[i].index] = rowData;
}
return sortedArray;
/**
* builds the full attribute name from the pre-loaded parent names and adds all parent names
* if required
*/
function _getFullName (pAttributeId, pSimpleName)
{
if (!pAttributeId)
return "";
var attrId = pAttributeId;
var fullName = [];
while (attrId)
{
let name = null;
if (attrId in nameCache)
{
name = nameCache[attrId];
attrId = null;
}
else if (attrId in attrNameData)
{
name = attrNameData[attrId][1];
attrId = attrNameData[attrId][0]; //next parent
}
else
attrId = null;
if (name)
fullName.unshift(name);
if (pSimpleName)
break;
}
fullName = fullName.join(" / ");
nameCache[pAttributeId] = fullName;
return fullName;
}
}
import("system.translate");
import("Util_lib");
import("JditoFilter_lib");
import("KeywordRegistry_basic");
import("Keyword_lib");
import("system.db");
import("system.vars");
import("system.result");
import("Sql_lib");
import("Attribute_lib");
var getGroups = vars.exists("$param.GetGroups_param") && vars.get("$param.GetGroups_param");
var objectType = vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param");
var parentType = vars.exists("$param.AttrParentType_param") && vars.get("$param.AttrParentType_param");
var fetchUsages = true;
var translateName = false;
var sqlSelect = "select AB_ATTRIBUTEID, ATTRIBUTE_PARENT_ID, ATTRIBUTE_NAME, ATTRIBUTE_ACTIVE, DROPDOWNDEFINITION, DROPDOWNFILTER, SORTING, ATTRIBUTE_TYPE, "
+ KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.attributeType(), "ATTRIBUTE_TYPE") //3
+ ", '', '', '' from AB_ATTRIBUTE";
var sqlOrder = " order by ATTRIBUTE_PARENT_ID asc, SORTING asc";
var condition = SqlCondition.begin();
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues"))
{
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", vars.get("$local.idvalues"));
}
else if (getGroups) //if getGroups == true, it is the lookup for selecting the superordinate attribute
{
//this condition filters out the own id and the children to prevent loops
var isGroupCondition = SqlCondition.begin();
for (let type in $AttributeTypes)
if ($AttributeTypes[type].isGroup)
{
isGroupCondition.orPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes[type]);
}
condition.andSqlCondition(SqlCondition.begin()
.andSqlCondition(isGroupCondition)
.andPrepareVars("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$param.AttrParentId_param", "# != ?")
.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")), null, true)
);
}
else if (objectType) //if there's an objectType, it comes from the AttributeRelation entity (lookup for the attribute selection)
{
var filteredAttributes = null;
if (vars.exists("$param.AttributeTypes_param") && vars.getString("$param.AttributeTypes_param"))
condition.andIn("AB_ATTRIBUTE.ATTRIBUTE_TYPE", JSON.parse(vars.getString("$param.AttributeTypes_param")));
if (vars.exists("$param.FilteredAttributeIds_param") && vars.getString("$param.FilteredAttributeIds_param"))
filteredAttributes = JSON.parse(vars.getString("$param.FilteredAttributeIds_param"));
var attributeCount;
if (vars.exists("$param.AttributeCount_param") && vars.get("$param.AttributeCount_param"))
attributeCount = JSON.parse(vars.getString("$param.AttributeCount_param"));
var ids = AttributeUtil.getPossibleAttributes(objectType, false, filteredAttributes, attributeCount);
if (ids.length > 0)
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", ids);
else // do not return anything, if parameter is there but an empty array
condition.and("1=2");
fetchUsages = false;
translateName = true;
}
else if (parentType) //condition for all subordinate attributes of an attribute (for the tree of subordinate attributes in an attribute)
{
if (AttributeTypeUtil.isGroupType(parentType))
{
var parentId = vars.exists("$param.AttrParentId_param") && vars.get("$param.AttrParentId_param");
if (parentId)
condition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", AttributeUtil.getAllChildren(vars.getString("$param.AttrParentId_param")));
}
else
condition.and("1=2");
translateName = true;
}
//when there are filters selected, add them to the conditon
if (vars.exists("$local.filter") && vars.get("$local.filter"))
{
var filter = vars.get("$local.filter");
if (filter.filter)
condition.andSqlCondition(JditoFilterUtils.getSqlCondition(filter.filter, "AB_ATTRIBUTE"));
}
var usages;
if (fetchUsages) //this query is only necessary in Attribute, not in AttributeRelation
{
var usagesSelect = "select AB_ATTRIBUTE_ID, OBJECT_TYPE from AB_ATTRIBUTEUSAGE \n\
join AB_ATTRIBUTE on AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID";
var usageTbl = db.table(condition.buildSql(usagesSelect, "1=1"));
usages = {};
for (let i = 0, l = usageTbl.length; i < l; i++)
{
let attrId = usageTbl[i][0];
if (attrId in usages)
usages[attrId].push(usageTbl[i][1]);
else
usages[attrId] = [usageTbl[i][1]];
}
}
var attributes = db.table(condition.buildSql(sqlSelect, "1=1", sqlOrder));
var allNames = db.table("select AB_ATTRIBUTEID, ATTRIBUTE_PARENT_ID, ATTRIBUTE_NAME from AB_ATTRIBUTE");
var attrNameData = {};
for (let i = 0, l = allNames.length; i < l; i++)
{
attrNameData[allNames[i][0]] = [
allNames[i][1],
translateName
? translate.text(allNames[i][2])
: allNames[i][2]
];
}
var nameCache = {};
result.object(_buildAttributeTable(attributes, usages));
//sorts the records in a way that a tree can be built and adds values
function _buildAttributeTable (pAttributes, pUsages)
{
var rows = {};
var allIds = {};
//fills the allIds object, the object is used for checking if a parent exists in the array
for (let i = 0, l = pAttributes.length; i < l; i++)
allIds[pAttributes[i][0]] = true;
var arrayIndex = 0;
do {
var oldIndex = arrayIndex;
pAttributes.forEach(function (row)
{
//item will be added if the id is not already in the object and
//the parent is already added (or the parent is not in the array)
if (!(row[0] in this) && (row[1] in this || !allIds[row[1]]))
this[row[0]] = {
data : row,
index : arrayIndex++
};
}, rows);
} while (oldIndex != arrayIndex); //stops the loop when no new items were added so that recursive relations between attributes don't cause an infinite loop
var displaySimpleName = vars.exists("$param.DisplaySimpleName_param") && vars.get("$param.DisplaySimpleName_param");
var sortedArray = new Array(Object.keys(rows).length);
for (let i in rows)
{
let rowData = rows[i].data;
if (pUsages && rowData[7].trim() != $AttributeTypes.COMBOVALUE && i in pUsages)
{
rowData[9] = pUsages[i].map(function (usage)
{
return translate.text(usage);
}).join(", ");
}
rowData[10] = _getFullName(rowData[1]); //parent full name
rowData[11] = _getFullName(rowData[0], displaySimpleName);
sortedArray[rows[i].index] = rowData;
}
return sortedArray;
/**
* builds the full attribute name from the pre-loaded parent names and adds all parent names
* if required
*/
function _getFullName (pAttributeId, pSimpleName)
{
if (!pAttributeId)
return "";
var attrId = pAttributeId;
var fullName = [];
while (attrId)
{
let name = null;
if (attrId in nameCache)
{
name = nameCache[attrId];
attrId = null;
}
else if (attrId in attrNameData)
{
name = attrNameData[attrId][1];
attrId = attrNameData[attrId][0]; //next parent
}
else
attrId = null;
if (name)
fullName.unshift(name);
if (pSimpleName)
break;
}
fullName = fullName.join(" / ");
nameCache[pAttributeId] = fullName;
return fullName;
}
}
import("Sql_lib");
import("system.db");
import("system.vars");
var rowdata = vars.get("$local.rowdata");
var columns = [
"ATTRIBUTE_ACTIVE",
"ATTRIBUTE_NAME",
"ATTRIBUTE_PARENT_ID",
"ATTRIBUTE_TYPE",
"DROPDOWNDEFINITION",
"DROPDOWNFILTER",
"SORTING"
];
var values = [
rowdata["ATTRIBUTE_ACTIVE.value"] || "",
rowdata["ATTRIBUTE_NAME.value"] || "",
rowdata["ATTRIBUTE_PARENT_ID.value"] || "",
rowdata["ATTRIBUTE_TYPE.value"] || "",
rowdata["DROPDOWNDEFINITION.value"] || "",
rowdata["DROPDOWNFILTER.value"] || "",
rowdata["SORTING.value"] || ""
];
db.updateData("AB_ATTRIBUTE", columns, null, values,
import("system.logging");
import("Sql_lib");
import("system.db");
import("system.vars");
var rowdata = vars.get("$local.rowdata");
var columns = [
"ATTRIBUTE_ACTIVE",
"ATTRIBUTE_NAME",
"ATTRIBUTE_PARENT_ID",
"ATTRIBUTE_TYPE",
"DROPDOWNDEFINITION",
"DROPDOWNFILTER",
"SORTING"
];
var values = [
rowdata["ATTRIBUTE_ACTIVE.value"] || "",
rowdata["ATTRIBUTE_NAME.value"] || "",
rowdata["ATTRIBUTE_PARENT_ID.value"] || "",
rowdata["ATTRIBUTE_TYPE.value"] || "",
rowdata["DROPDOWNDEFINITION.value"] || "",
rowdata["DROPDOWNFILTER.value"] || "",
rowdata["SORTING.value"] || ""
];
logging.log(JSON.stringify(values, null, "\t"))
db.updateData("AB_ATTRIBUTE", columns, null, values,
SqlCondition.equals("AB_ATTRIBUTE.AB_ATTRIBUTEID", vars.get("$field.UID"), "1=2"));
\ No newline at end of file
......@@ -7,7 +7,7 @@ import("KeywordRegistry_basic");
import("Entity_lib");
var contactId = vars.get("local.value");
if (BulkMailUtils.isRecipient(vars.get("$field.BULKMAIL_ID"), contactId))
if (BulkMailUtils.isRecipient(vars.get("$field.BULKMAIL_ID"), contactId, vars.get("$field.BULKMAILRECIPIENTID")))
result.string(translate.text("The contact is already a recipient!"));
else if (ContactUtils.hasCommRestriction(contactId, $KeywordRegistry.communicationMediumCampaign$mail()))
result.string(translate.text("The contact has an advertising ban for emails!"));
\ No newline at end of file
import("system.neon");
import("Sql_lib");
import("system.vars");
import("system.db");
......@@ -31,7 +32,8 @@ else
_handleCondition(campaignId, conditionSourceTableName, participantCondition);
}
if (!vars.exists("$param.currentCampaignId_param") || !vars.get("$param.currentCampaignId_param"))
neon.openContext("Campaign", "CampaignMain_view", [campaignId], neon.OPERATINGSTATE_VIEW, null);
function _handleCondition(pCampaignId, pTargetTableName, pCondition)
{
......
This diff is collapsed.
import("Context_lib");
import("system.vars");
import("ActivityTask_lib");
import("system.result");
result.string(!TaskUtils.hasTasks(vars.get("$field.CAMPAIGNSTEPID"), ContextUtils.getCurrentContextId())
&& !ActivityUtils.hasActivities(vars.get("$field.CAMPAIGNSTEPID"), ContextUtils.getCurrentContextId()));
\ No newline at end of file
......@@ -10,6 +10,7 @@
<element>CampaignCostChart_entity</element>
<element>CampaignStep_entity</element>
</siblings>
<grantDeleteProcess>%aditoprj%/entity/Campaign_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/Campaign_entity/contentTitleProcess.js</contentTitleProcess>
<afterUiInit>%aditoprj%/entity/Campaign_entity/afterUiInit.js</afterUiInit>
<iconId>VAADIN:GROUP</iconId>
......
import("Context_lib");
import("ActivityTask_lib");
import("Document_lib");
import("system.vars");
import("system.result");
result.string(!DocumentUtil.hasDocuments("CAMPAIGN", null, vars.get("$field.CAMPAIGNID"))
&& !TaskUtils.hasTasks(vars.get("$field.CAMPAIGNID"), ContextUtils.getCurrentContextId())
&& !ActivityUtils.hasActivities(vars.get("$field.CAMPAIGNID"), ContextUtils.getCurrentContextId()));
\ 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