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

AppointmentLink: Fixes und Loggings raus

parent d8872d14
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("Appointment_lib");
import("system.result");
......
......@@ -105,39 +105,21 @@ AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pA
var entry;
if(pSysRecordstate == neon.OPERATINGSTATE_NEW && pAppointmentIdParam)
{
logging.log("NEW");
entry = calendars.getEntry(pAppointmentIdParam, null, null);
}
else if(pSysRecordstate == neon.OPERATINGSTATE_EDIT)
{
logging.log("EDIT");
entry = calendars.getEntry(pAppointmentIdFieldValue, null, null);
}
if(entry)
{
var currentUserId = CalendarUtil.getEffectiveCalendarIdFromUser(tools.getCurrentUser());
var organzierId = CalendarUtil.getEffectiveCalendarIdFromUser(tools.getUser(entry[calendars.ORGANIZER2]["cn"], tools.PROFILE_DEFAULT));
logging.log("current: " + currentUserId);
logging.log("organizer: " + organzierId);
if(currentUserId && currentUserId == organzierId)
{
logging.log("ENABELED: currentUser == organizer");
return neon.COMPONENTSTATE_EDITABLE;
}
else
{
logging.log("DISABLED: currentUser != organizer");
return neon.COMPONENTSTATE_DISABLED;
}
}
else
{
logging.log("DISABLED: entry == null");
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