diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 709bfac8d00e3b805a383dc0c78c0cb8b91a07d1..9e3b631b9d03671f41b9dc0fe28f7b20bc55db10 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -18,12 +18,12 @@ var appointmentUids; /** * Will be used, if the user is operating the calendar. */ -if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) +if(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") != "") { + if (vars.get("$param.MasterEntry_param") != "") { masterEntry = JSON.parse(vars.getString("$param.MasterEntry_param")); } diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index a1c9dc5748145d7807a8927740c9383fa46d735c..94a9a3b2fd7cca6f0dd58ae878848b5160a67ca3 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -1418,6 +1418,7 @@ <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <state>INVISIBLE</state> <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index f294673d397ad7e5b12ab7f16821daa5d3c0d75b..e4191e1d78eb97fd86408a3f73e0aa41ea1aa7f8 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1453,6 +1453,7 @@ <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <state>INVISIBLE</state> <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod index acc3d4d6af16f5a623d57e47879a2c4a6a9b679f..28198aeea3e39e48bbbadf6f2c037a8c2e9ba3d6 100644 --- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod +++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod @@ -111,7 +111,7 @@ <title>New Appointment</title> <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> - <state>EDITABLE</state> + <state>INVISIBLE</state> <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/stateProcess.js</stateProcess> <tooltip>Create new Appointment</tooltip> <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/tooltipProcess.js</tooltipProcess> diff --git a/entity/VisitPlanEntry_entity/afterSave.js b/entity/VisitPlanEntry_entity/afterSave.js index a244a88b306cc25daa82c01c12d5a45982ef2132..fb0d5e8e2fa192420d84303ccef757f6ec0f65f5 100644 --- a/entity/VisitPlanEntry_entity/afterSave.js +++ b/entity/VisitPlanEntry_entity/afterSave.js @@ -26,11 +26,12 @@ if(savedData["STATUS_APPOINTMENT"] == "VISITSTATUSAPPOINTMENTCONFIRMED") var description = savedData["CONTACT_ID.displayValue"]; var standardMail = CommUtil.getStandardMail(savedData["CONTACT_ID"]); - var entryDate = datetime.toLocaleDate(savedData["ENTRYDATE"], "dd-MM-yyyy"); - var startTime = entryDate + " " + datetime.toLocaleDate(savedData["BEGIN_TIME"], "HH:mm:ss.S"); - startTime = datetime.toLong(startTime, "dd-MM-yyyy HH:mm:ss.S", "UTC"); // #1076044 set tz to prevent time gaps. - var endTime = savedData["END_TIME"]; - var duration = eMath.subInt(endTime, startTime); + //1077138, 1074419 customized code to match, new CalendarUtil.createEntry()/newSilentEvent() and work without misbehaviour. + var entryDateLocalTime = parseInt(datetime.toLong(datetime.toLocaleDate(parseInt(savedData["ENTRYDATE"]), "dd-MM-yyyy"), "dd-MM-yyyy", + vars.get("$sys.timezone"))); + + var start = new Date(entryDateLocalTime+Number(savedData["BEGIN_TIME"])); + var end = new Date(entryDateLocalTime+Number(savedData["END_TIME"])); var links = [ { @@ -45,8 +46,7 @@ if(savedData["STATUS_APPOINTMENT"] == "VISITSTATUSAPPOINTMENTCONFIRMED") var params = { "Entry_param" : JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, - Date(Date.toExponential(startTime)), Date(Date.toExponential(endTime)), - undefined, undefined, undefined, [standardMail], undefined, undefined, undefined)) + start, end, undefined, undefined, undefined, [standardMail], undefined, undefined, undefined)) }; neon.openContext("Appointment", "AppointmentEdit_view", [vars.get("$field.UID")], neon.OPERATINGSTATE_NEW, params, null); diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js index b760e1613d9594960cabd2067bade94a03105560..e4ce6570614113ea043d477950c84a74b066139b 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js @@ -25,6 +25,7 @@ var summary = translate.text("Site visit") + " || " + fullName; var description = fullName; var standardMail = CommUtil.getStandardMail(selectionRowData[0].CONTACT_ID); +//1077138, 1074419 customized code to match, new CalendarUtil.createEntry()/newSilentEvent() and work without misbehaviour. var startTime = selectionRowData[0].BEGIN_TIME; var endTime = selectionRowData[0].END_TIME; var duration = eMath.subInt(endTime, startTime); diff --git a/process/Calendar_lib/process.js b/process/Calendar_lib/process.js index 455b28d263c1e6def680391206245b213240c4e8..cf037ba7e0f371b144a262206d0ad28e439ab219 100644 --- a/process/Calendar_lib/process.js +++ b/process/Calendar_lib/process.js @@ -391,7 +391,7 @@ CalendarUtil.createEntry = function(pSummary, pDescription, pLinks, pOwner, pAff pStatus = calendars.STATUS_CONFIRMED; } - if(!pReminder) + if(pReminder) { entry[calendars.HASREMINDER] = "true"; entry[calendars.REMINDER_DURATION] = pReminder.getTime().toString();