Exemple #1
0
 /**
  * Method to load required data
  *
  * @access	private
  * @return	array
  * @since	0.9
  */
 protected function _loadDetails()
 {
     if (empty($this->_event)) {
         $user =& JFactory::getUser();
         // Get the WHERE clause
         $where = $this->_buildDetailsWhere();
         $query = 'SELECT x.*, a.*, a.id AS did, x.id AS xref, a.title, a.datdescription, ' . ' a.meta_keywords, a.meta_description, a.datimage, a.registra, a.unregistra, a.summary, ' . ' x.title as session_title, ' . ' CASE WHEN CHAR_LENGTH(x.title) THEN CONCAT_WS(\' - \', a.title, x.title) ELSE a.title END as full_title, ' . ' a.created_by, a.redform_id, x.maxwaitinglist, x.maxattendees, a.juser, a.show_names, a.showfields, ' . ' a.submission_type_email, a.submission_type_external, a.submission_type_phone, a.review_message, ' . ' v.venue, v.city AS location, v.country, v.locimage, v.street, v.plz, v.state, v.locdescription as venue_description, v.map, v.url as venueurl,' . ' v.city, v.latitude, v.longitude, v.company AS venue_company, ' . ' u.name AS creator_name, u.email AS creator_email, ' . ' f.formname, ' . " a.confirmation_message, IF (x.course_credit = 0, '', x.course_credit) AS course_credit, a.course_code, a.submission_types, c.catname, c.access," . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug, ' . ' CASE WHEN CHAR_LENGTH(x.alias) THEN CONCAT_WS(\':\', x.id, x.alias) ELSE x.id END as xslug, ' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as categoryslug, ' . ' CASE WHEN CHAR_LENGTH(v.alias) THEN CONCAT_WS(":", v.id, v.alias) ELSE v.id END as venueslug ' . ' FROM #__redevent_events AS a' . ' LEFT JOIN #__redevent_event_venue_xref AS x ON x.eventid = a.id' . ' LEFT JOIN #__redevent_venues AS v ON x.venueid = v.id' . ' LEFT JOIN #__redevent_event_category_xref AS xcat ON xcat.event_id = a.id' . ' LEFT JOIN #__redevent_categories AS c ON c.id = xcat.category_id' . ' LEFT JOIN #__rwf_forms AS f ON f.id = a.redform_id ' . ' LEFT JOIN #__users AS u ON a.created_by = u.id ' . $where;
         $this->_db->setQuery($query);
         $this->_event = $this->_db->loadObject();
         if ($this->_event) {
             $this->_details = $this->_getEventCategories($this->_event);
             $this->_details->attachments = REAttach::getAttachments('event' . $this->_details->did, max($user->getAuthorisedViewLevels()));
         }
         return (bool) $this->_event;
     }
     return true;
 }
Exemple #2
0
 /**
  * logic to get the venue
  *
  * @access private
  * @return array
  */
 function _loadVenue()
 {
     if (empty($this->_venue)) {
         $user =& JFactory::getUser();
         $this->_venue =& JTable::getInstance('redevent_venues', '');
         $this->_venue->load($this->_id);
         if ($this->_venue->id) {
             $query = ' SELECT c.id ' . ' FROM #__redevent_venues_categories as c ' . ' INNER JOIN #__redevent_venue_category_xref as x ON x.category_id = c.id ' . ' WHERE c.published = 1 ' . '   AND x.venue_id = ' . $this->_db->Quote($this->_venue->id);
             $this->_db->setQuery($query);
             $this->_venue->categories = $this->_db->loadResultArray();
             $this->_venue->attachments = REAttach::getAttachments('venue' . $this->_venue->id, max($user->getAuthorisedViewLevels()));
         }
     }
     return $this->_venue;
 }
Exemple #3
0
 /**
  * Method to load content event data
  *
  * @access	private
  * @return	boolean	True on success
  * @since	0.9
  */
 function _loadData()
 {
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         if (!$this->_id) {
             return false;
         }
         $query = 'SELECT e.*, v.venue' . ' FROM #__redevent_events AS e' . ' LEFT JOIN #__redevent_event_venue_xref AS x ON x.eventid = e.id' . ' LEFT JOIN #__redevent_venues AS v ON v.id = x.venueid' . ' WHERE e.id = ' . $this->_id;
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
         if ($this->_data) {
             $categories =& $this->getEventCategories();
             $this->_data->categories_ids = array_keys($categories);
             $this->_data->attachments = REAttach::getAttachments('event' . $this->_data->id);
         }
         return (bool) $this->_data;
     }
     return true;
 }
Exemple #4
0
 /**
  * Method to get the Category
  *
  * @access public
  * @return integer
  */
 function getCategory()
 {
     if (!$this->_category) {
         $user =& JFactory::getUser();
         $query = 'SELECT *,' . ' CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\':\', id, alias) ELSE id END as slug' . ' FROM #__redevent_categories' . ' WHERE id = ' . $this->_id;
         $this->_db->setQuery($query);
         $this->_category = $this->_db->loadObject();
         if ($this->_category->private) {
             $acl =& UserAcl::getInstance();
             $cats = $acl->getManagedCategories();
             if (!is_array($cats) || !in_array($this->_category->id, $cats)) {
                 JError::raiseError(403, JText::_('COM_REDEVENT_ACCESS_NOT_ALLOWED'));
             }
         }
         $this->_category->attachments = REAttach::getAttachments('category' . $this->_category->id, max($user->getAuthorisedViewLevels()));
     }
     return $this->_category;
 }
