Ejemplo n.º 1
0
 /**
  * Method to get the Venues
  *
  * @access public
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $menu->getParams($item->id);
     $elsettings =& redEVENTHelper::config();
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         // Get a reference to the global cache object.
         $cache =& JFactory::getCache('redevent');
         $this->_data = $cache->call(array('RedeventModelCountriesmap', '_getResultList'), $query);
         $countrycoords = redEVENTHelperCountries::getCountrycoordArray();
         $k = 0;
         for ($i = 0; $i < count($this->_data); $i++) {
             $country =& $this->_data[$i];
             $country->flag = REOutput::getFlag($country->iso2);
             $country->flagurl = REOutput::getFlagUrl($country->iso2);
             $country->latitude = $countrycoords[$country->iso2][0];
             $country->longitude = $countrycoords[$country->iso2][1];
             //create target link
             $country->targetlink = JRoute::_(JURI::base() . 'index.php?option=com_redevent&view=countryevents&filter_country=' . $country->iso2);
             $k = 1 - $k;
         }
     }
     return $this->_data;
 }
Ejemplo n.º 2
0
 /**
  * Creates the Venueevents View
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $option = JRequest::getCmd('option');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $elsettings =& redEVENTHelper::config();
     $item = $menu->getActive();
     $params =& $mainframe->getParams('com_redevent');
     $uri =& JFactory::getURI();
     $upcomingevents = $this->get('UpcomingEvents');
     //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]-->');
     //params
     $params->def('page_title', JText::_('COM_REDEVENT_UPCOMING_EVENTS_TITLE'));
     /* Add rss link */
     $link = '&format=feed';
     $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
     $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
     $this->assignRef('upcomingevents', $upcomingevents);
     $this->assignRef('params', $params);
     $this->assign('action', JRoute::_('index.php?option=com_redevent&view=upcomingevents'));
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 /**
  * Creates the output for the details view
  *
  * @since 2.0
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $id = JRequest::getInt('id');
     $settings = redEVENTHelper::config();
     // Get data from the model
     $row = $this->get('Details');
     // initiate new CALENDAR
     $vcal = redEVENTHelper::getCalendarTool();
     $vcal->setProperty('unique_id', 'session' . $row->xref . '@' . $mainframe->getCfg('sitename'));
     $vcal->setConfig("filename", "event" . $row->xref . ".ics");
     redEVENTHelper::icalAddEvent($vcal, $row);
     $vcal->returnCalendar();
     // generate and redirect output to user browser
     //		echo $vcal->createCalendar(); // debug
     $mainframe->close();
 }
Ejemplo n.º 4
0
 function display($tpl = null)
 {
     jimport('joomla.filesystem.file');
     $model = $this->getModel();
     $event = $this->get('Event');
     $fields = $model->getFields();
     $registers = $model->getRegisters(true, true);
     //		echo '<pre>';print_r($registers); echo '</pre>';exit;
     $text = "";
     foreach ($fields as $f) {
         $cols[] = $f->field_header;
     }
     $stdcols = array(JText::_('COM_REDEVENT_REGDATE'), JText::_('COM_REDEVENT_IP_ADDRESS'), JText::_('COM_REDEVENT_UNIQUE_ID'), JText::_('COM_REDEVENT_USERNAME'), JText::_('COM_REDEVENT_ACTIVATED'), JText::_('COM_REDEVENT_CANCELLED'), JText::_('COM_REDEVENT_WAITINGLIST'), JText::_('COM_REDEVENT_PRICE'), JText::_('COM_REDEVENT_PRICEGROUP'), JText::_('COM_REDEVENT_PAYMENT'));
     $cols = array_merge($cols, $stdcols);
     $text .= $this->writecsvrow($cols);
     if (count($registers)) {
         foreach ((array) $registers as $r) {
             $data = array();
             foreach ($fields as $f) {
                 $cleanfield = 'field_' . $f->id;
                 if (isset($r->answers->{$cleanfield})) {
                     $val = $r->answers->{$cleanfield};
                     if (stristr($val, '~~~')) {
                         $val = str_replace('~~~', '\\n', $val);
                     }
                     $data[] = $val;
                 } else {
                     $data[] = '';
                 }
             }
             $svals = array($r->uregdate, $r->uip, $event->course_code . '-' . $event->xref . '-' . $r->id, $r->name, $r->confirmed, $r->cancelled, $r->waitinglist, $r->answers->price, $r->pricegroup, $r->answers->paid ? JText::_('COM_REDEVENT_REGISTRATION_PAID') . ' / ' . $r->answers->status : JText::_('COM_REDEVENT_REGISTRATION_NOT_PAID') . ' / ' . $r->answers->status);
             $data = array_merge($data, $svals);
             $text .= $this->writecsvrow($data);
         }
     } else {
         //$text = "no attendees";
     }
     $event->dates = redEVENTHelper::isValidDate($event->dates) ? $event->dates : JText::_('COM_REDEVENT_OPEN_DATE');
     $title = JFile::makeSafe($event->title . '_' . $event->dates . '_' . $event->venue . '.csv');
     $doc =& JFactory::getDocument();
     $doc->setMimeEncoding('text/csv');
     header('Content-Disposition: attachment; filename="' . $title . '"');
     echo $text;
 }
Ejemplo n.º 5
0
 /**
  * Method to get the Venues
  *
  * @access public
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $menu->getParams($item->id);
     $elsettings =& redEVENTHelper::config();
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         // Get a reference to the global cache object.
         $cache =& JFactory::getCache('redevent');
         $this->_data = $cache->call(array('RedeventModelVenuesmap', '_getResultList'), $query);
         $k = 0;
         for ($i = 0; $i < count($this->_data); $i++) {
             $venue =& $this->_data[$i];
             //Create image information
             $venue->limage = redEVENTImage::flyercreator($venue->locimage);
             //Generate Venuedescription
             if (!empty($venue->locdescription)) {
                 //execute plugins
                 $venue->locdescription = JHTML::_('content.prepare', $venue->locdescription);
             }
             //build the url
             if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") {
                 $venue->url = 'http://' . $venue->url;
             }
             //prepare the url for output
             if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) {
                 $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...';
             } else {
                 $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES);
             }
             //create flag
             if ($venue->country) {
                 $venue->countryimg = REOutput::getFlag($venue->country);
             }
             //create target link
             $venue->targetlink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug));
             $k = 1 - $k;
         }
     }
     return $this->_data;
 }
Ejemplo n.º 6
0
 function display($tpl = null)
 {
     jimport('joomla.filesystem.file');
     $model = $this->getModel();
     $events = JRequest::getVar('events_filter', array(), 'post', 'array');
     JArrayHelper::toInteger($events);
     $attendees = $model->getRegisters(JRequest::getInt('form_filter'), $events, JRequest::getInt('category_filter'), JRequest::getInt('venue_filter'), JRequest::getInt('state_filter'), JRequest::getInt('filter_attending'));
     $fields = $model->getFields(JRequest::getInt('form_filter'));
     $cols = array(JText::_('COM_REDEVENT_EVENT'), JText::_('COM_REDEVENT_DATE'), JText::_('COM_REDEVENT_VENUE'));
     $text = "";
     foreach ($fields as $f) {
         $cols[] = $f->field_header;
     }
     $stdcols = array(JText::_('COM_REDEVENT_REGDATE'), JText::_('COM_REDEVENT_IP_ADDRESS'), JText::_('COM_REDEVENT_UNIQUE_ID'), JText::_('COM_REDEVENT_USERNAME'), JText::_('COM_REDEVENT_ACTIVATED'), JText::_('COM_REDEVENT_WAITINGLIST'), JText::_('COM_REDEVENT_PRICE'), JText::_('COM_REDEVENT_PRICEGROUP'), JText::_('COM_REDEVENT_PAYMENT'));
     $cols = array_merge($cols, $stdcols);
     $text .= $this->writecsvrow($cols);
     if (count($attendees)) {
         foreach ((array) $attendees as $r) {
             $data = array($r->title, redEVENTHelper::isValidDate($r->dates) ? $r->dates : JText::_('COM_REDEVENT_OPEN_DATE'), $r->venue);
             foreach ($fields as $f) {
                 $cleanfield = 'field_' . $f->id;
                 if (isset($r->answers->{$cleanfield})) {
                     $val = $r->answers->{$cleanfield};
                     if (stristr($val, '~~~')) {
                         $val = str_replace('~~~', '\\n', $val);
                     }
                     $data[] = $val;
                 } else {
                     $data[] = '';
                 }
             }
             $svals = array($r->uregdate, $r->uip, $r->course_code . '-' . $r->xref . '-' . $r->id, $r->name, $r->confirmed, $r->waitinglist, $r->answers->price, $r->pricegroup, $r->answers->paid ? JText::_('COM_REDEVENT_REGISTRATION_PAID') . ' / ' . $r->answers->status : JText::_('COM_REDEVENT_REGISTRATION_NOT_PAID') . ' / ' . $r->answers->status);
             $data = array_merge($data, $svals);
             $text .= $this->writecsvrow($data);
         }
     } else {
         //$text = "no attendees";
     }
     $title = JFile::makeSafe('attendees.csv');
     $doc =& JFactory::getDocument();
     $doc->setMimeEncoding('text/csv');
     header('Content-Disposition: attachment; filename="' . $title . '"');
     echo $text;
 }
Ejemplo n.º 7
0
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     //Load pane behavior
     jimport('joomla.html.pane');
     //initialise variables
     $editor =& JFactory::getEditor();
     $document =& JFactory::getDocument();
     $user =& JFactory::getUser();
     $cid = JRequest::getVar('cid');
     $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_EDITATTENDEE'));
     //add css to document
     $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css');
     $row =& $this->get('data');
     //make data safe
     JFilterOutput::objectHTMLSafe($row);
     //create selectlists
     $lists = array();
     //user list
     $lists['user'] = JHTML::_('list.users', 'uid', $row->uid, 1, NULL, 'name', 0);
     $sessionpricegroups = $this->get('Pricegroups');
     $lists['pricegroup_id'] = redEVENTHelper::getRfPricesSelect($sessionpricegroups, $row->pricegroup_id);
     //build toolbar
     if (!empty($cid)) {
         JToolBarHelper::title(JText::_('COM_REDEVENT_EDIT_REGISTRATION'), 'registrations');
         JToolBarHelper::spacer();
     } else {
         JToolBarHelper::title(JText::_('COM_REDEVENT_ADD_REGISTRATION'), 'registrations');
         JToolBarHelper::spacer();
     }
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::spacer();
     JToolBarHelper::cancel();
     JToolBarHelper::spacer();
     //JToolBarHelper::help( 'el.registrationedit', true );
     //		echo '<pre>';print_r($row); echo '</pre>';exit;
     $this->assignRef('row', $row);
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
Ejemplo n.º 8
0
 /**
  * Creates the Calendar View
  *
  * @since 1.1
  */
 function display($tpl = null)
 {
     $app =& JFactory::getApplication();
     // Load tooltips behavior
     JHTML::_('behavior.tooltip');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $settings =& redEVENTHelper::config();
     $item = $menu->getActive();
     $params =& $app->getParams();
     $uri =& JFactory::getURI();
     $pathway =& $app->getPathWay();
     //add css file
     $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css');
     $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #redevent dd { height: 1%; }</style><![endif]-->');
     $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redeventcalendar.css');
     // add javascript
     $document->addScript($this->baseurl . '/components/com_redevent/assets/js/calendar.js');
     $year = (int) JRequest::getVar('yearID', strftime("%Y"));
     $month = (int) JRequest::getVar('monthID', strftime("%m"));
     //get data from model and set the month
     $model =& $this->getModel();
     $model->setDate(mktime(0, 0, 1, $month, 1, $year));
     $rows =& $this->get('Data');
     //Set Meta data
     $document->setTitle($item->title);
     //Set Page title
     $pagetitle = $params->def('page_title', $item->title);
     $this->document->setTitle($pagetitle);
     //init calendar
     $cal = new RECalendar($year, $month, 0, $app->getCfg('offset'));
     $cal->enableMonthNav('index.php?option=com_redevent&view=calendar');
     $cal->setFirstWeekDay($params->get('week_start', "SU") == 'SU' ? 0 : 1);
     $cal->enableDayLinks(false);
     $this->assignRef('rows', $rows);
     $this->assignRef('params', $params);
     $this->assignRef('settings', $settings);
     $this->assignRef('cal', $cal);
     parent::display($tpl);
 }
