diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index bd143b765e15e4636eda7c4007f64d35652a91d2..9992bec4e3286c3d8979615800f14ff4eda8ee2a 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -20,6 +20,7 @@ <element>DESCRIPTION</element> <element>LOCATION</element> <element>ICON</element> + <element>CLASSIFICATION</element> </fields> <contentProcess>%aditoprj%/entity/Appointment_entity/contentProcess.js</contentProcess> <onInsert>%aditoprj%/entity/Appointment_entity/onInsert.js</onInsert> @@ -31,6 +32,7 @@ <entityField> <name>SUMMARY</name> <fieldName>SUBJECT</fieldName> + <caption>Betreff</caption> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/summary/valueProcess.js</valueProcess> </entityField> <entityParameter> @@ -43,7 +45,45 @@ <fieldName>DESCRIPTION</fieldName> </entityField> <entityField> + <name>CLASSIFICATION</name> + <fieldName>CLASSIFICATION</fieldName> + <possibleItemsProcess>%aditoprj%/entity/Appointment_entity/entityfields/classification/possibleItemsProcess.js</possibleItemsProcess> + <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/classification/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>BEGIN</name> + <fieldName>STARTDATE</fieldName> + <selectionMode>SINGLE</selectionMode> + <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/begin/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>END</name> + <fieldName>ENDDATE</fieldName> + <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/end/valueProcess.js</valueProcess> + </entityField> + <entityFieldGroup> <name>STARTEND</name> + <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/startend/valueProcess.js</valueProcess> + <description>FIELDGROUP</description> + <fields> + <element>BEGIN</element> + <element>END</element> + </fields> + </entityFieldGroup> + <entityField> + <name>STATUS</name> + <fieldName>STATUS</fieldName> + <possibleItemsProcess>%aditoprj%/entity/Appointment_entity/entityfields/status/possibleItemsProcess.js</possibleItemsProcess> + </entityField> + <entityField> + <name>LOCATION</name> + <fieldName>LOCATION</fieldName> + </entityField> + <entityField> + <name>REMINDER_CHECK</name> + </entityField> + <entityField> + <name>REMINDER</name> </entityField> </entityFields> </entity> diff --git a/entity/Appointment_entity/contentProcess.js b/entity/Appointment_entity/contentProcess.js index 6457081b5687a06db81acc5428cd06545f0ad569..c09809b13798063ac9faa3f05d72d0e932534090 100644 --- a/entity/Appointment_entity/contentProcess.js +++ b/entity/Appointment_entity/contentProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.result"); import("system.vars"); import("system.calendars"); @@ -21,16 +22,19 @@ if(vars.exists("$image.entry")) var location = entry[calendars.LOCATION]; var reminder = entry[calendars.REMINDER]; var remindercheck = entry[calendars.HASREMINDER] + var classification = entry[calendars.CLASSIFICATION]; + + logging.log("contentproc: entry location:" + location + " desc: " + description + " summary: " + summary); //@TODO Icon result.object([ - [uid, '', '', attendees.length, startdate, enddate, summary, organizer, attendees, status, links, description, location, ''] //, location, reminder, remindercheck + [uid, '', '', attendees.length, startdate, enddate, summary, organizer, attendees, status, links, description, location, '', classification] //, location, reminder, remindercheck ]); } else { - + logging.log("contentproc: empty"); var filter = ( vars.exists("$param.p_filter") && vars.get("$param.p_filter") != null @@ -43,16 +47,15 @@ else ,USER_1: vars.get("$sys.user") ,COUNT: "1" }; - var entries = calendars.getExpandedEntries(cond, new Long(datetime.date()), new Long(eMath.addInt(datetime.date(), datetime.ONE_DAY * 7))); + //var entries = calendars.getExpandedEntries(cond, new Long(datetime.date()), new Long(eMath.addInt(datetime.date(), datetime.ONE_DAY * 7))); - for (i = 0; i < events.length; i++) - { - events[i].push([""]) - var count = events[i][3]; - var iconInfo = (count > 1 ? "gruppentermin" : "einzeltermin"); - var icon = (getIcon("termine_aufgaben", iconInfo)); - events[i] = events[i].concat(icon); - } - result.object(events); - + //for (i = 0; i < events.length; i++) + //{ + // events[i].push([""]) + // var count = events[i][3]; + // var iconInfo = (count > 1 ? "gruppentermin" : "einzeltermin"); + // var icon = (getIcon("termine_aufgaben", iconInfo)); + // events[i] = events[i].concat(icon); + //} + //result.object(events); } \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/begin/valueProcess.js b/entity/Appointment_entity/entityfields/begin/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Appointment_entity/entityfields/classification/possibleItemsProcess.js b/entity/Appointment_entity/entityfields/classification/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7f8cf5bff36828f0a2eef7c253b895f3d4ee530f --- /dev/null +++ b/entity/Appointment_entity/entityfields/classification/possibleItemsProcess.js @@ -0,0 +1,6 @@ +import("system.result"); + +var resObject = new Object(); +resObject["PRIVATE"] = "PRIVATE"; +resObject["PUBLIC"] = "PUBLIC"; +result.object( resObject ); \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/classification/valueProcess.js b/entity/Appointment_entity/entityfields/classification/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Appointment_entity/entityfields/end/valueProcess.js b/entity/Appointment_entity/entityfields/end/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Appointment_entity/entityfields/startend/valueProcess.js b/entity/Appointment_entity/entityfields/startend/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5d76d8d6c64576e7491336644b5b84425408dd1a --- /dev/null +++ b/entity/Appointment_entity/entityfields/startend/valueProcess.js @@ -0,0 +1,59 @@ +import("system.result"); +import("system.calendars"); +import("system.vars"); +import("system.datetime"); + +var startLong = vars.get("$field.BEGIN"); +var endLong = vars.get("$field.END"); + + +if(startLong != null && endLong != null) +{ + var startdate = datetime.toDate(startLong, "dd.MM.yyyy"); + var enddate = datetime.toDate(endLong, "dd.MM.yyyy"); + var starttime = datetime.toDate(startLong, "HH:mm"); + var endtime = datetime.toDate(endLong, "HH:mm"); + + //wenn der termin an einem tag beginnt UND endet + if(startdate == enddate) + { + if(datetime.isToday(startLong) || + datetime.isTomorrow(startLong)) + { + if(datetime.isToday(startLong)) + result.string("heute " + " | " + starttime + " - " + endtime + " Uhr"); + + if(datetime.isTomorrow(startLong)) + result.string("morgen " + " | " + starttime + " - " + endtime + " Uhr"); + } + else + result.string(startdate + " | " + starttime + " - " + endtime + " Uhr"); + + } + //wenn der termin über mehrere tage geht + else + { + var datebegin; + var dateend; + + if(datetime.isToday(startLong)) + datebegin = "heute"; + else if(datetime.isTomorrow(startLong)) + datebegin = "morgen"; + else + datebegin = startdate; + + if(datetime.isToday(endLong)) + dateend = "heute"; + else if(datetime.isTomorrow(endLong)) + dateend = "morgen"; + else + dateend = enddate; + + result.string(datebegin + " | " + starttime + " Uhr - " + dateend + " | " + endtime + " Uhr"); + } +} +else +{ + result.string(""); +} \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/status/possibleItemsProcess.js b/entity/Appointment_entity/entityfields/status/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..74fdc79b4a4ad83059a393470a41a5487d6b77c9 --- /dev/null +++ b/entity/Appointment_entity/entityfields/status/possibleItemsProcess.js @@ -0,0 +1,24 @@ +import("system.logging"); +import("system.result"); +import("system.translate"); +import("system.calendars"); + +if( calendars.getBackendType() != calendars.BACKEND_EXCHANGEWS ) +{ + logging.log("possible items: if") + + result.object( [ [calendars.STATUS_TENTATIVE, translate.text("Vorläufig")] + , [calendars.STATUS_CONFIRMED, translate.text("Bestätigt")] + , [calendars.STATUS_CANCELLED, translate.text("Abgesagt")] + ] ); +} +else +{ + logging.log("possible items: else") + + result.object( [ [calendars.STATUS_TENTATIVE, translate.text("Vorläufig")] + , [calendars.STATUS_BUSY, translate.text("Gebucht")] + , [calendars.STATUS_OOF, translate.text("Außer Haus")] + , [calendars.STATUS_FREE, translate.text("frei")] + ] ); +} \ No newline at end of file diff --git a/entity/Appointment_entity/entityfields/summary/valueProcess.js b/entity/Appointment_entity/entityfields/summary/valueProcess.js index e8dc52cb185af85f2b238f6b492cab93ff7c5407..d3f5a12faa99758192ecc4ed3fc22c9249232e86 100644 --- a/entity/Appointment_entity/entityfields/summary/valueProcess.js +++ b/entity/Appointment_entity/entityfields/summary/valueProcess.js @@ -1,5 +1 @@ -import("system.result"); -import("system.vars"); -var sum = vars.getString("$field.SUMMARY"); -result.string(sum); \ No newline at end of file diff --git a/entity/Appointment_entity/onInsert.js b/entity/Appointment_entity/onInsert.js index 0dd49954c32cba3688fd3c29f12e8416e1efc950..a5258b7fecd0910aa788defd22e4ac7efc5b6b37 100644 --- a/entity/Appointment_entity/onInsert.js +++ b/entity/Appointment_entity/onInsert.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.neon"); import("system.calendars"); import("system.vars"); @@ -9,6 +10,8 @@ import("system.db"); import("system.result"); import("system.tools"); +logging.log("on insert"); + // Dieser Prozess speichert die im Frame angezeigten Daten // Je nach Modus (INSERT, EDIT) wird ein neuer Datensatz angelegt oder der alte editiert var event = vars.get("$image.entry"); diff --git a/entity/Appointment_entity/onUpdate.js b/entity/Appointment_entity/onUpdate.js index 77ab68ffa79d46057a7a0667d9e0b101b61556d1..95a51ce1a5fa1be923327bc52450619d7f5602d0 100644 --- a/entity/Appointment_entity/onUpdate.js +++ b/entity/Appointment_entity/onUpdate.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.neon"); import("system.calendars"); import("system.vars"); @@ -10,6 +11,9 @@ import("system.db"); import("system.result"); import("system.tools"); + +logging.log("on update"); + // 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("$image.entry")) @@ -26,11 +30,11 @@ if(vars.exists("$image.entry")) { event[calendars.TYPE] = calendars.VEVENT; event[calendars.STATUS] = vars.getString("$field.STATUS"); - event[calendars.SUMMARY] = vars.getString("$field.SUBJECT"); + event[calendars.SUMMARY] = vars.getString("$field.SUMMARY"); event[calendars.LOCATION] = vars.get("$field.LOCATION"); event[calendars.DESCRIPTION] = vars.get("$field.DESCRIPTION"); - event[calendars.DTSTART] = vars.get("$field.STARTDATE"); - event[calendars.DTEND] = vars.get("$field.ENDDATE"); + event[calendars.DTSTART] = vars.get("$field.BEGIN"); + event[calendars.DTEND] = vars.get("$field.END"); event[calendars.HASREMINDER] = "false"; var hasReminder = vars.get("$field.REMINDER_CHECK"); if (hasReminder == "true") diff --git a/neonView/AppointmentEdit_view/AppointmentEdit_view.aod b/neonView/AppointmentEdit_view/AppointmentEdit_view.aod index 8bb02c87b7b4a23f114d20d3c061f47584812f16..e43e16d39876dc085bb8d6514a52fdd29b260fbd 100644 --- a/neonView/AppointmentEdit_view/AppointmentEdit_view.aod +++ b/neonView/AppointmentEdit_view/AppointmentEdit_view.aod @@ -11,13 +11,14 @@ <appointmentEditViewTemplate> <name>AppointmentEditTemplate</name> <summaryField>SUMMARY</summaryField> - <beginField>SUMMARY</beginField> - <endField>SUMMARY</endField> + <descriptionField>DESCRIPTION</descriptionField> + <beginField>BEGIN</beginField> + <endField>END</endField> <affectedUsersField>SUMMARY</affectedUsersField> <attendeesField>SUMMARY</attendeesField> - <privateField>SUMMARY</privateField> - <statusField>SUMMARY</statusField> - <locationField>SUMMARY</locationField> + <privateField>CLASSIFICATION</privateField> + <statusField>STATUS</statusField> + <locationField>LOCATION</locationField> <entityField>#ENTITY</entityField> </appointmentEditViewTemplate> </children> diff --git a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod index 2d360e85afc2d21450b5a603aecedad22de3d5ac..4e5e5e466f0829a24add9b0a217441f205d3fff8 100644 --- a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod +++ b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod @@ -11,11 +11,13 @@ <appointmentPreviewViewTemplate> <name>AppointmentPreviewTemplate</name> <summaryField>SUMMARY</summaryField> - <periodField>SUMMARY</periodField> + <descriptionField>DESCRIPTION</descriptionField> + <periodField>STARTEND</periodField> <affectedUsersField>SUMMARY</affectedUsersField> <attendeesField>SUMMARY</attendeesField> - <privateField>SUMMARY</privateField> - <statusField>SUMMARY</statusField> + <privateField>CLASSIFICATION</privateField> + <statusField>STATUS</statusField> + <locationField>LOCATION</locationField> <entityField>#ENTITY</entityField> </appointmentPreviewViewTemplate> </children>