Exemple #5
0
 /**
  * Method to load content event data
  *
  * @access	private
  * @return	boolean	True on success
  * @since	0.9
  */
 function _loadData()
 {
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = 'SELECT *' . ' FROM #__redevent_venues' . ' WHERE id = ' . $this->_id;
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
         if ($this->_data) {
             $this->_data->categories = $this->getVenueCategories();
             $this->_data->attachments = REAttach::getAttachments('venue' . $this->_data->id);
         }
         return (bool) $this->_data;
     }
     return true;
 }
Exemple #6
0
 /**
  * logic to get the event
  *
  * @access private
  * @return object
  */
 function _loadEvent($id = null)
 {
     // Lets load the content if it doesn't already exist
     if (empty($this->_event)) {
         $user =& JFactory::getUser();
         if (!$id) {
             $id = $this->_id;
         }
         if (!$id) {
             return false;
         }
         $xfields = array();
         foreach ($this->_getXCustomFields() as $f) {
             $xfields[] = 'x.custom' . $f->id;
         }
         $query = ' SELECT e.*, v.venue, x.id AS xref, x.eventid, x.venueid, ' . ' x.dates, x.enddates, x.times, x.endtimes, x.maxattendees, x.details, ' . ' x.maxwaitinglist, x.course_credit, x.registrationend, x.title as session_title, ' . ' r.id as recurrence_id, r.rrule, rp.count ' . (count($xfields) ? ', ' . implode(', ', $xfields) : '');
         $query .= ' FROM #__redevent_events AS e' . ' LEFT JOIN #__redevent_event_venue_xref AS x ON x.eventid = e.id' . ' LEFT JOIN #__redevent_venues AS v ON v.id = x.venueid' . ' LEFT JOIN #__redevent_repeats AS rp on rp.xref_id = x.id ' . ' LEFT JOIN #__redevent_recurrences AS r on r.id = rp.recurrence_id ';
         if ($this->_xref) {
             $query .= ' WHERE x.id = ' . (int) $this->_xref;
         } else {
             $query .= ' WHERE e.id = ' . (int) $id;
         }
         $this->_db->setQuery($query);
         $this->_event = $this->_db->loadObject();
         if (!$this->_event) {
             return false;
         }
         if ($this->_event->id) {
             $query = ' SELECT c.id, c.catname, ' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug ' . ' FROM #__redevent_categories as c ' . ' INNER JOIN #__redevent_event_category_xref as x ON x.category_id = c.id ' . ' WHERE c.published = 1 ' . '   AND x.event_id = ' . $this->_db->Quote($this->_event->id) . ' ORDER BY c.ordering';
             $this->_db->setQuery($query);
             $this->_event->categories = $this->_db->loadObjectList();
             $this->_event->attachments = REAttach::getAttachments('event' . $this->_event->id, max($user->getAuthorisedViewLevels()));
             $this->_event->rrules = RedeventHelperRecurrence::getRule($this->_event->rrule);
         }
         return (bool) $this->_event;
     }
     return true;
 }
Exemple #7
0
 /**
  * Method to get the Venue
  *
  * @access public
  * @return array
  */
 function getVenue()
 {
     $user =& JFactory::getUser();
     //Location holen
     $query = 'SELECT *, v.id AS venueid, ' . ' CASE WHEN CHAR_LENGTH(v.alias) THEN CONCAT_WS(\':\', v.id, v.alias) ELSE v.id END as slug ' . ' FROM #__redevent_venues AS v' . ' WHERE v.id = ' . $this->_id;
     $this->_db->setQuery($query);
     $_venue = $this->_db->loadObject();
     if ($_venue->private) {
         $acl =& UserAcl::getInstance();
         $cats = $acl->getManagedVenues();
         if (!is_array($cats) || !in_array($_venue->id, $cats)) {
             JError::raiseError(403, JText::_('COM_REDEVENT_ACCESS_NOT_ALLOWED'));
         }
     }
     $_venue->attachments = REAttach::getAttachments('venue' . $_venue->id, max($user->getAuthorisedViewLevels()));
     return $_venue;
 }
Exemple #8
0
 /**
  * Method to load content event data
  *
  * @access	private
  * @return	boolean	True on success
  * @since	0.9
  */
 function _loadData()
 {
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = ' SELECT c.*, e.title AS event_template_name ' . ' FROM #__redevent_categories AS c ' . ' LEFT JOIN #__redevent_event_venue_xref AS x ON x.id = c.event_template ' . ' LEFT JOIN #__redevent_events AS e ON e.id = x.eventid ' . ' WHERE c.id = ' . $this->_id;
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
         if ($this->_data) {
             $files = REAttach::getAttachments('category' . $this->_data->id);
             $this->_data->attachments = $files;
         }
         return (bool) $this->_data;
     }
     return true;
 }