/** * Generates a list of RSS feed items. * * @return void */ function display() { $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $params = $app->getParams(); $doc->link = htmlspecialchars(JFactory::getURI()->toString()); $feed_email = $app->getCfg('feed_email') == '' ? 'site' : $app->getCfg('feed_email'); $site_email = $app->getCfg('mailfrom'); // Set the query limit to the feed setting JRequest::setVar('limit', (int) $app->getCfg('feed_limit', 20)); // Get model data $rows = $this->get('Items'); foreach ($rows as $row) { // Load individual item creator class $item = new JFeedItem(); $item->title = html_entity_decode($this->escape($row->title), ENT_COMPAT, 'UTF-8'); $item->link = JRoute::_(PFprojectsHelperRoute::getDashboardRoute($row->slug)); $item->description = $row->description; $item->date = $row->created ? date('r', strtotime($row->created)) : ''; $item->author = $row->author_name; $item->authorEmail = $feed_email == 'site' ? $site_email : $row->author_email; // Categorize the item if (!empty($row->category_title)) { $item->category = array(html_entity_decode($this->escape($row->category_title), ENT_COMPAT, 'UTF-8')); } // Loads item info into the RSS array $doc->addItem($item); } }
/** * Returns a list of buttons for the frontend * * @return array */ public static function getSiteButtons() { $user = JFactory::getUser(); $buttons = array(); if ($user->authorise('core.create', 'com_pfprojects')) { $buttons[] = array('title' => 'MOD_PF_DASH_BUTTONS_ADD_PROJECT', 'link' => PFprojectsHelperRoute::getProjectsRoute() . '&task=form.add', 'icon' => JHtml::image('com_projectfork/projectfork/header/icon-48-projectform.add.png', JText::_('MOD_PF_DASH_BUTTONS_ADD_PROJECT'), null, true)); } return $buttons; }
protected function getTitleLink() { if ($this->client_id) { $link = 'index.php?option=' . $this->item->extension . '&task=' . $this->item->name . '.edit' . '&id=' . (int) $this->item->item_id; } else { $item_slug = $this->item->item_id . ':' . $this->item->metadata->get('alias'); $link = PFprojectsHelperRoute::getDashboardRoute($item_slug); } return JRoute::_($link); }
/** * Method to generate the email message * * @param object $lang Instance of the default user language * @param object $receiveer Instance of the the receiving user * @param object $user Instance of the user who made the change * @param object $after Instance of the item table after it was updated * @param object $before Instance of the item table before it was updated * @param boolean $is_new True if the item is new ($before will be null) * * @return string */ public static function getCommentMessage($lang, $receiver, $user, $after, $before, $is_new) { if (!$is_new) { return false; } list($component, $item) = explode('.', $after->context, 2); $txt_prefix = self::$prefix . '_' . ($is_new ? 'NEW' : 'UPD'); $class_name = 'PF' . str_replace('com_pf', '', $component) . 'NotificationsHelper'; $value = null; if (class_exists($class_name)) { if (in_array('getItemName', get_class_methods($class_name))) { $item = call_user_func(array($class_name, 'getItemName'), $after->context); } } switch ($item) { case 'project': $link = PFprojectsHelperRoute::getDashboardRoute($after->project_id); break; default: $class_name = 'PF' . str_replace('com_pf', '', $component) . 'HelperRoute'; $method = 'get' . ucfirst($item) . 'Route'; $link = ''; if (file_exists(JPATH_SITE . '/components/' . $component . '/helpers/route.php')) { JLoader::register($class_name, JPATH_SITE . '/components/' . $component . '/helpers/route.php'); } if (class_exists($class_name)) { if (in_array($method, get_class_methods($class_name))) { $link = call_user_func_array(array($class_name, $method), array($after->item_id, $after->project_id)); } } break; } $format = $lang->_($txt_prefix . '_MESSAGE'); $footer = sprintf($lang->_('COM_PROJECTFORK_EMAIL_FOOTER'), JURI::root()); $link = JRoute::_(JURI::root() . $link); $txt = sprintf($format, $receiver->name, $user->name, strip_tags($after->description), $link); $txt = str_replace('\\n', "\n", $txt . "\n\n" . $footer); return $txt; }
/** * Method to generate the frontend input markup. * * @param string $title The title of the current value * * @return array $html The html field markup */ protected function getSiteHTML($title) { $html = array(); $isJ3 = version_compare(JVERSION, '3.0.0', 'ge'); if (JFactory::getApplication()->isSite()) { $link = PFprojectsHelperRoute::getProjectsRoute() . '&layout=modal&tmpl=component' . '&function=pfSelectProject_' . $this->id; } else { $link = 'index.php?option=com_pfprojects&view=projects' . '&layout=modal&tmpl=component' . '&function=pfSelectProject_' . $this->id; } // Initialize some field attributes. $attr = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; if ($isJ3) { $html[] = '<div class="input-append">'; } // Create a dummy text field with the project title. $html[] = '<input type="text" id="' . $this->id . '_name" value="' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '" disabled="disabled"' . $attr . ' />'; // Create the project select button. if ($this->element['readonly'] != 'true') { $html[] = '<a class="modal_' . $this->id . ' btn" title="' . JText::_('COM_PROJECTFORK_SELECT_PROJECT') . '"' . ' href="' . JRoute::_($link) . '" rel="{handler: \'iframe\', size: {x: 800, y: 500}}">'; $html[] = JText::_('COM_PROJECTFORK_SELECT_PROJECT') . '</a>'; } if ($isJ3) { $html[] = '</div>'; } // Create the hidden field, that stores the id. $html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />'; return $html; }
<?php echo $item->event->beforeDisplayContent; ?> <div class="item-description"> <dl class="article-info dl-horizontal pull-right"> <dt class="project-title"> <?php echo JText::_('JGRID_HEADING_PROJECT'); ?> : </dt> <dd class="project-data"> <a href="<?php echo JRoute::_(PFprojectsHelperRoute::getDashboardRoute($item->project_slug)); ?> "><?php echo $item->project_title; ?> </a> </dd> <?php if ($item->milestone_id) { ?> <dt class="milestone-title"> <?php echo JText::_('JGRID_HEADING_MILESTONE'); ?> : </dt>
<?php if ($params->get('show_page_heading', 1)) { ?> <h1><?php echo $this->escape($params->get('page_heading')); ?> </h1> <?php } ?> <div class="cat-items"> <form id="adminForm" name="adminForm" method="post" action="<?php echo JRoute::_(PFprojectsHelperRoute::getDashboardRoute($state->get('filter.project'))); ?> "> <?php if ($state->get('filter.project') && !empty($item)) { ?> <div class="btn-group pull-right"> <a data-toggle="collapse" data-target="#project-details" class="btn<?php echo $details_active; ?> "> <?php echo JText::_('COM_PROJECTFORK_DETAILS_LABEL'); ?> <span class="caret"></span>
// Find the project repo base dir if ($pid) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('attribs')->from('#__pf_projects')->where('id = ' . $db->quote($pid)); $db->setQuery($query); $project_attribs = $db->loadResult(); $project_params = new JRegistry(); $project_params->loadString($project_attribs); $repo_dir = (int) $project_params->get('repo_dir'); } else { $repo_dir = 1; } // Prepare component base links $link_tasks = class_exists('PFtasksHelperRoute') ? PFtasksHelperRoute::getTasksRoute() : 'index.php?option=com_pftasks'; $link_projects = class_exists('PFprojectsHelperRoute') ? PFprojectsHelperRoute::getProjectsRoute() : 'index.php?option=com_pfprojects'; $link_time = class_exists('PFtimeHelperRoute') ? PFtimeHelperRoute::getTimesheetRoute() : 'index.php?option=com_pftime'; $link_ms = class_exists('PFmilestonesHelperRoute') ? PFmilestonesHelperRoute::getMilestonesRoute() : 'index.php?option=com_pfmilestones'; $link_forum = class_exists('PFforumHelperRoute') ? PFforumHelperRoute::getTopicsRoute() : 'index.php?option=com_pfforum'; $link_repo = class_exists('PFrepoHelperRoute') ? PFrepoHelperRoute::getRepositoryRoute($pid, $repo_dir) : 'index.php?option=com_pfrepo&filter_project=' . $pid . '&parent_id=' . $repo_dir; // Logout link return $return = base64_encode($this->baseurl); ?> <!DOCTYPE html> <html> <head> <jdoc:include type="head" /> <?php // Detecting Home $site_app = JFactory::getApplication('Site'); $menu = $site_app->getMenu();
/** * Method to generate the email message * * @param object $lang Instance of the default user language * @param object $receiveer Instance of the the receiving user * @param object $user Instance of the user who made the change * @param object $after Instance of the item table after it was updated * @param object $before Instance of the item table before it was updated * @param boolean $is_new True if the item is new ($before will be null) * * @return string */ public static function getAttachmentMessage($lang, $receiver, $user, $after, $before, $is_new) { if (!$is_new) { return false; } list($component, $item) = explode('.', $after->item_type, 2); $txt_prefix = self::$prefix . '_' . ($is_new ? 'NEW' : 'UPD'); $class_name = 'PF' . str_replace('com_pf', '', $component) . 'NotificationsHelper'; $value = null; if (class_exists($class_name)) { $methods = get_class_methods($class_name); if (in_array('getItemName', $methods)) { $item = call_user_func(array($class_name, 'getItemName'), $after->context); } if (in_array('translateItem', $methods)) { $value = call_user_func_array(array($class_name, 'translateItem'), array($after->item_type, $after->item_id)); } } if (!$value) { $value = PFnotificationsHelper::translateValue($item . '_id', $after->item_id); } switch ($item) { case 'project': $link = PFprojectsHelperRoute::getDashboardRoute($after->project_id); break; default: $class_name = 'PF' . str_replace('com_pf', '', $component) . 'HelperRoute'; $method = 'get' . ucfirst($item) . 'Route'; $link = ''; if (class_exists($class_name)) { if (in_array($method, get_class_methods($class_name))) { $link = call_user_func_array(array($class_name, $method), array($after->item_id, $after->project_id)); } } break; } $format = $lang->_($txt_prefix . '_MESSAGE'); $footer = sprintf($lang->_('COM_PROJECTFORK_EMAIL_FOOTER'), JURI::root()); $link = JRoute::_(JURI::root() . $link); $txt = sprintf($format, $receiver->name, $user->name, $value, $link); $txt = str_replace('\\n', "\n", $txt . "\n\n" . $footer); return $txt; }
/** * Method to get a list of projects to render in the gantt chart * * @return array $items The items to render */ protected static function getItemsOverview() { $data = modPFganttHelperProjects::getItems(); $user = JFactory::getUser(); $config = JFactory::getConfig(); $params = self::$params; $items = array(); $highlight = (int) $params->get('highlight_today'); $date_now = new JDate('now', 'UTC'); $date_now->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); $today = $date_now->toUnix() * 1000; foreach ($data as $i => $record) { $link = JRoute::_(PFprojectsHelperRoute::getDashboardRoute($record->id . ':' . $record->alias)); $name = '<i class="icon-star' . ($record->complete ? '' : '-empty') . '"></i> ' . '<a href="' . $link . '">' . ucfirst(htmlspecialchars($record->title)) . '</a>'; // Create row object $row = new stdClass(); $row->name = $name; $row->desc = self::formatDuration($record->duration, $record->start_time, $record->end_time, $record->complete); $row->values = array(); // Create row item object $item = new stdClass(); $item->label = ucfirst(htmlspecialchars($record->title)); $item->desc = ''; $item->from = '/Date(' . $record->start_year . ', ' . ($record->start_month - 1) . ', ' . $record->start_day . ')/'; $item->to = '/Date(' . $record->end_year . ', ' . ($record->end_month - 1) . ', ' . $record->end_day . ')/'; // Determine custom class $item->customClass = 'gantt-p'; $item->id = 'gantt-p-' . $record->id; if ($record->complete) { $item->customClass .= '-complete'; } elseif ($record->start_time > self::$time_today) { $item->customClass .= '-notstarted'; } elseif ($record->end_time < self::$time_today) { $item->customClass .= '-behind'; } // Highlight today? if ($highlight) { $hl = new stdClass(); $hl->label = ''; $hl->desc = ''; $hl->from = '/Date(' . intval($date_now->format('Y', true, false)) . ', ' . intval($date_now->format('m', true, false) - 1) . ', ' . intval($date_now->format('d', true, false)) . ')/'; $hl->to = '/Date(' . intval($date_now->format('Y', true, false)) . ', ' . intval($date_now->format('m', true, false) - 1) . ', ' . intval($date_now->format('d', true, false)) . ')/'; $hl->customClass = 'gantt-today'; $row->values[] = $hl; } $row->values[] = $item; $items[] = $row; } return $items; }
/** * Method to get a json encoded list of projects to render in the calendar * * @return array $items The items to render */ protected static function getItemsOverview() { $params = self::$params; $data = modPFcalendarHelperProjects::getItems(); $db = JFactory::getDbo(); $items = array(); $display = (int) $params->get('project_display', 0); $truncate = (int) $params->get('truncate', 0); foreach ($data as $i => $record) { $title = ucfirst(htmlspecialchars($record->title, ENT_COMPAT, 'UTF-8')); $title2 = str_replace('&', '&', $title); if ($truncate > 0 && strlen($title) > $truncate + 3) { $title = substr($title, 0, $truncate) . '...'; } $item = '{'; $item .= 'title:\'' . $title . '\','; $item .= 'title_alt:\'' . $title2 . '\','; // Display style if ($display == 0) { // Deadline // $item .= 'start:new Date(' . ($record->end_time * 1000) . '),'; $item .= 'start:new Date(' . $record->end_year . ', ' . ($record->end_month - 1) . ', ' . $record->end_day . '),'; $item .= 'ev_type:\'\','; $item .= 'allDay: true,'; } elseif ($display == 1) { // Start and Deadline if ($record->start_time > 0) { $item2 = '{'; $item2 .= 'title:\'' . $title . '\','; $item2 .= 'title_alt:\'' . $title2 . '\','; // $item2 .= 'start:new Date(' . ($record->start_time * 1000) . '),'; $item2 .= 'start:new Date(' . $record->start_year . ', ' . ($record->start_month - 1) . ', ' . $record->start_day . '),'; $item2 .= 'allDay: true,'; $item2 .= 'ev_type:\'start\','; // Color if ($record->complete) { $item2 .= 'color:\'#468847\','; } elseif ($record->end_time < self::$time_today) { $item2 .= 'color:\'#B94A48\','; } $item2 .= 'url:\'' . JRoute::_(PFprojectsHelperRoute::getDashboardRoute($record->id . ':' . $record->alias)) . '\''; $item2 .= '}'; $items[] = $item2; } // $item .= 'start:new Date(' . ($record->end_time * 1000) . '),'; $item .= 'start:new Date(' . $record->end_year . ', ' . ($record->end_month - 1) . ', ' . $record->end_day . '),'; $item .= 'ev_type:\'end\','; $item .= 'allDay: true,'; } elseif ($display == 2) { // Entire span if ($record->start_time > 0) { // $item .= 'start:new Date(' . ($record->start_time * 1000) . '),'; $item .= 'start:new Date(' . $record->start_year . ', ' . ($record->start_month - 1) . ', ' . $record->start_day . '),'; // $item .= 'end:new Date(' . ($record->end_time * 1000) . '),'; $item .= 'end:new Date(' . $record->end_year . ', ' . ($record->end_month - 1) . ', ' . $record->end_day . '),'; $item .= 'ev_type:\'span\','; } else { // $item .= 'start:new Date(' . ($record->end_time * 1000) . '),'; $item .= 'start:new Date(' . $record->end_year . ', ' . ($record->end_month - 1) . ', ' . $record->end_day . '),'; $item .= 'ev_type:\'end\','; $item .= 'allDay: true,'; } } // Color if ($record->complete) { $item .= 'color:\'#468847\','; } elseif ($record->end_time < self::$time_today) { $item .= 'color:\'#B94A48\','; } $item .= 'url:\'' . JRoute::_(PFprojectsHelperRoute::getDashboardRoute($record->id . ':' . $record->alias)) . '\''; $item .= '}'; $items[] = $item; } return '[' . implode(',', $items) . ']'; }
echo $item->params->get('phone'); ?> </dd> <?php } ?> </dl> </div> <div class="span12 hidden-phone"> <div class="btn-toolbar"> <?php if ($can_edit || $can_edit_own) { ?> <div class="btn-group"> <a class="btn btn-mini" href="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectEditRoute($item->slug) . '&return=' . $return_url); ?> "> <span aria-hidden="true" class="icon-pencil"></span> <?php echo JText::_('COM_PROJECTFORK_ACTION_EDIT'); ?> </a> </div> <?php } ?> <?php if ($cmnts_enabled) { ?> <div class="btn-group">
echo $item->params->get('phone'); ?> </dd> <?php } ?> </dl> </div> <div class="span12 hidden-phone"> <div class="btn-toolbar"> <?php if ($can_edit || $can_edit_own) { ?> <div class="btn-group"> <a class="btn btn-mini" href="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectEditRoute($item->slug)); ?> "> <span aria-hidden="true" class="icon-pencil"></span> <?php echo JText::_('COM_PROJECTFORK_ACTION_EDIT'); ?> </a> </div> <?php } ?> <?php if ($cmnts_enabled) { ?> <div class="btn-group">
/** * Get the return URL. * If a "return" variable has been passed in the request * * @return string The return URL. */ protected function getReturnPage() { $return = JRequest::getVar('return', null, 'default', 'base64'); if (empty($return) || !JUri::isInternal(base64_decode($return))) { return JRoute::_(PFprojectsHelperRoute::getProjectsRoute(), false); } else { return base64_decode($return); } }
defined('_JEXEC') or die; $function = JRequest::getCmd('function', 'pfSelectActiveProject'); $list_order = $this->escape($this->state->get('list.ordering')); $list_dir = $this->escape($this->state->get('list.direction')); $user = JFactory::getUser(); $uid = $user->get('id'); ?> <div id="projectfork" class="category-list<?php echo $this->pageclass_sfx; ?> view-projects"> <div class="cat-items"> <form name="adminForm" id="adminForm" action="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectsRoute() . '&layout=modal&tmpl=component&function=' . $function); ?> " method="post"> <fieldset class="filters"> <span class="filter-search"> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?> " /> <button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?> </button> <button type="button" class="btn" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR');
/** * Generates the toolbar for the top of the view * * @return string Toolbar with buttons */ protected function getToolbar() { $id = empty($this->item) || empty($this->item->id) ? null : $this->item->id; $access = PFprojectsHelper::getActions($id); $uid = JFactory::getUser()->get('id'); if (!empty($id)) { $slug = $this->item->id . ':' . $this->item->alias; $return = base64_encode(PFprojectsHelperRoute::getDashboardRoute($slug)); PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFprojectsHelperRoute::getProjectsRoute() . '&task=form.edit&id=' . $slug . '&return=' . $return))); } return PFToolbar::render(); }
<?php if ($this->params->get('show_page_heading', 1)) { ?> <h1><?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php } ?> <div class="clearfix"></div> <div class="grid"> <form name="adminForm" id="adminForm" action="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectsRoute()); ?> " method="post"> <div class="btn-toolbar btn-toolbar-top"> <?php echo $this->toolbar; ?> <a class="btn button" id="print_btn" href="javascript:void(0);" onclick="window.open('<?php echo JRoute::_($print_url); ?> ', 'print', '<?php echo $print_opt; ?> ')"> <?php
/** * Method to generate the email message * * @param object $lang Instance of the default user language * @param object $receiveer Instance of the the receiving user * @param object $user Instance of the user who made the change * @param object $after Instance of the item table after it was updated * @param object $before Instance of the item table before it was updated * @param boolean $is_new True if the item is new ($before will be null) * * @return string */ public static function getProjectMessage($lang, $receiver, $user, $after, $before, $is_new) { $txt_prefix = self::$prefix . '_' . ($is_new ? 'NEW' : 'UPD'); // Get the changed fields $props = array('description', 'catid', 'created_by', 'access', 'start_date', 'end_date'); $changes = array(); if (is_object($before) && is_object($after)) { $changes = PFObjectHelper::getDiff($before, $after, $props); } if (!count($changes)) { return false; } $format = $lang->_($txt_prefix . '_MESSAGE'); $changes = PFnotificationsHelper::formatChanges($lang, $changes); $footer = sprintf($lang->_('COM_PROJECTFORK_EMAIL_FOOTER'), JURI::root()); $link = JRoute::_(JURI::root() . PFprojectsHelperRoute::getDashboardRoute($after->id . ':' . $after->alias)); $txt = sprintf($format, $receiver->name, $user->name, $changes, $link); $txt = str_replace('\\n', "\n", $txt . "\n\n" . $footer); return $txt; }