Ejemplo n.º 1
0
 function __construct($tablename, $filterfield, $isstring = true)
 {
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     if (file_exists($file)) {
         include_once $file;
     }
     $reg =& JevRegistry::getInstance("jevents");
     $this->datamodel = $reg->getReference("jevents.datamodel", false);
     if (!$this->datamodel) {
         $this->datamodel = new JEventsDataModel();
         $this->datamodel->setupComponentCatids();
     }
     $this->filterType = "category";
     $this->filterLabel = JText::_('CATEGORY');
     $this->filterNullValue = "0";
     parent::__construct($tablename, "catid", true);
     $catid = $this->filter_value;
     // NO filtering of the list att all
     $this->allAccessibleCategories = $this->datamodel->accessibleCategoryList(null, $this->datamodel->mmcatids, $this->datamodel->mmcatidList);
     if ($this->filter_value == $this->filterNullValue || $this->filter_value == "") {
         $this->accessibleCategories = $this->allAccessibleCategories;
     } else {
         $this->accessibleCategories = $this->datamodel->accessibleCategoryList(null, array($catid), $catid);
     }
 }
Ejemplo n.º 2
0
 function __construct($event, $datamodel, $view = false)
 {
     $cfg = JEVConfig::getInstance();
     $this->event = $event;
     $this->_datamodel = $datamodel;
     $this->_view = $view;
     $this->start_publish = $this->event->getUnixStartDate();
     $this->stop_publish = $this->event->getUnixEndDate();
     $this->title = $this->event->title();
     // On mouse over date formats
     $this->start_date = JEventsHTML::getDateFormat($this->event->yup(), $this->event->mup(), $this->event->dup(), 0);
     //$this->start_time = $this->event->startTime()	;
     $this->start_time = JEVHelper::getTime($this->event->getUnixStartTime(), $this->event->hup(), $this->event->minup());
     $this->stop_date = JEventsHTML::getDateFormat($this->event->ydn(), $this->event->mdn(), $this->event->ddn(), 0);
     //$this->stop_time = $this->event->endTime()	;
     $this->stop_time = JEVHelper::getTime($this->event->getUnixEndTime(), $this->event->hdn(), $this->event->mindn());
     $this->stop_time_midnightFix = $this->stop_time;
     $this->stop_date_midnightFix = $this->stop_date;
     if ($this->event->sdn() == 59 && $this->event->mindn() == 59) {
         $this->stop_time_midnightFix = JEVHelper::getTime($this->event->getUnixEndTime() + 1, 0, 0);
         $this->stop_date_midnightFix = JEventsHTML::getDateFormat($this->event->ydn(), $this->event->mdn(), $this->event->ddn() + 1, 0);
     }
     // we only need the one helper so stick to default layout here!
     $this->jevlayout = "default";
     $this->addHelperPath(JEV_VIEWS . "/default/helpers");
     $this->addHelperPath(JPATH_BASE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . JEV_COM_COMPONENT . '/' . "helpers");
     // attach data model
     $reg = JevRegistry::getInstance("jevents");
     $this->datamodel = $reg->getReference("jevents.datamodel");
 }
Ejemplo n.º 3
0
 function __construct($config = null)
 {
     parent::__construct($config);
     $this->jevlayout = "default";
     $this->addHelperPath(realpath(dirname(__FILE__) . "/../helpers"));
     $this->addHelperPath(JPATH_BASE . DS . 'templates' . DS . JFactory::getApplication()->getTemplate() . DS . 'html' . DS . JEV_COM_COMPONENT . DS . "helpers");
     // attach data model
     $this->datamodel = new JEventsDataModel();
     $this->datamodel->setupComponentCatids();
     $reg =& JevRegistry::getInstance("jevents");
     $reg->setReference("jevents.datamodel", $this->datamodel);
 }
Ejemplo n.º 4
0
 function __construct($tablename, $filterfield, $isstring = true)
 {
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     if (file_exists($file)) {
         include_once $file;
     }
     $reg =& JevRegistry::getInstance("jevents");
     $this->datamodel = $reg->getReference("jevents.datamodel", false);
     if (!$this->datamodel) {
         $this->datamodel = new JEventsDataModel();
         $this->datamodel->setupComponentCatids();
     }
     // NO filtering of the list att all
     $this->allAccessibleCategories = $this->datamodel->accessibleCategoryList(null, $this->datamodel->mmcatids, $this->datamodel->mmcatidList);
     $this->accessibleCategories = $this->allAccessibleCategories;
 }
