예제 #1
0
    ?>
		<h2 class="location_desc"><?php 
    echo JText::_('COM_REDEVENT_Registration');
    ?>
</h2>
		<?php 
    if (redEVENTHelper::isValidDate($this->row->registrationend)) {
        ?>
			<?php 
        echo strftime('%F', strtotime($this->row->registrationend));
        ?>
		<?php 
    }
    ?>
		<?php 
    $registration_status = redEVENTHelper::canRegister($this->row->xref);
    ?>
		<div class="event-registration">
		<?php 
    if (!$registration_status->canregister) {
        $imgpath = 'components/com_redevent/assets/images/' . $registration_status->error . '.png';
        $img = JHTML::_('image', JURI::base() . $imgpath, $registration_status->status, array('class' => 'hasTip', 'title' => $registration_status->status));
        echo REOutput::moreInfoIcon($this->row->xslug, $img, $registration_status->status);
    } else {
        ?>
		<?php 
        $venues_html = '';
        /* Get the different submission types */
        $submissiontypes = explode(',', $this->row->submission_types);
        $imagepath = JURI::base() . 'administrator/components/com_redevent/assets/images/';
        foreach ($submissiontypes as $key => $subtype) {
예제 #2
0
 private function _canRegister()
 {
     if ($this->_canregister === null) {
         $this->_canregister = redEVENTHelper::canRegister($this->getXref());
     }
     return $this->_canregister;
 }
예제 #3
0
</td>
			<td class="courseinfo_country"><?php 
    echo REOutput::getFlag($event->country);
    ?>
</td>
			<td class="courseinfo_prices re-price"><?php 
    echo REOutput::formatListPrices($event->prices);
    ?>
</td>
			<td class="courseinfo_credit"><?php 
    echo $event->course_credit;
    ?>
</td>
		<td class="courseinfo_signup" width="*"><div class="courseinfo_signupwrapper">
		<?php 
    $registration_status = redEVENTHelper::canRegister($event->xref);
    if (!$registration_status->canregister) {
        $imgpath = 'components/com_redevent/assets/images/' . $registration_status->error . '.png';
        $img = JHTML::_('image', JURI::base() . $imgpath, $registration_status->status, array('class' => 'hasTip', 'title' => $registration_status->status));
        echo REOutput::moreInfoIcon($event->xslug, $img, $registration_status->status);
    } else {
        $venues_html = '';
        /* Get the different submission types */
        $submissiontypes = explode(',', $event->submission_types);
        foreach ($submissiontypes as $key => $subtype) {
            switch ($subtype) {
                case 'email':
                    $venues_html .= '<div class="courseinfo_vlink courseinfo_email">' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('email', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_email_img'), JText::_($elsettings->get('signup_email_text')), 'width="24px" height="24px"')) . '</div> ';
                    break;
                case 'phone':
                    $venues_html .= '<div class="courseinfo_vlink courseinfo_phone">' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('phone', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_phone_img'), JText::_($elsettings->get('signup_phone_text')), 'width="24px" height="24px"')) . '</div> ';
예제 #4
0
 /**
  * returns the registration status as an object (canregister, status)
  *
  * @return object (canregister, status)
  */
 function getRegistrationStatus()
 {
     return redEVENTHelper::canRegister($this->_xref);
 }
예제 #5
0
 /**
  * handle registration
  * 
  */
 function register()
 {
     if (JRequest::getVar('cancel', '', 'post')) {
         return $this->cancelreg();
     }
     $app =& JFactory::getApplication();
     $msg = 'OK';
     $xref = JRequest::getInt('xref');
     $pricegroups = JRequest::getVar('pricegroup_id', array(), 'post', 'array');
     $review = JRequest::getVar('hasreview', 0);
     $isedit = JRequest::getVar('isedit', 0);
     JArrayHelper::toInteger($pricegroups);
     if (!$xref) {
         $msg = JText::_('COM_REDEVENT_REGISTRATION_MISSING_XREF');
         $this->setRedirect('index.php', $msg, 'error');
         return;
     }
     $status = redEVENTHelper::canRegister($xref);
     if (!$status->canregister) {
         $msg = $status->status;
         $this->setRedirect('index.php', $msg, 'error');
         return false;
     }
     $model = $this->getModel('registration');
     $model->setXref($xref);
     $details = $model->getSessionDetails();
     // get prices associated to pricegroups
     $prices = array();
     foreach ($pricegroups as $p) {
         $price = $model->getRegistrationPrice($p);
         if ($price === false) {
             $msg = JText::_('COM_REDEVENT_REGISTRATION_MISSING_PRICE');
             $this->setRedirect('index.php', $msg, 'error');
             return;
         }
         $prices[] = $price;
     }
     // first, ask redform to save it's fields, and return the corresponding sids.
     $options = array('baseprice' => $prices);
     if ($review) {
         $options['savetosession'] = 1;
     }
     $rfcore = new redFormCore();
     $result = $rfcore->saveAnswers('redevent', $options);
     if (!$result) {
         $msg = JText::_('COM_REDEVENT_REGISTRATION_REDFORM_SAVE_FAILED') . ' - ' . $rfcore->getError();
         $this->setRedirect(JRoute::_(RedeventHelperRoute::getDetailsRoute($details->did, $xref)), $msg, 'error');
         return;
     }
     $submit_key = $result->submit_key;
     JRequest::setVar('submit_key', $submit_key);
     if ($review) {
         // remember set prices groups
         $app->setUserState('pgids' . $submit_key, $pricegroups);
     } else {
         $app->setUserState('pgids' . $submit_key, null);
     }
     if (!$isedit && !$review) {
         // redform saved fine, now add the attendees
         $user = JFactory::getUser();
         if (!$user->get('id') && $details->juser) {
             if ($new = $this->_createUser($result->posts[0]['sid'])) {
                 $user = $new;
             }
         }
         $attendees = array();
         $k = 0;
         foreach ($result->posts as $rfpost) {
             if (!($res = $model->register($user, $rfpost['sid'], $result->submit_key, $pricegroups[$k++]))) {
                 $msg = JText::_('COM_REDEVENT_REGISTRATION_REGISTRATION_FAILED');
                 $this->setRedirect(JRoute::_(RedeventHelperRoute::getDetailsRoute($details->did, $xref)), $msg, 'error');
                 return;
             }
             $attendees[] = $res;
         }
         JPluginHelper::importPlugin('redevent');
         $dispatcher =& JDispatcher::getInstance();
         $res = $dispatcher->trigger('onEventUserRegistered', array($xref));
         if ($details->notify) {
             $mail = $model->sendNotificationEmail($submit_key);
         }
         $mail = $model->notifyManagers($submit_key);
     }
     if (!$review) {
         $cache = JFactory::getCache('com_redevent');
         $cache->clean();
         $rfredirect = $rfcore->getFormRedirect($details->redform_id);
         if ($rfredirect) {
             $link = $rfredirect;
         } else {
             $link = RedeventHelperRoute::getRegistrationRoute($xref, 'confirm', $submit_key);
         }
     } else {
         $link = RedeventHelperRoute::getRegistrationRoute($xref, 'review', $submit_key);
     }
     // redirect to prevent resending the form on refresh
     $this->setRedirect(JRoute::_($link, false));
 }