Ejemplo n.º 9
0
 /**
  * Creates the raw output for the simplelist view
  *
  * @since 2.0
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $settings = redEVENTHelper::config();
     // Get data from the model
     $model = $this->getModel();
     $model->setLimit($settings->get('ical_max_items', 100));
     $model->setLimitstart(0);
     $rows =& $model->getData();
     // initiate new CALENDAR
     $vcal = redEVENTHelper::getCalendarTool();
     $vcal->setProperty('unique_id', 'allevents@' . $mainframe->getCfg('sitename'));
     $vcal->setConfig("filename", "events.ics");
     foreach ($rows as $row) {
         redEVENTHelper::icalAddEvent($vcal, $row);
     }
     $vcal->returnCalendar();
     // generate and redirect output to user browser
     //		echo $vcal->createCalendar(); // debug
     $mainframe->close();
 }
Ejemplo n.º 10
0
 /**
  * Creates the attendees output for the details view
  *
  * @since 2.0
  */
 function _displayAttendees($tpl = null)
 {
     jimport('joomla.filesystem.file');
     $model = $this->getModel();
     if (!$this->get('ViewAttendees')) {
         JError::raiseError(403, 'Not authorized');
     }
     $event = $this->get('Session');
     $registers = $model->getRegisters(true, true);
     $text = "";
     if (count($registers)) {
         $fields = array();
         foreach ($registers[0]->fields as $f) {
             $fields[] = $f;
         }
         $text .= $this->writecsvrow($fields);
         foreach ((array) $registers as $r) {
             $data = array();
             foreach ($r->answers as $val) {
                 if (stristr($val, '~~~')) {
                     $val = str_replace('~~~', '\\n', $val);
                 }
                 $data[] = $val;
             }
             $text .= $this->writecsvrow($data);
         }
     } else {
         //$text = "no attendees";
     }
     if (!redEVENTHelper::isValidDate($event->dates)) {
         $event->dates = JText::_('COM_REDEVENT_OPEN_DATE');
     }
     $title = JFile::makeSafe($event->full_title . '_' . $event->dates . '_' . $event->venue . '.csv');
     $doc =& JFactory::getDocument();
     $doc->setMimeEncoding('text/csv');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Disposition: attachment; filename="' . $title . '"');
     header('Pragma: no-cache');
     echo $text;
 }
