From ed4b97b628da417fb52cd99e9fcd582d09e4daf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Thu, 20 Feb 2025 10:40:25 +0100 Subject: [PATCH] fix(Calendar): event event_types definedBy filter not working --- tine20/Calendar/js/EventEditDialog.js | 2 +- tine20/Calendar/js/Model/Event.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tine20/Calendar/js/EventEditDialog.js b/tine20/Calendar/js/EventEditDialog.js index 1122f973cbd..dd6180ee960 100644 --- a/tine20/Calendar/js/EventEditDialog.js +++ b/tine20/Calendar/js/EventEditDialog.js @@ -116,7 +116,7 @@ Tine.Calendar.EventEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, { width: 100, // height: 30, xtype: 'label', - text: this.app.i18n._('Event Type') + text: this.app.i18n._('Event Types') }, { flex: 1, xtype:'tinerecordspickercombobox', diff --git a/tine20/Calendar/js/Model/Event.js b/tine20/Calendar/js/Model/Event.js index e05fd128b12..3fa4293aa6c 100644 --- a/tine20/Calendar/js/Model/Event.js +++ b/tine20/Calendar/js/Model/Event.js @@ -47,7 +47,13 @@ const Event = Record.create(Record.genericFields.concat([ { name: 'tags' }, { name: 'notes'}, { name: 'attachments'}, - { name: 'event_types'}, + { name: 'event_types', fieldDefinition: {config: { + // we need some fieldDef to get filter working + appName: 'Calendar', + modelName: 'EventTypes', + refIdField: 'record', + dependentRecords: true + }}}, //{ name: 'contact' }, //{ name: 'related' }, //{ name: 'resources' }, @@ -512,7 +518,7 @@ Event.getFilterModel = function() { ]; if (app.featureEnabled('featureEventType')) { - filter.push({filtertype: 'foreignrecord', linkType: 'foreignId', app: app, foreignRecordClass: 'Calendar.EventTypes', ownField: 'event_types', foreignRefIdField: 'eventType'}); + filter.push({filtertype: 'foreignrecord', linkType: 'foreignId', app: app, ownRecordClass: 'Calendar.Event', ownField: 'event_types', foreignRecordClass: 'Calendar.EventTypes'}); } if (Tine.Tinebase.featureEnabled('featureSite')) { filter.push({filtertype: 'tinebase.site', app: app});