Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab Maintenance 28.03.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
d164a530
Commit
d164a530
authored
4 years ago
by
Benjamin Ulrich
Committed by
Johannes Goderbauer
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Projekt: Entwicklung - Neon][TicketNr.: 1063698][Aufgabe/Aktivität aus Termin erstellen]
parent
dcc97063
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/Appointment_entity/entityfields/newactivity/onActionProcess.js
+18
-16
18 additions, 16 deletions
...ntment_entity/entityfields/newactivity/onActionProcess.js
process/ActivityTask_lib/process.js
+26
-0
26 additions, 0 deletions
process/ActivityTask_lib/process.js
with
44 additions
and
16 deletions
entity/Appointment_entity/entityfields/newactivity/onActionProcess.js
+
18
−
16
View file @
d164a530
import
(
"
system.db
"
);
import
(
"
KeywordRegistry_basic
"
);
import
(
"
Contact_lib
"
);
import
(
"
system.vars
"
);
import
(
"
ActivityTask_lib
"
);
import
(
"
Context_lib
"
);
import
(
"
Sql_lib
"
);
import
(
"
system.entities
"
);
var
uid
=
vars
.
get
(
"
$field.UID
"
);
var
appointmentLinkConfig
=
entities
.
createConfigForLoadingConsumerRows
().
consumer
(
"
AppointmentLinks
"
)
.
fields
([
"
OBJECTID
"
,
"
OBJECTTYPE
"
]);
var
appointmentLinks
=
entities
.
getRows
(
appointmentLinkConfig
);
var
objectdata
=
newSelect
(
"
OBJECT_TYPE, OBJECT_ROWID
"
)
.
from
(
"
AB_APPOINTMENTLINK
"
)
.
where
(
"
AB_APPOINTMENTLINK.APPOINTMENT_ID
"
,
"
$field.UID
"
)
.
arrayRow
();
var
links
=
[];
if
(
objectdata
.
length
>
0
)
{
links
.
push
(
objectdata
);
//filter only for objectTypes that may bet set in Activity (In AppointmentLink_entity there can be linked more objects than in the ActivityLink_entity)
//this needs to be done if links exists, otherwise we can spare this for better performance
if
(
appointmentLinks
.
length
>
0
)
{
var
availableActivityObjectTypesSet
=
ActivityUtils
.
getLinkableObjectTypes
();
var
links
=
[];
appointmentLinks
.
forEach
(
function
(
appointmentLink
){
var
linkType
=
appointmentLink
[
"
OBJECTTYPE
"
];
var
isLinkableType
=
availableActivityObjectTypesSet
.
has
(
linkType
);
if
(
isLinkableType
)
links
.
push
([
linkType
,
appointmentLink
[
"
OBJECTID
"
]]);
});
}
ActivityUtils
.
createNewActivity
(
undefined
,
links
,
ContextUtils
.
getCurrentContextId
(),
vars
.
get
(
"
$field.UID
"
),
vars
.
get
(
"
$field.SUMMARY
"
),
vars
.
get
(
"
$field.DESCRIPTION
"
),
$KeywordRegistry
.
activityDirection
$outgoing
());
//pParentContext and pParentId have been set to null because an appoint can not be the predecessor of an activity at the moment
ActivityUtils
.
createNewActivity
(
undefined
,
links
,
null
,
null
,
vars
.
get
(
"
$field.SUMMARY
"
),
vars
.
get
(
"
$field.DESCRIPTION
"
),
$KeywordRegistry
.
activityDirection
$outgoing
());
This diff is collapsed.
Click to expand it.
process/ActivityTask_lib/process.js
+
26
−
0
View file @
d164a530
import
(
"
system.entities
"
);
import
(
"
system.vars
"
);
import
(
"
system.util
"
);
import
(
"
system.datetime
"
);
...
...
@@ -24,6 +25,31 @@ import("Context_lib");
*/
function
ActivityUtils
()
{}
/**
* Determines object types (=context ids) by loading them from the Context_entity.ActivityLinkable provider.
*
* @return {Set} <br/>Set that contains the context ids as string elements
* @example
* var linkableTypes = ActivityUtils.getLinkableObjectTypes();
* linkableTypes.has("Organisation");//true
* linkableTypes.has("Actvity");//false
*/
ActivityUtils
.
getLinkableObjectTypes
=
function
()
{
var
entityConfig
=
entities
.
createConfigForLoadingRows
().
entity
(
"
Context_entity
"
)
.
fields
([
"
UID
"
])
//UID contains the technical name
.
provider
(
"
ActivityLinkable
"
);
var
availableActivityObjectTypes
=
entities
.
getRows
(
entityConfig
);
var
res
=
new
Set
();
for
(
var
i
=
0
,
l
=
availableActivityObjectTypes
.
length
;
i
<
l
;
i
++
)
{
if
(
availableActivityObjectTypes
[
i
][
"
UID
"
])
res
.
add
(
availableActivityObjectTypes
[
i
][
"
UID
"
]);
}
return
res
;
};
/**
* Create a new activity within the database-scope.
* This funciton will insert a complete new activity into the database.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment