diff --git a/entity/Appointment_entity/entityfields/categories/valueProcess.js b/entity/Appointment_entity/entityfields/categories/valueProcess.js index 6e54dcd0b4fefaf6c86753a468b6a549ee231929..064e4914d6c19cdc8841cf1aeab99818618da376 100644 --- a/entity/Appointment_entity/entityfields/categories/valueProcess.js +++ b/entity/Appointment_entity/entityfields/categories/valueProcess.js @@ -3,5 +3,6 @@ import("system.result"); import("system.vars"); import("system.calendars"); -var categs = JSON.parse(vars.getString("param.entry"))[calendars.CATEGORIES]; -result.string(categs); +var categs = JSON.parse(vars.getString("$param.entry"))[calendars.CATEGORIES]; +logging.log("categs -> "+ categs); +result.string(categs); \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/partstatactiongroup/children/accept/onActionProcess.js b/entity/Appointment_entity/entityfields/partstatactiongroup/children/accept/onActionProcess.js index 4ee04f054f1217ca5ce2f61235174720e00b8e00..fd31c4af45f3b051737a82014287d7c34b8ee7ff 100644 --- a/entity/Appointment_entity/entityfields/partstatactiongroup/children/accept/onActionProcess.js +++ b/entity/Appointment_entity/entityfields/partstatactiongroup/children/accept/onActionProcess.js @@ -10,8 +10,15 @@ var currentUserEncodedString = calendars.getCalendarUser(vars.getString("$sys.us var currentUserDecodedArray = text.decodeMS(currentUserEncodedString); var currentUserUri = currentUserDecodedArray[0]; -var currentAttendees = vars.get("$field.ATTENDEES"); -var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, "ACCEPTED"); +var newState = "ACCEPTED"; -appointmentUtil.sendExchangedAction(vars.get("$param.entry")); -neon.setFieldValue("$field.ATTENDEES", updatedAttendees); +if(calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS) +{ + appointmentUtil.sendExchangedAction(vars.get("$param.entry"), newState); +} +else +{ + var currentAttendees = vars.get("$field.ATTENDEES"); + var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, newState); + neon.setFieldValue("$field.ATTENDEES", updatedAttendees); +} diff --git a/entity/Appointment_entity/entityfields/partstatactiongroup/children/decline/onActionProcess.js b/entity/Appointment_entity/entityfields/partstatactiongroup/children/decline/onActionProcess.js index 4c8288f8a49b6b59e2fcc0f1dd060a70949568f0..831a49bcec9981e3429d24f4afe98c398739698d 100644 --- a/entity/Appointment_entity/entityfields/partstatactiongroup/children/decline/onActionProcess.js +++ b/entity/Appointment_entity/entityfields/partstatactiongroup/children/decline/onActionProcess.js @@ -10,8 +10,15 @@ var currentUserEncodedString = calendars.getCalendarUser(vars.getString("$sys.us var currentUserDecodedArray = text.decodeMS(currentUserEncodedString); var currentUserUri = currentUserDecodedArray[0]; -var currentAttendees = vars.get("$field.ATTENDEES"); -var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, "DECLINED"); +var newState = "DECLINED"; -appointmentUtil.sendExchangedAction(vars.get("$param.entry")); -neon.setFieldValue("$field.ATTENDEES", updatedAttendees); +if(calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS) +{ + appointmentUtil.sendExchangedAction(vars.get("$param.entry"), newState); +} +else +{ + var currentAttendees = vars.get("$field.ATTENDEES"); + var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, newState); + neon.setFieldValue("$field.ATTENDEES", updatedAttendees); +} diff --git a/entity/Appointment_entity/entityfields/partstatactiongroup/children/tentative/onActionProcess.js b/entity/Appointment_entity/entityfields/partstatactiongroup/children/tentative/onActionProcess.js index 9fdc8598e107ef80c6e91de3743de711adfde54e..24a1e6e1c9ef39f826600b5c1a01d5a7fc57d506 100644 --- a/entity/Appointment_entity/entityfields/partstatactiongroup/children/tentative/onActionProcess.js +++ b/entity/Appointment_entity/entityfields/partstatactiongroup/children/tentative/onActionProcess.js @@ -10,8 +10,15 @@ var currentUserEncodedString = calendars.getCalendarUser(vars.getString("$sys.us var currentUserDecodedArray = text.decodeMS(currentUserEncodedString); var currentUserUri = currentUserDecodedArray[0]; -var currentAttendees = vars.get("$field.ATTENDEES"); -var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, "TENTATIVE"); +var newState = "TENTATIVE"; -appointmentUtil.sendExchangedAction(vars.get("$param.entry")); -neon.setFieldValue("$field.ATTENDEES", updatedAttendees); \ No newline at end of file +if(calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS) +{ + appointmentUtil.sendExchangedAction(vars.get("$param.entry"), newState); +} +else +{ + var currentAttendees = vars.get("$field.ATTENDEES"); + var updatedAttendees = appointmentUtil.setPartStat(currentUserUri, currentAttendees, newState); + neon.setFieldValue("$field.ATTENDEES", updatedAttendees); +} \ No newline at end of file diff --git a/entity/Appointment_entity/onUpdate.js b/entity/Appointment_entity/onUpdate.js index 14e610ccd1b99d5f6c0a50d5c0daa05ac32dc43c..48860685efadbc2c593a112cf29f3dec01961596 100644 --- a/entity/Appointment_entity/onUpdate.js +++ b/entity/Appointment_entity/onUpdate.js @@ -13,9 +13,9 @@ import("system.tools"); // Dieser Prozess speichert die im Frame angezeigten Daten // Je nach Modus (INSERT, EDIT) wird ein neuer Datensatz angelegt oder der alte editiert -if(vars.exists("param.entry")) +if(vars.exists("$param.entry")) { - var event = JSON.parse(vars.getString("param.entry")); + var event = JSON.parse(vars.getString("$param.entry")); var ok = false; if ( calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS && event[calendars.ORGANIZER2]["cn"] != event[calendars.USER2]["cn"]) diff --git a/process/Appointment_lib/process.js b/process/Appointment_lib/process.js index 43f7d1b94279811306a1cc3eed25e5cb5fe0c90d..476a993b04c8dc887aee6b8479fb1ff8fd49b519 100644 --- a/process/Appointment_lib/process.js +++ b/process/Appointment_lib/process.js @@ -62,13 +62,10 @@ function AppointmentUtils() } - this.sendExchangedAction = function(event) + this.sendExchangedAction = function(event, newState) { - if( calendars.getBackendType() == calendars.BACKEND_EXCHANGEWS ) - { - event["X-ADITO-STATUSACTION"] = "ACCEPT"; // "ACCEPT", "DECLINE", "" - event[calendars.AFFECTEDUSERS] = ""; - calendars.updateEntry(event); - } + event["X-ADITO-STATUSACTION"] = newState; // "ACCEPT", "DECLINE", "" + event[calendars.AFFECTEDUSERS] = ""; + calendars.updateEntry(event); } } \ No newline at end of file