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.