function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('person', $person);
     $ref =& $model->getReferee();
     if ($ref) {
         $titleStr = JText::sprintf('COM_JOOMLEAGUE_REFEREE_ABOUT_AS_A_REFEREE', JoomleagueHelper::formatName(null, $ref->firstname, $ref->nickname, $ref->lastname, $this->config["name_format"]));
     } else {
         $titleStr = JText::_('Unknown referee within project');
     }
     $this->assignRef('referee', $ref);
     $this->assignRef('history', $model->getHistory('ASC'));
     $this->assign('title', $titleStr);
     if ($config['show_gameshistory']) {
         $this->assignRef('games', $model->getGames());
         $this->assignRef('teams', $model->getTeamsIndexedByPtid());
     }
     if ($person) {
         $extended = $this->getExtended($person->extended, 'referee');
         $this->assignRef('extended', $extended);
     }
     $document->setTitle($titleStr);
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('person', $person);
     $this->assignRef('showediticon', $model->getAllowed($config['edit_own_player']));
     $staff =& $model->getTeamStaff();
     $titleStr = JText::sprintf('COM_JOOMLEAGUE_STAFF_ABOUT_AS_A_STAFF', JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]));
     $this->assignRef('inprojectinfo', $staff);
     $this->assignRef('history', $model->getStaffHistory('ASC'));
     $this->assignRef('stats', $model->getStats());
     $this->assignRef('staffstats', $model->getStaffStats());
     $this->assignRef('historystats', $model->getHistoryStaffStats());
     $this->assign('title', $titleStr);
     $extended = $this->getExtended($person->extended, 'staff');
     $this->assignRef('extended', $extended);
     $document->setTitle($titleStr);
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 public static function getStaffLink($item, $params)
 {
     $flag = "";
     if ($params->get('show_flag')) {
         $flag = Countries::getCountryFlag($item->country) . " ";
     }
     $text = "<i>" . JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format")) . "</i>";
     if ($params->get('show_staff_link')) {
         $link = JoomleagueHelperRoute::getStaffRoute($params->get('p'), $params->get('team'), $item->slug);
         echo $flag . JHtml::link($link, $text);
     } else {
         echo '<i>' . JText::sprintf('%1$s', $flag . $text) . '</i>';
     }
 }
Ejemplo n.º 4
0
 public function searchReferee()
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $model = JLGModel::getInstance('Quickadd', 'JoomleagueModel');
     $query = JRequest::getVar("query", "", "", "string");
     $projectid = $mainframe->getUserState($option . "project");
     $results = $model->getNotAssignedReferees($query, $projectid);
     $response = array("totalCount" => count($results), "rows" => array());
     foreach ($results as $row) {
         $name = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, 0) . " (" . $row->id . ")";
         $response["rows"][] = array("id" => $row->id, "name" => $name);
     }
     echo json_encode($response);
     exit;
 }
Ejemplo n.º 5
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $project = $model->getProject();
     $current_round = $project->current_round;
     $personid = $model->personid;
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $staff = $model->getTeamStaffByRound($current_round, $personid);
     $this->teamStaff = $staff;
     $this->history = $model->getStaffHistory('ASC');
     $this->stats = $model->getStats($current_round, $personid);
     $this->staffstats = $model->getStaffStats($current_round, $personid);
     $this->historystats = $model->getHistoryStaffStats($current_round, $personid);
     $this->showediticon = $model->getAllowed($config['edit_own_player']);
     $extended = $this->getExtended($person->extended, 'staff');
     $this->extended = $extended;
     if (isset($person)) {
         $name = JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]);
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_STAFF_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 6
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $isEditor = $model->hasEditPermission('projectreferee.edit');
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $this->showediticon = $isEditor;
     $ref = $model->getReferee();
     $this->referee = $ref;
     $this->history = $model->getHistory('ASC');
     if ($config['show_gameshistory']) {
         $this->games = $model->getGames();
         $this->teams = $model->getTeamsIndexedByPtid();
     }
     if ($person) {
         $extended = $this->getExtended($person->extended, 'referee');
         $this->extended = $extended;
     }
     $name = !empty($person) ? JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]) : "";
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_REFEREE_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
<?php

defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.mootools');
$modalheight = JComponentHelper::getParams('com_joomleague')->get('modal_popup_height', 600);
$modalwidth = JComponentHelper::getParams('com_joomleague')->get('modal_popup_width', 900);
?>
<table class="contentpaneopen">
	<tr>
		<td class="contentheading">
			<?php 
