function save()
 {
     $jinput = JFactory::getApplication()->input;
     $id = $jinput->get('cid');
     $model = $this->getModel('registration');
     $session = JFactory::getSession();
     //get data from request
     $post = $jinput->get('post');
     $socialadsbackurl = $session->get('socialadsbackurl');
     // let the model save it
     $result = $model->store($post);
     if ($result) {
         $message = JText::_('REGIS_USER_CREATE_MSG');
         $itemid = $jinput->get('Itemid');
         $user = JFactory::getuser();
         $cart = $session->get('cart_temp');
         $session->set('cart' . $user->id, $cart);
         $session->clear('cart_temp');
         $cart1 = $session->get('cart' . $user->id);
         $this->setRedirect($socialadsbackurl, $message);
     } else {
         $message = $jinput->get('message', '', 'STRING');
         $itemid = $jinput->get('Itemid');
         $this->setRedirect('index.php?option=com_quick2cart&view=registration&Itemid=' . $itemid, $message);
     }
 }
Example #2
0
 function _buildQuery()
 {
     $db = JFactory::getDBO();
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $option = $jinput->get('option');
     $layout = $jinput->get('layout', 'salesreport');
     //Get the WHERE and ORDER BY clauses for the query
     $where = '';
     $me = JFactory::getuser();
     $user_id = $me->id;
     $where = $this->_buildContentWhere();
     //if($layout=='default')//payouts report //when called from front end
     //{
     $query = "SELECT oi.`item_id`, SUM(oi.`product_quantity`) AS 'saleqty', i.`store_id`, i.`name` as item_name, i.`stock`, i.`mdate`, i.`state`\n\t\t\t FROM `#__kart_order_item` AS oi\n\t\t\t JOIN `#__kart_orders` AS o ON oi.`order_id` = o.`id`\n\t\t\t JOIN `#__kart_items` AS i  ON oi.`item_id` = i.`item_id`\n\t\t\t" . $where . "\n\t\t\tGROUP BY `item_id` ";
     $filter_order = $mainframe->getUserStateFromRequest($option . $this->view . '.filter_order', 'filter_order', 'saleqty', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . $this->view . 'salesreport.filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
     $orderByArray = array();
     $orderByArray['name'] = "item_name";
     if ($filter_order) {
         if (!empty($orderByArray[$filter_order])) {
             $query .= " ORDER BY " . $orderByArray['name'] . " {$filter_order_Dir}";
         } else {
             $query .= " ORDER BY {$filter_order} {$filter_order_Dir}";
         }
     }
     //}
     return $query;
 }
Example #3
0
 /**
  * Get a list of articles.
  *
  * @param	JObject		The module parameters.
  *
  * @return	mixed		An array of articles, or false on error.
  */
 public static function getList($params)
 {
     // Initialise variables
     $user = JFactory::getuser();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select("o.orderID AS id, o.productNaam, o.orderNetto, o.created, o.checked_out, o.checked_out_time");
     // Join over the user
     $query->select("CONCAT(ou.name,' (',ou.username,')') AS userNaam");
     $query->from('#__bps_order AS o');
     $query->join('INNER', '#__users AS ou ON ou.id=o.userID');
     //orderstatus
     $query->select('os.statusName AS orderStatusName');
     $query->join('LEFT', '#__bps_orderstatus AS os ON os.statusCode = o.orderStatus');
     // Join over the users for the checked out user.
     $query->select('up.name AS editor');
     $query->join('LEFT', '#__users AS up ON up.id=o.checked_out');
     $query->where('o.bestelID > 0');
     $query->order('o.created DESC');
     $db->setQuery($query, 0, $params->get('count', 5));
     $items = $db->loadObjectList();
     if ($error = $db->getError()) {
         JError::raiseError(500, $error);
         return false;
     }
     // Set the links
     foreach ($items as &$item) {
         if ($user->authorise('core.edit', 'com_bixprintshop.order.' . $item->id)) {
             $item->link = JRoute::_('index.php?option=com_bixprintshop&task=order.edit&orderID=' . $item->id);
         } else {
             $item->link = '';
         }
     }
     return $items;
 }
Example #4
0
 function getDisplayTab($tab, $user, $ui)
 {
     // $$$ hugh - added privacy option, so you can restrict who sees the tab, requested on forums:
     // http://fabrikar.com/forums/showthread.php?p=128127#post128127
     // privacy setting:
     // 0 = public
     // 1 = profile owner only
     // 2 = profile owner and admins
     $private = (int) $this->params->get('fabrik_private', '0');
     if ($private > 0) {
         $viewer = JFactory::getuser();
         if ($private === 1) {
             if ($user->get('user_id') != $viewer->get('id')) {
                 return false;
             }
         } else {
             if ($private === 2) {
                 if ($user->get('id') !== $viewer->get('id') && ($viewer->get('gid') != 24 && $viewer->get('gid') != 25)) {
                     return false;
                 }
             }
         }
     }
     $dispatcher = new JDispatcher();
     JPluginHelper::importPlugin('content', 'fabrik', true, $dispatcher);
     $dispatcher->register('content', 'plgContentFabrik');
     $args = array();
     $article = new stdClass();
     $txt = $this->params->get('plugintext');
     // $$$ hugh - set profile user in session so Fabrik user element can get at it
     // TODO - should really make this table/form specific!
     $session =& JFactory::getSession();
     // $$$ hugh - testing using a unique session hash, which we will stuff in the
     // plugin args, and will get added where necessary in Fabrik lists and forms so
     // we can actually track the right form submissions with their coresponding CB
     // profiles.
     $social_hash = md5(serialize(array(JRequest::getURI(), $tab, $user)));
     $session->set('fabrik.plugin.' . $social_hash . '.profile_id', $user->get('id'));
     // do the old style one without the hash for backward compat
     $session->set('fabrik.plugin.profile_id', $user->get('id'));
     $txt = rtrim($txt, '}') . " fabrik_social_profile_hash=" . $social_hash . '}';
     //do some dynamic replacesments with the owner's data
     foreach ($user as $k => $v) {
         if (strstr($txt, "{\$my->{$k}}")) {
             $txt = str_replace("{\$my->{$k}}", $v, $txt);
         }
         // $$$ hugh - might as well stuff the entire CB user object in the session
         $session->set('fabrik.plugin.' . $social_hash . '.' . $k, $v);
     }
     $params = new stdClass();
     $args[] = 0;
     $article->text = $txt;
     $args[] =& $article;
     $args[] =& $params;
     $res = $dispatcher->trigger('onContentPrepare', $args);
     // $$$ peamak http://fabrikar.com/forums/showthread.php?t=10446&page=2
     $dispatcher->register('content', 'plgContentFabrik');
     return $article->text;
 }
 /**
  * Logs out the user
  *
  * @return  void
  */
 public function logoutUser()
 {
     $mainframe = JFactory::getApplication();
     $my = JFactory::getuser();
     $mainframe->logout($my->id);
     $link = JRoute::_("index.php?option=com_matukio&view=eventlist");
     $msg = JText::_("COM_MATUKIO_LOGOUT_SUCCESS");
     $this->setRedirect($link, $msg);
 }
 /**
  * Get a list of articles.
  *
  * @param	JObject		The module parameters.
  *
  * @return	mixed		An array of articles, or false on error.
  */
 public static function getList($params)
 {
     // Initialise variables
     $user = JFactory::getuser();
     // Get an instance of the generic articles model
     $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
     // Set List SELECT
     $model->setState('list.select', 'a.id, a.title, a.checked_out, a.checked_out_time, ' . ' a.access, a.created, a.created_by, a.created_by_alias, a.featured, a.state');
     // Set Ordering filter
     switch ($params->get('ordering')) {
         case 'm_dsc':
             $model->setState('list.ordering', 'modified DESC, created');
             $model->setState('list.direction', 'DESC');
             break;
         case 'c_dsc':
         default:
             $model->setState('list.ordering', 'created');
             $model->setState('list.direction', 'DESC');
             break;
     }
     // Set Category Filter
     $categoryId = $params->get('catid');
     if (is_numeric($categoryId)) {
         $model->setState('filter.category_id', $categoryId);
     }
     // Set User Filter.
     $userId = $user->get('id');
     switch ($params->get('user_id')) {
         case 'by_me':
             $model->setState('filter.author_id', $userId);
             break;
         case 'not_me':
             $model->setState('filter.author_id', $userId);
             $model->setState('filter.author_id.include', false);
             break;
     }
     // Set the Start and Limit
     $model->setState('list.start', 0);
     $model->setState('list.limit', $params->get('count', 5));
     $items = $model->getItems();
     if ($error = $model->getError()) {
         JError::raiseError(500, $error);
         return false;
     }
     // Set the links
     foreach ($items as &$item) {
         if ($user->authorise('core.edit', 'com_content.article.' . $item->id)) {
             $item->link = JRoute::_('index.php?option=com_content&task=article.edit&id=' . $item->id);
         } else {
             $item->link = '';
         }
     }
     return $items;
 }
Example #7
0
 function _buildQuery()
 {
     $db = JFactory::getDBO();
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $option = $jinput->get('option');
     $layout = $jinput->get('layout', 'payouts');
     //Get the WHERE and ORDER BY clauses for the query
     $where = '';
     $me = JFactory::getuser();
     $user_id = $me->id;
     $where = " where user_id=" . $user_id;
     //$this->_buildContentWhere();
     $where .= " AND a.status=1";
     if ($layout == 'mypayouts') {
         $query = "SELECT a.id, a.user_id, a.payee_name, a.transaction_id, a.date, a.email_id, a.amount, a.status, u.username\n\t\t\tFROM #__kart_payouts AS a\n\t\t\tLEFT JOIN `#__users` AS u ON u.id=a.user_id\n\t\t\t" . $where;
         $filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'id', 'cmd');
         $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
         /*$me=JFactory::getuser();
         		$user_id = $me->id;
         		$query = "SELECT * FROM #__kart_commission WHERE user_id = ".$user_id;*/
         if ($filter_order) {
             $qry1 = "SHOW COLUMNS FROM #__kart_payouts";
             $db->setQuery($qry1);
             $exists1 = $db->loadobjectlist();
             foreach ($exists1 as $key1 => $value1) {
                 $allowed_fields[] = $value1->Field;
             }
             if (in_array($filter_order, $allowed_fields)) {
                 $query .= " ORDER BY {$filter_order} {$filter_order_Dir}";
             }
         }
     }
     if ($layout == 'payouts') {
         $filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'id', 'int');
         $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', 'desc', 'string');
         $query = "SELECT * FROM #__kart_payouts ";
         if ($filter_order) {
             $qry1 = "SHOW COLUMNS FROM #__kart_payouts";
             $db->setQuery($qry1);
             $exists1 = $db->loadobjectlist();
             foreach ($exists1 as $key1 => $value1) {
                 $allowed_fields[] = $value1->Field;
             }
             if (in_array($filter_order, $allowed_fields)) {
                 $query .= " ORDER BY {$filter_order} {$filter_order_Dir}";
             }
         }
     }
     //echo $query."<br/>";
     return $query;
 }