Ejemplo n.º 11
0
 /**
  * Method to build the sortlists
  *
  * @access private
  * @return array
  * @since 0.9
  */
 function _buildSortLists()
 {
     $app =& JFactory::getApplication();
     $elsettings =& redEVENTHelper::config();
     $filter_order = JRequest::getCmd('filter_order', 'x.dates');
     $filter_order_Dir = JRequest::getWord('filter_order_Dir', 'ASC');
     $filter = $app->getUserState('com_redevent.day.filter');
     $filter_type = $app->getUserState('com_redevent.day.filter_type');
     $sortselects = array();
     $sortselects[] = JHTML::_('select.option', 'title', JText::_('COM_REDEVENT_FILTER_SELECT_EVENT'));
     $sortselects[] = JHTML::_('select.option', 'venue', JText::_('COM_REDEVENT_FILTER_SELECT_VENUE'));
     $sortselects[] = JHTML::_('select.option', 'city', JText::_('COM_REDEVENT_FILTER_SELECT_CITY'));
     $sortselects[] = JHTML::_('select.option', 'type', JText::_('COM_REDEVENT_FILTER_SELECT_CATEGORY'));
     $sortselect = JHTML::_('select.genericlist', $sortselects, 'filter_type', 'size="1" class="inputbox"', 'value', 'text', $filter_type);
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $lists['filter'] = $filter;
     $lists['filter_types'] = $sortselect;
     return $lists;
 }
Ejemplo n.º 12
0
 function _getTag_phonesignup()
 {
     $registration_status = $this->_canRegister();
     if (!$registration_status->canregister) {
         $img = JHTML::_('image', JURI::root() . 'components/com_redevent/assets/images/agt_action_fail.png', $registration_status->status, array('class' => 'hasTip', 'title' => $registration_status->status));
         return $img;
     }
     $mainframe =& JFactory::getApplication();
     $base_url = JURI::root();
     $iconspath = $base_url . 'administrator/components/com_redevent/assets/images/';
     $elsettings = redEVENTHelper::config();
     $text = '<span class="vlink phone">' . JHTML::_('link', $this->absoluteUrls(RedeventHelperRoute::getSignupRoute('phone', $this->getEvent()->getData()->slug, $this->getEvent()->getData()->xslug)), JHTML::_('image', $iconspath . $elsettings->get('signup_phone_img'), JText::_($elsettings->get('signup_phone_text')), 'width="24px" height="24px"')) . '</span> ';
     return $text;
 }