Ejemplo n.º 5
0
 function _createfilterHTML()
 {
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     if (file_exists($file)) {
         include_once $file;
     }
     $reg = JevRegistry::getInstance("jevents");
     $this->datamodel = $reg->getReference("jevents.datamodel", false);
     if (!$this->datamodel) {
         $this->datamodel = new JEventsDataModel();
         $this->datamodel->setupComponentCatids();
     }
     $filterList = array();
     $filterList["title"] = JText::_("JEV_SELECT_MATCHING_EVENT");
     $options = array();
     // only if other filters are active to we offer a choice
     if (JRequest::getInt("eventlist") == 1) {
         $options[] = JHTML::_('select.option', "0", JText::_("JEV_SELECT_MATCHING_EVENT"), "value", "text");
         list($year, $month, $day) = JEVHelper::getYMD();
         $tenyear = $year + 10;
         // next 100 matching events
         $events = $this->datamodel->queryModel->listIcalEventsByRange("{$year}-{$month}-{$day}", "{$tenyear}-{$month}-{$day}", 0, 100, false, "rpt.startrepeat asc, rpt.endrepeat ASC, det.summary ASC");
         if ($events && count($events) > 0) {
             $Itemid = $this->datamodel->myItemid;
             foreach ($events as $event) {
                 $link = $event->viewDetailLink($event->yup(), $event->mup(), $event->dup(), true, $Itemid);
                 $options[] = JHTML::_('select.option', $link, $event->title(), "value", "text");
             }
         }
     } else {
         $options[] = JHTML::_('select.option', "0", JText::_("JEV_NO_MATCHING_EVENTS"), "value", "text");
     }
     $filterList["html"] = JHTML::_('select.genericlist', $options, 'eventlist_fv', 'class="inputbox" size="1" onchange="document.location.replace(this.value);"', 'value', 'text', 0);
     $filterList["html"] .= "<input type='hidden' name='eventlist' id='eventlistid' value='1'  />";
     $script = "function resetEventlist(){document.getElementById('eventlistid').value=0;}\n";
     $script .= "try {JeventsFilters.filters.push({action:'resetEventlist()',id:'eventlist_fv',value:0});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
Ejemplo n.º 6
0
 function getEvents(&$params)
 {
     // Reuse existing language file from JomSocial
     $language = JFactory::getLanguage();
     $language->load('com_jevents', JPATH_ROOT);
     $query_start_date = null;
     $query_end_date = null;
     if ($params->get('time_range') == 'time_span' || $params->get('rangespan') != 'all_events') {
         $query_start_date = $params->get('startmin');
         $startMax = $params->get('startmax', false);
         if ($startMax !== false) {
             $query_end_date = $startMax;
         }
     }
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     if (file_exists($file)) {
         include_once $file;
         include_once JEV_LIBS . "/modfunctions.php";
     } else {
         die("JEvents Calendar\n<br />This module needs the JEvents component");
     }
     // load language constants
     JEVHelper::loadLanguage('modlatest');
     $datamodel = new JEventsDataModel();
     $showrepeats = $params->get('jevents_norepeats', 0) == 0 ? true : false;
     //$myItemid = $this->datamodel->setupModuleCatids($this->modparams);
     //$catout	= $this->datamodel->getCatidsOutLink(true);
     $params->set('catid0', $params->get('jevents_category', 0));
     $myItemid = $datamodel->setupModuleCatids($params);
     $catout = $datamodel->getCatidsOutLink(true);
     $reg =& JevRegistry::getInstance("jevents");
     $reg->setReference("jevents.datamodel", $datamodel);
     if (!empty($query_start_date)) {
         $rstartdate = new RokMiniEvents_Date($query_start_date);
         if ($params->get('jevents_past', 0) == 0 && $rstartdate->toUnix() < time()) {
             $rstartdate = new RokMiniEvents_Date(time());
         }
         $dates_start = $rstartdate->toISO8601();
     } else {
         if ($params->get('jevents_past', 0) == 0) {
             $rstartdate = new RokMiniEvents_Date(time());
             $dates_start = $rstartdate->toISO8601();
         } else {
             $dates_start = date('Y-m-d\\T23:59:59', strtotime("-1 month"));
         }
     }
     if (empty($query_end_date)) {
         $dates_end = date('Y-m-d\\T23:59:59', strtotime("+1 year"));
     } else {
         $dates_end = $query_end_date;
     }
     $rows = $datamodel->queryModel->listIcalEventsByRange($dates_start, $dates_end, 0, 0, $showrepeats);
     $events = array();
     $total_count = 1;
     $total_max = $params->get('jevents_total', 10);
     foreach ($rows as $row) {
         if ($params->get('jevents_links') != 'link_no') {
             if ($params->get('jevents_links') == 'event_internal' || $params->get('jevents_links') == 'event_external') {
                 $link = array('internal' => $params->get('jevents_links') == 'event_internal' ? true : false, 'link' => self::getCalendarLink($myItemid, $catout, TRUE, $row->_eventid));
             } else {
                 $link = array('internal' => $params->get('jevents_links') == 'link_internal' ? true : false, 'link' => self::getCalendarLink($myItemid, $catout));
             }
         } else {
             $link = false;
         }
         $event = new RokMiniEvents_Event($row->_unixstarttime, $row->_unixendtime, $row->_title, $row->_content, $link);
         $events[] = $event;
         $total_count++;
         if ($total_count > $total_max) {
             break;
         }
     }
     return $events;
 }
Ejemplo n.º 7
0
 function &getCategoryEvents($Itemid, &$catids)
 {
     static $datamodel;
     if (!isset($datamodel)) {
         $datamodel = new JEventsDataModel();
         $reg =& JevRegistry::getInstance("jevents");
         $reg->setReference("jevents.datamodel", $datamodel);
     }
     $datamodel->catidList = JEVHelper::forceIntegerArray($catids, true);
     $datamodel->catids = $catids;
     $datamodel->catidsOut = implode('|', $catids);
     JRequest::setVar('category_fv', $datamodel->catidList);
     $filter = new jevFilterProcessing(array('category'));
     $rows = $datamodel->queryModel->listEventsByCat($catids, 0, 10000);
     $icalrows = $datamodel->queryModel->listIcalEventsByCat($catids, false, 0, 0, 10000, " ORDER BY rpt.startrepeat asc", $filter, '', '');
     $rows = array_merge($icalrows, $rows);
     return $rows;
 }
Ejemplo n.º 8
0
 function getEvents(&$params)
 {
     // Reuse existing language file from JomSocial
     $language = JFactory::getLanguage();
     $language->load('com_jevents', JPATH_ROOT);
     $query_start_date = null;
     $query_end_date = null;
     if ($params->get('time_range') == 'time_span' || $params->get('rangespan') != 'all_events') {
         $query_start_date = $params->get('startmin');
         $startMax = $params->get('startmax', false);
         if ($startMax !== false) {
             $query_end_date = $startMax;
         }
     }
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     if (file_exists($file)) {
         include_once $file;
         include_once JEV_LIBS . "/modfunctions.php";
     } else {
         die("JEvents Calendar\n<br />This module needs the JEvents component");
     }
     $eventHelper = @new JEVHelper();
     // load language constants
     @$eventHelper->loadLanguage('modlatest');
     $datamodel = @new JEventsDataModel();
     $showrepeats = $params->get('jevents_norepeats', 0) == 0 ? true : false;
     $catids = $params->get('jevents_category', array());
     if (!empty($catids) && !in_array('0', $catids)) {
         $params->set('catidnew', $catids);
     }
     $myItemid = @$datamodel->setupModuleCatids($params);
     $catout = @$datamodel->getCatidsOutLink(true);
     $reg = @JevRegistry::getInstance("jevents");
     $reg->setReference("jevents.datamodel", $datamodel);
     if (!empty($query_start_date)) {
         $rstartdate = new RokMiniEvents3_Date($query_start_date);
         if ($params->get('jevents_past', 0) == 0 && $rstartdate->toUnix() < time()) {
             $rstartdate = new RokMiniEvents3_Date(time());
         }
         $dates_start = $rstartdate->toISO8601();
     } else {
         if ($params->get('jevents_past', 0) == 0) {
             $rstartdate = new RokMiniEvents3_Date(time());
             $dates_start = $rstartdate->toISO8601();
         } else {
             $dates_start = date('Y-m-d\\T23:59:59', strtotime("-1 month"));
         }
     }
     if (empty($query_end_date)) {
         $dates_end = date('Y-m-d\\T23:59:59', strtotime("+1 year"));
     } else {
         $dates_end = $query_end_date;
     }
     $rows = @$datamodel->queryModel->listIcalEventsByRange($dates_start, $dates_end, 0, 20, $showrepeats);
     $events = array();
     if (empty($rows)) {
         return $events;
     }
     $total_count = 1;
     $total_max = $params->get('jevents_total', 10);
     foreach ($rows as $row) {
         if ($params->get('jevents_links') != 'link_no') {
             $title = JFilterOutput::stringURLSafe($row->_title);
             $itemId = @$eventHelper->getItemid();
             if ($params->get('jevents_links') == 'link_internal_event' || $params->get('jevents_links') == 'link_external_event') {
                 $link = array('internal' => $params->get('jevents_links') == 'link_internal_event' ? true : false, 'link' => JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icalrepeat.detail&rp_id=' . $row->_eventid . '&rp_id=' . $row->_rp_id . '&Itemid=' . $itemId . '&year=' . $row->_yup . '&month=' . $row->_mup . '&day=' . $row->_dup . 'title=' . $title));
             } else {
                 $link = array('internal' => $params->get('jevents_links') == 'link_internal' ? true : false, 'link' => JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=month.calendar&year' . $row->_yup . '&month=' . $row->_mup . '&day=' . $row->_dup . '&Itemid=' . $itemId));
             }
         } else {
             $link = false;
         }
         $event = new RokMiniEvents3_Event($row->_unixstarttime, $row->_unixendtime, $row->_title, $row->_content, $link);
         $event->setAllDay($row->_alldayevent ? true : false);
         if ($row->_noendtime == "1") {
             $event->setNoEndTime(true);
         }
         $events[] = $event;
         $total_count++;
         if ($total_count > $total_max) {
             break;
         }
     }
     return $events;
 }