Example #8
0
 function getDisplayTab($tab, $user, $ui)
 {
     // $$$ hugh - added privacy option, so you can restrict who sees the tab, requested on forums:
     // http://fabrikar.com/forums/showthread.php?p=128127#post128127
     // privacy setting:
     // 0 = public
     // 1 = profile owner only
     // 2 = profile owner and admins
     $private = (int) $this->params->get('fabrik_private', '0');
     if ($private > 0) {
         $viewer = JFactory::getuser();
         if ($private === 1) {
             if ($user->get('user_id') != $viewer->get('id')) {
                 return false;
             }
         } else {
             if ($private === 2) {
                 if ($user->get('id') !== $viewer->get('id') && ($viewer->get('gid') != 24 && $viewer->get('gid') != 25)) {
                     return false;
                 }
             }
         }
     }
     $dispatcher = new JDispatcher();
     JPluginHelper::importPlugin('content', 'fabrik', true, $dispatcher);
     $dispatcher->register('content', 'plgContentFabrik');
     $args = array();
     $article = new stdClass();
     $txt = $this->params->get('plugintext');
     //do some dynamic replacesments with the owner's data
     foreach ($user as $k => $v) {
         if (strstr($txt, "{\$my->{$k}}")) {
             $txt = str_replace("{\$my->{$k}}", $v, $txt);
         }
     }
     // $$$ hugh - set profile user in session so Fabrik user element can get at it
     // TODO - should really make this table/form specific!
     $session =& JFactory::getSession();
     $session->set('fabrik.plugin.profile_id', $user->get('id'));
     $params = new stdClass();
     $article->text = $txt;
     $args[] =& $article;
     $args[] =& $params;
     $args[] = 0;
     $res = $dispatcher->trigger('onPrepareContent', $args);
     // $$$ peamak http://fabrikar.com/forums/showthread.php?t=10446&page=2
     $dispatcher->register('content', 'plgContentFabrik');
     // HERE
     return $article->text;
 }
