Example #1
0
 /**
  * Method to validate the form data.
  * Each field error is stored in session and can be retrieved with getFieldError().
  * Once getFieldError() is called, the error is deleted from the session.
  *
  * @param   JForm   $form   The form to validate against.
  * @param   array   $data   The data to validate.
  * @param   string  $group  The name of the field group to validate.
  *
  * @return  mixed  Array of filtered data if valid, false otherwise.
  */
 public function validate($form, $data, $group = null)
 {
     if (!isset($data['project_id'])) {
         $data['project_id'] = TrackslibHelperTools::getCurrentProjectId();
     }
     return parent::validate($form, $data, $group);
 }
Example #2
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return  object  Query object
  */
 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', array('obj.*', 'i.last_name, i.first_name', 't.name AS team')));
     $query->from($db->qn('#__tracks_participants', 'obj'));
     $query->join('INNER', $db->qn('#__tracks_individuals', 'i') . ' ON ' . $db->qn('obj.individual_id') . ' = ' . $db->qn('i.id'));
     $query->join('LEFT', $db->qn('#__tracks_teams', 't') . ' ON ' . $db->qn('obj.team_id') . ' = ' . $db->qn('t.id'));
     $query->where($db->qn('obj.project_id') . ' = ' . TrackslibHelperTools::getCurrentProjectId());
     // Filter: like / search
     $search = $this->getState('filter.search', '');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('obj.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->Quote('%' . $db->escape($search, true) . '%');
             $query->where('CONCAT(i.last_name, i.first_name) LIKE ' . $search);
         }
     }
     // Add the list ordering clause.
     $query->order($db->escape($this->getState('list.ordering', 'i.last_name')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
     return $query;
 }
Example #3
0
 /**
  * return items to display
  *
  * @param   int  $team_id  team id
  *
  * @return object team
  */
 public function getTeamLinks($team_id)
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('*');
     $query->from('#__tracks_teams');
     $query->where('id = ' . (int) $team_id);
     $db->setQuery($query);
     $res = $db->loadObject();
     $links = TrackslibHelperTools::getTeamSocialItems($res);
     return $links;
 }
Example #4
0
        echo JText::_('COM_TRACKS_Rankings');
        ?>
						</a>
					</td>
					<td>
						<a href="<?php 
        echo $link_teams_ranking;
        ?>
"
						   title="<?php 
        echo JText::_('COM_TRACKS_Team_Rankings');
        ?>
">
							<?php 
        echo JText::_('COM_TRACKS_Team_Rankings');
        ?>
						</a>
					</td>
				</tr>
			<?php 
    }
}
?>
	</table>
	<p class="copyright">
		<?php 
echo TrackslibHelperTools::footer();
?>
	</p>
</div>
Example #5
0
 protected function populateState($ordering = 'ordering', $direction = 'asc')
 {
     $this->setState('project_id', TrackslibHelperTools::getCurrentProjectId());
     parent::populateState($ordering, $direction);
 }
Example #6
0
        echo $this->escape(addslashes($row->name));
        ?>
');">
							<?php 
        echo $itemTitle;
        ?>
						</a>
					</td>
					<td>
						<?php 
        echo $row->project;
        ?>
					</td>
					<td>
						<?php 
        echo $row->start_date ? TrackslibHelperTools::formatRoundStartEnd($row) : '';
        ?>
					</td>
					<td>
						<?php 
        echo $row->id;
        ?>
					</td>
				</tr>
			<?php 
    }
    ?>
			</tbody>
		</table>
		<?php 
    echo $this->pagination->getPaginationLinks(null, array('showLimitBox' => false));
Example #7
0
 /**
  * Get project id
  *
  * @return mixed
  */
 protected function getProjectId()
 {
     if (!$this->project_id) {
         $this->project_id = TrackslibHelperTools::getCurrentProjectId();
     }
     return $this->project_id;
 }
Example #8
0
							<?php 
            echo $itemTitle;
            ?>
						<?php 
        } else {
            ?>
							<?php 
            echo JHtml::_('link', 'index.php?option=com_tracks&task=event.edit&id=' . $row->id . '&projectround_id=' . $row->projectround_id, $itemTitle);
            ?>
						<?php 
        }
        ?>
					</td>
					<td>
						<?php 
        echo TrackslibHelperTools::isValidDate($row->start_date) ? TrackslibHelperTools::formatDate($row->start_date, 'j F Y H:i') : '';
        ?>
					</td>
					<td>
						<?php 
        echo JHtml::link($editResultsLink, JText::_('COM_TRACKS_RESULTS'));
        ?>
					</td>
					<td>
						<?php 
        echo $row->id;
        ?>
					</td>
				</tr>
			<?php 
    }
Example #9
0
<?php

/**
* @version    $Id: default.php 101 2008-05-22 08:32:12Z julienv $
* @package    JoomlaTracks
* @copyright  Copyright (C) 2008 Julien Vonthron. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* Joomla Tracks is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$socials = TrackslibHelperTools::getTeamSocialItems($this->data);
if (count($socials)) {
    ?>
<div class="team-social">
	<h3><?php 
    echo JTExt::_('COM_TRACKS_TEAM_SOCIAL_LINKS');
    ?>
</h3>
	<ul>
		<?php 
    foreach ($socials as $name => $s) {
        ?>


			<li class="ts-<?php 
        echo $name;
Example #10
0
            ?>
      <?php 
            if ($this->params->get('indview_results_showrank', 1)) {
                ?>
      <td><?php 
                echo $result->rank;
                ?>
</td>
      <?php 
            }
            ?>
      <?php 
            if ($this->params->get('indview_results_points', 1)) {
                ?>
      <td><?php 
                echo TrackslibHelperTools::getSubroundPoints($result);
                ?>
</td>
      <?php 
            }
            ?>
    </tr>
    <?php 
        }
        ?>
  </tbody>
</table>
<?php 
    }
} else {
    ?>