Ejemplo n.º 13
0
 /**
  * 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);
 }
Ejemplo n.º 14
0
    ?>
	<tr>
		<td><?php 
    echo JHTML::_('link', $event_url, $event->full_title);
    ?>
</td>
		<td><?php 
    echo $event->location;
    ?>
</td>
		<td><?php 
    echo REOutput::formatdate($event->dates, $event->times);
    ?>
 
		<?php 
    echo redEVENTHelper::getEventDuration($event);
    ?>
 
		<?php 
    echo JHTML::_('link', $venue_url, $event->venue);
    ?>
</td>
		<td class="re-price"><?php 
    echo REOutput::formatListPrices($event->prices);
    ?>
</td>
	</tr>
<?php 
}
?>
</tbody>
Ejemplo n.º 15
0
 function registrationexpiration()
 {
     redEVENTHelper::registrationexpiration();
 }
Ejemplo n.º 16
0
 /**
  * returns the registration status as an object (canregister, status)
  *
  * @return object (canregister, status)
  */
 function getRegistrationStatus()
 {
     return redEVENTHelper::canRegister($this->_xref);
 }
Ejemplo n.º 17
0
 /**
  * Method to build the sortlists
  *
  * @access private
  * @return array
  * @since 0.9
  */
 function _buildSortLists()
 {
     $elsettings =& redEVENTHelper::config();
     $filter_order = JRequest::getCmd('filter_order', 'x.dates');
     $filter_order_Dir = JRequest::getWord('filter_order_Dir', 'ASC');
     $filter = $this->escape(JRequest::getString('filter'));
     $filter_type = JRequest::getString('filter_type');
     $sortselects = array();
     $sortselects[] = JHTML::_('select.option', 'title', JText::_('COM_REDEVENT_FILTER_SELECT_EVENT'));
     $sortselects[] = JHTML::_('select.option', 'venue', JText::_('COM_REDEVENT_FILTER_SELECT_VENUE'));
     $sortselects[] = JHTML::_('select.option', 'city', JText::_('COM_REDEVENT_FILTER_SELECT_CITY'));
     $sortselects[] = JHTML::_('select.option', 'type', JText::_('COM_REDEVENT_FILTER_SELECT_CATEGORY'));
     $sortselect = JHTML::_('select.genericlist', $sortselects, 'filter_type', 'size="1" class="inputbox"', 'value', 'text', $filter_type);
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $lists['filter'] = $filter;
     $lists['filter_types'] = $sortselect;
     return $lists;
 }
Ejemplo n.º 18
0
 function doexport()
 {
     $app =& JFactory::getApplication();
     $cats = JRequest::getVar('categories', null, 'request', 'array');
     JArrayHelper::toInteger($cats);
     $venues = JRequest::getVar('venues', null, 'request', 'array');
     JArrayHelper::toInteger($venues);
     $model = $this->getModel('events');
     $events = $model->exportEvents($cats, $venues);
     header('Content-Type: text/x-csv');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Disposition: attachment; filename=events.csv');
     header('Pragma: no-cache');
     $k = 0;
     $export = '';
     $col = array();
     $eventtablefields = array('id', 'title', 'alias', 'created_by', 'modified', 'modified_by', 'summary', 'datdescription', 'details_layout', 'meta_description', 'meta_keywords', 'datimage', 'author_ip', 'created', 'published', 'registra', 'unregistra', 'checked_out', 'checked_out_time', 'notify', 'notify_subject', 'notify_body', 'redform_id', 'juser', 'notify_on_list_body', 'notify_off_list_body', 'notify_on_list_subject', 'notify_off_list_subject', 'show_names', 'notify_confirm_subject', 'notify_confirm_body', 'review_message', 'confirmation_message', 'activate', 'showfields', 'submission_types', 'course_code', 'submission_type_email', 'submission_type_external', 'submission_type_phone', 'submission_type_webform', 'show_submission_type_webform_formal_offer', 'submission_type_webform_formal_offer', 'max_multi_signup', 'submission_type_formal_offer', 'submission_type_formal_offer_subject', 'submission_type_formal_offer_body', 'submission_type_email_body', 'submission_type_email_subject', 'submission_type_email_pdf', 'submission_type_formal_offer_pdf', 'send_pdf_form', 'pdf_form_data', 'paymentaccepted', 'paymentprocessing', 'enable_ical', '_tbl', '_tbl_key', '_db', '_errors');
     if (count($events)) {
         $header = current($events);
         $export .= redEVENTHelper::writecsvrow(array_keys($header));
         $current = 0;
         // current event
         foreach ($events as $data) {
             if ($current == $data['id']) {
                 foreach ($data as $k => $v) {
                     if (in_array($k, $eventtablefields)) {
                         $data[$k] = null;
                     }
                 }
             } else {
                 $current = $data['id'];
                 // first event id
             }
             $export .= redEVENTHelper::writecsvrow($data);
         }
         echo $export;
     }
     $app->close();
 }
Ejemplo n.º 19
0
                    echo $k < count($row->categories) ? '<br/>' : '';
                    ?>
          <?php 
                }
                ?>
          </td> 
        <?php 
            }
            ?>

				
				<?php 
            if ($this->params->get('showcode', 1)) {
                ?>
				<td headers="el_code" align="left" valign="top"><?php 
                echo $this->escape(redEVENTHelper::getSessionCode($row));
                ?>
</td>
				<?php 
            }
            ?>
 
				<td headers="el_edit" align="left" valign="top"><?php 
            echo $row->registered . ($row->maxattendees ? '/' . $row->maxattendees : '');
            ?>
 <?php 
            echo $this->xrefattendeesbutton($row->xref);
            ?>
