Skip to content
Snippets Groups Projects
Commit 617ba3f1 authored by S.Listl's avatar S.Listl
Browse files

neon.addRecord usages changed

parent b19c7f0a
No related branches found
No related tags found
No related merge requests found
......@@ -9,14 +9,22 @@ var reasons = params.value;
if (reasons)
{
reasons = text.decodeMS(reasons);
var keywordMap = {};
KeywordUtils.getEntryNamesAndIdsByContainer($KeywordRegistry.salesprojectWonLost()).forEach(function (keyword)
if (reasons.length)
{
this[keyword[0]] = keyword[1];
}, keywordMap);
reasons = reasons.map(function (reasonId)
{
return this[reasonId];
}, keywordMap).join(", ");
var keywordMap = {};
KeywordUtils.getEntryNamesAndIdsByContainer(
$KeywordRegistry.salesprojectWonLost(),
params.locale
).forEach(function (keyword)
{
this[keyword[0]] = keyword[1];
}, keywordMap);
reasons = reasons.map(function (reasonId)
{
return this[reasonId];
}, keywordMap).join(", ");
}
else
reasons = "";
}
result.string(reasons);
\ No newline at end of file
......@@ -12,7 +12,7 @@ if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param"))
if(entry["AppLinkContext"] && entry["AppLinkId"])
{
neon.addRecord(null, "AppointmentLinks",
neon.addRecord("AppointmentLinks",
{
"AB_APPOINTMENTLINKID" : util.getNewUUID(),
"OBJECTID" : entry["AppLinkId"],
......
import("system.result");
import("system.vars");
import("system.calendars");
import("system.datetime");
import("system.eMath");
import("system.util");
import("system.neon");
if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param"))
{
var entry = JSON.parse(vars.getString("$param.Entry_param"));
var masterEntry = null;
if (vars.exists("$param.MasterEntry_param") && vars.get("$param.MasterEntry_param") != "") {
masterEntry = JSON.parse(vars.get("$param.MasterEntry_param"));
}
var uid = entry[calendars.ID];
var summary = entry[calendars.SUMMARY];
var attendees = entry[calendars.AFFECTEDUSERS];
var startdate = entry[calendars.DTSTART];
var enddate = entry[calendars.DTEND];
var links = entry[calendars.LINKS];
var description = entry[calendars.DESCRIPTION];
if(entry[calendars.ORGANIZER2] != undefined)
var organizer = entry[calendars.ORGANIZER2]["paramvalue"];
var status = entry[calendars.STATUS];
var location = entry[calendars.LOCATION];
var reminder = entry[calendars.REMINDER_DURATION];
var remindercheck = entry[calendars.HASREMINDER]
var classification = entry[calendars.CLASSIFICATION];
var transparency = entry[calendars.TRANSPARENCY];
var categories = entry[calendars.CATEGORIES];
var masterBegin = masterEntry != null ? masterEntry[calendars.DTSTART] : null
var masterEnd = masterEntry != null ? masterEntry[calendars.DTEND] : null
// Recurrence
var recurrenceID = entry[calendars.RECURRENCEID];
var rrule = null;
if (masterEntry != null) { // Entry is a recurrence exception, therefore get rrule from master
rrule = masterEntry[calendars.RRULE] != null ? masterEntry[calendars.RRULE][0] : null;
} else {
rrule = entry[calendars.RRULE] != null ? entry[calendars.RRULE][0] : null;
}
// if(entry["AppLinkContext"] && entry["AppLinkId"])
// {
// logging.log("hier geht lohos... " + uid + " id");
// neon.addRecord(null, "AppointmentLinks",
// {
// "AB_APPOINTMENTLINKID" : util.getNewUUID(),
// "APPOINTMENT_ID" : vars.get("$field.UID"),
// "OBJECTID" : entry["AppLinkId"],
// "OBJECTTYPE" : entry["AppLinkContext"]
// });
// }
//@TODO Icon
result.object([
[
uid,
attendees.length,
startdate,
enddate,
summary,
organizer,
attendees,
status,
links,
description,
location,
'',
classification,
transparency,
categories,
reminder,
remindercheck,
rrule,
recurrenceID,
null,
masterBegin,
masterEnd
]
]);
}
import("system.result");
import("system.vars");
import("system.calendars");
import("system.datetime");
import("system.eMath");
import("system.util");
import("system.neon");
if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param"))
{
var entry = JSON.parse(vars.getString("$param.Entry_param"));
var masterEntry = null;
if (vars.exists("$param.MasterEntry_param") && vars.get("$param.MasterEntry_param") != "") {
masterEntry = JSON.parse(vars.get("$param.MasterEntry_param"));
}
var uid = entry[calendars.ID];
var summary = entry[calendars.SUMMARY];
var attendees = entry[calendars.AFFECTEDUSERS];
var startdate = entry[calendars.DTSTART];
var enddate = entry[calendars.DTEND];
var links = entry[calendars.LINKS];
var description = entry[calendars.DESCRIPTION];
if(entry[calendars.ORGANIZER2] != undefined)
var organizer = entry[calendars.ORGANIZER2]["paramvalue"];
var status = entry[calendars.STATUS];
var location = entry[calendars.LOCATION];
var reminder = entry[calendars.REMINDER_DURATION];
var remindercheck = entry[calendars.HASREMINDER]
var classification = entry[calendars.CLASSIFICATION];
var transparency = entry[calendars.TRANSPARENCY];
var categories = entry[calendars.CATEGORIES];
var masterBegin = masterEntry != null ? masterEntry[calendars.DTSTART] : null
var masterEnd = masterEntry != null ? masterEntry[calendars.DTEND] : null
// Recurrence
var recurrenceID = entry[calendars.RECURRENCEID];
var rrule = null;
if (masterEntry != null) { // Entry is a recurrence exception, therefore get rrule from master
rrule = masterEntry[calendars.RRULE] != null ? masterEntry[calendars.RRULE][0] : null;
} else {
rrule = entry[calendars.RRULE] != null ? entry[calendars.RRULE][0] : null;
}
// if(entry["AppLinkContext"] && entry["AppLinkId"])
// {
// logging.log("hier geht lohos... " + uid + " id");
// neon.addRecord("AppointmentLinks",
// {
// "AB_APPOINTMENTLINKID" : util.getNewUUID(),
// "APPOINTMENT_ID" : vars.get("$field.UID"),
// "OBJECTID" : entry["AppLinkId"],
// "OBJECTTYPE" : entry["AppLinkContext"]
// });
// }
//@TODO Icon
result.object([
[
uid,
attendees.length,
startdate,
enddate,
summary,
organizer,
attendees,
status,
links,
description,
location,
'',
classification,
transparency,
categories,
reminder,
remindercheck,
rrule,
recurrenceID,
null,
masterBegin,
masterEnd
]
]);
}
......@@ -20,7 +20,7 @@ if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW
//preset the usages with the ones from the parent
usages.forEach(function (usage)
{
neon.addRecord(null, "AttributeUsages", {
neon.addRecord("AttributeUsages", {
"OBJECT_TYPE" : usage
});
});
......
......@@ -192,7 +192,7 @@ _ActivityTaskUtils._addLinkRecords = function(pObjectIdField, pRowIdField, pAddi
}
presetLinks.forEach(function(link) {
neon.addRecord(null, pConsumerName, {
neon.addRecord(pConsumerName, {
"OBJECT_TYPE" : link[0],
"OBJECT_ROWID" : link[1]
});
......
......@@ -355,7 +355,7 @@ AttributeRelationUtils.presetMandatoryAttributes = function (pObjectType, pConsu
{
//adding an attribute more than 20 times would be too much (having a min_count > 20 is very unlikely)
for (let i = 0; i < usage[1] && i < 20; i++)
neon.addRecord(null, pConsumer, {
neon.addRecord(pConsumer, {
"AB_ATTRIBUTE_ID" : usage[0]
});
});
......
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