echo JText::sprintf('COM_JOOMLEAGUE_PLAYER_INFORMATION', JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]));
if ($this->showediticon) {
    /*
        $link = JoomleagueHelperRoute::getPlayerRoute( $this->project->id, $this->teamPlayer->team_id, $this->person->id, 'person.edit' );
    		$desc = JHTML::image(
    			"media/com_joomleague/jl_images/edit.png",
    			JText::_( 'COM_JOOMLEAGUE_PERSON_EDIT' ),
    			array( "title" => JText::_( "COM_JOOMLEAGUE_PERSON_EDIT" ) )
    		);
    echo " ";
    echo JHTML::_('link', $link, $desc );
    */
    ?>
   
	             <a	rel="{handler: 'iframe',size: {x: <?php 
    echo $modalwidth;
    ?>
,y: <?php 
    echo $modalheight;
    ?>
Ejemplo n.º 8
0
/**
 * Joomleague
 *
 * @copyright	Copyright (C) 2006-2015 joomleague.at. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @link		http://www.joomleague.at
 */
defined('_JEXEC') or die;
?>
		
		
			<fieldset class="adminform">
			<legend>
				<?php 
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_DETAILS_TITLE', JoomleagueHelper::formatName(null, $this->project_teamstaff->firstname, $this->project_teamstaff->nickname, $this->project_teamstaff->lastname, 0), $this->teamws->name, $this->projectws->name);
?>
			</legend>
			<table class="admintable table">
				<tr>
					<td width="20%" valign="top" align="right" class="key">
						<label for="position">
							<?php 
echo JText::_('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_POS');
?>
						</label>
					</td>
					<td colspan="7">
						<?php 
echo $this->lists['projectpositions'];
?>
 function _displayEditlist($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $project_id = $mainframe->getUserState($option . 'project');
     $uri = JFactory::getURI();
     $filter_state = $mainframe->getUserStateFromRequest($option . 'p_filter_state', 'filter_state', '', 'word');
     $filter_order = $mainframe->getUserStateFromRequest($option . 'p_filter_order', 'filter_order', 'p.lastname', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'p_filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($option . 'p_search', 'search', '', 'string');
     $search_mode = $mainframe->getUserStateFromRequest($option . 'p_search_mode', 'search_mode', '', 'string');
     $model = $this->getModel();
     $projectplayer =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     // state filter
     $lists['state'] = JHTML::_('grid.state', $filter_state);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $lists['search_mode'] = $search_mode;
     $projectws =& $this->get('Data', 'projectws');
     //build the html select list for project assigned players
     $ress = array();
     $res1 = array();
     $notusedplayers = array();
     if ($ress =& $model->getProjectPlayers()) {
         foreach ($ress1 as $res1) {
             $used = 0;
             foreach ($ress as $res) {
                 if ($res1->value == $res->value) {
                     $used = 1;
                 }
             }
             if ($used == 0) {
                 $notusedplayers[] = JHTML::_('select.option', $res1->value, JoomleagueHelper::formatName(null, $res1->firstname, $res1->nickname, $res1->lastname, 0) . ' (' . $res1->notes . ')');
             }
         }
     } else {
         foreach ($ress1 as $res1) {
             $notusedplayers[] = JHTML::_('select.option', $res1->value, JoomleagueHelper::formatName(null, $res1->firstname, $res1->nickname, $res1->lastname, 0) . ' (' . $res1->notes . ')');
         }
     }
     //build the html select list for players
     if (count($notusedplayers) > 0) {
         $lists['players'] = JHTML::_('select.genericlist', $notusedplayers, 'playerslist[]', ' style="width:150px" class="inputbox" multiple="true" size="30"', 'value', 'text');
     } else {
         $lists['players'] = '<select name="playerslist[]" id="playerslist" style="width:150px" class="inputbox" multiple="true" size="10"></select>';
     }
     unset($res);
     unset($res1);
     unset($notusedplayers);
     $this->assignRef('user', JFactory::getUser());
     $this->assignRef('lists', $lists);
     $this->assignRef('projectplayer', $projectplayer);
     $this->assignRef('projectws', $projectws);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Ejemplo n.º 10
0
							</td>
							<td class="center">
								<?php 
    echo $row->person_id;
    ?>
							</td>
							<td class="center">
								<?php 
    if ($row->picture == '') {
        $imageTitle = JText::_('COM_JOOMLEAGUE_ADMIN_TSTAFFS_NO_IMAGE');
        echo JHtml::_('image', 'administrator/components/com_joomleague/assets/images/delete.png', $imageTitle, 'title= "' . $imageTitle . '"');
    } elseif ($row->picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
        $imageTitle = JText::_('COM_JOOMLEAGUE_ADMIN_TSTAFFS_DEFAULT_IMAGE');
        echo JHtml::_('image', 'administrator/components/com_joomleague/assets/images/information.png', $imageTitle, 'title= "' . $imageTitle . '"');
    } elseif ($row->picture == !'') {
        $playerName = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, 0);
        echo JoomleagueHelper::getPictureThumb($row->picture, $playerName, 0, 21, 4);
    }
    ?>
							</td>
							<td class="nowrap" class="center">
								<?php 
    if ($row->project_position_id != 0) {
        $selectedvalue = $row->project_position_id;
        $append = '';
    } else {
        $selectedvalue = 0;
        $append = '';
    }
    if ($append != '') {
        ?>
    if ($this->matchreferees) {
        ?>
            <tr>
                <td colspan="3" >
                    <span class="label"><?php 
        echo JText::_('COM_JOOMLEAGUE_MATCHREPORT_REFEREE');
        ?>
</span>
                    <?php 
        $first = true;
        foreach ($this->matchreferees as $referee) {
            $referee_link = JoomleagueHelperRoute::getRefereeRoute($this->project->id, $referee->id);
            if (!$first) {
                echo ', ';
            }
            $link = JHTML::link($referee_link, JoomleagueHelper::formatName(null, $referee->firstname, $referee->nickname, $referee->lastname, $this->config["name_format"]));
            if ($this->config["show_referee_position"] == 1) {
                $link .= ' (' . $referee->position_name . ')';
            }
            ?>
<span><?php 
            echo $link;
            ?>
</span>
                        <?php 
            $first = false;
        }
        ?>
                </td>
            </tr>
            <tr>
Ejemplo n.º 12
0
 public static function printName($item, $team, $params, $project)
 {
     $name = JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format"));
     if ($params->get('show_player_link')) {
         return JHtml::link(JoomleagueHelperRoute::getPlayerRoute($project->slug, $team->team_slug, $item->person_id), $name);
     } else {
         echo $name;
     }
 }
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     // Joomleague model
     $model = $this->getModel();
     $user = JFactory::getUser();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('match', $model->getMatch());
     $this->assignRef('matchid', $model->getMatchID());
     $isAllowed = $model->isAllowed() || $model->isMatchAdmin($this->matchid, $user->id);
     $config = $model->getTemplateConfig("player");
     $this->assignRef('config', $config);
     $this->assignRef('isAllowed', $isAllowed);
     $this->assignRef('hometeam', $model->getHomeTeam());
     $this->assignRef('team1_id', $model->getHomeTeamID());
     $this->assignRef('projectteam1_id', $model->getHomeProjectTeamID());
     // diddipoeler
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     $this->assignRef('eventsprojecttime', $model->getProjectGameRegularTime($this->project->id));
     $matchcommentary =& $model->getMatchCommentary();
     $this->assignRef('matchcommentary', $matchcommentary);
     $this->assignRef('awayteam', $model->getAwayTeam());
     $this->assignRef('team2_id', $model->getAwayTeamID());
     $this->assignRef('projectteam2_id', $model->getAwayProjectTeamID());
     $this->assignRef('rosters', $model->createRosterArray());
     $this->assignRef('homeroster', $model->getRosterOptions($this->projectteam1_id));
     $this->assignRef('awayroster', $model->getRosterOptions($this->projectteam2_id));
     $this->assignRef('homeplayeroptions', $model->getPlayerPositionOptions($this->projectteam1_id));
     $this->assignRef('awayplayeroptions', $model->getPlayerPositionOptions($this->projectteam2_id));
     $this->assignRef('homeinoutoptions', $model->getInOutOptions($this->projectteam1_id));
     $this->assignRef('awayinoutoptions', $model->getInOutOptions($this->projectteam2_id));
     $this->assignRef('post_add', $model->getPositionAdd());
     $this->assignRef('homesubstitutions', $model->getSubstitutions($this->projectteam1_id));
     $this->assignRef('awaysubstitutions', $model->getSubstitutions($this->projectteam2_id));
     $this->assignRef('eventtypes', $model->getEventTypes());
     $this->assignRef('homeoptions', $model->getHomeOptions());
     $this->assignRef('awayoptions', $model->getAwayOptions());
     $this->assignRef('matchevents', $model->getMatchEvents($model->getMatchID(), 1));
     $this->assignRef('playerprojectpositions', $model->getProjectPositions(0, 1));
     $this->assignRef('staffprojectpositions', $model->getProjectPositions(0, 2));
     $this->assignRef('refereeprojectpositions', $model->getProjectPositions(0, 3));
     $this->assignRef('homeplayersoptions', $model->getPlayersOptions($this->projectteam1_id));
     $this->assignRef('awayplayersoptions', $model->getPlayersOptions($this->projectteam2_id));
     $this->assignRef('overallconfig', $model->getTemplateConfig('overall'));
     $lists = array();
     // teams
     $teamlist = array();
     $teamlist[] = JHTML::_('select.option', $this->projectteam1_id, $this->hometeam->name);
     $teamlist[] = JHTML::_('select.option', $this->projectteam2_id, $this->awayteam->name);
     $lists['teams'] = JHTML::_('select.genericlist', $teamlist, 'team_id', 'class="inputbox select-team"');
     // events
     $events = $model->getEventsOptions($this->project->id);
     $eventlist = array();
     $eventlist = array_merge($eventlist, $events);
     unset($events);
     $lists['events'] = JHTML::_('select.genericlist', $eventlist, 'event_type_id', 'class="inputbox select-event"');
     // player
     $lists['team_players']['home'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamPlayerPersons($this->projectteam1_id), 'hplayer[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     //echo '<br /><pre>~'.print_r($lists['team_players']['home'],true).'~</pre><br />';
     $lists['team_players']['away'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamPlayerPersons($this->projectteam2_id), 'aplayer[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     //echo '<br /><pre>~'.print_r($lists['team_players']['away'],true).'~</pre><br />';
     foreach ($this->playerprojectpositions as $project_position_id => $pos) {
         // get home players assigned to this position
         $options = array();
         foreach ($model->getMatchPlayers($this->projectteam1_id) as $player) {
             if ($player->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $player->teamplayer_id, $nameStr);
             }
         }
         $lists['team_players' . $project_position_id]['home'] = JHTML::_('select.genericlist', $options, 'hplayerposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
         // get away players assigned to this position
         $options = array();
         foreach ($model->getMatchPlayers($this->projectteam2_id) as $player) {
             if ($player->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $player->teamplayer_id, $nameStr);
             }
         }
         $lists['team_players' . $project_position_id]['away'] = JHTML::_('select.genericlist', $options, 'aplayerposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // staff
     $lists['team_staffs']['home'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamStaffPersons($this->projectteam1_id), 'hstaff[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     $lists['team_staffs']['away'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamStaffPersons($this->projectteam2_id), 'astaff[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     foreach ($this->staffprojectpositions as $project_position_id => $pos) {
         // get home staff assigned to this position
         $options = array();
         foreach ($model->getMatchStaffs($this->projectteam1_id) as $staff) {
             if ($staff->project_position_id == $project_position_id) {
                 // TODO: Aad thinks that the order of home and away staff should be the same...
                 $nameStr = JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $staff->team_staff_id, $nameStr);
             }
         }
         $lists['team_staffs' . $project_position_id]['home'] = JHTML::_('select.genericlist', $options, 'hstaffposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
         // get away staff assigned to this position
         $options = array();
         foreach ($model->getMatchStaffs($this->projectteam2_id) as $staff) {
             if ($staff->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $staff->team_staff_id, $nameStr);
             }
         }
         $lists['team_staffs' . $project_position_id]['away'] = JHTML::_('select.genericlist', $options, 'astaffposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // referees
     $referees = $this->project->teams_as_referees ? $model->getNotAssignedProjectRefereeTeams() : $model->getNotAssignedProjectReferees();
     $lists['project_referees'] = JHTML::_('select.genericlist', $referees, 'referee[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     unset($referees);
     foreach ($this->refereeprojectpositions as $project_position_id => $pos) {
         // get match referees assigned to this position
         $options = array();
         $referees = $this->project->teams_as_referees ? $model->getMatchRefereeTeams() : $model->getMatchReferees();
         foreach ($referees as $referee) {
             if ($referee->project_position_id == $project_position_id) {
                 if ($this->project->teams_as_referees) {
                     $options[] = JHTML::_('select.option', $referee->project_referee_id, $referee->teamname);
                 } else {
                     $nameStr = JoomleagueHelper::formatName(null, $referee->firstname, $referee->nickname, $referee->lastname, $config["name_format"]);
                     $options[] = JHTML::_('select.option', $referee->project_referee_id, $nameStr);
                 }
             }
         }
         $lists['match_referees' . $project_position_id] = JHTML::_('select.genericlist', $options, 'refereeposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // substitutions
     $lists['home_projectpositions'] = $model->getSelectPositions('home');
     $lists['away_projectpositions'] = $model->getSelectPositions('away');
     $this->assignRef('lists', $lists);
     $pageTitle = JText::_('COM_JOOMLEAGUE_EDIT_EVENTS_TITLE');
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
Ejemplo n.º 14
0
                }
            }
            ?>
	<tr class="<?php 
            echo $class;
            ?>
"<?php 
            echo $favStyle;
            ?>
>
		<td class="rank"><?php 
            echo $rank;
            ?>
</td>
		<?php 
            $playerName = JoomleagueHelper::formatName(null, $row->fname, $row->nname, $row->lname, $this->config['name_format']);
            ?>
		<?php 
            if ($this->config['show_picture_thumb'] == 1) {
                ?>
		<td class="td_c playerpic">
		<?php 
                $picture = isset($row->teamplayerpic) ? $row->teamplayerpic : null;
                if (empty($picture) || $picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
                    $picture = $row->picture;
                }
                if (!file_exists($picture)) {
                    $picture = JoomleagueHelper::getDefaultPlaceholder("player");
                }
                echo JoomleagueHelper::getPictureThumb($picture, $playerName, $this->config['player_picture_width'], $this->config['player_picture_height']);
                ?>
 /**
  * Add the page title and toolbar.
  *
  * @since	1.7
  */
 protected function addToolbar()
 {
     // Set toolbar items for the page
     $edit = JRequest::getVar('edit', true);
     $option = JRequest::getCmd('option');
     $params = JComponentHelper::getParams($option);
     $default_name_format = $params->get("name_format");
     $name = JoomleagueHelper::formatName(null, $this->project_teamstaff->firstname, $this->project_teamstaff->nickname, $this->project_teamstaff->lastname, $default_name_format);
     $text = !$edit ? JText::_('COM_JOOMLEAGUE_GLOBAL_NEW') : JText::_('COM_JOOMLEAGUE_ADMIN_TEAMSTAFF_TITLE') . ': ' . $name;
     JToolBarHelper::title($text);
     JLToolBarHelper::save('teamstaff.save');
     if (!$edit) {
         JLToolBarHelper::cancel('teamstaff.cancel');
     } else {
         // for existing items the button is renamed `close` and the apply button is showed
         JLToolBarHelper::apply('teamstaff.apply');
         JLToolBarHelper::cancel('teamstaff.cancel', 'COM_JOOMLEAGUE_GLOBAL_CLOSE');
     }
     JToolBarHelper::back();
     JToolBarHelper::help('screen.joomleague', true);
 }
		</thead>
		<?php 
    $k = 0;
    for ($i = 0, $n = count($this->stafflist); $i < $n; $i++) {
        $row =& $this->stafflist[$i];
        ?>
			<tr class="<?php 
        echo $k == 0 ? $this->config['style_class1'] : $this->config['style_class2'];
        ?>
">
				<?php 
        if ($this->config['show_player_numbers']) {
            ?>
				<td width="30" class="td_c">&nbsp;</td><?php 
        }
        $playerName = JoomleagueHelper::formatName(null, $row->firstname, $row->nickname, $row->lastname, $this->config["name_format_staff"]);
        if ($this->config['show_staff_icon']) {
            $picture = $row->picture;
            if (empty($picture) || $picture == JoomleagueHelper::getDefaultPlaceholder("player")) {
                $picture = $row->ppic;
            }
            if (!file_exists($picture)) {
                $picture = JoomleagueHelper::getDefaultPlaceholder("player");
            }
            ?>
				<td width="40" class="td_c" nowrap="nowrap">
                <?php 
            if (!$this->config['show_highslide']) {
                /*
                          echo JoomleagueHelper::getPictureThumb($picture, $playerName,
                $this->config['staff_picture_width'],
<?php

defined('_JEXEC') or die('Restricted access');
?>

		<fieldset class="adminform">
			<legend>
			<?php 
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_TEAMPLAYER_PIC_TITLE', JoomleagueHelper::formatName(null, $this->project_player->firstname, $this->project_player->nickname, $this->project_player->lastname, 0), '<i>' . $this->teamws->name . '</i>', '<i>' . $this->projectws->name . '</i>');
?>
			</legend>
			<table class="admintable">
					<?php 
foreach ($this->form->getFieldset($this->cfg_which_media_tool) as $field) {
    ?>
					<tr>
						<td class="key"><?php 
    echo $field->label;
    ?>
</td>
						<td><?php 
    echo $field->input;
    ?>
</td>
					</tr>					
					<?php 
}
?>
			</table>
		</fieldset>		
Ejemplo n.º 18
0
 function _displayEditlineup($tpl)
 {
     $option = JRequest::getCmd('option');
     $app = JFactory::getApplication();
     $project_id = $app->getUserState($option . 'project');
     $document = JFactory::getDocument();
     $tid = JRequest::getVar('team', '0');
     $params = JComponentHelper::getParams($option);
     $default_name_format = $params->get("name_format");
     $default_name_dropdown_list_order = $params->get("cfg_be_name_dropdown_list_order", "lastname");
     // add the js script
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JUri::base() . 'components/com_joomleague/assets/js/startinglineup.js?v=' . $version);
     $model = $this->getModel();
     $teams = $model->getMatchTeams();
     if (is_null($teams)) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_TEAM_MATCH') . '<br /><br />');
         return false;
     }
     $teamname = $tid == $teams->projectteam1_id ? $teams->team1 : $teams->team2;
     $this->_handlePreFillRoster($teams, $model, $params, $tid, $teamname);
     // get starters
     $starters = $model->getRoster($tid);
     $starters_id = array_keys($starters);
     // get players not already assigned to starter
     $not_assigned = $model->getTeamPlayers($tid, $starters_id, $default_name_dropdown_list_order);
     if (!$not_assigned && !$starters_id) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_PLAYERS_MATCH') . '<br /><br />');
         return false;
     }
     $projectpositions = $model->getProjectPositions();
     if (!$projectpositions) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_POS') . '<br /><br />');
         return false;
     }
     // build select list for not assigned players
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         if ($p->jerseynumber > 0) {
             $jerseynumber = '[' . $p->jerseynumber . '] ';
         } else {
             $jerseynumber = '';
         }
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
             case 'position':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, '(' . JText::_($p->positionname) . ') - ' . $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
         }
     }
     $lists['team_players'] = JHtml::_('select.genericlist', $not_assigned_options, 'roster[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // build position select
     $selectpositions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_IN_POSITION'));
     $selectpositions = array_merge($selectpositions, $model->getProjectPositionsOptions(0, 1));
     $lists['projectpositions'] = JHtml::_('select.genericlist', $selectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', NULL, false, true);
     // build player select for substitutions
     // starters + came in (because of multiple substitutions possibility in amateur soccer clubs for example)
     $substitutions = $model->getSubstitutions($tid);
     $starters = array_merge($starters, $substitutions[$tid]);
     // not assigned players + went out (because of multiple substitutions possibility in amateur soccer clubs for example)
     $not_assigned = array_merge($not_assigned, $substitutions[$tid]);
     // filter out duplicates $starters
     $new_starters = array();
     $exclude = array("");
     for ($i = 0; $i <= count($starters) - 1; $i++) {
         if (!in_array(trim($starters[$i]->value), $exclude)) {
             $new_starters[] = $starters[$i];
             $exclude[] = trim($starters[$i]->value);
         }
     }
     // filter out duplicates $not_assigned
     $new_not_assigned = array();
     $exclude = array("");
     for ($i = 0; $i <= count($not_assigned) - 1; $i++) {
         if (array_key_exists('came_in', $not_assigned[$i]) && $not_assigned[$i]->came_in == 1) {
             if (!in_array(trim($not_assigned[$i]->in_for), $exclude)) {
                 $new_not_assigned[] = $not_assigned[$i];
                 $exclude[] = trim($not_assigned[$i]->in_for);
             }
         } elseif (!array_key_exists('came_in', $not_assigned[$i])) {
             if (!in_array(trim($not_assigned[$i]->value), $exclude)) {
                 $new_not_assigned[] = $not_assigned[$i];
                 $exclude[] = trim($not_assigned[$i]->value);
             }
         }
     }
     $playersoptions_subs_out = array();
     $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
     $i = 0;
     foreach ((array) $new_starters as $player) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 if (array_key_exists('came_in', $player)) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_IN'));
                     }
                 }
                 $playersoptions_subs_out[] = JHtml::_('select.option', $player->value, JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 break;
             case 'position':
                 if (array_key_exists('came_in', $player)) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_IN'));
                     }
                 }
                 $playersoptions_subs_out[] = JHtml::_('select.option', $player->value, '(' . JText::_($player->positionname) . ') - ' . JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 break;
         }
     }
     $playersoptions_subs_in = array();
     $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
     $i = 0;
     foreach ((array) $new_not_assigned as $player) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 if (array_key_exists('came_in', $player) && $player->came_in == 1 && $player->in_for > 0) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_OUT'));
                     }
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->in_for, JoomleagueHelper::formatName(null, $player->out_firstname, $player->out_nickname, $player->out_lastname, $default_name_format));
                 } elseif (!array_key_exists('came_in', $player)) {
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->value, JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 }
                 break;
             case 'position':
                 if (array_key_exists('came_in', $player) && $player->came_in == 1 && $player->in_for > 0) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_OUT'));
                     }
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->in_for, '(' . JText::_($player->positionname_out) . ') - ' . JoomleagueHelper::formatName(null, $player->out_firstname, $player->out_nickname, $player->out_lastname, $default_name_format));
                 } elseif (!array_key_exists('came_in', $player)) {
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->value, '(' . JText::_($player->positionname) . ') - ' . JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 }
                 break;
         }
     }
     // $lists['all_players']=JHtml::_( 'select.genericlist',$playersoptions,'roster[]',
     // 'id="roster" style="font-size:12px;height:auto;min-width:15em;" class="inputbox" size="4"',
     // 'value','text');
     // generate selection list for each position
     $starters = array();
     foreach ($projectpositions as $position_id => $pos) {
         // get players assigned to this position
         $starters[$position_id] = $model->getRoster($tid, $pos->pposid);
     }
     foreach ($starters as $position_id => $players) {
         $options = array();
         foreach ((array) $players as $p) {
             if ($p->jerseynumber > 0) {
                 $jerseynumber = '[' . $p->jerseynumber . '] ';
             } else {
                 $jerseynumber = '';
             }
             $options[] = JHtml::_('select.option', $p->value, $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
         }
         $lists['team_players' . $position_id] = JHtml::_('select.genericlist', $options, 'position' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-starters" multiple="true" ', 'value', 'text');
     }
     /**
      * staff positions
      */
     $staffpositions = $model->getProjectStaffPositions();
     // get staff not already assigned to starter
     // echo '<pre>'.print_r($staffpositions,true).'</pre>';
     // assigned staff
     $assigned = $model->getMatchStaffs($tid);
     $assigned_id = array_keys($assigned);
     // not assigned staff
     $not_assigned = $model->getTeamStaffs($tid, $assigned_id, $default_name_dropdown_list_order);
     // build select list for not assigned
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
             case 'position':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, '(' . JText::_($p->positionname) . ') - ' . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
         }
     }
     $lists['team_staffs'] = JHtml::_('select.genericlist', $not_assigned_options, 'staff[]', 'style="font-size:12px;height:auto;min-width:15em;" size="18" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // generate selection list for each position
     $options = array();
     foreach ($staffpositions as $position_id => $pos) {
         // get players assigned to this position
         $options = array();
         foreach ($assigned as $staff) {
             if ($staff->project_position_id == $pos->pposid) {
                 $options[] = JHtml::_('select.option', $staff->team_staff_id, JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $default_name_format));
             }
         }
         $lists['team_staffs' . $position_id] = JHtml::_('select.genericlist', $options, 'staffposition' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     $this->match = $teams;
     $this->tid = $tid;
     $this->teamname = $teamname;
     $this->positions = $projectpositions;
     $this->staffpositions = $staffpositions;
     $this->substitutions = $substitutions[$tid];
     $this->playersoptions_subs_out = $playersoptions_subs_out;
     $this->playersoptions_subs_in = $playersoptions_subs_in;
     $this->lists = $lists;
     $this->default_name_format = $default_name_format;
     $this->default_name_dropdown_list_order = $default_name_dropdown_list_order;
     parent::display($tpl);
 }
Ejemplo n.º 19
0
        }
        ?>
						</ul>
					</div>
				</td>
				<!-- list of guest-team -->
				<td class="list">
					<div style="text-align: left;">
						<ul style="list-style-type: none;">
							<?php 
        foreach ($this->matchstaffs as $player) {
            if ($player->pposid == $pos->pposid && $player->ptid == $this->match->projectteam2_id) {
                ?>
									<li class="list">
										<?php 
                $match_player = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $this->config["name_format"]);
                $imgTitle = JText::sprintf('Picture of %1$s', $match_player);
                $picture = $player->picture;
                if (!file_exists($picture)) {
                    $picture = JoomleagueHelper::getDefaultPlaceholder("player");
                }
                echo JoomleagueHelper::getPictureThumb($picture, $imgTitle, $this->config['staff_picture_width'], $this->config['staff_picture_height']);
                echo '&nbsp;';
                $player_link = JoomleagueHelperRoute::getStaffRoute($this->project->slug, $player->team_slug, $player->person_slug);
                echo JHtml::link($player_link, $match_player);
                ?>
									</li>
									<?php 
            }
        }
        ?>
Ejemplo n.º 20
0
    $persons = jl_birthday_sort($persons, array("n+days_to_birthday", "n" . $params->get('sort_order') . "age"), false);
}
$k = 0;
$counter = 0;
?>
<table class="birthday">
<?php 
if (count($persons) > 0) {
    foreach ($persons as $person) {
        if ($params->get('limit') > 0 && $counter == intval($params->get('limit'))) {
            break;
        }
        $class = $k == 0 ? $params->get('sectiontableentry1') : $params->get('sectiontableentry2');
        $thispic = "";
        $flag = $params->get('show_player_flag') ? Countries::getCountryFlag($person['country']) . "&nbsp;" : "";
        $text = htmlspecialchars(JoomleagueHelper::formatName(null, $person['firstname'], $person['nickname'], $person['lastname'], $params->get("name_format")), ENT_QUOTES, 'UTF-8');
        $usedname = $flag . $text;
        $person_link = "";
        $person_type = $person['type'];
        if ($person_type == 1) {
            $person_link = JoomleagueHelperRoute::getPlayerRoute($person['project_id'], $person['team_id'], $person['id']);
        } else {
            if ($person_type == 2) {
                $person_link = JoomleagueHelperRoute::getStaffRoute($person['project_id'], $person['team_id'], $person['id']);
            } else {
                if ($person_type == 3) {
                    $person_link = JoomleagueHelperRoute::getRefereeRoute($person['project_id'], $person['team_id'], $person['id']);
                }
            }
        }
        $showname = JHtml::link($person_link, $usedname);
Ejemplo n.º 21
0
/**
 * Joomleague
 *
 * @copyright	Copyright (C) 2006-2015 joomleague.at. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @link		http://www.joomleague.at
 */
defined('_JEXEC') or die;
?>
		
		
		<fieldset class="adminform">
			<legend>
				<?php 
echo JText::sprintf('COM_JOOMLEAGUE_ADMIN_P_REF_DETAILS_TITLE', JoomleagueHelper::formatName(null, $this->projectreferee->firstname, $this->projectreferee->nickname, $this->projectreferee->lastname, 0), $this->projectws->name);
?>
			</legend>
			<table class="admintable">
				<tr>
					<td class="key">
						<label for="position">
							<?php 
echo JText::_('COM_JOOMLEAGUE_ADMIN_P_REF_DETAILS_STAND_REF_POS');
?>
						</label>
					</td>
					<td colspan="9">
						<?php 
echo $this->lists['refereepositions'];
?>
Ejemplo n.º 22
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $nickname = isset($person->nickname) ? $person->nickname : "";
     if (!empty($nickname)) {
         $nickname = "'" . $nickname . "'";
     }
     $this->isContactDataVisible = $model->isContactDataVisible($config['show_contact_team_member_only']);
     $project = $model->getProject();
     $this->project = $project;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $this->nickname = $nickname;
     /*
     $this->teamPlayers = $model->getTeamPlayers();
     
     // Select the teamplayer that is currently published (in case the player played in multiple teams in the project)
     $teamPlayer = null;
     if (count($this->teamPlayers))
     {
     	$currentProjectTeamId=0;
     	foreach ($this->teamPlayers as $teamPlayer)
     	{
     		if ($teamPlayer->published == 1)
     		{
     			$currentProjectTeamId=$teamPlayer->projectteam_id;
     			break;
     		}
     	}
     	if ($currentProjectTeamId)
     	{
     		$teamPlayer = $this->teamPlayers[$currentProjectTeamId];
     	}
     }
     */
     $sportstype = $config['show_plcareer_sportstype'] ? $model->getSportsType() : 0;
     $current_round = $project->current_round;
     $personid = $model->personid;
     $teamPlayer = $model->getTeamPlayerByRound($current_round, $personid);
     $this->teamPlayer = $teamPlayer[0];
     $this->historyPlayer = $model->getPlayerHistory($sportstype, 'ASC');
     $this->historyPlayerStaff = $model->getPlayerHistoryStaff($sportstype, 'ASC');
     $this->AllEvents = $model->getAllEvents($sportstype);
     $this->showediticon = $model->getAllowed($config['edit_own_player']);
     $this->stats = $model->getProjectStats();
     // Get events and stats for current project
     if ($config['show_gameshistory']) {
         $this->games = $model->getGames();
         $this->teams = $model->getTeamsIndexedByPtid();
         $this->gamesevents = $model->getGamesEvents();
         $this->gamesstats = $model->getPlayerStatsByGame();
     }
     // Get events and stats for all projects where player played in (possibly restricted to sports type of current project)
     if ($config['show_career_stats']) {
         $this->stats = $model->getStats($current_round, $personid);
         $this->projectstats = $model->getPlayerStatsByProject($sportstype, $current_round, $personid);
     }
     $extended = $this->getExtended($person->extended, 'person');
     $this->extended = $extended;
     $name = !empty($person) ? JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]) : "";
     $this->playername = $name;
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_PLAYER_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 23
0
    ?>
				</td>
			</tr>
			<?php 
}
?>
			<tr>
				<td class="">
					<span class="label"><?php 
echo JText::_('COM_JOOMLEAGUE_PERSON_NAME');
?>
</span>
				</td>
				<td class="data">
				<?php 
$outputName = JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]);
if ($this->person->id) {
    switch ($this->config['show_user_profile']) {
        case 1:
            // Link to Joomla Contact Page
            $link = JoomleagueHelperRoute::getContactRoute($this->person->contact_id);
            $outputName = JHtml::link($link, $outputName);
            break;
        case 2:
            // Link to CBE User Page with support for JoomLeague Tab
            $link = JoomleagueHelperRoute::getUserProfileRouteCBE($this->person->id, $this->project->id, $this->person->id);
            $outputName = JHtml::link($link, $outputName);
            break;
        default:
            break;
    }
Ejemplo n.º 24
0
 function printName($item, $team, $params, $project)
 {
     $name = JoomleagueHelper::formatName(null, $item->fname, $item->nname, $item->lname, $params->get("name_format"));
     if ($params->get('show_player_link')) {
         return JHTML::link(JoomleagueHelperRoute::getPlayerRoute($project->slug, $team->team_slug, $item->pid), $name);
     } else {
         echo $name;
     }
 }
 function getPlayersOptions($projectTeamID)
 {
     $allplayers =& $this->getTeamPlayers($projectTeamID);
     $playersoptions = array();
     $playersoptions[] = JHTML::_('select.option', '0', JText::_('- Select Player -'));
     $config = $this->getTemplateConfig("player");
     foreach ((array) $allplayers as $player) {
         $nameStr = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $config["name_format"]);
         $playersoptions[] = JHTML::_('select.option', $player->value, $nameStr);
     }
     return $playersoptions;
 }
Ejemplo n.º 26
0
         echo '</li>';
     }
 }
 echo '</ul>';
 echo '</td>';
 echo '<td class="list">';
 echo '<ul>';
 foreach ($this->matchevents as $me) {
     if ($me->event_type_id == $event->id && $me->ptid == $this->match->projectteam2_id) {
         echo '<li class="list">';
         if ($this->config['show_event_minute'] == 1 && $me->event_time > 0) {
             $prefix = str_pad($me->event_time, 2, '0', STR_PAD_LEFT) . "' ";
         } else {
             $prefix = null;
         }
         $match_player = JoomleagueHelper::formatName($prefix, $me->firstname1, $me->nickname1, $me->lastname1, $this->config["name_format"]);
         if ($this->config['event_link_player'] == 1 && $me->playerid != 0) {
             $player_link = JoomleagueHelperRoute::getPlayerRoute($this->project->slug, $me->team_id, $me->playerid);
             $match_player = JHtml::link($player_link, $match_player);
         }
         echo $match_player;
         // only show event sum and match notice when set to on in template cofig
         $sum_notice = "";
         if ($this->config['show_event_sum'] == 1 || $this->config['show_event_notice'] == 1) {
             if ($this->config['show_event_sum'] == 1 && $me->event_sum > 0 || $this->config['show_event_notice'] == 1 && strlen($me->notice) > 0) {
                 $sum_notice .= ' (';
                 if ($this->config['show_event_sum'] == 1 && $me->event_sum > 0) {
                     $sum_notice .= $me->event_sum;
                 }
                 if ($this->config['show_event_sum'] == 1 && $me->event_sum > 0 && ($this->config['show_event_notice'] == 1 && strlen($me->notice) > 0)) {
                     $sum_notice .= ' | ';
Ejemplo n.º 27
0
		<legend>
			<?php 
echo JText::sprintf('Assign persons to a team or the project [%1$s]', '<i>' . $this->projectname . '</i>');
?>
		</legend>
		<ul>
			<?php 
foreach ($this->persons as $p) {
    ?>
				<li>
					<input type="hidden" name="pid" value="<?php 
    echo $p->id;
    ?>
" />
					<?php 
    echo JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, 0);
    ?>
				</li>
				<?php 
}
?>
		</ul>
		<p class="instructions">
			<?php 
echo JText::_('Assign selected persons as a player,staff or referee');
?>
		</p>
		<?php 
echo $this->lists['type'];
?>
		<p class="instructions">
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $nickname = isset($person->nickname) ? $person->nickname : "";
     if (!empty($nickname)) {
         $nickname = "'" . $nickname . "'";
     }
     $this->assignRef('isContactDataVisible', $model->isContactDataVisible($config['show_contact_team_member_only']));
     $project = $model->getProject();
     $this->assignRef('project', $project);
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('person', $person);
     $this->assignRef('nickname', $nickname);
     $this->assignRef('teamPlayers', $model->getTeamPlayers());
     $this->assignRef('checkextrafields', $model->checkUserExtraFields());
     //        $mainframe->enqueueMessage(JText::_('player checkextrafields -> '.'<pre>'.print_r($this->checkextrafields,true).'</pre>' ),'');
     if ($this->checkextrafields) {
         $this->assignRef('extrafields', $model->getUserExtraFields($person->id));
     }
     // Select the teamplayer that is currently published (in case the player played in multiple teams in the project)
     $teamPlayer = null;
     if (count($this->teamPlayers)) {
         $currentProjectTeamId = 0;
         foreach ($this->teamPlayers as $teamPlayer) {
             if ($teamPlayer->published == 1) {
                 $currentProjectTeamId = $teamPlayer->projectteam_id;
                 break;
             }
         }
         if ($currentProjectTeamId) {
             $teamPlayer = $this->teamPlayers[$currentProjectTeamId];
         }
     }
     $sportstype = $config['show_plcareer_sportstype'] ? $model->getSportsType() : 0;
     $this->assignRef('teamPlayer', $teamPlayer);
     $this->assignRef('historyPlayer', $model->getPlayerHistory($sportstype, 'ASC'));
     $this->assignRef('historyPlayerStaff', $model->getPlayerHistoryStaff($sportstype, 'ASC'));
     $this->assignRef('AllEvents', $model->getAllEvents($sportstype));
     $this->assignRef('showediticon', $model->getAllowed($config['edit_own_player']));
     $this->assignRef('stats', $model->getProjectStats());
     // Get events and stats for current project
     if ($config['show_gameshistory']) {
         $this->assignRef('games', $model->getGames());
         $this->assignRef('teams', $model->getTeamsIndexedByPtid());
         $this->assignRef('gamesevents', $model->getGamesEvents());
         $this->assignRef('gamesstats', $model->getPlayerStatsByGame());
     }
     // Get events and stats for all projects where player played in (possibly restricted to sports type of current project)
     if ($config['show_career_stats']) {
         $this->assignRef('stats', $model->getStats());
         $this->assignRef('projectstats', $model->getPlayerStatsByProject($sportstype));
     }
     $extended = $this->getExtended($person->extended, 'person');
     $this->assignRef('extended', $extended);
     $form_value = $this->extended->getValue('COM_JOOMLEAGUE_EXT_PERSON_PARENT_POSITIONS');
     // nebenposition vorhanden ?
     if ($form_value) {
         $this->assignRef('person_parent_positions', explode(",", $form_value));
     }
     $form_value = $this->extended->getValue('COM_JOOMLEAGUE_EXT_PERSON_POSITION');
     if ($form_value) {
         $this->assignRef('person_position', $form_value);
     } else {
         $mainframe->enqueueMessage(JText::_('COM_JOOMLEAGUE_PERSON_NO_POSITION'), 'Error');
     }
     $this->assignRef('hasDescription', $this->teamPlayer->notes);
     foreach ($this->extended->getFieldsets() as $fieldset) {
         $hasData = false;
         $fields = $this->extended->getFieldset($fieldset->name);
         foreach ($fields as $field) {
             // TODO: backendonly was a feature of JLGExtraParams, and is not yet available.
             //       (this functionality probably has to be added later)
             $value = $field->value;
             // Remark: empty($field->value) does not work, using an extra local var does
             if (!empty($value)) {
                 $hasData = true;
                 break;
             }
         }
     }
     $this->assignRef('hasExtendedData', $hasData);
     $hasStatus = false;
     if (isset($this->teamPlayer->injury) && $this->teamPlayer->injury > 0 || isset($this->teamPlayer->suspension) && $this->teamPlayer->suspension > 0 || isset($this->teamPlayer->away) && $this->teamPlayer->away > 0) {
         $hasStatus = true;
     }
     $this->assignRef('hasStatus', $hasStatus);
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     $this->assign('use_joomlaworks', JComponentHelper::getParams('com_joomleague')->get('use_joomlaworks', 0));
     if (isset($person)) {
         $name = JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]);
     }
     $this->assignRef('playername', $name);
     $document->setTitle(JText::sprintf('COM_JOOMLEAGUE_PLAYER_INFORMATION', $name));
     parent::display($tpl);
 }
 function _formatSubstitutionContainerInResults($subs, $projectteamId, $imgTime, $imgOut, $imgIn)
 {
     $output = '';
     if ($subs->ptid == $projectteamId) {
         $output .= '<li class="events">';
         // $output .= $imgTime;
         $output .= '&nbsp;' . $subs->in_out_time . '. ' . JText::_('COM_JOOMLEAGUE_MATCHREPORT_SUBSTITUTION_MINUTE');
         $output .= '<br />';
         $output .= $imgOut;
         $output .= '&nbsp;' . JoomleagueHelper::formatName(null, $subs->out_firstname, $subs->out_nickname, $subs->out_lastname, $this->config["name_format"]);
         $output .= '&nbsp;(' . JText::_($subs->out_position) . ')';
         $output .= '<br />';
         $output .= $imgIn;
         $output .= '&nbsp;' . JoomleagueHelper::formatName(null, $subs->firstname, $subs->nickname, $subs->lastname, $this->config["name_format"]);
         $output .= '&nbsp;(' . JText::_($subs->in_position) . ')';
         $output .= '<br /><br />';
         $output .= '</li>';
     }
     return $output;
 }
Ejemplo n.º 30
0
    echo "row{$k}";
    ?>
">
							<td>
								<?php 
    if ($substitution->came_in == 2) {
        echo JoomleagueHelper::formatName(null, $substitution->firstname, $substitution->nickname, $substitution->lastname, $this->default_name_format);
    } else {
        echo JoomleagueHelper::formatName(null, $substitution->out_firstname, $substitution->out_nickname, $substitution->out_lastname, $this->default_name_format);
    }
    ?>
							</td>
							<td>
								<?php 
    if ($substitution->came_in == 1) {
        echo JoomleagueHelper::formatName(null, $substitution->firstname, $substitution->nickname, $substitution->lastname, $this->default_name_format);
    }
    ?>
							</td>
							<td>
								<?php 
    echo JText::_($substitution->in_position);
    ?>
							</td>
							<td>
								<?php 
    $time = !is_null($substitution->in_out_time) && $substitution->in_out_time > 0 ? $substitution->in_out_time : '--';
    echo $time;
    ?>
							</td>
							<td>