</td>
				<td headers="el_edit" align="left" valign="top"><?php 
            echo $this->eventeditbutton($row->slug, $row->xref);
Ejemplo n.º 20
0
 /**
  * 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);
 }
Ejemplo n.º 21
0
 /**
  * Creates the Venueevents View
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $option = JRequest::getCmd('option');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $elsettings =& redEVENTHelper::config();
     $item = $menu->getActive();
     $params =& $mainframe->getParams('com_redevent');
     $uri =& JFactory::getURI();
     $acl = UserAcl::getInstance();
     //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]-->');
     // add js
     JHTML::_('behavior.mootools');
     // for filter hint
     $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js');
     // Request variables
     $limitstart = JRequest::getInt('limitstart');
     $limit = $mainframe->getUserStateFromRequest('com_redevent.venueevents.limit', 'limit', $params->def('display_num', 0), 'int');
     $pop = JRequest::getBool('pop');
     $task = JRequest::getWord('task');
     //get data from model
     $rows =& $this->get('Data');
     $venue =& $this->get('Venue');
     $total =& $this->get('Total');
     $customs =& $this->get('ListCustomFields');
     $customsfilters =& $this->get('CustomFilters');
     //does the venue exist?
     if ($venue->id == 0) {
         return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Venue_d_not_found', $venue->id));
     }
     //are events available?
     if (!$rows) {
         $noevents = 1;
     } else {
         $noevents = 0;
     }
     // Add needed scripts if the lightbox effect is enabled
     JHTML::_('behavior.modal');
     //add alternate feed link
     $link = 'index.php?option=com_redevent&view=venueevents&format=feed&id=' . $venue->id;
     $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);
     //pathway
     $pathway =& $mainframe->getPathWay();
     //create the pathway
     if ($task == 'archive') {
         $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug, 'archive'));
         $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $venue->venue, $link);
         $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&task=archive&pop=1&tmpl=component');
         $pagetitle = $venue->venue . ' - ' . JText::_('COM_REDEVENT_ARCHIVE');
     } else {
         $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug));
         $pathway->addItem($venue->venue, $link);
         $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&pop=1&tmpl=component');
         $pagetitle = $venue->venue;
     }
     $thumb_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'thumb');
     $list_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'default');
     //set Page title
     $this->document->setTitle($pagetitle);
     $document->setMetadata('keywords', $venue->meta_keywords);
     $document->setDescription(strip_tags($venue->meta_description));
     //Printfunction
     $params->def('print', !$mainframe->getCfg('hidePrint'));
     $params->def('icons', $mainframe->getCfg('icons'));
     if ($pop) {
         $params->set('popup', 1);
     }
     //Check if the user has access to the form
     $maintainer = $acl->canEditVenue($venue->id);
     //Generate Venuedescription
     if (!empty($venue->locdescription)) {
         //execute plugins
         $venuedescription = JHTML::_('content.prepare', $venue->locdescription);
     }
     //build the url
     if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") {
         $venue->url = 'http://' . $venue->url;
     }
     //prepare the url for output
     if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) {
         $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...';
     } else {
         $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES);
     }
     //create flag
     if ($venue->country) {
         $venue->countryimg = REOutput::getFlag($venue->country);
     }
     // Create the pagination object
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     //create select lists
     $lists = $this->_buildSortLists($elsettings);
     $state =& $this->get('state');
     $filter_customs = $state->get('filter_customs');
     $this->assign('lists', $lists);
     $this->assign('action', JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug)));
     $this->assignRef('rows', $rows);
     $this->assignRef('customs', $customs);
     $this->assignRef('noevents', $noevents);
     $this->assignRef('venue', $venue);
     $this->assignRef('print_link', $print_link);
     $this->assignRef('params', $params);
     $this->assignRef('editlink', $maintainer);
     $this->assignRef('venuedescription', $venuedescription);
     $this->assignRef('pageNav', $pageNav);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('item', $item);
     $this->assignRef('pagetitle', $pagetitle);
     $this->assignRef('task', $task);
     $this->assignRef('config', $elsettings);
     $this->assignRef('thumb_link', $thumb_link);
     $this->assignRef('list_link', $list_link);
     $this->assignRef('customsfilters', $customsfilters);
     $this->assign('filter_customs', $filter_customs);
     $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category'));
     $cols = redEVENTHelper::validateColumns($cols);
     $this->assign('columns', $cols);
     parent::display($tpl);
 }
Ejemplo n.º 22
0
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $params = JComponentHelper::getParams('com_redevent');
     // Load pane behavior
     jimport('joomla.html.pane');
     JHTML::_('behavior.framework');
     //initialise variables
     $editor =& JFactory::getEditor();
     $document =& JFactory::getDocument();
     $pane =& JPane::getInstance('sliders');
     $tabs =& JPane::getInstance('tabs');
     $user =& JFactory::getUser();
     $settings = JComponentHelper::getParams('com_redevent');
     //get vars
     $cid = JRequest::getVar('cid');
     $url = JURI::root();
     $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_EDITVENUE'));
     //add css and js to document
     $document->addScript('../includes/js/joomla/popup.js');
     $document->addStyleSheet('../includes/js/joomla/popup.css');
     $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css');
     $document->addScript($url . '/components/com_redevent/assets/js/attachments.js');
     $document->addScriptDeclaration('var removemsg = "' . JText::_('COM_REDEVENT_ATTACHMENT_CONFIRM_MSG') . '";');
     // Get data from the model
     $model =& $this->getModel();
     $row =& $this->get('Data');
     // fail if checked out not by 'me'
     if ($row->id) {
         if ($model->isCheckedOut($user->get('id'))) {
             JError::raiseWarning('REDEVENT_GENERIC_ERROR', $row->venue . ' ' . JText::_('COM_REDEVENT_EDITED_BY_ANOTHER_ADMIN'));
             $mainframe->redirect('index.php?option=com_redevent&view=venues');
         }
     }
     $task = JRequest::getVar('task');
     //create the toolbar
     if ($task == 'copy') {
         JToolBarHelper::title(JText::_('COM_REDEVENT_COPY_VENUE'), 'venuesedit');
     } elseif ($cid) {
         JToolBarHelper::title(JText::_('COM_REDEVENT_EDIT_VENUE'), 'venuesedit');
         //makes data safe
         JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'locdescription');
     } else {
         JToolBarHelper::title(JText::_('COM_REDEVENT_ADD_VENUE'), 'venuesedit');
         //set the submenu
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT'), 'index.php?option=com_redevent');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_EVENTS'), 'index.php?option=com_redevent&view=events');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_VENUES'), 'index.php?option=com_redevent&view=venues');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_CATEGORIES'), 'index.php?option=com_redevent&view=categories');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_ARCHIVESCREEN'), 'index.php?option=com_redevent&view=archive');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_GROUPS'), 'index.php?option=com_redevent&view=groups');
         JSubMenuHelper::addEntry(JText::_('COM_REDEVENT_HELP'), 'index.php?option=com_redevent&view=help');
     }
     JToolBarHelper::apply();
     JToolBarHelper::spacer();
     JToolBarHelper::save();
     JToolBarHelper::spacer();
     JToolBarHelper::cancel();
     JToolBarHelper::spacer();
     //JToolBarHelper::help( 'el.editvenues', true );
     $lists = array();
     // categories selector
     $selected = array();
     foreach ((array) $row->categories as $cat) {
         $selected[] = $cat;
     }
     $lists['categories'] = JHTML::_('select.genericlist', (array) $this->get('Categories'), 'categories[]', 'class="inputbox" multiple="multiple" size="10"', 'value', 'text', $selected);
     $countries = array();
     $countries[] = JHTML::_('select.option', '', JText::_('COM_REDEVENT_Select_country'));
     $countries = array_merge($countries, redEVENTHelperCountries::getCountryOptions());
     $lists['countries'] = JHTML::_('select.genericlist', $countries, 'country', 'class="inputbox"', 'value', 'text', $row->country);
     unset($countries);
     $pinpointicon = REOutput::pinpointicon($row);
     if ($task == 'copy') {
         $row->id = null;
         $row->venue .= ' ' . JText::_('COM_REDEVENT_copy');
         $row->alias = '';
     }
     //assign data to template
     $this->assignRef('row', $row);
     $this->assignRef('pane', $pane);
     $this->assignRef('tabs', $tabs);
     $this->assignRef('editor', $editor);
     $this->assignRef('settings', $settings);
     $this->assignRef('params', $params);
     $this->assignRef('lists', $lists);
     $this->assignRef('imageselect', $imageselect);
     $this->assignRef('pinpointicon', $pinpointicon);
     $this->assignRef('access', redEVENTHelper::getAccesslevelOptions());
     $this->assignRef('form', $this->get('form'));
     parent::display($tpl);
 }
Ejemplo n.º 23
0
 function export()
 {
     $app =& JFactory::getApplication();
     $model = $this->getModel('customfields');
     $rows = $model->export();
     header('Content-Type: text/x-csv');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Disposition: attachment; filename=customfields.csv');
     header('Pragma: no-cache');
     $k = 0;
     $export = '';
     $col = array();
     if (count($rows)) {
         $header = current($rows);
         $export .= redEVENTHelper::writecsvrow(array_keys($header));
         $current = 0;
         // current event
         foreach ($rows as $data) {
             $export .= redEVENTHelper::writecsvrow($data);
         }
         echo $export;
     }
     $app->close();
 }
Ejemplo n.º 24
0
				<?php 
                case 'picture':
                    ?>
          <td class="re_places" itemprop="image"><?php 
                    echo redEVENTImage::modalimage($row->datimage, $row->title, intval($this->params->get('lists_picture_size', 30)));
                    ?>
</td>
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'places':
                    ?>
          <td class="re_places"><?php 
                    echo redEVENTHelper::getRemainingPlaces($row);
                    ?>
</td>
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'price':
                    ?>
					<td class="re_prices" class="re-price"><?php 
                    echo REOutput::formatListPrices($row->prices);
                    ?>
</td>
				<?php 
                    break;
Ejemplo n.º 25
0
    /**
     * Creates the Venueevents View
     *
     * @since 0.9
     */
    function display()
    {
        $document =& JFactory::getDocument();
        $document->link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents');
        $upcomingevents = $this->get('UpcomingVenueEvents');
        $elsettings = redEVENTHelper::config();
        $imagepath = JURI::root() . 'administrator/components/com_redevent/assets/images/';
        foreach ((array) $upcomingevents as $key => $event) {
            $event_url = RedeventHelperRoute::getDetailsRoute($event->slug, $event->xslug);
            $venue_url = RedeventHelperRoute::getVenueEventsRoute($event->venueslug);
            $description = '<table>
			<tbody>
			<tr>
				<td width="100">Course:</td><td>' . JHTML::_('link', $event_url, $event->full_title, 'target="_blank"') . '</td>
			</tr><tr>
				<td>Where:</td><td>' . $event->location . ' &nbsp; ' . REOutput::getFlag($event->country) . '</td>
			</tr><tr>				
				<td>Date:</td><td>' . REOutput::formatdate($event->dates, $event->times) . '</td>
			</tr><tr>				
				<td>Duration:</td><td>' . $event->duration;
            if ($event->duration == 1) {
                $description .= JText::_('COM_REDEVENT_DAY');
            } else {
                if ($event->duration > 1) {
                    $description .= JText::_('COM_REDEVENT_DAYS');
                }
            }
            $description .= '</td>
			</tr><tr>			
				<td>Venue:</td><td>' . JHTML::_('link', $venue_url, $event->venue, 'target="_blank"') . '</td>
			</tr><tr>				
				<td>Price:</td><td class="re-price">' . REOutput::formatListPrices($event->prices) . '</td>
			</tr><tr>
				<td>Credits:</td><td>' . $event->course_credit . '</td>
			</tr><tr>			
				<td>Signup:</td><td>';
            /* Get the different submission types */
            $submissiontypes = explode(',', $event->submission_types);
            $venues_html = '';
            foreach ($submissiontypes as $key => $subtype) {
                switch ($subtype) {
                    case 'email':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=email&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_email_img'), JText::_($elsettings->get('signup_email_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'phone':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=phone&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_phone_img'), JText::_($elsettings->get('signup_phone_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'external':
                        $venues_html .= '&nbsp;' . JHTML::_('link', $event->submission_type_external, JHTML::_('image', $imagepath . $elsettings->get('signup_external_img'), $elsettings->get('signup_external_text'), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'webform':
                        if ($event->prices && count($event->prices)) {
                            foreach ($event->prices as $p) {
                                $img = empty($p->image) ? JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text'))) : JHTML::_('image', $imagepath . $p->image, JText::_($p->name));
                                $link = JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug, $p->slug));
                                $venues_html .= '&nbsp;' . JHTML::_('link', $link, $img) . '&nbsp; ';
                            }
                        } else {
                            $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text')))) . '&nbsp; ';
                        }
                        break;
                    case 'formaloffer':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&subtype=formaloffer&task=signup&xref=' . $event->xslug . '&id=' . $event->slug), JHTML::_('image', $imagepath . $elsettings->get('signup_formal_offer_img'), JText::_($elsettings->get('signup_formal_offer_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                }
            }
            $description .= $venues_html;
            $description .= '</td></tr></tbody></table>';
            $item = new JFeedItem();
            $item->title = $event->full_title;
            $item->link = $event_url;
            $item->description = $description;
            $item->date = '';
            $item->category = $event->venue;
            // loads item info into rss array
            $document->addItem($item);
        }
    }
