[TYPO3-seminars] Using modifyListItem hook: getLinkToUnregistrationPage() doesn't work
Michael Spindler
michael at spindler-digital.de
Wed Nov 17 09:43:50 CET 2010
Hello list,
at first I have to thank the seminar manager programming team for the
excellent and well structured extension!
For customizing purposes I have to create a "compact"
seminar-plus-registration list (maybe this also could be a new
"what_to_display" case). So I use a list of type "My VIP events" in the
frontend. All attendants are VIPs and may see other registrations for a
seminar.
By using the modifyListItem hook I replace the list_registrations marker
(that's the link to the list of registered attendants) by the attendants
list directly (for getting the list without a second click). That works
fine.
Also registering for a seminar is possible by using the
getRegistrationLink() method. Therefore I set the second parameter to
$parent->getSeminar().
Now the problem is the unregistration link: I tried using
getLinkToUnregistrationPage() but the second parameter,
tx_seminars_registration $registration which I set by calling
$parent->getRegistration() always returns NULL. How can I get a
registration to a seminar to create the link?
This is the code I use in my own extension:
-------------------------------------------------
class tx_msseminarsxtender_modlistitem {
function modifyListItem(tx_seminars_pi1 $parent) {
// create the list of attendants
$registrationsList = tx_oelib_ObjectFactory::make(
'tx_seminars_pi1_frontEndRegistrationsList',
$parent->conf,
'list_vip_registrations',
$parent->getSeminar()->getUid(),
$parent->cObj);
$result = $registrationsList->render();
$registrationsList->__destruct();
unset($registrationsList);
// Link for unregistering for a seminar
$unregistrationLink = '';
if ($parent->getRegistration()) { // <-- always returns NULL!
$unregistrationLink =
(($parent->getSeminar()->isUnregistrationPossible()) ?
$parent->getRegistrationManager()->getLinkToUnregistrationPage($parent,
$parent->getRegistration()) : '');
}
// Link for registering for a seminar
$registrationLink =
$parent->getRegistrationManager()->getRegistrationLink($parent,
$parent->getSeminar());
// replace marker
$parent->setMarker('list_registrations', $result . $unregistrationLink
. $registrationLink);
}
}
-------------------------------------------------
And this is how It should look like (logged in as "Albert Maier):
Seminar Registrations EMail register/unregister link
30.11.2010, 10:00 Albert Maier am at mail.de unregister
30.11.2010, 11:00 Simon Schüler sis at mail.de
Albert Maier am at mail.de unregister
30.11.2010, 12:00 register
Any hints would be helpful...
Greetings,
Michael.
More information about the TYPO3-project-seminars
mailing list