Skip to content
Snippets Groups Projects
Commit 20578015 authored by Andreas Schindlbeck's avatar Andreas Schindlbeck
Browse files

#1041362 Kalender Exchange Multiple fixes

parent ba0e1eb3
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,11 @@
<name>dependency</name>
</dependency>
</entityConsumer>
<entityParameter>
<name>AppointmentState_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -3,4 +3,4 @@ import("Appointment_lib");
import("system.result");
result.object(AppointmentUtils.setAppointmentLinkComponentState(vars.get("$sys.recordstate"), vars.get("$param.AppointmentId_param"), vars.get("$field.APPOINTMENT_ID")));
\ No newline at end of file
result.object(AppointmentUtils.setAppointmentLinkComponentState(vars.get("$sys.recordstate"), vars.get("$param.AppointmentState_param"), vars.get("$param.AppointmentId_param"), vars.get("$field.APPOINTMENT_ID")));
\ No newline at end of file
......@@ -3,5 +3,5 @@ import("Appointment_lib");
import("system.result");
result.object(AppointmentUtils.setAppointmentLinkComponentState(vars.get("$sys.recordstate"), vars.get("$param.AppointmentId_param"), vars.get("$field.APPOINTMENT_ID")));
result.object(AppointmentUtils.setAppointmentLinkComponentState(vars.get("$sys.recordstate"), vars.get("$param.AppointmentState_param"), vars.get("$param.AppointmentId_param"), vars.get("$field.APPOINTMENT_ID")));
\ No newline at end of file
......@@ -177,6 +177,10 @@
<name>AppointmentId_param</name>
<valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/appointmentlinks/children/appointmentid_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>AppointmentState_param</name>
<valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/appointmentlinks/children/appointmentstate_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityActionField>
......
import("system.result");
import("system.vars");
result.string(vars.get("$sys.recordstate"));
\ No newline at end of file
......@@ -11,10 +11,10 @@ var event = JSON.parse(vars.getString("$param.Entry_param"));
if(event) //event not empty
{
var ownerCn = event[calendars.ORGANIZER2]["cn"];
var orgaCn = event[calendars.ORGANIZER2]["cn"];
var currentUserTitle = vars.getString("$sys.user");
if((event[calendars.RECURRENCEID] && ownerCn == currentUserTitle) || calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS) //serientermin und currentUser der TerminOwner
if(event[calendars.RECURRENCEID] && ((orgaCn == currentUserTitle) || calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS)) //serientermin und currentUser der TerminOwner
result.object(neon.COMPONENTSTATE_AUTO);
else
result.object(neon.COMPONENTSTATE_INVISIBLE);
......
......@@ -93,21 +93,27 @@ AppointmentUtils.sendExchangedAction = function(event, newState)
}
jsonEvent = JSON.parse(event);
var jsonEvent = JSON.parse(event);
jsonEvent["X-ADITO-STATUSACTION"] = newState; // "ACCEPT", "DECLINE", ""
jsonEvent[calendars.AFFECTEDUSERS] = "";
calendars.updateEntry(jsonEvent);
}
AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pAppointmentIdParam, pAppointmentIdFieldValue)
AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pAppointmentState, pAppointmentIdParam, pAppointmentIdFieldValue)
{
var entry;
if(pSysRecordstate == neon.OPERATINGSTATE_NEW && pAppointmentIdParam)
var newAppointment = false;
if(pAppointmentState && pAppointmentState == neon.OPERATINGSTATE_NEW)
newAppointment = true;
else if(pSysRecordstate == neon.OPERATINGSTATE_NEW && pAppointmentIdParam)
entry = calendars.getEntry(pAppointmentIdParam, null, null);
else if(pSysRecordstate == neon.OPERATINGSTATE_EDIT)
entry = calendars.getEntry(pAppointmentIdFieldValue, null, null);
if(entry)
{
......@@ -119,6 +125,8 @@ AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pA
else
return neon.COMPONENTSTATE_DISABLED;
}
else if(newAppointment)
return neon.COMPONENTSTATE_EDITABLE
else
return neon.COMPONENTSTATE_DISABLED;
}
\ 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