Example #9
0
 function display($tmpl = null)
 {
     $mainframe = JFactory::getApplication();
     $my = JFactory::getuser();
     if (empty($my->id)) {
         $return = JRequest::getVar('return', '');
         EasyBlogHelper::showLogin($return);
         return;
     } else {
         $showPermissionMsg = JRequest::getVar('showpermissionmsg', '');
         if ($showPermissionMsg) {
             EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_YOU_DO_NOT_HAVE_PERMISSION_TO_VIEW'), 'error');
         } else {
             EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_YOU_ARE_ALREADY_LOGIN'), 'error');
             $mainframe->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=latest'));
         }
     }
 }
 /**
  * Displays the form
  *
  * @param   string  $tpl  - The tpl
  *
  * @return  mixed|object
  */
 public function display($tpl = null)
 {
     $my = JFactory::getuser();
     $art = JFactory::getApplication()->input->getInt('art', 1);
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     $model = $this->getModel();
     if (empty($cid)) {
         JError::raiseError('404', "COM_MATUKIO_NO_ID");
     }
     // Only registered users
     if ($my->id == 0) {
         JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     $event = $model->getEvent($cid);
     $database = JFactory::getDBO();
     $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='" . $cid . "' AND userid='" . $my->id . "'");
     $booking = $database->loadObject();
     $this->event = $event;
     $this->booking = $booking;
     parent::display($tpl);
 }
Example #11
0
 public function execute()
 {
     $app = new Sp4kAppsAccountApp(new Registry($this->state->toObject()));
     $this->item = $app->getItem();
     $this->id = $this->item->id;
     $this->created = $this->item->created;
     $accountFilter = ['filters' => ['account_id' => $this->id]];
     if ($this->item->id != null) {
         $this->item->parents = Sp4kAppsParentApp::getInstance(new Registry($accountFilter))->getItems();
         foreach ($this->item->parents as &$parent) {
             $juser = JFactory::getuser($parent->juser_id);
             $parent->name = $juser->name;
             $parent->email = $juser->email;
         }
         $this->item->children = Sp4kAppsChildApp::getInstance(new Registry($accountFilter))->getItems();
         foreach ($this->item->children as $child) {
             $this->item->registrations = $this->item->registrations + Sp4kAppsRegistrationApp::getInstance(new Registry(['filters' => ['child_id' => $child->id]]))->getItems();
         }
         $this->item->subscriptions = Sp4kAppsSubscriptionApp::getInstance(new Registry($accountFilter))->getItems();
         $this->item->orders = Sp4kAppsOrderApp::getInstance(new Registry($accountFilter))->getItems();
     }
 }
 /**
  * Unpublishs the event
  *
  * @return object
  */
 public function unpublishEvent()
 {
     $msg = "COM_MATUKIO_EVENT_UNPUBLISH_SUCCESS";
     $database = JFactory::getDBO();
     $my = JFactory::getuser();
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     if (!JFactory::getUser()->authorise('core.edit', 'com_matukio', $cid)) {
         return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     $vorlage = JFactory::getApplication()->input->getInt('vorlage', 0);
     $database->setQuery("SELECT * FROM #__matukio WHERE id='{$cid}'");
     $rows = $database->loadObjectList();
     $aktsem =& $rows[0];
     $neudatum = MatukioHelperUtilsDate::getCurrentDate();
     if ($neudatum < $aktsem->begin && $vorlage == 0 && MatukioHelperSettings::_("notify_participants_publish", 1)) {
         foreach ($rows as $row) {
             $events = MatukioHelperUtilsEvents::getEventsRecurringOnEventId($row->semid);
             foreach ($events as $e) {
                 $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid = " . $database->quote($e->id));
                 $bookings = $database->loadObjectList();
                 for ($i = 0, $n = count($bookings); $i < $n; $i++) {
                     MatukioHelperUtilsEvents::sendBookingConfirmationMail($e, $bookings[$i]->id, 4);
                 }
             }
         }
     }
     $database->setQuery("UPDATE #__matukio SET published=0 WHERE id='" . $cid . "'");
     // TODO Update recurring
     if (!$database->execute()) {
         JError::raiseError(500, $database->getError());
         $msg = "COM_MATUKIO_EVENT_UNPUBLISH_FAILURE_" . $database->getError();
         exit;
     }
     $link = JRoute::_("index.php?com_matukio&view=eventlist&art=2");
     $this->setRedirect($link, $msg);
 }
 /**
  * Rates an event
  *
  * @throws  Exception if user is not logged in
  * @return  void / redirect
  */
 public function rate()
 {
     // Check if user is logged in
     if (JFactory::getUser()->id == 0) {
         throw new Exception("COM_MATUKIO_NO_ACCESS");
     }
     $msg = JText::_("COM_MATUKIO_RATING_SUCCESSFULL");
     $mainframe = JFactory::getApplication();
     jimport('joomla.mail.helper');
     $my = JFactory::getuser();
     $database = JFactory::getDBO();
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     $grade = JFactory::getApplication()->input->getInt('grade', 0);
     $text = JFactory::getApplication()->input->get('text', '');
     $text = str_replace(array("\"", "\\'"), "", $text);
     $text = JMailHelper::cleanBody($text);
     $database->setQuery("UPDATE #__matukio_bookings SET grade='" . $grade . "', comment='" . $text . "' WHERE semid='" . $cid . "' AND userid='" . $my->id . "'");
     if (!$database->execute()) {
         JError::raiseError(500, $database->getError());
         exit;
     }
     $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='" . $cid . "'");
     $rows = $database->loadObjectList();
     $zaehler = 0;
     $wertung = 0;
     foreach ($rows as $row) {
         if ($row->grade > 0) {
             $wertung = $wertung + $row->grade;
             $zaehler++;
         }
     }
     if ($zaehler > 0) {
         $geswert = round($wertung / $zaehler);
     } else {
         $geswert = 0;
     }
     $database->setQuery("UPDATE #__matukio SET grade='{$geswert}' WHERE id='{$cid}'");
     if (!$database->execute()) {
         JError::raiseError(500, $database->getError());
         $msg = "COM_MATUKIO_RATING_FAILED " . $database->getError();
     }
     if (MatukioHelperSettings::getSettings('sendmail_owner', 1) > 0) {
         $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='{$cid}' AND userid='{$my->id}'");
         $buchung = $database->loadObject();
         // Load event (use model function)
         $emodel = JModelLegacy::getInstance('Event', 'MatukioModel');
         $row = $emodel->getItem($cid);
         $publisher = JFactory::getuser($row->publisher);
         $body = "\n<head>\n<style type=\"text/css\">\n<!--\nbody {\nfont-family: Verdana, Tahoma, Arial;\nfont-size:12pt;\n}\n-->\n</style></head><body>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_RECEIVED_RATING') . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_RATING') . ":</div>";
         $htxt = str_replace('SEM_POINTS', $grade, JTEXT::_('COM_MATUKIO_SEM_POINTS_6'));
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . $htxt . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_COMMENT') . ":</div>";
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . htmlspecialchars($text) . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_AVARAGE_SCORE') . ":</div>";
         $htxt = str_replace('SEM_POINTS', $geswert, JTEXT::_('COM_MATUKIO_SEM_POINTS_6'));
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . $htxt . "</div>";
         $body .= "<p>" . MatukioHelperUtilsEvents::getEmailBody($row, $buchung, $my);
         $sender = $mainframe->getCfg('fromname');
         $from = $mainframe->getCfg('mailfrom');
         $replyname = $my->name;
         $replyto = $my->email;
         $email = $publisher->email;
         $subject = JTEXT::_('COM_MATUKIO_EVENT');
         if ($row->semnum != "") {
             $subject .= " " . $row->semnum;
         }
         $subject .= ": " . $row->title;
         $subject = JMailHelper::cleanSubject($subject);
         $mailer = JFactory::getMailer();
         $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname);
     }
     $link = "index.php?option=com_matukio&tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&view=rateevent&cid=" . $cid;
     $this->setRedirect($link, $msg);
 }
Example #14
0
 /**
  * Retrieves a list of teams that are associated with the specific user
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getUserTeams($userId = null)
 {
     $user = JFactory::getuser($userId);
     $userId = $user->id;
     $db = EB::db();
     $query = array();
     $query[] = 'SELECT a.* FROM ' . $db->qn('#__easyblog_team') . ' AS a';
     $query[] = 'LEFT JOIN ' . $db->qn('#__easyblog_team_users') . ' AS b';
     $query[] = 'ON a.' . $db->qn('id') . ' = b.' . $db->qn('team_id');
     $query[] = 'AND b.' . $db->qn('user_id') . '=' . $db->Quote($userId);
     $query[] = 'LEFT JOIN ' . $db->qn('#__easyblog_team_groups') . ' AS c';
     $query[] = 'ON a.' . $db->qn('id') . ' = c.' . $db->qn('team_id');
     $query[] = 'WHERE a.' . $db->qn('published') . '=' . $db->Quote(1);
     $query[] = 'GROUP BY a.' . $db->qn('id') . ' HAVING (COUNT(b.' . $db->qn('team_id') . ') > 0 || COUNT(c.' . $db->qn('team_id') . ') > 0)';
     $query = implode(' ', $query);
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     if (!$rows) {
         return $rows;
     }
     $teams = array();
     foreach ($rows as $row) {
         $team = EB::table('TeamBlog');
         $team->bind($row);
         $teams[] = $team;
     }
     return $teams;
 }
Example #15
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return  JDatabaseQuery
  *
  * @since   1.6
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     // Select the required fields from the table.
     $query->select($this->getState('list.select', 'a.id, a.user_id, a.payee_name, a.transaction_id, a.date, a.email_id, a.amount, a.status'));
     $query->from('`#__kart_payouts` AS a');
     $query->select('u.username');
     $query->join('LEFT', '`#__users` AS u ON u.id=a.user_id');
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('a.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->Quote('%' . $db->escape($search, true) . '%');
             $query->where('( a.payee_name LIKE ' . $search . '  OR  a.transaction_id LIKE ' . $search . '  OR  a.email_id LIKE ' . $search . ' )');
         }
     }
     $query->where("user_id = " . JFactory::getuser()->id);
     // Add the list ordering clause.
     $orderCol = $this->state->get('list.ordering');
     $orderDirn = $this->state->get('list.direction');
     if ($orderCol && $orderDirn) {
         $query->order($db->escape($orderCol . ' ' . $orderDirn));
     }
     return $query;
 }
 public static function getTemplateListSelect($vorlage, $art)
 {
     $html = "";
     $database = JFactory::getDBO();
     $my = JFactory::getuser();
     $where = array();
     // Nur veroeffentlichte Kurse anzeigen
     $where[] = "published = '1'";
     $where[] = "pattern != ''";
     $where[] = "publisher = '" . $my->id . "'";
     // Nur Kurse anzeigen, deren Kategorie fuer den Benutzer erlaubt ist
     $groups = implode(',', $my->getAuthorisedViewLevels());
     $query = $database->getQuery(true);
     $query->select("id, access")->from("#__categories")->where(array("extension = " . $database->quote("com_matukio"), "published = 1", "access in (" . $groups . ")"));
     $database->setQuery($query);
     $cats = $database->loadObjectList();
     $allowedcat = array();
     foreach ((array) $cats as $cat) {
         $allowedcat[] = $cat->id;
     }
     if (count($allowedcat) > 0) {
         $allowedcat = implode(',', $allowedcat);
         $where[] = "catid IN ({$allowedcat})";
     }
     $database->setQuery("SELECT * FROM #__matukio" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nORDER BY pattern");
     $rows = $database->loadObjectList();
     $patterns = array();
     $patterns[] = JHTML::_('select.option', '', JTEXT::_('COM_MATUKIO_CHOOSE_TEMPLATE'));
     foreach ($rows as $row) {
         $patterns[] = JHTML::_('select.option', $row->id, $row->pattern);
     }
     $htxt = JTEXT::_('COM_MATUKIO_TEMPLATE') . ": ";
     $disabled = "";
     if ($vorlage == 0) {
         $disabled = " disabled";
     }
     if ($art == 1) {
         if (count($patterns) > 1) {
             $htxt .= JHTML::_('select.genericlist', $patterns, 'vorlage', 'class="sem_inputbox" size="1"
                 onChange="form.cid.value=form.vorlage.value;form.task.value=9;form.submit();"', 'value', 'text', $vorlage);
             $htxt .= " <button class=\"button\" id=\"tmpldel\" style=\"cursor:pointer;\" type=\"button\"\n                    onclick=\"form.cid.value=form.vorlage.value;form.task.value=11;form.submit();\"" . $disabled . ">\n                    <img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1516.png\" border=\"0\"\n                    align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_DELETE') . "</button>";
         } else {
             $htxt .= "<input type=\"hidden\" name=\"vorlage\" value=\"0\">";
         }
         $htxt .= " <input type=\"text\" name=\"pattern\" id=\"pattern\" class=\"sem_inputbox\" value=\"\"\n            onKeyup=\"if(this.value=='') {form.tmplsave.disabled=true;} else {form.tmplsave.disabled=false;}\" />";
         $htxt .= " <button class=\"button\" id=\"tmplsave\" style=\"cursor:pointer;\" type=\"button\"\n                onclick=\"form.task.value=10;form.submit();\" disabled><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1416.png\" border=\"0\" align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_SAVE') . "</button>";
         $html = "<tr>" . self::getTableCell($htxt, 'd', 'c', '80%', 'sem_nav', 2) . "</tr>";
     } elseif ($art == 2) {
         if (count($patterns) > 1) {
             $htxt .= JHTML::_('select.genericlist', $patterns, 'vorlage', 'class="sem_inputbox" size="1" ' . 'onChange="form.id.value=form.vorlage.value;form.task.value=\'12\';form.submit();"', 'value', 'text', $vorlage);
             $html = "<tr>" . self::getTableCell($htxt, 'd', 'c', '80%', 'sem_nav', 2) . "</tr>";
         }
     }
     return $html;
 }
 /**
  * Sends an email to the organizer
  *
  * @throws  exception
  * @return  object
  */
 public function sendEmail()
 {
     $mainframe = JFactory::getApplication();
     $msg = JText::_("COM_MATUKIO_MAIL_TO_ORGANIZER_SEND_SUCCESSFULL");
     $msg_type = "message";
     jimport('joomla.mail.helper');
     // Check if sending is allowed
     if (!MatukioHelperSettings::getSettings("sendmail_contact", 1)) {
         throw new Exception("COM_MATUKIO_CONTACTING_ORGANIZERS_IS_DISABLED");
     }
     $my = JFactory::getuser();
     $database = JFactory::getDBO();
     $cid = JFactory::getApplication()->input->getInt('event_id', 0);
     $organizer_id = JFactory::getApplication()->input->getInt('organizer_id', 0);
     $uid = JFactory::getApplication()->input->get('art', 0);
     $text = JMailHelper::cleanBody(nl2br(JFactory::getApplication()->input->get('text', '', 'string')));
     $name = JFactory::getApplication()->input->get('name', '', 'string');
     $email = JFactory::getApplication()->input->get('email', '', 'string');
     if ($text != "" && $name != "" && $email != "") {
         $reason = JTEXT::_('COM_MATUKIO_MESSAGE_SEND');
         // Load event (use model function)
         $emodel = JModelLegacy::getInstance('Event', 'MatukioModel');
         $event = $emodel->getItem($cid);
         $subject = "";
         if ($event->semnum != "") {
             $subject .= " " . $event->semnum;
         }
         $subject .= ": " . $event->title;
         $subject = JMailHelper::cleanSubject($subject);
         $sender = $mainframe->getCfg('fromname');
         $from = $mainframe->getCfg('mailfrom');
         if ($my->id == 0) {
             $replyname = $name;
             $replyto = $email;
             // Setting it hardcoded for the body function.. dirk you really give me headaches
             $my->name = $name;
             $my->email = $email;
         } else {
             $replyname = $my->name;
             $replyto = $my->email;
         }
         $body = "\n<head>\n<style type=\"text/css\">\n<!--\nbody {\nfont-family: Verdana, Tahoma, Arial;\nfont-size:12pt;\n}\n-->\n</style></head><body>";
         if ($uid == 1 and $my->id != 0) {
             $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_QUESTION_ABOUT_EVENT') . "</div><p>";
         }
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . $text . "</div><p>";
         $temp = array();
         // Mail to Organizer
         if ($uid == 1) {
             $body .= MatukioHelperUtilsEvents::getEmailBody($event, $temp, $my);
             $publisher = JFactory::getUser($event->publisher);
             $email = $publisher->email;
             $mailer = JFactory::getMailer();
             $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname);
         } elseif ($uid == "organizer") {
             $organizer = MatukioHelperOrganizer::getOrganizerId($organizer_id);
             $publisher = JFactory::getuser($organizer->userId);
             $email = $publisher->email;
             $mailer = JFactory::getMailer();
             $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname);
         } else {
             if (!JFactory::getUser()->authorise('core.create', 'com_matukio')) {
                 return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
             }
             $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='" . $event->id . "'");
             $rows = $database->loadObjectList();
             foreach ($rows as $row) {
                 if ($row->userid == 0) {
                     $user = JFactory::getUser(0);
                     $user->email = $row->email;
                     $user->name = $row->name;
                 } else {
                     $user = JFactory::getUser($row->userid);
                 }
                 $text = $body . MatukioHelperUtilsEvents::getEmailBody($event, $row, $user);
                 $mailer = JFactory::getMailer();
                 $mailer->sendMail($from, $sender, $user->email, $subject, $text, 1, null, null, null, $replyto, $replyname);
             }
         }
     } else {
         $msg = JTEXT::_('COM_MATUKIO_MESSAGE_NOT_SEND');
         $msg_type = "error";
     }
     $link = MatukioHelperUtilsBasic::getSitePath() . "index.php?tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&option=" . JFactory::getApplication()->input->get('option') . "&view=contactorganizer&cid=" . $cid . "&art=" . $uid . "&task=19";
     $this->setRedirect($link, $msg, $msg_type);
 }