Ejemplo n.º 26
0
        ?>
		<div class="rf_img"></div>
		<?php 
    }
    ?>
		<p class="rf_thumbevent_title">
		<span class="summary"><?php 
    echo JHTML::_('link', JRoute::_($detaillink), $row->full_title);
    ?>
</span> @ <span class="location"><?php 
    echo JHTML::_('link', JRoute::_($venuelink), $row->venue);
    ?>
</span>
		</p>
		<p class="rf_thumbevent_date">
    	<span class="dtstart"><?php 
    echo REOutput::formatdate($row->dates, $row->times);
    ?>
</span>    	
    	<?php 
    if (redEVENTHelper::isValidDate($row->enddates) && $row->enddates != $row->dates) {
        echo ' - <span class="dtend">' . REOutput::formatdate($row->enddates, $row->endtimes) . '</span>';
    }
    ?>
		</p>
	</li>
	<?php 
}
?>
</ul>
Ejemplo n.º 27
0
 /**
  * Creates the Categoryevents View
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $option = JRequest::getCmd('option');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $elsettings =& redEVENTHelper::config();
     $item = $menu->getActive();
     $params =& $mainframe->getParams();
     $uri =& JFactory::getURI();
     $pathway =& $mainframe->getPathWay();
     if (!$this->getLayout()) {
         $this->setLayout($params->get('default_list_layout'));
     }
     /* Check if the item is an object */
     if (!is_object($item)) {
         $item = new StdClass();
         $item->title = '';
     }
     //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]-->');
     // add js
     JHTML::_('behavior.mootools');
     // for filter hint
     $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js');
     // Request variables
     $limitstart = JRequest::getInt('limitstart');
     $limit = $mainframe->getUserStateFromRequest('com_redevent.categoryevents.limit', 'limit', $params->def('display_num', 0), 'int');
     $task = JRequest::getWord('task');
     $pop = JRequest::getBool('pop');
     //get data from model
     $rows =& $this->get('Data');
     $customs =& $this->get('ListCustomFields');
     $customsfilters =& $this->get('CustomFilters');
     $category =& $this->get('Category');
     $total =& $this->get('Total');
     //are events available?
     if (!$rows) {
         $noevents = 1;
     } else {
         $noevents = 0;
     }
     //does the category exist
     if ($category->id == 0) {
         return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Category_d_not_found', $category->id));
     }
     //Set Meta data
     if (!$item->title) {
         $document->setTitle($category->catname);
     } else {
         $document->setTitle($item->title . ' - ' . $category->catname);
     }
     $document->setMetadata('keywords', $category->meta_keywords);
     $document->setDescription(strip_tags($category->meta_description));
     //Print function
     $params->def('print', !$mainframe->getCfg('hidePrint'));
     $params->def('icons', $mainframe->getCfg('icons'));
     if ($pop) {
         $params->set('popup', 1);
     }
     //add alternate feed link
     $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug) . '&format=feed';
     $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);
     if ($task == 'archive') {
         $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, 'archive');
         $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $category->catname, JRoute::_($link));
         $print_link = JRoute::_($link . '&pop=1&tmpl=component');
     } else {
         $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug);
         $pathway->addItem($category->catname, JRoute::_($link));
         $print_link = JRoute::_($link . '&pop=1&tmpl=component');
     }
     $thumb_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'thumb');
     $list_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'default');
     //Check if the user has access to the form
     $maintainer = ELUser::ismaintainer();
     $genaccess = ELUser::validate_user($elsettings->get('evdelrec'), $elsettings->get('delivereventsyes'));
     if ($maintainer || $genaccess) {
         $dellink = 1;
     }
     // Create the pagination object
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     //Generate Categorydescription
     if (empty($category->catdescription)) {
         $catdescription = JText::_('COM_REDEVENT_NO_DESCRIPTION');
     } else {
         //execute plugins
         $catdescription = JHTML::_('content.prepare', $category->catdescription);
     }
     //create select lists
     $lists = $this->_buildSortLists($elsettings);
     $state =& $this->get('state');
     $filter_customs = $state->get('filter_customs');
     $this->assign('lists', $lists);
     $this->assign('action', JRoute::_('index.php?option=com_redevent&view=categoryevents&id=' . $category->id));
     $this->assignRef('rows', $rows);
     $this->assignRef('customs', $customs);
     $this->assignRef('noevents', $noevents);
     $this->assignRef('category', $category);
     $this->assignRef('print_link', $print_link);
     $this->assignRef('params', $params);
     $this->assignRef('dellink', $dellink);
     $this->assignRef('task', $task);
     $this->assignRef('catdescription', $catdescription);
     $this->assignRef('pageNav', $pageNav);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('item', $item);
     $this->assignRef('config', $elsettings);
     $this->assignRef('thumb_link', $thumb_link);
     $this->assignRef('list_link', $list_link);
     $this->assignRef('customsfilters', $customsfilters);
     $this->assign('filter_customs', $filter_customs);
     $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category'));
     $cols = redEVENTHelper::validateColumns($cols);
     $this->assign('columns', $cols);
     parent::display($tpl);
 }
