Skip to content
Snippets Groups Projects
Commit c28f4635 authored by b.ulrich's avatar b.ulrich
Browse files

merged 2020.0 into 1042982_belegInsLog

parents ff194c30 809dc82b
No related branches found
No related tags found
No related merge requests found
Showing
with 106 additions and 78 deletions
#This file is generated by ADITO designer. Do NOT delete or modify!
#Wed Feb 05 13:39:26 CET 2020
#Mon Feb 03 11:04:39 CET 2020
version=6.1.0
......@@ -6,10 +6,12 @@ import("system.result");
/**
* Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate
*/
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param"))
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && vars.get("$this.value") == null)
{
var event = JSON.parse(vars.getString("$param.Entry_param"));
if(event["X-ADITO-ISALLDAYEVENT"])
result.string(event["X-ADITO-ISALLDAYEVENT"]);
}
\ No newline at end of file
}
else
result.string(vars.get("$this.value"));
\ No newline at end of file
......@@ -6,10 +6,12 @@ import("system.result");
/**
* Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate
*/
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param"))
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && vars.get("$this.value") == null)
{
var event = JSON.parse(vars.getString("$param.Entry_param"));
if(event[calendars.CLASSIFICATION])
result.string(event[calendars.CLASSIFICATION]);
}
\ No newline at end of file
}
else
result.string(vars.get("$this.value"));
\ No newline at end of file
......@@ -45,9 +45,9 @@ if(startLong != null && endLong != null)
datebegin = startdate;
if(datetime.isToday(endLong))
dateend = ranslate.text("today");
dateend = translate.text("today");
else if(datetime.isTomorrow(endLong))
dateend = ranslate.text("tomorrow");
dateend = translate.text("tomorrow");
else
dateend = enddate;
......
......@@ -6,10 +6,12 @@ import("system.result");
/**
* Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate
*/
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param"))
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && vars.get("$this.value") == null)
{
var event = JSON.parse(vars.getString("$param.Entry_param"));
if(event[calendars.TRANSPARENCY])
result.string(event[calendars.TRANSPARENCY]);
}
\ No newline at end of file
}
else
result.string(vars.get("$this.value"));
\ No newline at end of file
import("Context_lib");
import("system.result");
import("system.neon");
import("system.vars");
import("system.project");
if (vars.get("$field.OBJECT_TYPE"))
{
......@@ -9,5 +9,5 @@ if (vars.get("$field.OBJECT_TYPE"))
//@TODO replace this when it's possible to get the old value in onDBUpdate
vars.set("$context.originalObjectType", vars.get("$field.OBJECT_TYPE"));
result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.OBJECT_TYPE"))[1]);
result.string(ContextUtils.getTitle(vars.get("$field.OBJECT_TYPE"), true));
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
<contentTitleProcess>%aditoprj%/entity/Attribute_entity/contentTitleProcess.js</contentTitleProcess>
<afterUiInit>%aditoprj%/entity/Attribute_entity/afterUiInit.js</afterUiInit>
<onValidation>%aditoprj%/entity/Attribute_entity/onValidation.js</onValidation>
<afterOperatingState>%aditoprj%/entity/Attribute_entity/afterOperatingState.js</afterOperatingState>
<iconId>VAADIN:TAG</iconId>
<titlePlural>Attributes</titlePlural>
<recordContainer>jdito</recordContainer>
......
import("system.vars");
import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW && vars.get("$param.ParentIdPreset_param"))
neon.refreshAll();
\ No newline at end of file
......@@ -12,6 +12,6 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.
if (possibleTypes && possibleTypes.length === 1) //only one type possible -> set that type
result.string(possibleTypes[0]);
else if (possibleTypes.indexOf(type) === -1) //selected type can't be used with parent -> reset type
else if (possibleTypes && possibleTypes.indexOf(type) === -1) //selected type can't be used with parent -> reset type
result.string("");
}
\ No newline at end of file
import("Context_lib");
import("system.translate");
import("Util_lib");
import("JditoFilter_lib");
......@@ -171,7 +172,7 @@ function _buildAttributeTable (pAttributes, pUsages)
{
rowData[9] = pUsages[i].map(function (usage)
{
return translate.text(usage);
return ContextUtils.getTitle(usage, true);
}).join(", ");
}
rowData[10] = _getFullName(rowData[1]); //parent full name
......
......@@ -36,6 +36,7 @@
</entityField>
<entityField>
<name>CLASSIFICATIONGROUP</name>
<title>Group</title>
<contentType>TEXT</contentType>
<groupable v="true" />
<mandatoryProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroup/mandatoryProcess.js</mandatoryProcess>
......
......@@ -383,6 +383,9 @@
<isFilterable v="true" />
<isLookupFilter v="true" />
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>PASSWORD.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>CONFIRM_PASSWORD.value</name>
</jDitoRecordFieldMapping>
......@@ -395,12 +398,6 @@
<name>SHORT_UID.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
<filterExtensions>
<filterExtension>
<name>filterExtension</name>
<contentType>TEXT</contentType>
</filterExtension>
</filterExtensions>
</jDitoRecordContainer>
</recordContainers>
</entity>
......@@ -35,16 +35,17 @@ users = users.map(function (user)
user[tools.DESCRIPTION],
user[tools.PARAMS][tools.CONTACTID], //8
user[tools.PARAMS].department,
null,
"",
fetchRoles ? tools.getRoles(user[tools.TITLE]) : [] //for filtering
"", //password
"", //confirm_password
fetchRoles ? tools.getRoles(user[tools.TITLE]) : [], //for filtering
EmployeeUtils.sliceUserId(user[tools.NAME])
];
});
var filter = vars.get("$local.filter");
//TODO: this is a workaround that filters the records manually, it should be possible to filter the users with a tools.* method
var filterFields = ["UID", "TITLE", "ISACTIVE", "FIRSTNAME", "LASTNAME", "EMAIL_ADDRESS", "", "DESCRIPTION", "CONTACT_ID", "", "DEPARTMENT", "", "ROLE_FILTER"];
var filterFields = ["UID", "TITLE", "ISACTIVE", "FIRSTNAME", "LASTNAME", "EMAIL_ADDRESS", "", "DESCRIPTION", "CONTACT_ID", "DEPARTMENT", "", "", "ROLE_FILTER"];
var filterFns = {
"ROLE_FILTER" : function (pRecordVal, pFilterVal, pOperator)
{
......@@ -67,11 +68,7 @@ var filterFns = {
};
users = JditoFilterUtils.filterRecords(filterFields, users, filter.filter, filterFns);
for (let i = 0, l = users.length; i < l; i++)
{
users[i][11] = "";
users[i][12] = EmployeeUtils.sliceUserId(users[i][0]);
}
users.forEach(function (user) {user[12] = "";}); //clean up the ROLE_FILTER field, we don't need it after filtering
var order = vars.get("$local.order");
var columnOrder = {
......
......@@ -3,22 +3,24 @@ import("system.vars");
import("system.tools");
import("Employee_lib");
var rowdata = vars.get("$local.rowdata");
var user = {};
var params = []; //this has to be an array
params[tools.FIRSTNAME] = vars.get("$field.FIRSTNAME");
params[tools.LASTNAME] = vars.get("$field.LASTNAME");
params[tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS");
params[tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS");
params[tools.CONTACTID] = vars.get("$field.CONTACT_ID");
params[tools.DESCRIPTION] = vars.get("$field.DESCRIPTION");
params[tools.ISACTIVE] = vars.get("$field.ISACTIVE");
params.department = vars.get("$field.DEPARTMENT");
params[tools.EMAIL] = rowdata["EMAIL_ADDRESS.value"];
params[tools.CALENDARID] = rowdata["EMAIL_ADDRESS.value"];
params[tools.DESCRIPTION] = rowdata["DESCRIPTION.value"];
params[tools.CONTACTID] = rowdata["CONTACT_ID.value"];
params[tools.FIRSTNAME] = rowdata["FIRSTNAME.value"];
params[tools.LASTNAME] = rowdata["LASTNAME.value"];
params[tools.ISACTIVE] = rowdata["ISACTIVE.value"];
params.department = rowdata["DEPARTMENT.value"];
user[tools.TITLE] = vars.get("$field.TITLE");
user[tools.TITLE] = rowdata["TITLE.value"];
user[tools.PARAMS] = params;
if (vars.get("$field.PASSWORD") && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD"))
if (rowdata["PASSWORD.value"] && rowdata["PASSWORD.value"] == rowdata["CONFIRM_PASSWORD.value"])
{
user[tools.PASSWORD] = vars.getString("$field.PASSWORD");
user[tools.PASSWORD] = rowdata["PASSWORD.value"];
}
tools.insertUser(user, vars.get("$field.UID"));
\ No newline at end of file
tools.insertUser(user, rowdata["UID.value"]);
\ No newline at end of file
......@@ -1007,12 +1007,6 @@
<name>HEADER.value</name>
<recordfield>SALESORDER.HEADER</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>LANGUAGE.value</name>
<recordfield>SALESORDER.ISOLANGUAGE</recordfield>
<isFilterable v="true" />
<isLookupFilter v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>NET.value</name>
<recordfield>SALESORDER.NET</recordfield>
......@@ -1163,6 +1157,12 @@
<dbRecordFieldMapping>
<name>ISOLANGUAGE.value</name>
<recordfield>SALESORDER.ISOLANGUAGE</recordfield>
<isFilterable v="true" />
<isLookupFilter v="false" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ISOLANGUAGE.displayValue</name>
<expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/isolanguage.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
......
......@@ -6,7 +6,7 @@ import("Order_lib");
var itemcount = newSelect("count(*)")
.from("SALESORDERITEM")
.whereIfSet("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDERID")
.whereIfSet("SALESORDERITEM.SALESORDER_ID", "$field.SALESORDER_ID")
.cell(true, "0");
if (vars.get("$field.OrderStatus") == undefined){
......
......@@ -36,6 +36,9 @@ else
wfInstances = _getInstances(workflowDefId, workflowDefKey);
}
if (!wfInstances)
wfInstances = [];
wfInstances = wfInstances.map(function (instance)
{
return [
......
......@@ -37,8 +37,8 @@
<entityField>ORDERTYPE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>49e446b5-015e-45ad-9417-c5c50f9756f1</name>
<entityField>LANGUAGE</entityField>
<name>1be56d96-0a47-4895-a73f-2e01855da628</name>
<entityField>ISOLANGUAGE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>fecf7457-825d-40a3-b330-bace7ed75ddc</name>
......
......@@ -364,7 +364,7 @@ CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCon
if(pCondition != "")
query.and(pCondition);
return query.arraColumn();
return query.arrayColumn();
}
CampaignUtils.GetContactIdsInCampaignByCondition = function(pCampaignId, pCondition, pRightJoinContacts)
......
import("system.tools");
import("system.logging");
import("Sql_lib");
......@@ -44,6 +45,8 @@ JditoFilterHelper.prototype.checkRecord = function (pRow)
if (this.filter.length == 0)
return true;
var regexFlags = JditoFilterUtils.isUserIgnoreCase() ? "i" : undefined;
return _testRecord.call(this, this.filter);
/**
......@@ -74,17 +77,17 @@ JditoFilterHelper.prototype.checkRecord = function (pRow)
switch (pOperator)
{
case "CONTAINS":
return (new RegExp(pFilterValue)).test(pRowValue);
return (new RegExp(pFilterValue, regexFlags)).test(pRowValue);
case "CONTAINSNOT":
return !(new RegExp(pFilterValue)).test(pRowValue);
return !(new RegExp(pFilterValue, regexFlags)).test(pRowValue);
case "STARTSWITH":
return (new RegExp("^" + pFilterValue)).test(pRowValue);
return (new RegExp("^" + pFilterValue, regexFlags)).test(pRowValue);
case "ENDSWITH":
return (new RegExp(pFilterValue + "$")).test(pRowValue);
return (new RegExp(pFilterValue + "$", regexFlags)).test(pRowValue);
case "EQUAL":
return (new RegExp("^" + pFilterValue + "$")).test(pRowValue);
return (new RegExp("^" + pFilterValue + "$", regexFlags)).test(pRowValue);
case "NOT_EQUAL":
return !(new RegExp("^" + pFilterValue + "$")).test(pRowValue);
return !(new RegExp("^" + pFilterValue + "$", regexFlags)).test(pRowValue);
case "LESS":
return pRowValue < pFilterValue;
case "LESS_OR_EQUAL":
......@@ -192,7 +195,9 @@ JditoFilterUtils.filterRecords = function (pColumns, pRecords, pFilter, pCustomC
*/
JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColumnOrFnMap)
{
var condition = newWhere();
var condition = newWhere();
var ignoreCase = JditoFilterUtils.isUserIgnoreCase();
if (!pFilter)
return condition;
......@@ -229,11 +234,15 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu
}
else
{
condition = _getCondition.call(pFilter, pFilter.value, pFilter.operator);
let isStringType, filterValue;
[condition, filterValue, isStringType] = _getCondition(pFilter.value, pFilter.operator);
if (isStringType && ignoreCase)
condition = condition.replace("#", "UPPER(#)").replace("?", "UPPER(?)");
if (pOperator == "AND")
this.andIfSet(pFilter.name, pFilter.value, condition);
this.andIfSet(pFilter.name, filterValue, condition);
else if (pOperator == "OR")
this.orIfSet(pFilter.name, pFilter.value, condition);
this.orIfSet(pFilter.name, filterValue, condition);
}
}
else if (pFilter.type == "group")
......@@ -251,43 +260,49 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu
}
}
//returns the condition depending on the operator and
//adds wildcards to the value if necessary
//returns [condition, value with wildcards, is a string type] depending on the operator
function _getCondition (pValue, pOperator)
{
switch (pOperator)
{
case "CONTAINS":
this.value = "%" + pValue + "%";
return SqlBuilder.LIKE();
return [SqlBuilder.LIKE(), "%" + pValue + "%", true];
case "CONTAINSNOT":
this.value = "%" + pValue + "%";
return SqlBuilder.NOT_LIKE();
return [SqlBuilder.NOT_LIKE(), "%" + pValue + "%", true];
case "STARTSWITH":
this.value = pValue + "%";
return SqlBuilder.LIKE();
return [SqlBuilder.LIKE(), pValue + "%", true];
case "ENDSWITH":
this.value = "%" + pValue;
return SqlBuilder.LIKE();
return [SqlBuilder.LIKE(), "%" + pValue, true];
case "EQUAL":
return SqlBuilder.EQUAL();
return [SqlBuilder.EQUAL(), pValue, true];
case "NOT_EQUAL":
return SqlBuilder.NOT_EQUAL();
return [SqlBuilder.NOT_EQUAL(), pValue, true];
case "LESS":
return SqlBuilder.LESS();
return [SqlBuilder.LESS(), pValue, false];
case "LESS_OR_EQUAL":
return SqlBuilder.LESS_OR_EQUAL();
return [SqlBuilder.LESS_OR_EQUAL(), pValue, false];
case "GREATER":
return SqlBuilder.GREATER();
return [SqlBuilder.GREATER(), pValue, false];
case "GREATER_OR_EQUAL":
return SqlBuilder.GREATER_OR_EQUAL();
return [SqlBuilder.GREATER_OR_EQUAL(), pValue, false];
case "ISNULL":
return "# is null";
return ["# is null", pValue, false];
case "ISNOTNULL":
return "# is not null";
return ["# is not null", pValue, false];
}
}
}
/**
* @return {boolean} the selectionIgnoreCase property of the current user, defaults to true
*/
JditoFilterUtils.isUserIgnoreCase = function ()
{
var user = tools.getCurrentUser();
var ignoreCase = user ? user[tools.PARAMS][tools.SELECTION_IGNORECASE] : "";
return ignoreCase == "" || /true/i.test(ignoreCase);
}
return JditoFilterUtils; //return only functions that should be public
})();
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