Example #18
0
$my = JFactory::getuser();
JHTML::_('behavior.modal');
JHTML::_('stylesheet', 'media/com_matukio/css/modern.css');
// Backward compatibilty
$buchopt = MatukioHelperUtilsEvents::getEventBookableArray($this->art, $this->event, $my->id, $this->uuid);
$nametemp = "";
$htxt = 2;
$bezahlt = 0;
if ($this->art == 1) {
    $bezahlt = $this->booking->paid;
}
if ($this->art > 2) {
    if ($usrid == 0) {
        $nametemp = MatukioHelperUtilsBasic::getBookedUserList($this->event);
    } elseif ($usrid > 0) {
        $nametemp = JFactory::getuser($usrid);
        $nametemp = $nametemp->name;
    }
    if ($nametemp == "") {
        $htxt = 2.2;
    }
}
// Status für Parser festlegen
$parse = "sem_unregistered";
if ($my->id > 0) {
    $parse = "sem_registered";
}
if ($buchopt[0] == 2) {
    $parse = "sem_booked";
    if ($buchopt[2][0]->paid > 0) {
        $parse = "sem_paid";
 /**
  * TODO Fix this
  * @deprecated  Moved to ACL
  * @return int|string
  */
 public static function getUserLevel()
 {
     // Public
     $reglevel = 0;
     $my = JFactory::getuser();
     // Zugriffslevel festlegen
     if (JVERSION >= 3) {
         $utype = 0;
     } else {
         $utype = strtolower($my->usertype);
     }
     // > Joomla 1.5
     $utype = self::getUserTypeID($my);
     $reglevel = $utype;
     if ($utype == -1) {
         $reglevel = 0;
         if (MatukioHelperSettings::getSettings('booking_unregistered', 1) == 1) {
             $reglevel = 1;
         }
     }
     return $reglevel;
 }
 /**
  * Shows the form
  *
  * @param   string  $tpl  - The tmpl
  *
  * @return  bool|mixed|object
  */
 public function display($tpl = NULL)
 {
     $database = JFactory::getDBO();
     $my = JFactory::getuser();
     $dateid = JFactory::getApplication()->input->getInt('dateid', 1);
     $catid = JFactory::getApplication()->input->getInt('catid', 0);
     $search = JFactory::getApplication()->input->get('search', '', 'string');
     $limit = JFactory::getApplication()->input->getInt('limit', 5);
     $limitstart = JFactory::getApplication()->input->getInt('limitstart', 0);
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     $uid = JFactory::getApplication()->input->getInt('uid', 0);
     $todo = JFactory::getApplication()->input->get('todo', 'print_eventlist');
     // print_eventlist, print_booking, print_myevents, print
     $rows = null;
     $status = null;
     $headertext = null;
     $neudatum = MatukioHelperUtilsDate::getCurrentDate();
     if ($limitstart < 0) {
         $limitstart = 0;
     }
     $ttlimit = "";
     if ($limit > 0) {
         $ttlimit = "\nLIMIT {$limitstart}, {$limit}";
     }
     /**
      * 65O9805443904 =    public ?!
      * 653O875032490 =    Meine Angebote
      * 6530387504345 =  Meine Buchungen / Buchungsbestätigung ?!
      *
      * 3728763872762 =
      * csv
      */
     $where = array();
     $where[] = "a.pattern = ''";
     $where[] = "a.published = '1'";
     switch ($todo) {
         case "print_eventlist":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavshowmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_booking":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavbookingmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_myevents":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavoffermodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_teilnehmerliste":
             $navioben = "";
             break;
     }
     if ($todo != "print_teilnehmerliste" && $todo != "csvlist" && $todo != "certificate" && $todo != "invoice") {
         if (in_array('SEM_TYPES', $navioben)) {
             switch ($dateid) {
                 case "1":
                     $where[] = "a.end > '{$neudatum}'";
                     break;
                 case "2":
                     $where[] = "a.end <= '{$neudatum}'";
                     break;
             }
         }
     }
     switch ($todo) {
         default:
         case "print_eventlist":
             if (!in_array('SEM_TYPES', $navioben)) {
                 $where[] = "r.end > '{$neudatum}'";
             }
             if ((isset($_GET["catid"]) or in_array('SEM_CATEGORIES', $navioben)) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $headertext = JTEXT::_('COM_MATUKIO_EVENTS');
             if ($cid) {
                 $where[] = "r.id= '{$cid}'";
                 $headertext = JTEXT::_('COM_MATUKIO_EVENT');
             }
             $database->setQuery("SELECT a.*, r.*, cc.title AS category FROM #__matukio_recurring AS r" . "\nLEFT JOIN #__matukio AS a ON r.event_id = a.id" . "\nLEFT JOIN #__categories AS cc ON cc.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%'" . " OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')");
             $rows = $database->loadObjectList();
             // Abzug der Kurse, die wegen Ausbuchung nicht angezeigt werden sollen
             if (!$cid) {
                 $abid = array();
                 foreach ($rows as $row) {
                     if ($row->stopbooking == 2) {
                         $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
                         if ($row->maxpupil - $gebucht->booked < 1) {
                             $abid[] = $row->id;
                         }
                     }
                 }
                 if (count($abid) > 0) {
                     $abid = implode(',', $abid);
                     $where[] = "r.id NOT IN ({$abid})";
                 }
             }
             $database->setQuery("SELECT a.*, r.*, cc.title AS category FROM #__matukio_recurring AS r" . "\nLEFT JOIN #__matukio AS a ON r.event_id = a.id" . "\nLEFT JOIN #__categories AS cc" . "\nON cc.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (a.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             $paid = array();
             $abid = array();
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
                 $gebucht = $gebucht->booked;
                 if (MatukioHelperUtilsDate::getCurrentDate() > $row->booked or $row->maxpupil - $gebucht < 1 and $row->stopbooking == 1 or $my->id == $row->publisher and MatukioHelperSettings::getSettings('booking_ownevents', 1) == 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_UNBOOKABLE');
                 } elseif ($row->maxpupil - $gebucht < 1 && $row->stopbooking == 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_BOOKING_ON_WAITLIST');
                 } elseif ($row->maxpupil - $gebucht < 1 && $row->stopbooking == 2) {
                     $abid[] = $row->id;
                 } else {
                     $status[$i] = JTEXT::_('COM_MATUKIO_NOT_EXCEEDED');
                 }
                 $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='{$row->id}' AND userid='{$my->id}'");
                 $temp = $database->loadObjectList();
                 if (count($temp) > 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_ALREADY_BOOKED');
                     if ($temp[0]->paid == 1) {
                         $rows[$i]->fees = $rows[$i]->fees . " - " . JTEXT::_('COM_MATUKIO_PAID');
                     }
                 }
                 $rows[$i]->codepic = "";
             }
             break;
             // My bookings ?!
         // My bookings ?!
         case "print_booking":
             $headertext = JTEXT::_('COM_MATUKIO_MY_BOOKINGS') . " - " . $my->name;
             if (in_array('SEM_CATEGORIES', $navioben) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $where[] = "cc.userid = '" . $my->id . "'";
             if ($cid) {
                 $where[] = "cc.semid = '" . $cid . "'";
                 $headertext = JTEXT::_('COM_MATUKIO_BOOKING_CONFIRMATION') . " - " . $my->name;
             }
             $database->setQuery("SELECT a.*, r.*, cat.title AS category, cc.bookingdate AS bookingdate, cc.id AS bookid, cc.status AS bookingstatus\r\n\t\t\t\t\tFROM #__matukio_recurring AS r\r\n\t\t\t\t\tLEFT JOIN #__matukio AS a ON r.event_id = a.id\r\n\t\t\t\t\tLEFT JOIN #__matukio_bookings AS cc ON cc.semid = r.id\r\n\t\t\t\t\tLEFT JOIN #__categories AS cat ON cat.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%'\r\n                        OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid = '{$row->id}' ORDER BY id");
                 $temps = $database->loadObjectList();
                 $status[$i] = MatukioHelperUtilsBooking::getBookingStatusName($row->bookingstatus);
                 $rows[$i]->codepic = $row->bookid;
                 if ($temps[0]->paid == 1) {
                     $rows[$i]->fees = $rows[$i]->fees . " - " . JTEXT::_('COM_MATUKIO_PAID');
                 }
             }
             break;
             // My events ?!
         // My events ?!
         case "print_myevents":
             if (in_array('SEM_CATEGORIES', $navioben) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $where[] = "a.publisher = '" . $my->id . "'";
             $database->setQuery("SELECT a.*, r.* cat.title AS category FROM #__matukio_recurring AS r\r\n\t\t\t \t    LEFT JOIN #__matukio AS a ON r.eventid = a.id\r\n\t\t\t\t\tLEFT JOIN #__categories AS cat ON cat.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             $headertext = JTEXT::_('COM_MATUKIO_MY_OFFERS') . " - " . $my->name;
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $status[$i] = MatukioHelperUtilsBooking::getBookingStatusName($row->bookingstatus);
                 $rows[$i]->codepic = "";
             }
             break;
         case "print_teilnehmerliste":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $this->art = $art;
             if ($art == 1) {
                 $this->setLayout("signaturelist");
             } else {
                 $this->setLayout("participants");
             }
             break;
         case "csvlist":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $this->art = $art;
             $this->cid = $cid;
             $this->setLayout("csv");
             break;
         case "certificate":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $uid = JFactory::getApplication()->input->getInt('uid', 0);
             $this->art = $art;
             $this->uid = $uid;
             $this->setLayout("certificate");
             break;
         case "invoice":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $uid = JFactory::getApplication()->input->getInt('uid', 0);
             $this->art = $art;
             $this->uid = $uid;
             $this->setLayout("invoice");
             break;
     }
     $this->rows = $rows;
     $this->status = $status;
     $this->headertext = $headertext;
     parent::display($tpl);
 }
Example #21
0
 /**
  * Micro blogging layout
  *
  * @since	3.0.7706
  * @access	public
  * @param	null
  * @return 	null
  */
 public function microblog()
 {
     $mainframe = JFactory::getApplication();
     $config = EasyBlogHelper::getConfig();
     $acl = EasyBlogACLHelper::getRuleSet();
     if (!EasyBlogHelper::isLoggedIn()) {
         EasyBlogHelper::showLogin();
         return;
     }
     $my = JFactory::getuser();
     $user = EasyBlogHelper::getTable('Profile', 'Table');
     $user->load($my->id);
     // @rule: Test if microblogging is allowed
     if (!$config->get('main_microblog')) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_NOT_ALLOWED'), 'error');
         JFactory::getApplication()->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false));
     }
     // @rule: Test ACL if add entry is allowed
     if (!$acl->rules->add_entry) {
         $mainframe->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false), JText::_('COM_EASYBLOG_NO_PERMISSION_TO_CREATE_BLOG'));
         $mainframe->close();
     }
     $document = JFactory::getDocument();
     $title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_DASHBOARD_SHARE_A_STORY_TITLE'));
     // @task: Set the page title
     parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
     // Add toolbar to the output
     echo $this->showToolbar(__FUNCTION__, $user);
     // Get active tabs
     $activeType = JRequest::getVar('type', 'text');
     // Add the breadcrumbs
     $breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_SHARE_STORY') => '');
     // @task: Retrieve existing categories
     $categoryModel = $this->getModel('Categories');
     $categories = EasyBlogHelper::populateCategories('', '', 'select', 'category_id', '', true, true, true);
     // @task: Retrieve existing tags
     $tagsModel = $this->getModel('Tags');
     $tags = $tagsModel->getTags();
     $template = new CodeThemes('dashboard');
     $template->set('activeType', $activeType);
     $template->set('categories', $categories);
     $template->set('breadcrumbs', $breadcrumbs);
     $template->set('tags', $tags);
     echo $template->fetch('dashboard.microblog.php');
 }
