Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of reserve into events2 #105

Closed
Hobokens opened this issue Jan 30, 2022 · 5 comments
Closed

Integration of reserve into events2 #105

Hobokens opened this issue Jan 30, 2022 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Hobokens
Copy link

Hi,
I try to integrate reserve v1.2.3. into events2 v7.0.12. I added the viewhelper (https://docs.typo3.org/p/jweiland/reserve/1.2/en-us/Extend%20reserve/PeriodRegistrationViewHelper/Index.html) into my events2 template. I see that a pid for the facilityand a timestamp for the event is added in the example. But I have a lot of events in my calendar. How can I deal with this?
My second problem: I hope to activate the viewhelper within events2 with the 'registration_required' button in the backend. I added a condition in my events2 template with <f:if condition="{registration_required}"> Unfortunately this doesn't work.
Thanks for any help.
Regards
Hobokens

@Hobokens
Copy link
Author

Hobokens commented Feb 1, 2022

After extending the class \JWeiland\Events2\Domain\Model\Event with getter and setter the condition <f:if condition="{event.registrationRequired}"> is working. But I still don't understand how to get the dateAndBegin and the facilityUid from different events in events2.

@pascal20997 pascal20997 self-assigned this Feb 11, 2022
@pascal20997 pascal20997 added the question Further information is requested label Feb 11, 2022
@pascal20997
Copy link
Contributor

Hi @Hobokens,

the registration_required field is not inside the Domain Model so you've done it right with extending the model and adding the property to it. I'm thinking about writing an IfRegistrationRequiredViewHelper for this, which will fetch the value directly from the database so this step won't be necessary in the future.

The argument dateAndBegin requires an matching unix timestamp. You are using the same begin date for your events2 "Day" record I guess? Then you're able to use something like <jw:periodRegistration facilityUid="{day.event.location.facility.uid}" dateAndBegin="{day.dayTimeAsTimestamp}"> in case you are embedding that ViewHelper inside the Day/Properties partial. Otherwise you can loop through {event.days} if you want to display all at once.

@Hobokens
Copy link
Author

Hi @pascal20997,
Thank you very much for your helpful explanations. I would like to add the display to the list view. If I do the following loop I get the date without any problem:

<f:for as="day" each="{event.days}">
{day.dayTimeAsTimestamp}
</f:for>

But I am still looking for the way to get the uid for the facility as well. Do I have to extend the model once more?

@pascal20997
Copy link
Contributor

Hello @Hobokens,

you're right I forgot that tx_events2_domain_model_location.facility is not inside the default Location Entity from events2. You have to extend it for the current reserve Version. I try to add a ViewHelper for this case as well or maybe add some more arguments to the PeriodRegistrationViewHelper like location="{day.event.location}" facilityFromLocation="true", but I can not guarantee for this feature and when I will add it.

@Hobokens
Copy link
Author

Hello @pascal20997,
thanks for the additional help information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants