lochmueller / calendarize

📆 Best TYPO3 Calendar ever 📆
http://typo3.org/extensions/repository/view/calendarize
74 stars 84 forks source link

Set a category during ICS import #789

Closed miniton closed 7 months ago

miniton commented 7 months ago

Hi, I am trying to set a category during ICS import.

I have 3 ICS files, that should go into one calendar, but with different categories.

I already have set up a console command with an extra option for a category, but now I am stuck for the moment. Any hints appreciated, thank you.

lochmueller commented 7 months ago

Hey @miniton is your command at the same base, as the default import command of EXT:calendarize? Then you can put your category in a global state and assign it in the EventListener of the import (ImportSingleIcalEventListener->hydrateEventRecord). Perhaps you have to disable the default Listener and create a new one for your case. Or you use the default import Event Listener and add a second one, that only handle the category. Regards, Tim

miniton commented 7 months ago

Hi @lochmueller, thank you so much, I will take a look!

moondoms commented 2 months ago

Hello @lochmueller I also would love this feature. Sadly I haven't figured out how to add this functionality based on your comment. Could you be so kind and give a more detailled instruction for newbies? Maybe even @miniton could tell if and how he was able to get this functionality up and running? Thanks!

lochmueller commented 2 months ago

Hey @moondoms ,

this Event is triggerd in the import process: https://github.com/lochmueller/calendarize/blob/master/Classes/Event/ImportSingleIcalEvent.php You can use this event, to handle the ICS entry "in the way you need it". An example of the EventListener that use the Event is in the extension itself, because the current Import process use also this event: https://github.com/lochmueller/calendarize/blob/master/Classes/EventListener/ImportSingleIcalEventListener.php

Regards, Tim