Example #22
0
    static function showRequestRentBooksCB($option, $rent_requests, &$pageNav, $params)
    {
        global $my, $mosConfig_live_site, $mainframe, $Itemid, $booklibrary_configuration;
        $session = JFactory::getSession();
        $acl = JFactory::getACL();
        $arr = $session->get("array", "default");
        $doc = JFactory::getDocument();
        $doc->addScript($mosConfig_live_site . '/components/com_booklibrary/includes/functions.js');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        // for 1.6
        if ($option == 'com_booklibrary') {
            $user = JFactory::getuser();
            $db = JFactory::getDBO();
            $query = "SELECT * FROM #__booklibrary_lend_request AS b WHERE b.status=0";
            $db->setQuery($query);
            $current_user_rent_request_array = $db->loadObjectList();
            $check_for_show_rent_request = 0;
            if (isset($current_user_rent_request_array)) {
                $check_for_show_rent_request = 1;
            }
            if ($booklibrary_configuration['cb_mybook']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo "<span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_edit']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=showmybooks&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBEDIT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_history']['show']) {
                $params->def('show_history', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_history']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_history_registrationlevel', 1);
                }
                if ($params->get('show_history')) {
                    if ($params->get('show_history_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'>\n\t\t\t\t\t\t\t\t\t\t<a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=rent_history_books&name=' . $user->name . '&user=' . $user->id . '&is_show_data=1') . "'>" . _BOOKLIBRARY_MY_LEND_HISTORY . "</a></span>";
                        }
                        //echo "<div style=\" border:1px solid black; padding: 10px; text-align:center; \">you dont have rent_history_lable</div>";
                    }
                }
            }
            if ($booklibrary_configuration['cb_rent']['show']) {
                $params->def('show_rent', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_rent']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_rent_registrationlevel', 1);
                }
                if ($params->get('show_rent')) {
                    if ($params->get('show_rent_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=rent_requests_cb_books&is_show_data=1') . "'>" . _BOOKLIBRARY_LEND_REQUESTS . "</a></span>";
                        }
                    }
                }
            }
            ?>
            <style type="text/css">
                .row0 {background-color:#F9F9F9;}
            </style><br/><br/><br/>
        <?php 
        }
        ?>
        <script>
            function vm_buttonClickCB()  {
                document.getElementById('adminFormTaskInput').value = 'decline_rent_requests_cb_book';
                document.getElementById('adminForm').submit();
            }
        </script>
        <script type="text/javascript">
            function checkAll(all) 
            { var c = document.getElementsByName('bid[]');
                for(var i=0;i<c.length;i++)
                {if(all.checked!=true)
                    {c[i].checked=false;}
                    else {c[i].checked=true;}
                }
            }
            function buttonClick(button)
            {if(button.name=='addbook')
                {submitform('add_book_fe');return;}
                var c = document.getElementsByName('bid[]');
                for(var i=0;i<c.length;i++)
                {if(c[i].checked)
                    {var checkedbooks = true;break;}
                }
                if(!checkedbooks){ alert("<?php 
        echo _BOOKLIBRARY_ERROR_DEL;
        ?>
");return;}
                if(button.name=='delete'){ resultat = confirm("<?php 
        echo _BOOKLIBRARY_LABEL_EBOOK_DELETE;
        ?>
");
                    if (resultat) { submitform('delete');}
                    return;}
                if(button.name=='unpublish'){ submitform('unpublish');return;}
                if(button.name=='publish'){ submitform('publish');return;}
            }
            function submitform(submit){
                var button=document.getElementsByName('submitbutton');
                button[0].value=submit;document.forms["adminForm1"].submit();
            }
        </script>
        <form class="bl_all_categories_show_my_book_lend_requests_form" action="index.php" method="get" name="adminForm" id="adminForm">
            <table cellpadding="4" cellspacing="0" border="0" width="100%" class="bl_all_categories_show_my_book_lend_requests my_table my_table-bordered basictable my_table-hover">
                <tr>
                    <th align = "center" width="5%">
                        <input type="checkbox" name="toggle" value="" onClick="checkAll(this<?php 
        //echo count($rent_requests);
        ?>
);" />
                    </th>
                    <th align = "center" width="5%">#</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_ORDER_LEND_FROM;
        ?>
</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_ORDER_LEND_UNTIL;
        ?>
</th>
                    <th align = "center" class="title" width="5%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_BOOKID;
        ?>
</th>
                    <th align = "center" class="title" width="70%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_TITLE;
        ?>
</th>
                    <th align = "center" class="title" width="15%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_LEND_USER;
        ?>
</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_LEND_EMAIL;
        ?>
</th>
                    <th align = "center" class="title" width="20%" nowrap="nowrap">
                <?php 
        echo _BOOKLIBRARY_LABEL_LEND_ADRES;
        ?>
</th>
                </tr>

                <?php 
        for ($i = 0, $n = count($rent_requests); $i < $n; $i++) {
            $row = $rent_requests[$i];
            ?>
                    <tr class="row<?php 
            echo $i % 2;
            ?>
">
                        <td width="20" align="center"><?php 
            echo mosHTML::idBox($i, $row->id, 0, 'bid');
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->id;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->lend_from;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->lend_until;
            ?>
</td>
                        <td align = "center"><?php 
            $data = JFactory::getDBO();
            $query = "SELECT bookid FROM #__booklibrary where id = " . $row->fk_bookid . " ";
            $data->setQuery($query);
            $bookid = $data->loadObjectList();
            echo $bookid[0]->bookid;
            ?>
                        </td>
                        <td align = "center"><?php 
            echo $row->title;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->user_name;
            ?>
</td>
                        <td align = "center">
                            <a href='mailto:"<?php 
            echo $row->user_email;
            ?>
'><?php 
            echo $row->user_email;
            ?>
</a>
                        </td>
                        <td align= "center"><?php 
            echo $row->user_mailing;
            ?>
</td>
                    </tr>
                        <?php 
        }
        ?>

                <tr class="for_paginator">
                    <td colspan = "9" align="center" id="pagenavig">
                        <?php 
        $paginations = $arr;
        if ($paginations && $pageNav->total > $pageNav->limit) {
            echo $pageNav->getPagesLinks();
        }
        ?>
                    </td>
                </tr>
            </table>
        <?php 
        if ($option == 'com_booklibrary') {
            ?>
                <input type="hidden" name="option" value="com_booklibrary" />
        <?php 
        } else {
            ?>
                <input type="hidden" name="option" value="com_comprofiler" />
                <input type="hidden" name="tab" value="getmybooksTab" /><?php 
        }
        ?>
            <input type="hidden" name="is_show_data" value="1" />
            <input type="hidden" id="adminFormTaskInput" name="task" value="accept_rent_requests_cb_book" />
            <input type="hidden" name="boxchecked" value="0" />
            <input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />  
            <input class="my_btn my_btn-success" type="submit" name="submitButton" value="accept request"/>
            <input class="my_btn my_btn-danger" type="button" name="declineButton" value="decline request" onclick="vm_buttonClickCB()"/>

        </form>
        <?php 
    }
    return;
}
$type = 'entry';
if ($view == 'teamblog') {
    $type = 'teamblog';
}
if ($view == 'categories') {
    $type = 'category';
}
// This module will require the main script file since composer needs to be loaded
EB::init('site');
// Ensure that all script are loaded in the site.
EB::init('module');
// Attach modules stylesheet
EB::stylesheet('module')->attach();
// Get a list of subscribers
$model = EB::model('Subscription');
$subscribers = $model->getSubscribers($type, $id);
// Determines if the current user is subscribed
$subscribed = false;
$my = JFactory::getuser();
// Compile the return url
$return = base64_encode(JRequest::getUri());
if (!$my->guest) {
    $subscription = EB::table('Subscriptions');
    $exists = $subscription->load(array('uid' => $id, 'utype' => $type, 'user_id' => $my->id));
    if ($exists) {
        $subscribed = $subscription->id;
    }
}
require JModuleHelper::getLayoutPath('mod_easyblogsubscribers');
 * @copyright  Copyright (C) 2008 - 2014 Yves Hoppe - compojoom.com . All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die('Restricted access');
