function display($tpl = null) { $mainframe =& JFactory::getApplication(); $dispatcher =& JDispatcher::getInstance(); /* Load the event details */ $course = $this->get('Details'); $venue = $this->get('Venue'); $pdf = new TCPDF("P", "mm", "A4", true); $pdf->SetCreator($mainframe->getCfg('sitename')); $pdf->SetAuthor($mainframe->getCfg('sitename')); $pdf->SetTitle($course->title); $pdf->SetSubject($course->title); $pdf->setHeaderFont(array('freesans', '', 8)); $pdf->setFooterFont(array('freesans', '', 8)); $pdf->setFont('freesans'); // disable header and footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(true); //set the display mode $pdf->SetDisplayMode('default'); //initialize document $pdf->AliasNbPages(); // add a page $pdf->AddPage(); $pdf->SetFontSize(10); /* This loads the tags replacer */ JView::loadHelper('tags'); $tags = new redEVENT_tags(); $tags->setXref(JRequest::getInt('xref')); $message = $tags->ReplaceTags($course->submission_type_email_pdf); // convert urls $htmlmsg = REOutput::ImgRelAbs($message); $pdf->WriteHTML($message, true); // add the form data if requested if ($course->pdf_form_data) { JRequest::setVar('pdfform', $pdf); JPluginHelper::importPlugin('content'); $form = new stdClass(); $form->text = '{redform}' . $course->redform_id . ',1{/redform}'; $form->eventid = $course->did; $form->task = 'userregister'; $results = $dispatcher->trigger('onPrepareEvent', array(&$form, array(), 0)); $pdf->WriteHTML($form->text, true); } // output the file $pdf->Output($course->title . ".pdf", "I"); exit; }
/** * Creates the output for the registration view * * @since 1.5 */ function display($tpl = null) { $mainframe =& Jfactory::getApplication(); $document =& JFactory::getDocument(); $user =& JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); $config = redEVENTHelper::config(); $acl = UserAcl::getInstance(); $event = $this->get('SessionDetails'); if ($this->getLayout() == 'confirmed') { $message = $event->confirmation_message; $document->setTitle($event->title . ' - ' . JText::_('COM_REDEVENT_REGISTRATION_CONFIRMED_PAGE_TITLE')); } else { if ($this->getLayout() == 'review') { $message = $event->review_message; $document->setTitle($event->title . ' - ' . JText::_('COM_REDEVENT_REGISTRATION_REVIEW_PAGE_TITLE')); } else { if ($this->getLayout() == 'edit') { return $this->_displayEdit($tpl); } else { if ($this->getLayout() == 'cancel') { return $this->_displayCancel($tpl); } else { echo 'layout not defined'; return; } } } } /* This loads the tags replacer */ JView::loadHelper('tags'); /* Start the tag replacer */ $tags = new redEVENT_tags(); $tags->setXref(JRequest::getInt('xref')); $message = $tags->ReplaceTags($message); $this->assignRef('tags', $tags); $this->assignRef('message', $message); $this->assignRef('event', $event); parent::display($tpl); }
/** * send reminder emails */ function reminder() { jimport('joomla.filesystem.file'); $app =& JFactory::getApplication(); $params = $app->getParams('com_redevent'); $file = JPATH_COMPONENT_SITE . DS . 'reminder.txt'; if (JFile::exists($file)) { $date = (int) JFile::read($file); } else { $date = 0; } // only run this once a day echo sprintf("last update on %s<br/>", strftime('%Y-%m-%d %H:%M', $date)); if (time() - $date < 3600 * 23.9 && !JRequest::getVar('force', 0)) { echo "reminder sent less the 24 hours ago<br/>"; return; } $model = $this->getModel('attendees'); $events = $model->getReminderEvents($params->get('reminder_days', 14)); if ($events && count($events)) { $mailer =& JFactory::getMailer(); $MailFrom = $app->getCfg('mailfrom'); $FromName = $app->getCfg('fromname'); $mailer->setSender(array($MailFrom, $FromName)); $mailer->IsHTML(true); $subject = $params->get('reminder_subject'); $body = $params->get('reminder_body'); foreach ($events as $event) { echo "sending reminder for event: " . $event->full_title . "<br>"; $tags = new redEVENT_tags(); $tags->setXref($event->id); // get attendees $attendees = $model->getAttendeesEmails($event->id, $params->get('reminder_include_waiting', 1)); if (!$attendees) { continue; } foreach ($attendees as $sid => $a) { $msubject = $tags->ReplaceTags($subject, array('sids' => array($sid))); $mbody = '<html><body>' . $tags->ReplaceTags($body) . '</body></html>'; // convert urls $mbody = REOutput::ImgRelAbs($mbody); $mailer->setSubject($msubject); $mailer->setBody($mbody); $mailer->clearAllRecipients(); $mailer->addRecipient($a); $sent = $mailer->Send(); } } } else { echo 'No events for this reminder interval<br/>'; } // update file JFile::write($file, time()); }
/** * send mail to selected attendees * * @param array $cid attendee ids * @param string $subject * @param string $body * @param string $from * @param string $fromname * @param string $replyto * @return boolean */ function sendMail($cid, $subject, $body, $from = null, $fromname = null, $replyto = null) { $app =& JFactory::getApplication(); $emails = $this->getEmails($cid); $taghelper = new redEVENT_tags(); $taghelper->setXref($this->_xref); $subject = $taghelper->ReplaceTags($subject); $body = $taghelper->ReplaceTags($body); $mailer =& JFactory::getMailer(); $mailer->setSubject($subject); $mailer->MsgHTML('<html><body>' . $body . '</body></html>'); if (!empty($from) && JMailHelper::isEmailAddress($from)) { $fromname = !empty($fromname) ? $fromname : $app->getCfg('sitename'); $mailer->setSender(array($from, $fromname)); } $res = true; foreach ($emails as $e) { $mailer->clearAllRecipients(); if (isset($e['fullname'])) { $mailer->addAddress($e['email'], $e['fullname']); } else { $mailer->addAddress($e['email']); } if (!$mailer->send()) { JError::raiseWarning(JText::sprintf('COM_REDEVENT_EMAIL_ATTENDEES_ERROR_SENDING_EMAIL_TO'), $e['email']); $res = false; } } return true; }
/** * Creates the output for the details view * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); /* Set which page to show */ $state = JRequest::getVar('state', ''); $submit_key = JRequest::getVar('submit_key', ''); $document = JFactory::getDocument(); $dispatcher = JDispatcher::getInstance(); $elsettings = redEVENTHelper::config(); $uri =& JFactory::getURI(); $row = $this->get('Event'); /* This loads the tags replacer */ JView::loadHelper('tags'); JRequest::setVar('xref', $row->xref); // neede for tag constructor $tags = new redEVENT_tags(); $tags->setXref($row->xref); $tags->setSubmitkey($submit_key); //get menu information $menu =& JSite::getMenu(); $item = $menu->getActive(); if (!$item) { $item = $menu->getDefault(); } $params =& $mainframe->getParams('com_redevent'); //Check if the id exists if ($row->eventid == 0) { return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Event_d_not_found', $row->eventid)); } //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); //Print $pop = JRequest::getBool('pop'); $params->def('page_title', JText::_('COM_REDEVENT_DETAILS')); if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_(htmlspecialchars($uri->toString()) . '&pop=1&tmpl=component'); //set page title and meta stuff $document->setTitle($row->title . ' - ' . JText::_('COM_REDEVENT_Payment')); $text = ''; switch ($state) { case 'processing': $text = $tags->ReplaceTags($row->paymentprocessing); break; case 'accepted': $text = $tags->ReplaceTags($row->paymentaccepted); break; case 'refused': $text = JText::_('COM_REDEVENT_PAYMENT_PAYMENT_REFUSED'); break; default: $text = JText::_('COM_REDEVENT_PAYMENT_UNKNOWN_PAYMENT_STATUS'); break; } //assign vars to jview $this->assignRef('row', $row); $this->assign('text', $text); $this->assignRef('params', $params); $this->assignRef('print_link', $print_link); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('tags', $tags); $tpl = JRequest::getVar('tpl', $tpl); parent::display($tpl); }
/** * Creates the output for the details view * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); $uri =& JFactory::getUri(); /* Set which page to show */ $tpl = JRequest::getVar('page', null); $params =& $mainframe->getParams('com_redevent'); $document = JFactory::getDocument(); $user = JFactory::getUser(); $dispatcher = JDispatcher::getInstance(); $elsettings = redEVENTHelper::config(); $acl = UserAcl::getInstance(); if ($params->get('gplusone', 1)) { $document->addScript('https://apis.google.com/js/plusone.js'); } if ($params->get('tweet', 1)) { $document->addScript('http://platform.twitter.com/widgets.js'); } $row = $this->get('Details'); $registers = $this->get('Registers'); $roles = $this->get('Roles'); $prices = $this->get('Prices'); $register_fields = $this->get('FormFields'); $regcheck = $this->get('Usercheck'); /* Get the venues information */ $this->_venues = $this->get('Venues'); /* This loads the tags replacer */ JView::loadHelper('tags'); $tags = new redEVENT_tags(); $tags->setEventId(JRequest::getInt('id')); $tags->setXref(JRequest::getInt('xref')); $this->assignRef('tags', $tags); //get menu information $menu =& JSite::getMenu(); $item = $menu->getActive(); if (!$item) { $item = $menu->getDefault(); } //Check if the id exists if ($row->did == 0) { return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Event_d_not_found', $row->did)); } //Check if user has access to the details if ($params->get('showdetails', 1) == 0) { $mainframe->redirect('index.php', JText::_('COM_REDEVENT_EVENT_DETAILS_NOT_AVAILABLE'), 'error'); } //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); //Print $pop = JRequest::getBool('pop'); $params->def('page_title', $row->full_title); if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_('index.php?option=com_redevent&view=details&id=' . $row->slug . '&xref=' . JRequest::getInt('xref') . '&pop=1&tmpl=component'); //pathway $pathway =& $mainframe->getPathWay(); $pathway->addItem($row->full_title, JRoute::_('index.php?option=com_redevent&view=details&id=' . $row->slug)); //Check user if he can edit $allowedtoeditevent = $acl->canEditEvent($row->did); //Timecheck for registration $jetzt = date("Y-m-d"); $now = strtotime($jetzt); $date = strtotime($row->dates); $timecheck = $now - $date; //is the user allready registered at the event if ($regcheck) { // add javascript code for cancel button on attendees layout. JHTML::_('behavior.mootools'); $js = " window.addEvent('domready', function(){\n\t\t \$\$('.unreglink').addEvent('click', function(event){\n\t\t if (confirm('" . JText::_('COM_REDEVENT_CONFIRM_CANCEL_REGISTRATION') . "')) {\n \treturn true;\n\t }\n\t else {\n\t \tif (event.preventDefault) {\n\t \t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.returnValue = false;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n \t}\n\t\t });\t\t \n\t\t }); "; $document->addScriptDeclaration($js); } //Generate Eventdescription if ($row->datdescription == '' || $row->datdescription == '<br />') { $row->datdescription = JText::_('COM_REDEVENT_NO_DESCRIPTION'); } else { //Execute Plugins $row->datdescription = JHTML::_('content.prepare', $row->datdescription); } // generate Metatags $meta_keywords_content = ""; if (!empty($row->meta_keywords)) { $keywords = explode(",", $row->meta_keywords); foreach ($keywords as $keyword) { if ($meta_keywords_content != "") { $meta_keywords_content .= ", "; } if (preg_match("/[\\/[\\/]/", $keyword)) { $keyword = trim(str_replace("[", "", str_replace("]", "", $keyword))); $buffer = $this->keyword_switcher($keyword, $row, $elsettings->get('formattime', '%H:%M'), $elsettings->get('formatdate', '%d.%m.%Y')); if ($buffer != "") { $meta_keywords_content .= $buffer; } else { $meta_keywords_content = substr($meta_keywords_content, 0, strlen($meta_keywords_content) - 2); // remove the comma and the white space } } else { $meta_keywords_content .= $keyword; } } } if (!empty($row->meta_description)) { $description = explode("[", $row->meta_description); $description_content = ""; foreach ($description as $desc) { $keyword = substr($desc, 0, strpos($desc, "]", 0)); if ($keyword != "") { $description_content .= $this->keyword_switcher($keyword, $row, $elsettings->get('formattime', '%H:%M'), $elsettings->get('formatdate', '%d.%m.%Y')); $description_content .= substr($desc, strpos($desc, "]", 0) + 1); } else { $description_content .= $desc; } } } else { $description_content = ""; } //set page title and meta stuff $document->setTitle($row->full_title); $document->setMetadata('keywords', $meta_keywords_content); $document->setDescription(strip_tags($description_content)); // more metadata $document->addCustomTag('<meta property="og:title" content="' . $row->full_title . '"/>'); $document->addCustomTag('<meta property="og:type" content="event"/>'); $document->addCustomTag('<meta property="og:url" content="' . htmlspecialchars($uri->toString()) . '"/>'); if ($row->datimage) { $document->addCustomTag('<meta property="og:image" content="' . JURI::base() . 'images/redevent/events/' . $row->datimage . '"/>'); } $document->addCustomTag('<meta property="og:site_name" content="' . $mainframe->getCfg('sitename') . '"/>'); $document->addCustomTag('<meta property="og:description" content="' . JFilterOutput::cleanText($row->summary) . '"/>'); //build the url if (!empty($row->url) && strtolower(substr($row->url, 0, 7)) != "http://") { $row->url = 'http://' . $row->url; } /* Get the Venue Dates */ $venuedates = $this->get('VenueDates'); //add alternate feed link $link = 'index.php?option=com_redevent&view=details&format=feed'; if (!empty($row->slug)) { $link .= '&id=' . $row->slug; } $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // check unregistration rights $unreg_check = redEVENTHelper::canUnregister($row->xref); //manages attendees $manage_attendees = $this->get('ManageAttendees') || $this->get('ViewFullAttendees'); $candeleteattendees = $this->get('ManageAttendees'); $view_attendees_list = $row->show_names && in_array($params->get('frontend_view_attendees_access'), JFactory::getUser()->getAuthorisedViewLevels()); //assign vars to jview $this->assignRef('row', $row); $this->assignRef('params', $params); $this->assignRef('user', $user); $this->assignRef('allowedtoeditevent', $allowedtoeditevent); $this->assignRef('manage_attendees', $manage_attendees); $this->assignRef('view_attendees_list', $view_attendees_list); $this->assignRef('candeleteattendees', $candeleteattendees); $this->assignRef('print_link', $print_link); $this->assignRef('registers', $registers); $this->assignRef('registersfields', $register_fields); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('messages', $messages); $this->assignRef('venuedates', $venuedates); $this->assignRef('unreg_check', $unreg_check); $this->assignRef('roles', $roles); $this->assignRef('prices', $prices); $this->assignRef('uri', $uri); $this->assignRef('lang', JFactory::getLanguage()); if ($params->get('fbopengraph', 1)) { $this->_opengraph(); } $tpl = JRequest::getVar('tpl', $tpl); if ($tpl == '') { switch ($row->details_layout) { case 2: $this->setLayout('fixed'); break; case 1: $this->setLayout('default'); break; case 0: $this->setLayout($params->get('details_layout', 'fixed')); break; } } parent::display($tpl); }
function notifyManagers($unreg = false) { jimport('joomla.mail.helper'); $app =& JFactory::getApplication(); $params = $app->getParams('com_redevent'); $tags = new redEVENT_tags(); $tags->setXref($this->getXref()); $tags->setSubmitkey($this->load()->submit_key); $tags->addOptions(array('sids' => array($this->load()->sid))); $event = $this->getSessionDetails(); $recipients = $this->getAdminEmails(); if (!count($recipients)) { return true; } $mailer =& JFactory::getMailer(); if ($this->getEmail() && $params->get('allow_email_aliasing', 1)) { $sender = array($this->getEmail(), $this->getFullname()); } else { // default to site settings $sender = array($app->getCfg('mailfrom'), $app->getCfg('sitename')); } $mailer->setSender($sender); $mailer->addReplyTo($sender); foreach ($recipients as $r) { $mailer->addAddress($r['email'], $r['name']); } $mail = '<HTML><HEAD> <STYLE TYPE="text/css"> <!-- table.formanswers , table.formanswers td, table.formanswers th { border-color: darkgrey; border-style: solid; text-align:left; } table.formanswers { border-width: 0 0 1px 1px; border-spacing: 0; border-collapse: collapse; padding: 5px; } table.formanswers td, table.formanswers th { margin: 0; padding: 4px; border-width: 1px 1px 0 0; } --> </STYLE> </head> <BODY bgcolor="#FFFFFF"> ' . $tags->ReplaceTags($unreg ? $params->get('unregistration_notification_body') : $params->get('registration_notification_body')) . ' </body> </html>'; // convert urls $mail = REOutput::ImgRelAbs($mail); if (!$unreg && $params->get('registration_notification_attach_rfuploads', 1)) { // files submitted through redform $files = $this->getRFFiles(); $filessize = 0; foreach ($files as $f) { $filessize += filesize($f); } if ($filessize < $params->get('registration_notification_attach_rfuploads_maxsize', 1500) * 1000) { foreach ($files as $f) { $mailer->addAttachment($f); } } } $mailer->setSubject($tags->ReplaceTags($unreg ? $params->get('unregistration_notification_subject') : $params->get('registration_notification_subject'))); $mailer->MsgHTML($mail); if (!$mailer->send()) { RedeventHelperLog::simplelog(JText::_('COM_REDEVENT_ERROR_REGISTRATION_MANAGERS_NOTIFICATION_FAILED')); $this->setError(JText::_('COM_REDEVENT_ERROR_REGISTRATION_MANAGERS_NOTIFICATION_FAILED')); return false; } return true; }
/** * Creates the output for the details view * * @since 0.9 */ function display($tpl = null) { if (JRequest::getVar('layout') == 'edit') { return $this->_displayEdit(); } $mainframe =& JFactory::getApplication(); $document =& JFactory::getDocument(); $params =& $mainframe->getParams(); $menu =& JSite::getMenu(); $item = $menu->getActive(); /* Load the event details */ $course = $this->get('Details'); $venue = $this->get('Venue'); $pagetitle = $params->set('page_title', JText::_('COM_REDEVENT_SIGNUP_PAGE_TITLE')); $document->setTitle($pagetitle); //Print $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); $canRegister = $this->get('RegistrationStatus'); if ($canRegister->canregister == 0) { echo '<span class="registration_error">' . $canRegister->status . '</span>'; echo '<br/>'; echo JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=details&xref=' . JRequest::getInt('xref') . '&id=' . JRequest::getInt('id')), JText::_('COM_REDEVENT_RETURN_EVENT_DETAILS')); return; } /* This loads the tags replacer */ JView::loadHelper('tags'); $tags = new redEVENT_tags(); $tags->setXref(JRequest::getInt('xref')); $this->assignRef('tags', $tags); switch (JRequest::getCmd('subtype', 'webform')) { case 'email': if (JRequest::getVar('sendmail') == '1') { $this->tmp_xref = JRequest::getInt('xref'); $this->tmp_id = JRequest::getInt('id'); $model_signup = $this->getModel('Signup'); /* Send the user the signup email */ $result = $model_signup->getSendSignupEmail($tags, $course->send_pdf_form); $this->assignRef('result', $result); JRequest::setVar('xref', $this->tmp_xref); JRequest::setVar('id', $this->tmp_id); } /* Load the view */ $this->assignRef('page', $course->submission_type_email); $tpl = 'email'; break; case 'formaloffer': if (JRequest::getVar('sendmail') == '1') { $this->tmp_xref = JRequest::getInt('xref'); $this->tmp_id = JRequest::getInt('id'); $model_details = $this->getModel('Details'); $model_signup = $this->getModel('Signup'); $model_details->getDetails(); $venues = $model_details->getVenues(); /* Send the user the formal offer email */ $result = $model_signup->getSendFormalOfferEmail($tags); $this->assignRef('result', $result); JRequest::setVar('xref', $this->tmp_xref); JRequest::setVar('id', $this->tmp_id); } /* Load the view */ $this->assignRef('page', $course->submission_type_formal_offer); $tpl = 'formaloffer'; break; case 'phone': /* Load the view */ $this->assignRef('page', $course->submission_type_phone); $tpl = 'phone'; break; case 'webform': default: $this->tmp_xref = JRequest::getInt('xref'); $this->tmp_id = JRequest::getInt('id'); $review_txt = trim(strip_tags($course->review_message)); $page = $tags->ReplaceTags($course->submission_type_webform, array('hasreview' => !empty($review_txt))); $print_link = JRoute::_('index.php?option=com_redevent&view=signup&subtype=webform&task=signup&xref=' . $this->tmp_xref . '&id=' . $this->tmp_id . '&pop=1&tmpl=component'); $this->assign('page', $page); $this->assign('print_link', $print_link); break; } // The replaceTag function can sometime call the layout directly. This variable allows to make the difference with regular // call $fullpage = true; $this->assignRef('course', $course); $this->assignRef('venue', $venue); $this->assignRef('params', $params); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('fullpage', $fullpage); parent::display($tpl); }
function notifyManagers() { jimport('joomla.mail.helper'); $app =& JFactory::getApplication(); $params = $app->getParams('com_redevent'); $event = $this->getDetails(); $tags = new redEVENT_tags(); $tags->setXref($this->_xref); $tags->setSubmitkey(JRequest::getVar('submit_key')); $recipients = array(); // default recipients $default = $params->get('registration_default_recipients'); if (!empty($default)) { if (strstr($default, ';')) { $addresses = explode(";", $default); } else { $addresses = explode(",", $default); } foreach ($addresses as $a) { $a = trim($a); if (JMailHelper::isEmailAddress($a)) { $recipients[] = array('email' => $a, 'name' => ''); } } } // creator if ($params->get('registration_notify_creator', 1)) { if (JMailHelper::isEmailAddress($event->creator_email)) { $recipients[] = array('email' => $event->creator_email, 'name' => $event->creator_name); } } // group recipients $gprecipients = $this->_getXrefRegistrationRecipients(); foreach ($gprecipients as $r) { $recipients[] = array('email' => $r->email, 'name' => $r->name); } if (!count($recipients)) { return true; } $mailer =& JFactory::getMailer(); foreach ($recipients as $r) { $mailer->addAddress($r['email'], $r['name']); } $mailer->setSubject($tags->ReplaceTags($params->get('registration_notification_subject'))); // convert urls $htmlmsg = '<html><body>' . $tags->ReplaceTags($params->get('registration_notification_body')) . '</body></html>'; $htmlmsg = REOutput::ImgRelAbs($htmlmsg); $mailer->MsgHTML($htmlmsg); if (!$mailer->send()) { RedeventHelperLog::simplelog(JText::_('COM_REDEVENT_ERROR_REGISTRATION_MANAGERS_NOTIFICATION_FAILED')); $this->setError(JText::_('COM_REDEVENT_ERROR_REGISTRATION_MANAGERS_NOTIFICATION_FAILED')); return false; } return true; }
$venues_html .= '<div class="courseinfo_vlink courseinfo_formaloffer">' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('formaloffer', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_formal_offer_img'), JText::_($elsettings->get('signup_formal_offer_text')), 'width="24px" height="24px"')) . '</div> '; break; } } echo $venues_html; } ?> </div></td> </tr> <?php if ($event->details) { ?> <tr> <td colspan="7"> <?php $tagsHelper = new redEVENT_tags(); ?> <?php $tagsHelper->setXref($event->xref); ?> <?php echo $tagsHelper->ReplaceTags($event->details); ?> </td> </tr> <?php } } ?> </tbody> </table>
/** * Confirms the users request */ function activate() { $mainframe =& JFactory::getApplication(); $msgtype = 'message'; /* Get the confirm ID */ $confirmid = JRequest::getVar('confirmid', '', 'get'); /* Get the details out of the confirmid */ list($uip, $xref, $uid, $register_id, $submit_key) = explode("x", $confirmid); /* Confirm sign up via mail */ $model = $this->getModel('Registration', 'RedEventModel'); $model->setXref($xref); $eventdata = $model->getSessionDetails(); /* This loads the tags replacer */ JRequest::setVar('xref', $xref); require_once JPATH_COMPONENT_SITE . DS . 'helpers' . DS . 'tags.php'; $tags = new redEVENT_tags(); $tags->setXref($xref); $tags->setSubmitkey($submit_key); /* Check the db if this entry exists */ $db = JFactory::getDBO(); $q = ' SELECT r.confirmed ' . ' FROM #__redevent_register r ' . ' WHERE r.uid = ' . $db->Quote($uid) . ' AND r.submit_key = ' . $db->Quote($submit_key) . ' AND r.xref = ' . $db->Quote($xref) . ' AND r.id = ' . $db->Quote($register_id); $db->setQuery($q); $regdata = $db->loadObject(); if ($regdata && $regdata->confirmed == 0) { $model->confirm($register_id); // send activation confirmation email if activated if ($eventdata->enable_activation_confirmation) { $this->_Mailer(); $rfcore = new RedFormCore(); $addresses = $rfcore->getSubmissionContactEmail($submit_key); /* Check if there are any addresses to be mailed */ if (count($addresses) > 0) { /* Start mailing */ foreach ($addresses as $key => $sid) { foreach ($sid as $email) { /* Send a off mailinglist mail to the submitter if set */ /* Add the email address */ $this->mailer->AddAddress($email['email']); /* Mail submitter */ $htmlmsg = '<html><head><title></title></title></head><body>' . $tags->ReplaceTags($eventdata->notify_confirm_body) . '</body></html>'; // convert urls $htmlmsg = REOutput::ImgRelAbs($htmlmsg); $this->mailer->setBody($htmlmsg); $this->mailer->setSubject($tags->ReplaceTags($eventdata->notify_confirm_subject)); /* Send the mail */ if (!$this->mailer->Send()) { $mainframe->enqueueMessage(JText::_('COM_REDEVENT_THERE_WAS_A_PROBLEM_SENDING_MAIL')); RedeventHelperLog::simpleLog('Error sending confirm email' . ': ' . $this->mailer->error); } /* Clear the mail details */ $this->mailer->ClearAddresses(); } } } } $msg = JText::_('COM_REDEVENT_REGISTRATION_ACTIVATION_SUCCESSFULL'); } else { if ($regdata && $regdata->confirmed == 1) { $msg = JText::_('COM_REDEVENT_YOUR_SUBMISSION_HAS_ALREADY_BEEN_CONFIRMED'); $msgtype = 'error'; } else { $msg = JText::_('COM_REDEVENT_YOUR_SUBMISSION_CANNOT_BE_CONFIRMED'); $msgtype = 'error'; } } $this->setRedirect(JRoute::_(RedeventHelperRoute::getDetailsRoute($eventdata->did, $xref)), $msg, $msgtype); }