当前位置: 首页>>代码示例>>PHP>>正文


PHP Registration::setSurvey方法代码示例

本文整理汇总了PHP中Registration::setSurvey方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::setSurvey方法的具体用法?PHP Registration::setSurvey怎么用?PHP Registration::setSurvey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registration的用法示例。


在下文中一共展示了Registration::setSurvey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Registration

 /**
  * Internal function to return a Registration object from a row.
  * @param $row array
  * @return Registration
  */
 function &_returnRegistrationFromRow(&$row)
 {
     $registration = new Registration();
     $registration->setId($row['registration_id']);
     $registration->setSchedConfId($row['sched_conf_id']);
     $registration->setUserId($row['user_id']);
     $registration->setTypeId($row['type_id']);
     $registration->setDateRegistered($this->dateFromDB($row['date_registered']));
     $registration->setDatePaid($this->dateFromDB($row['date_paid']));
     $registration->setMembership($row['membership']);
     $registration->setDomain($row['domain']);
     $registration->setIPRange($row['ip_range']);
     $registration->setSpecialRequests($row['special_requests']);
     $registration->setSurvey($row['survey']);
     $registration->setApplicationForm($row['application_form']);
     HookRegistry::call('RegistrationDAO::_returnRegistrationFromRow', array(&$registration, &$row));
     return $registration;
 }
开发者ID:pulipulichen,项目名称:ocs,代码行数:23,代码来源:RegistrationDAO.inc.php

示例2: execute

 /**
  * Save registration. 
  */
 function execute()
 {
     $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
     $schedConf =& Request::getSchedConf();
     if (isset($this->registrationId)) {
         $registration =& $registrationDao->getRegistration($this->registrationId);
     }
     if (!isset($registration)) {
         $registration = new Registration();
         $registration->setDateRegistered(time());
     }
     $registration->setSchedConfId($schedConf->getId());
     $registration->setUserId($this->getData('userId'));
     $registration->setTypeId($this->getData('typeId'));
     $registration->setApplicationForm($this->getData('applicationForm'));
     $registration->setSurvey($this->getData('survey'));
     $registration->setMembership($this->getData('membership') ? $this->getData('membership') : null);
     $registration->setDomain($this->getData('domain') ? $this->getData('domain') : null);
     $registration->setIPRange($this->getData('ipRange') ? $this->getData('ipRange') : null);
     $registration->setSpecialRequests($this->getData('specialRequests') ? $this->getData('specialRequests') : null);
     // Send an email to the registrant informing them that their payment was received
     if ($this->getData('notifyPaymentEmail')) {
         $userDao =& DAORegistry::getDAO('UserDAO');
         $schedConfName = $schedConf->getSchedConfTitle();
         $schedConfId = $schedConf->getId();
         $user =& $userDao->getUser($this->getData('userId'));
         list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
         $paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationContactSignature' => $registrationContactSignature);
         import('mail.MailTemplate');
         $mail = new MailTemplate('MANUAL_PAYMENT_RECEIVED');
         $mail->setFrom($registrationEmail, $registrationName);
         $mail->assignParams($paramArray);
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         $mail->send();
     }
     $registration->setDatePaid($this->getData('datePaid'));
     // Update or insert registration
     if ($registration->getId() != null) {
         $registrationDao->updateRegistration($registration);
     } else {
         $registrationDao->insertRegistration($registration);
     }
     $registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');
     $registrationOptions =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId());
     $registrationOptionIds = (array) $this->getData('registrationOptionIds');
     $registrationOptionDao->deleteRegistrationOptionAssocByRegistrationId($this->registrationId);
     while ($registrationOption =& $registrationOptions->next()) {
         $optionId = (int) $registrationOption->getOptionId();
         if (in_array($optionId, $registrationOptionIds)) {
             $registrationOptionDao->insertRegistrationOptionAssoc($this->registrationId, $registrationOption->getOptionId());
         }
         unset($registrationOption);
     }
     if ($this->getData('notifyEmail')) {
         // Send user registration notification email
         $userDao =& DAORegistry::getDAO('UserDAO');
         $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
         $schedConfName = $schedConf->getSchedConfTitle();
         $schedConfId = $schedConf->getId();
         $user =& $userDao->getUser($this->getData('userId'));
         $registrationType =& $registrationTypeDao->getRegistrationType($this->getData('typeId'));
         list($registrationEmail, $registrationName, $registrationContactSignature) = $this->getRegistrationContactInformation($schedConfId);
         $paramArray = array('registrantName' => $user->getFullName(), 'schedConfName' => $schedConfName, 'registrationType' => $registrationType->getSummaryString(), 'username' => $user->getEmail(), 'registrationContactSignature' => $registrationContactSignature);
         import('mail.MailTemplate');
         $mail = new MailTemplate('REGISTRATION_NOTIFY', null, null, null, null, false);
         $mail->setFrom($registrationEmail, $registrationName);
         $mail->assignParams($paramArray);
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         $mail->send();
     }
 }