Ejemplo n.º 28
0
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
$colnames = explode(",", $this->params->get('lists_columns_names', 'date, title, venue, city, category'));
$colnames = array_map('trim', $colnames);
?>
<div class="featured-events<?php 
echo $this->params->get('pageclass_sfx');
?>
" summary="eventlist">
<?php 
$k = 0;
foreach ($this->rows as $row) {
    //Link to details
    $detaillink = JRoute::_(RedeventHelperRoute::getDetailsRoute($row->slug, $row->xslug));
    if (redEVENTHelper::isValidDate($row->dates)) {
        $date = JFactory::getDate($row->times ? $row->dates . ' ' . $row->times : $row->dates);
    } else {
        $date = false;
    }
    $img = redEVENTImage::getThumbUrl($row->datimage, 150);
    $img = $img ? JHTML::image($img, $row->full_title) : false;
    ?>
  	<div class="event row<?php 
    echo $k + 1;
    ?>
" 
  	    itemscope itemtype="http://schema.org/Event">
  	    
			<?php 
    if ($img) {
Ejemplo n.º 29
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) {
Ejemplo n.º 30
0
 /**
  * get list of categories as options, according to acl
  *
  * @return array
  */
 function getCategoriesOptions()
 {
     $app =& JFactory::getApplication();
     $filter_venuecategory = JRequest::getVar('filter_venuecategory');
     $filter_venue = JRequest::getVar('filter_venue');
     $task = JRequest::getWord('task');
     $acl =& UserAcl::getInstance();
     $gids = $acl->getUserGroupsIds();
     if (!is_array($gids) || !count($gids)) {
         $gids = array(0);
     }
     $gids = implode(',', $gids);
     //Get Events from Database
     $query = ' SELECT c.id ' . ' FROM #__redevent_event_venue_xref AS x' . ' INNER JOIN #__redevent_events AS a ON a.id = x.eventid' . ' INNER JOIN #__redevent_venues AS l ON l.id = x.venueid' . ' LEFT JOIN #__redevent_venue_category_xref AS xvcat ON l.id = xvcat.venue_id' . ' LEFT JOIN #__redevent_venues_categories AS vc ON xvcat.category_id = vc.id' . ' INNER JOIN #__redevent_event_category_xref AS xcat ON xcat.event_id = a.id' . ' INNER JOIN #__redevent_categories AS c ON c.id = xcat.category_id' . ' LEFT JOIN #__redevent_groups_venues AS gv ON gv.venue_id = l.id AND gv.group_id IN (' . $gids . ')' . ' LEFT JOIN #__redevent_groups_venues_categories AS gvc ON gvc.category_id = vc.id AND gvc.group_id IN (' . $gids . ')' . ' LEFT JOIN #__redevent_groups_categories AS gc ON gc.category_id = c.id AND gc.group_id IN (' . $gids . ')';
     $where = array();
     // First thing we need to do is to select only the published events
     if ($task == 'archive') {
         $where[] = ' x.published = -1 ';
         $where[] = ' a.published <> 0 ';
     } else {
         $where[] = ' x.published = 1 ';
         $where[] = ' a.published <> 0 ';
     }
     // filter category
     if ($filter_venuecategory) {
         $category = $this->getVenueCategory((int) $filter_venuecategory);
         $where[] = '(vc.id = ' . $this->_db->Quote($category->id) . ' OR (vc.lft > ' . $this->_db->Quote($category->lft) . ' AND vc.rgt < ' . $this->_db->Quote($category->rgt) . '))';
     }
     if ($filter_venue) {
         $where[] = ' l.id = ' . $this->_db->Quote($filter_venue);
     }
     //acl
     $where[] = ' (l.private = 0 OR gv.id IS NOT NULL) ';
     $where[] = ' (c.private = 0 OR gc.id IS NOT NULL) ';
     $where[] = ' (vc.private = 0 OR vc.private IS NULL OR gvc.id IS NOT NULL) ';
     if (count($where)) {
         $query .= ' WHERE ' . implode(' AND ', $where);
     }
     $query .= ' GROUP BY c.id ';
     $this->_db->setQuery($query);
     $res = $this->_db->loadResultArray();
     return redEVENTHelper::getEventsCatOptions(true, false, $res);
 }