$mainconfig = JFactory::getConfig();
$filename = $this->events[0]->title;
//var_dump($this->events);
if (count($this->events) > 1) {
    $filename = $mainconfig->get('sitename') . " - Events";
}
$icsdata = "BEGIN:VCALENDAR\n";
$icsdata .= "VERSION:2.0\n";
$icsdata .= "PRODID:" . MatukioHelperUtilsBasic::getSitePath() . "\n";
$icsdata .= "METHOD:PUBLISH\n";
foreach ($this->events as $event) {
    $user = JFactory::getuser($event->publisher);
    $icsdata .= "BEGIN:VEVENT\n";
    $icsdata .= "UID:" . MatukioHelperUtilsBooking::getBookingId($event->id) . "\n";
    $icsdata .= "ORGANIZER;CN=\"" . $user->name . "\":MAILTO:" . $user->email . "\n";
    $icsdata .= "SUMMARY:" . JText::_($event->title) . "\n";
    if ($event->webinar == 1) {
        $location = JText::_("COM_MATUKIO_WEBINAR");
    } elseif ($event->place_id != 0) {
        $locobj = MatukioHelperUtilsEvents::getLocation($event->place_id);
        $location = $locobj->location;
    } else {
        $location = $event->place;
    }
    $icsdata .= "LOCATION:" . str_replace("(\r\n|\n|\r)", ", ", $location) . "\n";
    $icsdata .= "DESCRIPTION:" . str_replace("(\r\n|\n|\r)", " ", $event->shortdesc) . "\n";
    $icsdata .= "CLASS:PUBLIC\n";
 /**
  * Integrates into the Joomla search
  *
  * @param   string  $text      - The search text
  * @param   string  $phrase    - The search phrase
  * @param   string  $ordering  - The ordering of the results
  * @param   object  $areas     - The Areas
  *
  * @return array
  */
 public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     if (is_array($areas)) {
         if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) {
             return array();
         }
     }
     // No search text
     $text = trim($text);
     if ($text == "") {
         return array();
     }
     // Vorbereitungen
     $database = JFactory::getDBO();
     $my = JFactory::getuser();
     $app = JFactory::getApplication();
     $offset = $app->getCfg('offset');
     if (MatukioHelperSettings::getSettings('date_format_summertime', 1) > 0) {
         $jahr = date("Y");
         $sombeginn = mktime(2, 0, 0, 3, 31 - date('w', mktime(2, 0, 0, 3, 31, $jahr)), $jahr);
         $somende = mktime(2, 0, 0, 10, 31 - date('w', mktime(2, 0, 0, 10, 31, $jahr)), $jahr);
         $aktuell = time();
         if ($aktuell > $sombeginn and $aktuell < $somende) {
             $offset++;
         }
     }
     $date = JFactory::getDate();
     // Offset? $date->setOffset($offset);
     $neudatum = $date->toSql();
     // Find corresponding Matukio joomla entry
     $database->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_matukio&view=eventlist'");
     $tempitemid = $database->loadResult();
     $slimit = $this->params->get('search_limit', 50);
     $sname = $this->params->get('search_name', 'Matukio');
     // Check category ACL rights
     $groups = implode(',', $my->getAuthorisedViewLevels());
     // TODO Cleanup ..
     $query = $database->getQuery(true);
     $query->select("id, access")->from("#__categories")->where(array("extension = " . $database->quote("com_matukio"), "published = 1", "access in (" . $groups . ")"));
     $database->setQuery($query);
     $cats = $database->loadObjectList();
     // Filter search for allowed categories
     $allowedcat = array();
     foreach ((array) $cats as $cat) {
         $allowedcat[] = $cat->id;
     }
     if (!empty($allowedcat)) {
         $where[] = "a.catid IN (" . implode(',', $allowedcat) . ")";
     }
     $where[] = "r.published = '1'";
     $where[] = "a.pattern = ''";
     switch (MatukioHelperSettings::getSettings('event_stopshowing', 2)) {
         case "0":
             $showend = "r.begin";
             break;
         case "1":
             $showend = "r.booked";
             break;
         case "3":
             $showend = "";
             break;
         default:
             $showend = "r.end";
             break;
     }
     $where[] = "{$showend} > '{$neudatum}'";
     // Sortierung festlegen
     $order = '';
     switch ($ordering) {
         case 'newest':
             $order = ' ORDER BY r.id DESC';
             break;
         case 'oldest':
             $order = ' ORDER BY r.id';
             break;
         case 'popular':
             $order = ' ORDER BY r.hits';
             break;
         case 'alpha':
             $order = ' ORDER BY title';
             break;
         case 'category':
             $order = ' ORDER BY category';
             break;
     }
     switch ($phrase) {
         case 'exact':
             $text = preg_replace('/\\s/', ' ', trim($text));
             $suche = "\nAND (r.semnum LIKE '%" . $text . "%' OR a.gmaploc LIKE '%" . $text . "%' OR a.target LIKE '%" . $text . "%' OR a.place LIKE '%" . $text . "%' OR a.teacher LIKE '%" . $text . "%' OR a.title LIKE '%" . $text . "%' OR a.shortdesc LIKE '%" . $text . "%' OR a.description LIKE '%" . $text . "%')";
             break;
         case 'all':
         case 'any':
         default:
             $text = preg_replace('/\\s\\s+/', ' ', trim($text));
             $words = explode(' ', $text);
             $suche = array();
             foreach ($words as $word) {
                 $word = $database->Quote('%' . $database->getEscaped($word, true) . '%', false);
                 $suche2 = array();
                 $suche2[] = "a.semnum LIKE {$word}";
                 $suche2[] = "a.gmaploc LIKE {$word}";
                 $suche2[] = "a.target LIKE {$word}";
                 $suche2[] = "a.place LIKE {$word}";
                 $suche2[] = "a.teacher LIKE {$word}";
                 $suche2[] = "a.title LIKE {$word}";
                 $suche2[] = "a.shortdesc LIKE {$word}";
                 $suche2[] = "a.description LIKE {$word}";
                 $suche3[] = implode(' OR ', $suche2);
             }
             $suche = "\nAND (" . implode($phrase == 'all' ? ') AND (' : ') OR (', $suche3) . ")";
             break;
     }
     // Rueckgabe des Suchergebnisses
     $database->setQuery("SELECT a.*, r.*," . " a.title AS title," . " r.begin AS begin," . " a.publishdate AS created," . " a.shortdesc AS text," . " CONCAT('index.php?option=com_matukio&Itemid=" . $tempitemid . "&view=event&id=', r.id) AS href," . " '2' AS browsernav," . " '" . $sname . "' AS section," . " cat.title AS category" . " FROM #__matukio_recurring AS r" . " LEFT JOIN #__matukio AS a ON r.event_id = a.id" . " LEFT JOIN #__categories AS cat ON a.catid = cat.id" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . $suche . $order . " LIMIT 0, " . $slimit);
     $rows = $database->loadObjectList();
     for ($i = 0; $i < count($rows); $i++) {
         $date = JFactory::getDate($rows[$i]->begin);
         $rows[$i]->section = $rows[$i]->section . " - " . JHTML::_('date', $date, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
         $rows[$i]->Itemid = $tempitemid;
     }
     return $rows;
 }