开发者ID:pulipulichen,项目名称:ocs,代码行数:74,代码来源:RegistrationForm.inc.php

示例3: execute

 /**
  * Save registration.
  */
 function execute()
 {
     $schedConf =& Request::getSchedConf();
     $user =& Request::getUser();
     if (!$user) {
         // New user
         $user = new User();
         $user->setUsername($this->getData('username'));
         $user->setSalutation($this->getData('salutation'));
         $user->setFirstName($this->getData('firstName'));
         $user->setMiddleName($this->getData('middleName'));
         $user->setInitials($this->getData('initials'));
         $user->setLastName($this->getData('lastName'));
         $user->setAffiliation($this->getData('affiliation'));
         $user->setSignature($this->getData('signature'), null);
         // Localized
         $user->setEmail($this->getData('email'));
         $user->setUrl($this->getData('userUrl'));
         $user->setPhone($this->getData('phone'));
         $user->setFax($this->getData('fax'));
         $user->setMailingAddress($this->getData('mailingAddress'));
         $user->setBiography($this->getData('biography'), null);
         // Localized
         $user->setInterests($this->getData('interests'), null);
         // Localized
         $user->setDateRegistered(Core::getCurrentDate());
         $user->setCountry($this->getData('country'));
         $user->setPassword(Validation::encryptCredentials($this->getData('username'), $this->getData('password')));
         $userDao =& DAORegistry::getDAO('UserDAO');
         $userId = $userDao->insertUser($user);
         if (!$userId) {
             return REGISTRATION_FAILED;
         }
         $conference =& Request::getConference();
         $roleDao =& DAORegistry::getDAO('RoleDAO');
         $role = new Role();
         $role->setRoleId(ROLE_ID_READER);
         $role->setSchedConfId($schedConf->getId());
         $role->setConferenceId($conference->getId());
         $role->setUserId($user->getId());
         $roleDao->insertRole($role);
         $sessionManager =& SessionManager::getManager();
         $session =& $sessionManager->getUserSession();
         $session->setSessionVar('username', $user->getUsername());
         // Make sure subsequent requests to Request::getUser work
         Validation::login($this->getData('username'), $this->getData('password'), $reason);
         import('user.form.CreateAccountForm');
         CreateAccountForm::sendConfirmationEmail($user, $this->getData('password'), true);
     }
     // Get the registration type
     $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
     $registrationType =& $registrationTypeDao->getRegistrationType($this->getData('registrationTypeId'));
     if (!$registrationType || $registrationType->getSchedConfId() != $schedConf->getId()) {
         Request::redirect('index');
     }
     import('payment.ocs.OCSPaymentManager');
     $paymentManager =& OCSPaymentManager::getManager();
     if (!$paymentManager->isConfigured()) {
         return REGISTRATION_NO_PAYMENT;
     }
     import('registration.Registration');
     $registration = new Registration();
     $registration->setSchedConfId($schedConf->getId());
     $registration->setUserId($user->getId());
     $registration->setTypeId($this->getData('registrationTypeId'));
     $registration->setSpecialRequests($this->getData('specialRequests') ? $this->getData('specialRequests') : null);
     $registration->setSurvey($this->getData('survey') ? $this->getData('survey') : null);
     $registration->setApplicationForm($this->getData('applicationForm') ? $this->getData('applicationForm') : null);
     $registration->setDateRegistered(time());
     $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
     $registrationId = $registrationDao->insertRegistration($registration);
     $registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');
     $registrationOptions =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId());
     $registrationOptionIds = (array) $this->getData('registrationOptionId');
     $cost = $registrationType->getCost();
     $registrationOptionCosts = $registrationTypeDao->getRegistrationOptionCosts($this->getData('registrationTypeId'));
     while ($registrationOption =& $registrationOptions->next()) {
         if (in_array($registrationOption->getOptionId(), $registrationOptionIds) && strtotime($registrationOption->getOpeningDate()) < time() && strtotime($registrationOption->getClosingDate()) > time() && $registrationOption->getPublic()) {
             $registrationOptionDao->insertRegistrationOptionAssoc($registrationId, $registrationOption->getOptionId());
             $cost += $registrationOptionCosts[$registrationOption->getOptionId()];
         }
         unset($registrationOption);
     }
     $queuedPayment =& $paymentManager->createQueuedPayment($schedConf->getConferenceId(), $schedConf->getId(), QUEUED_PAYMENT_TYPE_REGISTRATION, $user->getId(), $registrationId, $cost, $registrationType->getCurrencyCodeAlpha());
     $queuedPaymentId = $paymentManager->queuePayment($queuedPayment, time() + 60 * 60 * 24 * 30);
     // 30 days to complete
     if ($cost == 0) {
         $paymentManager->fulfillQueuedPayment($queuedPaymentId, $queuedPayment);
         return REGISTRATION_FREE;
     } else {
         $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
     }
     return REGISTRATION_SUCCESSFUL;
 }
开发者ID:pulipulichen,项目名称:ocs,代码行数:97,代码来源:UserRegistrationForm.inc.php


注:本文中的Registration::setSurvey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。