Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Registration for Event Calendar


Go to End


1040 Views

Avatar
Mejoo

Community Member, 3 Posts

9 May 2012 at 5:47pm

Hi everyone

I have looked at the unclecheese tutorial " Thanks unclecheese for your tutorial" at the following link:
http://www.leftandmain.com/silverstripe-tutorials/2010/08/26/creating-an-event-registration-form-for-event-calendar/

And I was able to build Registration system for Trips. However, I tried to move the Registration tap to be on the event "Trips" instead of the TripsHolder. But I am facing some problem with, registrationLink I think!

Here what I have change from unclecheese approach:

I moved all the functions from the TripHolder “ConferenceHolder” Controller to Trip “Conference” Controller.

And to get the Registration for the current Trip I did:

public function getCMSFields() {
$f = parent::getCMSFields();
$f->addFieldToTab(‘Root.Content.Main’, new TextField(‘Location’,_t(‘Trip.LOCATION’,'The Trip Location’)), ‘Content’);
$f->addFieldToTab(“Root.Content.Main”, new CurrencyField(‘Cost’,_t(‘Trip.COST’,'Trip Cost’)),’Content’);

$f->addFieldToTab(“Root.Content.Registration”, new DataObjectManager(
$this,
‘Registration’,
‘TripRegistration’,
array(
‘Name’ => ‘Name’,
‘Email’ => ‘Email’,
‘Mobile’ => ‘Mobile’
),’getCMSfields_forPopup’,
“‘TripID’ = ‘{$this->ID}’”
));
return $f;
}

But it seems there is something wrong. I’m not getting the right registration link:

I change RegisterLink function to:

public function RegisterLink() {
return $this->Trip()->Link(“register”).”?DateID=$this->ID”;
}

Please Please Please Help me with that.