Example #26
0
 function _buildContentWhere($store_id = 0, $customer_id = 0)
 {
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $option = $jinput->get('option');
     $layout = $jinput->get('layout');
     $db = JFactory::getDBO();
     $filter_search = $mainframe->getUserStateFromRequest($option . 'filter.search', 'filter_search', '', 'string');
     $filter_state = $mainframe->getUserStateFromRequest($option . 'search_list', 'search_list', '', 'string');
     $search = $mainframe->getUserStateFromRequest($option . 'search_select', 'search_select', '', 'string');
     //For Filter Based on Gateway
     $search_gateway = '';
     $search_gateway = $mainframe->getUserStateFromRequest($option . 'search_gateway', 'search_gateway', '', 'string');
     $search_gateway = JString::strtolower($search_gateway);
     //For Filter Based on Gateway
     $where = array();
     if ($mainframe->getName() == 'site') {
         $user = JFactory::getuser();
         if (!empty($store_id)) {
             $order_ids = $this->getOrderIds($store_id, 1);
             $order_ids = !empty($order_ids) ? $order_ids : 0;
             $where[] = "i.id IN ( " . $order_ids . ")";
         } elseif (!empty($customer_id)) {
             if (is_numeric($customer_id)) {
                 $where[] = "i.payee_id = " . $customer_id;
             } else {
                 $where[] = "i.email LIKE '" . $customer_id . "'";
             }
         } else {
             $where[] = "i.payee_id = " . $user->id;
         }
     }
     // My orders
     if ($layout == 'default') {
         $subQuery = "SELECT DISTINCT oi.`order_id` FROM `#__kart_order_item` AS oi";
         if (!empty($search) && $search != -1) {
             $subQuery .= ' LEFT JOIN `#__kart_orders` AS o ON o.id = oi.order_id';
             $subQuery .= ' WHERE o.user_info_id = ' . $user->id . ' AND oi.status = ' . $this->_db->Quote($search);
             $db->setQuery($subQuery);
             $ids = $db->loadColumn();
             if ($ids) {
                 $ids = implode(',', $ids);
                 $where[] = " i.`id` IN (" . $ids . ")";
             } else {
                 $where[] = " i.`id` IN (0)";
             }
         }
     }
     /*
     		if ($search_gateway)
     		{
     		$where[] = " (i.processor LIKE '".$search_gateway."')";
     		}*/
     if ($layout == 'mycustomer') {
         if ($filter_state) {
             $where[] = " UPPER( CONCAT( i.prefix, i.id )) LIKE UPPER('%" . trim($filter_state) . "%')";
         }
     }
     if ($filter_search) {
         $where[] = "i.email LIKE '%" . $filter_search . "%'" . "\n\t\t\tOR i.id LIKE '%" . $filter_search . "%'" . "\n\t\t\tOR i.prefix LIKE '%" . $filter_search . "%'" . "\n\t\t\tOR u.name LIKE '%" . $filter_search . "%'" . "\n\t\t\tOR u.username LIKE '%" . $filter_search . "%'";
     }
     return $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
 }
