Example #1
0
 /**
  * Display conference registration page
  */
 function registration()
 {
     $this->addCheck(new HandlerValidatorSchedConf($this));
     $this->validate();
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $paymentManager =& OCSPaymentManager::getManager();
     if (!$paymentManager->isConfigured()) {
         Request::redirect(null, null, 'index');
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true), array(Request::url(null, null, 'index'), $schedConf->getSchedConfTitle(), true)));
     SchedConfHandler::setupTemplate($conference, $schedConf);
     $user =& Request::getUser();
     $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
     if ($user && ($registrationId = $registrationDao->getRegistrationIdByUser($user->getId(), $schedConf->getId()))) {
         // This user has already registered.
         $registration =& $registrationDao->getRegistration($registrationId);
         import('payment.ocs.OCSPaymentManager');
         $paymentManager =& OCSPaymentManager::getManager();
         if (!$paymentManager->isConfigured() || !$registration || $registration->getDatePaid()) {
             // If the system isn't fully configured or the registration is already paid,
             // display a message and block the user from going further.
             $templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredAndPaid');
             $templateMgr->assign('backLinkLabel', 'common.back');
             $templateMgr->assign('backLink', Request::url(null, null, 'index'));
             return $templateMgr->display('common/message.tpl');
         }
     }
     $typeId = (int) Request::getUserVar('registrationTypeId');
     if ($typeId) {
         // A registration type has been chosen
         import('registration.form.UserRegistrationForm');
         if (checkPhpVersion('5.0.0')) {
             // WARNING: This form needs $this in constructor
             $form = new UserRegistrationForm($typeId);
         } else {
             $form =& new UserRegistrationForm($typeId);
         }
         if ($form->isLocaleResubmit()) {
             $form->readInputData();
         } else {
             $form->initData();
         }
         $form->display();
     } else {
         // A registration type has not been chosen; prompt for one.
         $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
         $registrationTypes =& $registrationTypeDao->getRegistrationTypesBySchedConfId($schedConf->getId());
         $templateMgr->assign_by_ref('registrationTypes', $registrationTypes);
         return $templateMgr->display('registration/selectRegistrationType.tpl');
     }
 }
 function _registrationDisplay($registration)
 {
     import('registration.form.UserRegistrationForm');
     $typeId = $registration->getTypeId();
     if (checkPhpVersion('5.0.0')) {
         // WARNING: This form needs $this in constructor
         $form = new UserRegistrationForm($typeId);
     } else {
         $form =& new UserRegistrationForm($typeId);
     }
     if ($form->isLocaleResubmit()) {
         $form->readInputData();
     } else {
         $form->initData();
     }
     //echo $registration->getTypeId();
     $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
     $registrationType =& $registrationTypeDao->getRegistrationType($registration->getTypeId());
     //            if ($registrationType->getCost() > 0) {
     //                //$templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredAndPaid');
     //            }
     //            else {
     //                //$templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredNoPaid');
     //            }
     //$templateMgr->assign('email', $schedConf->getSetting('contactEmail'));
     //$templateMgr->assign('backLinkLabel', 'common.back');
     //$templateMgr->assign('backLink', Request::url(null, null, 'index'));
     //return $templateMgr->display('common/message.tpl');
     $form->display();
 }
Example #3
0
 /**
  * Display conference registration page
  * @param $args array
  * @param $request PKPRequest
  */
 function registration($args, &$request)
 {
     $this->addCheck(new HandlerValidatorSchedConf($this));
     $this->validate();
     $conference =& $request->getConference();
     $schedConf =& $request->getSchedConf();
     $templateMgr =& TemplateManager::getManager();
     $paymentManager = new OCSPaymentManager($request);
     if (!$paymentManager->isConfigured()) {
         // If the system isn't fully configured, display a message and block
         // the user from going further.
         $templateMgr->assign('message', 'schedConf.registration.paymentNotConfigured');
         $templateMgr->assign('backLinkLabel', 'common.back');
         $templateMgr->assign('backLink', $request->url(null, null, 'index'));
         AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON);
         return $templateMgr->display('common/message.tpl');
     }
     $templateMgr->assign('pageHierarchy', array(array($request->url(null, 'index', 'index'), $conference->getLocalizedName(), true), array($request->url(null, null, 'index'), $schedConf->getLocalizedName(), true)));
     $this->setupTemplate($request, $conference, $schedConf);
     $user =& $request->getUser();
     $registrationDao = DAORegistry::getDAO('RegistrationDAO');
     $registration = null;
     if ($user && ($registrationId = $registrationDao->getRegistrationIdByUser($user->getId(), $schedConf->getId()))) {
         // This user has already registered.
         $registration =& $registrationDao->getRegistration($registrationId);
         import('classes.payment.ocs.OCSPaymentManager');
         $paymentManager = new OCSPaymentManager($request);
         if (!$paymentManager->isConfigured() || !$registration || $registration->getDatePaid()) {
             // If the system isn't fully configured or the registration is already paid,
             // display a message and block the user from going further.
             $templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredAndPaid');
             $templateMgr->assign('backLinkLabel', 'common.back');
             $templateMgr->assign('backLink', $request->url(null, null, 'index'));
             return $templateMgr->display('common/message.tpl');
         }
     }
     $typeId = (int) $request->getUserVar('registrationTypeId');
     if ($typeId) {
         // A registration type has been chosen
         import('classes.registration.form.UserRegistrationForm');
         $form = new UserRegistrationForm($typeId, $registration, $request);
         if ($form->isLocaleResubmit()) {
             $form->readInputData();
         } else {
             $form->initData();
         }
         $form->display();
     } else {
         // A registration type has not been chosen; prompt for one.
         $registrationTypeDao = DAORegistry::getDAO('RegistrationTypeDAO');
         $registrationTypes =& $registrationTypeDao->getRegistrationTypesBySchedConfId($schedConf->getId());
         $templateMgr->assign_by_ref('registrationTypes', $registrationTypes);
         $templateMgr->assign('registration', $registration);
         return $templateMgr->display('registration/selectRegistrationType.tpl');
     }
 }