Example #27
0
 /**
  * Load EasyBlog's ACL
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public static function acl($userId = '')
 {
     static $acl = array();
     if (!$userId) {
         $userId = JFactory::getuser()->id;
     }
     if (!isset($acl[$userId])) {
         require_once dirname(__FILE__) . '/acl/acl.php';
         $acl[$userId] = EasyBlogAcl::getRuleSet($userId);
     }
     return $acl[$userId];
 }
 /**
  * Displays the form
  *
  * @param   string  $tpl  - The tmpl
  *
  * @return  mixed|object
  */
 public function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = JFactory::getApplication()->input->get('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     // Hardcode in Dirk's matukio-mvc.php task
     $art = JFactory::getApplication()->input->getInt('art', 0);
     $order_by = $params->get("orderby", "a.begin");
     $database = JFactory::getDBO();
     $dateid = JFactory::getApplication()->input->getInt('dateid', 1);
     $catid = JFactory::getApplication()->input->getInt('catid', 0);
     $uuid = JFactory::getApplication()->input->get('uuid', '', 'string');
     if (empty($catid)) {
         $catid = $params->get('startcat', 0);
     }
     $search = JFactory::getApplication()->input->get('search', '', 'string');
     $search = str_replace("'", "", $search);
     $search = str_replace("\"", "", $search);
     $limit = JFactory::getApplication()->input->getInt('limit', MatukioHelperSettings::getSettings('event_showanzahl', 10));
     $limitstart = JFactory::getApplication()->input->getInt('limitstart', 0);
     $my = JFactory::getuser();
     $groups = implode(',', $my->getAuthorisedViewLevels());
     if ($art == 1) {
         if ($my->id == 0 && empty($uuid)) {
             JError::raiseError("403", JTEXT::_('COM_MATUKIO_NOT_LOGGED_IN'));
         }
     }
     // Check if user is logged in and allowed to edit his OWN events
     if ($art == 2) {
         if (!JFactory::getUser()->authorise('core.edit.own', 'com_matukio')) {
             return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         }
     }
     switch ($art) {
         default:
         case "0":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavshowmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "1":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavbookingmodules', 'SEM_NUMBER SEM_SEARCH SEM_TYPES SEM_RESET'));
             break;
         case "2":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavoffermodules', 'SEM_NUMBER SEM_SEARCH SEM_TYPES SEM_RESET'));
             break;
     }
     // Old event form
     if ($this->getLayout() != "modern" || $my->id == 0) {
         $ret = MatukioHelperUtilsEvents::getEventList($art, $search, $dateid, $catid, $order_by, $my, $navioben, $limitstart, $limit, "old");
         $events = $ret[0];
         $total = $ret[1];
         switch ($art) {
             case "0":
                 $anztyp = array(JTEXT::_('COM_MATUKIO_EVENTS'), 0);
                 break;
             case "1":
                 // Show booked events
                 $anztyp = array(JTEXT::_('COM_MATUKIO_MY_BOOKINGS'), 1);
                 break;
             case "2":
                 // Show offered events
                 $anztyp = array(JTEXT::_('COM_MATUKIO_MY_OFFERS'), 2);
                 break;
         }
         $pageNav = MatukioHelperUtilsEvents::cleanSiteNavigation($total, $limit, $limitstart);
         $this->rows = $events;
         $this->pageNav = $pageNav;
     }
     // Modern Layout - merge that someday :/
     if ($this->getLayout() == "modern") {
         // Tabs
         if ($my->id > 0) {
             // Just set it to the default
             $anztyp = array(JTEXT::_('COM_MATUKIO_EVENTS'), 0);
             // Normal events view
             $ret = MatukioHelperUtilsEvents::getEventList(0, $search, $dateid, $catid, $order_by, $my, $navioben, $limitstart, $limit, "modern");
             $allEvents = $ret[0];
             $total = $ret[1];
             $this->pageNavAllEvents = MatukioHelperUtilsEvents::cleanSiteNavigation($total, $limit, $limitstart);
             $this->allEvents = $allEvents;
             // My Bookings
             $bookedEvents = MatukioHelperUtilsEvents::getEventList(1, $search, $dateid, $catid, $order_by, $my, $navioben, 0, 1000, "modern");
             $this->mybookedEvents = $bookedEvents[0];
             // My offers
             if (JFactory::getUser()->authorise('core.edit.own', 'com_matukio')) {
                 $editEvents = MatukioHelperUtilsEvents::getEventList(2, $search, $dateid, $catid, $order_by, $my, $navioben, 0, 1000, "modern");
                 $this->myofferEvents = $editEvents[0];
             }
         } else {
             // Not logged in user - we can take rows from above
             $this->allEvents = $events;
             $this->pageNavAllEvents = $pageNav;
         }
     }
     // Kursauswahl erstellen
     $allekurse = array();
     $allekurse[] = JHTML::_('select.option', '0', JTEXT::_('COM_MATUKIO_ALL_EVENTS'));
     $allekurse[] = JHTML::_('select.option', '1', JTEXT::_('COM_MATUKIO_CURRENT_EVENTS'));
     $allekurse[] = JHTML::_('select.option', '2', JTEXT::_('COM_MATUKIO_OLD_EVENTS'));
     $selectclass = $this->getLayout() == "modern" ? "mat_inputbox" : "sem_inputbox22";
     $datelist = JHTML::_('select.genericlist', $allekurse, "dateid", "class=\"" . $selectclass . " chzn-single\" size=\"1\"\r\n                onchange=\"changeStatus();\"", "value", "text", $dateid);
     $categories[] = JHTML::_('select.option', '0', JTEXT::_('COM_MATUKIO_ALL_CATS'));
     $database->setQuery("SELECT id AS value, title AS text FROM #__categories WHERE extension='" . JFactory::getApplication()->input->get('option') . "' AND access in (" . $groups . ") AND published = 1 ORDER BY lft");
     $categs = array_merge($categories, (array) $database->loadObjectList());
     $clist = JHTML::_('select.genericlist', $categs, "catid", "class=\"" . $selectclass . " chzn-single\" size=\"1\"\r\n                onchange=\"changeCategoryEventlist();\" style=\"width: 180px;\"", "value", "text", $catid);
     $listen = array($datelist, $dateid, $clist, $catid);
     // Navigationspfad erweitern
     MatukioHelperUtilsBasic::expandPathway($anztyp[0], JRoute::_("index.php?option=com_matukio&view=eventlist"));
     $ue_title = $params->get('title', 'COM_MATUKIO_EVENTS_OVERVIEW');
     $this->art = $art;
     $this->search = $search;
     $this->limit = $limit;
     $this->limitstart = $limitstart;
     $this->total = $total;
     $this->datelist = $datelist;
     $this->dateid = $dateid;
     $this->clist = $clist;
     $this->catid = $catid;
     $this->title = $ue_title;
     $this->order_by = $order_by;
     parent::display($tpl);
 }
Example #29
0
 * @package    Matukio
 * @author     Yves Hoppe <yves@compojoom.com>
 * @date       11.11.13
 *
 * @copyright  Copyright (C) 2008 - 2013 Yves Hoppe - compojoom.com . All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
/**
 * art 0 = display normal event list (not logged in user)
 * art 1 = my Bookings
 * art 2 = my Offers
 */
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
$database = JFactory::getDBO();
$user = JFactory::getuser();
$current_date = MatukioHelperUtilsDate::getCurrentDate();
$confusers = JComponentHelper::getParams('com_users');
JHTML::_('stylesheet', 'media/com_matukio/css/matukio.css');
JHTML::_('stylesheet', 'media/com_matukio/css/modern.css');
JHTML::_('script', 'media/com_matukio/js/matukio.js');
JHTML::_('stylesheet', 'media/com_matukio/css/strapper.css');
if (JVERSION > 3) {
    JHTML::_('bootstrap.tooltip');
    JHtml::_('formbehavior.chosen', 'select');
    JHTML::_('behavior.modal');
} else {
    JHTML::_('behavior.tooltip');
    JHTML::_('behavior.modal');
}
JHTML::_('behavior.multiselect');
Example #30
0
 /**
  * Retrieves the alias for this author
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getAlias()
 {
     static $permalinks = array();
     if (!isset($permalinks[$this->id])) {
         $config = EB::config();
         if (!$this->user && $this->id) {
             $this->user = JFactory::getuser($this->id);
         }
         // If the username is invalid
         if (!$this->user->username) {
             return JText::_('COM_EASYBLOG_INVALID_PERMALINK_BLOGGER');
         }
         // If user doesn't have a permalink, generate it for them
         if (!$this->permalink) {
             $this->permalink = EBR::normalizePermalink($this->user->username);
             $this->store();
         }
         $permalink = $this->permalink;
         if ($config->get('main_sef_unicode') || !EBR::isSefEnabled()) {
             $permalink = $this->id . '-' . $this->permalink;
         }
         $permalinks[$this->id] = $permalink;
     }
     return $permalinks[$this->id];
 }