function _getForms() { // category list($this->parentArray, $this->parentKeys) = CLMCategoryTree::getTree(); if (count($this->parentArray) > 0) { // nur, wenn Kategorien existieren $parentlist[] = JHtml::_('select.option', '0', CLMText::selectOpener(JText::_('NO_PARENT')), 'id', 'name'); foreach ($this->parentArray as $key => $value) { $parentlist[] = JHtml::_('select.option', $key, $value, 'id', 'name'); } $this->form['catidAlltime'] = JHtml::_('select.genericlist', $parentlist, 'catidAlltime', 'class="inputbox" size="1" style="max-width: 250px;"', 'id', 'name', intval($this->turnier->catidAlltime)); $this->form['catidEdition'] = JHtml::_('select.genericlist', $parentlist, 'catidEdition', 'class="inputbox" size="1" style="max-width: 250px;"', 'id', 'name', intval($this->turnier->catidEdition)); } // Saison $this->form['sid'] = CLMForm::selectSeason('sid', $this->turnier->sid); // Modus $this->form['modus'] = CLMForm::selectModus('typ', $this->turnier->typ, false, ' onChange="showFormRoundscount()";'); // Tiebreakers $this->form['tiebr1'] = CLMForm::selectTiebreakers('tiebr1', $this->turnier->tiebr1); $this->form['tiebr2'] = CLMForm::selectTiebreakers('tiebr2', $this->turnier->tiebr2); $this->form['tiebr3'] = CLMForm::selectTiebreakers('tiebr3', $this->turnier->tiebr3); // stages/dg $this->form['dg'] = CLMForm::selectStages('dg', $this->turnier->dg); // director/tl $this->form['tl'] = CLMForm::selectDirector('tl', $this->turnier->tl); // bezirksveranstaltung? $this->form['bezirkTur'] = JHtml::_('select.booleanlist', 'bezirkTur', 'class="inputbox"', $this->turnier->bezirkTur); // vereinZPS // $this->form['vereinZPS']= CLMForm::selectVereinZPS('vereinZPS', $this->turnier->vereinZPS); $this->form['vereinZPS'] = CLMForm::selectVereinZPSuVerband('vereinZPS', $this->turnier->vereinZPS); // director/tl $this->form['tl'] = CLMForm::selectDirector('tl', $this->turnier->tl); // published $this->form['published'] = CLMForm::radioPublished('published', $this->turnier->published); }
function _getTurnierData() { $query = "SELECT id, sid, name, typ, runden, rnd, published, params, catidAlltime, catidEdition" . " FROM #__clm_turniere" . " WHERE id = " . $this->turnierid; $this->_db->setQuery($query); $this->turnier = $this->_db->loadObject(); // TO-DO: auslagern // zudem PGN-Parameter auswerten $turParams = new clm_class_params($this->turnier->params); $pgnInput = $turParams->get('pgnInput', 1); $pgnPublic = $turParams->get('pgnPublic', 1); // User ermitteln $user = JFactory::getUser(); // Flag für View und Template setzen: pgnShow // FALSE - PGN nicht verlinken/anzeigen // TRUE - PGN-Links setzen und anzeigen // 'pgnInput möglich' UND ('pgn öffentlich' ORDER 'User eingeloggt') if ($pgnInput == 1 and ($pgnPublic == 1 or $user->id > 0)) { $this->pgnShow = TRUE; } else { $this->pgnShow = FALSE; } // turniernamen anpassen? $addCatToName = $turParams->get('addCatToName', 0); if ($addCatToName != 0 and ($this->turnier->catidAlltime > 0 or $this->turnier->catidEdition > 0)) { $this->turnier->name = CLMText::addCatToName($addCatToName, $this->turnier->name, $this->turnier->catidAlltime, $this->turnier->catidEdition); } }
/** * bearbeitet und überprüft Daten * */ function checkData() { $this->name = trim($this->name); if (strlen($this->name) == 0) { $this->setError(CLMText::errorText('ROUND_NAME', 'MISSING')); return false; } elseif ($this->nr < 1) { $this->setError(CLMText::errorText('ROUND_NR', 'MISSING')); return false; } // weitere if ($this->tl_ok == 1) { // Bestätigung gesetzt? $tournamentRound = new CLMTournamentRound($this->turnier, $this->id); if (!$tournamentRound->checkResultsComplete()) { $this->setError(CLMText::errorText('RESULTS', 'INCOMPLETE')); return false; } } if ($this->startzeit != '') { if (!CLMText::isTime($this->startzeit, true, false)) { $this->setError(CLMText::errorText('RUNDE_STARTTIME', 'IMPOSSIBLE')); return false; } } return true; }
function display($tpl = null) { $model =& $this->getModel(); $spieler = $model->getCLMSpieler(); $this->assignRef('spieler', $spieler); $model =& $this->getModel(); $runden = $model->getCLMRunden(); $this->assignRef('runden', $runden); $model =& $this->getModel(); $dwz_date_new = $model->getCLMlog(); $this->assignRef('dwz_date_new', $dwz_date_new); $model =& $this->getModel(); $spielerliste = $model->getCLMSpielerliste(); $this->assignRef('spielerliste', $spielerliste); $model =& $this->getModel(); $vereinsliste = $model->getCLMVereinsliste(); $this->assignRef('vereinsliste', $vereinsliste); $model =& $this->getModel(); $saisons = $model->getCLMSaisons(); $this->assignRef('saisons', $saisons); $document =& JFactory::getDocument(); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($spieler[0]->Vereinname, $spieler[0]->Spielername)); $document->setTitle($headTitle); parent::display($tpl); }
function _getParameters() { $mainframe =& JFactory::getApplication(); global $option; // search $this->param['search'] = $mainframe->getUserStateFromRequest("{$option}.search", 'search', '', 'string'); $this->param['search'] = JString::strtolower($this->param['search']); // parent $this->param['parentid'] = $mainframe->getUserStateFromRequest("{$option}.filter_parentid", 'filter_parentid', 0, 'int'); // get Tree list($this->parentArray, $this->parentKeys, $this->parentChilds) = CLMCategoryTree::getTree(); $parentlist[] = JHTML::_('select.option', '0', CLMText::selectOpener(JText::_('NO_PARENT')), 'id', 'name'); foreach ($this->parentArray as $key => $value) { $parentlist[] = JHTML::_('select.option', $key, $value, 'id', 'name'); } $this->form['parent'] = JHTML::_('select.genericlist', $parentlist, 'filter_parentid', 'class="inputbox" size="1" style="max-width: 250px;"' . CLMText::stringOnchange(TRUE), 'id', 'name', $this->param['parentid']); // Modus/Typ $this->param['modus'] = $mainframe->getUserStateFromRequest("{$option}.filter_modus", 'filter_modus', 0, 'int'); // Bezirk $this->param['bezirk'] = $mainframe->getUserStateFromRequest("{$option}.filter_bezirk", 'filter_bezirk', 0, 'int'); // Saison $this->param['sid'] = $mainframe->getUserStateFromRequest("{$option}.filter_sid", 'filter_sid', 0, 'int'); // Statusfilter $this->param['state'] = $mainframe->getUserStateFromRequest("{$option}.filter_state", 'filter_state', '', 'word'); // Order $this->param['order'] = $mainframe->getUserStateFromRequest("{$option}.filter_order", 'filter_order', 'a.id', 'cmd'); // JRequest::getString('filter_order', 'a.id'); $this->param['order_Dir'] = $mainframe->getUserStateFromRequest("{$option}.filter_order_Dir", 'filter_order_Dir', '', 'word'); }
function display($tpl = null) { $model = $this->getModel(); $liga = $model->getCLMliga(); $this->assignRef('liga', $liga); $model = $this->getModel(); $remis = $model->getCLMRemis(); $this->assignRef('remis', $remis); $model = $this->getModel(); $kampflos = $model->getCLMKampflos(); $this->assignRef('kampflos', $kampflos); $model = $this->getModel(); $heim = $model->getCLMHeim(); $this->assignRef('heim', $heim); $model = $this->getModel(); $gast = $model->getCLMGast(); $this->assignRef('gast', $gast); $model = $this->getModel(); $gesamt = $model->getCLMGesamt(); $this->assignRef('gesamt', $gesamt); //$model = $this->getModel(); //$spieler = $model->getCLMSpieler(); //$this->assignRef('spieler' , $spieler); $model = $this->getModel(); $bestenliste = $model->getCLMBestenliste(); $this->assignRef('bestenliste', $bestenliste); $model = $this->getModel(); $mannschaft = $model->getCLMMannschaft(); $this->assignRef('mannschaft', $mannschaft); $model = $this->getModel(); $brett = $model->getCLMBrett(); $this->assignRef('brett', $brett); $model = $this->getModel(); $gbrett = $model->getCLMGBrett(); $this->assignRef('gbrett', $gbrett); $model = $this->getModel(); $rbrett = $model->getCLMRBrett(); $this->assignRef('rbrett', $rbrett); $model = $this->getModel(); $kbrett = $model->getCLMKBrett(); $this->assignRef('kbrett', $kbrett); $model = $this->getModel(); $kgmannschaft = $model->getCLMkgMannschaft(); $this->assignRef('kgmannschaft', $kgmannschaft); $model = $this->getModel(); $kvmannschaft = $model->getCLMkvMannschaft(); $this->assignRef('kvmannschaft', $kvmannschaft); $document = JFactory::getDocument(); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($liga[0]->name, JText::_('LEAGUE_STATISTIK'))); $document->setTitle($headTitle); /* Call the state object */ $state = $this->get('state'); /* Get the values from the state object that were inserted in the model's construct function */ $lists['order'] = $state->get('filter_order_bl'); $lists['order_Dir'] = $state->get('filter_order_Dir_bl'); $this->assignRef('lists', $lists); parent::display($tpl); }
function checkData() { if (trim($this->name) == '') { // Name vorhanden $this->setError(CLMText::errorText('NAME', 'MISSING')); return false; } return true; }
function _saveDo() { JRequest::checkToken() or die('Invalid Token'); if (CLM_usertype != 'admin' and CLM_usertype != 'tl') { JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS')); return FALSE; } // Task $task = JRequest::getVar('task'); // Instanz der Tabelle $row =& JTable::getInstance('turplayeredit', 'TableCLM'); $row->load($this->playerid); // Daten zu dieser ID laden // Spieler existent? if (!$row->id) { JError::raiseWarning(500, CLMText::errorText('PLAYER', 'NOTEXISTING')); return FALSE; // Runde gehört zu Turnier? } elseif ($row->turnier != $this->turnierid) { JError::raiseWarning(500, CLMText::errorText('PLAYER', 'NOACCESS')); return FALSE; } if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError()); return FALSE; } if (!$row->check(JRequest::get('post'))) { JError::raiseError(500, $row->getError()); return FALSE; } if (!$row->store()) { JError::raiseError(500, $row->getError()); return FALSE; } $row->checkin(); $text = JText::_('PARTICIPANT_EDITED') . ": " . $row->name; // Log schreiben $clmLog = new CLMLog(); $clmLog->aktion = $text; $clmLog->params = array('sid' => $row->sid, 'tid' => $this->turnierid); // TurnierID wird als LigaID gespeichert $clmLog->write(); $app =& JFactory::getApplication(); $app->enqueueMessage($text); // wenn 'apply', weiterleiten in form if ($task == 'apply') { // Weiterleitung bleibt im Formular $this->adminLink->more = array('playerid' => $this->playerid); } else { // Weiterleitung in Liste $this->adminLink->more = array('id' => $this->turnierid); $this->adminLink->view = "turplayers"; // WL in Liste } return TRUE; }
function display($tpl = null) { $model =& $this->getModel(); $document =& JFactory::getDocument(); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_INVITATION'))); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); parent::display($tpl); }
function checkData() { // aktuelle Daten laden $accesspoint = new CLMAccesspoint($this->id, true); if (trim($this->accesspoint) == '') { // Name vorhanden $this->setError(CLMText::errorText('NAME', 'MISSING')); return false; } return true; }
function _getTurnierData() { $query = "SELECT t.*, CHAR_LENGTH(t.invitationText) AS invitationLength, s.name AS saisonname, u.name AS tlname, v.Vereinname AS organame" . " FROM #__clm_turniere AS t" . " LEFT JOIN #__clm_saison AS s ON s.id = t.sid" . " LEFT JOIN #__clm_user AS u ON jid = t.tl" . " LEFT JOIN #__clm_dwz_vereine AS v ON v.ZPS = t.vereinZPS" . " WHERE t.id = " . $this->turnierid; $this->_db->setQuery($query); $this->turnier = $this->_db->loadObject(); // turniernamen anpassen? $turParams = new JParameter($this->turnier->params); $addCatToName = $turParams->get('addCatToName', 0); if ($addCatToName != 0 and ($this->turnier->catidAlltime > 0 or $this->turnier->catidEdition > 0)) { $this->turnier->name = CLMText::addCatToName($addCatToName, $this->turnier->name, $this->turnier->catidAlltime, $this->turnier->catidEdition); } }
function _getTurnierData() { $query = "SELECT *" . " FROM #__clm_turniere" . " WHERE id = " . $this->turnierid; $this->_db->setQuery($query); $this->turnier = $this->_db->loadObject(); // turniernamen anpassen? $turParams = new JParameter($this->turnier->params); $addCatToName = $turParams->get('addCatToName', 0); if ($addCatToName != 0 and ($this->turnier->catidAlltime > 0 or $this->turnier->catidEdition > 0)) { $this->turnier->name = CLMText::addCatToName($addCatToName, $this->turnier->name, $this->turnier->catidAlltime, $this->turnier->catidEdition); } }
function display($tpl = null) { $config =& JComponentHelper::getParams('com_clm'); $model =& $this->getModel(); $document =& JFactory::getDocument(); $document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/updateTableHeaders.js'); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_PARTICIPANTLIST'))); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $this->assignRef('tourn_linkclub', $config->get('tourn_linkclub', 1)); $this->assignRef('players', $model->players); parent::display($tpl); }
function display($tpl = null) { $config = clm_core::$db->config(); $model = $this->getModel(); $document = JFactory::getDocument(); $document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/updateTableHeaders.js'); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_TABLE'))); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $tourn_linkclub = $config->tourn_linkclub; $this->assignRef('tourn_linkclub', $tourn_linkclub); $this->assignRef('players', $model->players); parent::display($tpl); }
function display($tpl = null) { $model =& $this->getModel(); $document =& JFactory::getDocument(); $document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/updateTableHeaders.js'); // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_RANKING'))); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $this->assignRef('players', $model->players); $this->assignRef('posToPlayers', $model->posToPlayers); $this->assignRef('matches', $model->matches); $this->assignRef('matrix', $model->matrix); parent::display($tpl); }
function display($tpl = null) { $config = clm_core::$db->config(); $googlemaps_api = $config->googlemaps_api; $googlemaps = $config->googlemaps; $model = $this->getModel(); $verein = $model->getCLMVerein(); $this->assignRef('verein', $verein); $model = $this->getModel(); $vereinstats = $model->getCLMVereinstats(); $this->assignRef('vereinstats', $vereinstats); $model = $this->getModel(); $mannschaft = $model->getCLMMannschaft(); $this->assignRef('mannschaft', $mannschaft); $model = $this->getModel(); $vereinsliste = $model->getCLMVereinsliste(); $this->assignRef('vereinsliste', $vereinsliste); $model = $this->getModel(); $saisons = $model->getCLMSaisons(); $this->assignRef('saisons', $saisons); $model = $this->getModel(); $turniere = $model->getCLMTurniere(); $this->assignRef('turniere', $turniere); $model = $this->getModel(); $row = $model->getCLMData(); $this->assignRef('row', $row); $model = $this->getModel(); $name = $model->getCLMName(); $this->assignRef('name', $name); $model = $this->getModel(); $clmuser = $model->getCLMCLMuser(); $this->assignRef('clmuser', $clmuser); $document = JFactory::getDocument(); if ($googlemaps == 1) { $document->addScript('http://maps.google.com/maps?file=api&v=2&key=' . $googlemaps_api . ''); } // Title in Browser if (isset($verein[0])) { $headTitle = CLMText::composeHeadTitle(array($verein[0]->name)); $document->setTitle($headTitle); } parent::display($tpl); }
function display($tpl = null) { $config = clm_core::$db->config(); $model = $this->getModel(); $document = JFactory::getDocument(); if ($model->pgnShow) { $document->addScript(JURI::base() . 'components/com_clm/javascript/jsPgnViewer.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/showPgnViewer.js'); // Zufallszahl $now = time() + mt_rand(); $document->addScriptDeclaration("var randomid = {$now};"); // pgn-params $document->addScriptDeclaration("var param = new Array();"); $document->addScriptDeclaration("param['fe_pgn_moveFont'] = '" . $config->fe_pgn_moveFont . "'"); $document->addScriptDeclaration("param['fe_pgn_commentFont'] = '" . $config->fe_pgn_commentFont . "'"); $document->addScriptDeclaration("param['fe_pgn_style'] = '" . $config->fe_pgn_style . "'"); // Tooltip-Texte $document->addScriptDeclaration("var text = new Array();"); $document->addScriptDeclaration("text['altRewind'] = '" . JText::_('PGN_ALT_REWIND') . "';"); $document->addScriptDeclaration("text['altBack'] = '" . JText::_('PGN_ALT_BACK') . "';"); $document->addScriptDeclaration("text['altFlip'] = '" . JText::_('PGN_ALT_FLIP') . "';"); $document->addScriptDeclaration("text['altShowMoves'] = '" . JText::_('PGN_ALT_SHOWMOVES') . "';"); $document->addScriptDeclaration("text['altComments'] = '" . JText::_('PGN_ALT_COMMENTS') . "';"); $document->addScriptDeclaration("text['altPlayMove'] = '" . JText::_('PGN_ALT_PLAYMOVE') . "';"); $document->addScriptDeclaration("text['altFastForward'] = '" . JText::_('PGN_ALT_FASTFORWARD') . "';"); $document->addScriptDeclaration("text['pgnClose'] = '" . JText::_('PGN_CLOSE') . "';"); // Pfad $document->addScriptDeclaration("var imagepath = '" . JURI::base() . "components/com_clm/images/pgnviewer/'"); } // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, $model->player->name)); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $this->assignRef('pgnShow', $model->pgnShow); $tourn_linkclub = $config->tourn_linkclub; $this->assignRef('tourn_linkclub', $tourn_linkclub); $this->assignRef('player', $model->player); $this->assignRef('matches', $model->matches); $this->assignRef('joomGalleryPhotosWidth', $model->joomGalleryPhotosWidth); $this->assignRef('playerPhoto', $model->playerPhoto); parent::display($tpl); }
function display($tpl = null) { $config = clm_core::$db->config(); $model = $this->getModel(); $document = JFactory::getDocument(); if ($model->pgnShow) { $document->addScript(JURI::base() . 'components/com_clm/javascript/jsPgnViewer.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/showPgnViewer.js'); // Zufallszahl $now = time() + mt_rand(); $document->addScriptDeclaration("var randomid = {$now};"); // pgn-params $document->addScriptDeclaration("var param = new Array();"); $document->addScriptDeclaration("param['fe_pgn_moveFont'] = '" . $config->fe_pgn_moveFont . "'"); $document->addScriptDeclaration("param['fe_pgn_commentFont'] = '" . $config->fe_pgn_commentFont . "'"); $document->addScriptDeclaration("param['fe_pgn_style'] = '" . $config->fe_pgn_style . "'"); // Tooltip-Texte $document->addScriptDeclaration("var text = new Array();"); $document->addScriptDeclaration("text['altRewind'] = '" . JText::_('PGN_ALT_REWIND') . "';"); $document->addScriptDeclaration("text['altBack'] = '" . JText::_('PGN_ALT_BACK') . "';"); $document->addScriptDeclaration("text['altFlip'] = '" . JText::_('PGN_ALT_FLIP') . "';"); $document->addScriptDeclaration("text['altShowMoves'] = '" . JText::_('PGN_ALT_SHOWMOVES') . "';"); $document->addScriptDeclaration("text['altComments'] = '" . JText::_('PGN_ALT_COMMENTS') . "';"); $document->addScriptDeclaration("text['altPlayMove'] = '" . JText::_('PGN_ALT_PLAYMOVE') . "';"); $document->addScriptDeclaration("text['altFastForward'] = '" . JText::_('PGN_ALT_FASTFORWARD') . "';"); $document->addScriptDeclaration("text['pgnClose'] = '" . JText::_('PGN_CLOSE') . "';"); // Pfad $document->addScriptDeclaration("var imagepath = '" . JURI::base() . "components/com_clm/images/pgnviewer/'"); } // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_ROUND') . " " . $model->round->nr)); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $this->assignRef('pgnShow', $model->pgnShow); $this->assignRef('displayTlOK', $model->displayTlOK); $this->assignRef('round', $model->round); $this->assignRef('matches', $model->matches); $this->assignRef('points', $model->points); // zusätzliche Funktionalitäten JHTML::_('behavior.tooltip'); parent::display($tpl); }
/** * Overloaded check function * * @access public * @return boolean * @see JTable::check * @since 1.5 */ function checkData() { // aktuelle Daten laden // $category = new CLMCategory($this->id, TRUE); if (trim($this->name) == '') { // Name vorhanden $this->setError(CLMText::errorText('NAME', 'MISSING')); return false; /* } elseif ($this->sid <= 0) { // SaisonID > 0 $this->setError( CLMText::errorText('SEASON', 'IMPOSSIBLE') ); return false; } elseif ($this->tl <= 0) { $this->setError( CLMText::errorText('TOURNAMENT_DIRECTOR', 'MISSING') ); return false; */ } return true; }
function _getForms() { // get Tree list($this->parentArray, $this->parentKeys) = CLMCategoryTree::getTree(); // parent $parentlist[] = JHTML::_('select.option', '0', CLMText::selectOpener(JText::_('NO_PARENT')), 'id', 'name'); foreach ($this->parentArray as $key => $value) { // Einträge ausscheiden, die die Kategorie selbst sind, ODER der Kategorie untergeordent sind! if ($key != $this->category->id) { if (!isset($this->parentKeys[$key]) or isset($this->parentKeys[$key]) and !in_array($this->category->id, $this->parentKeys[$key])) { $parentlist[] = JHTML::_('select.option', $key, $value, 'id', 'name'); } } } $this->form['parent'] = JHTML::_('select.genericlist', $parentlist, 'parentid', 'class="inputbox" size="1"', 'id', 'name', intval($this->category->parentid)); // director/tl // $this->form['tl'] = CLMForm::selectDirector('tl', $this->category->tl); // published $this->form['published'] = CLMForm::radioPublished('published', $this->category->published); }
function check() { if (trim($this->name) == '') { // Name vorhanden $this->setError(CLMText::errorText('NAME', 'MISSING')); return false; } elseif (!is_numeric($this->NATrating)) { // TWZ = Zahl $this->setError(CLMText::errorText('RATING', 'NOTANUMBER')); return false; } elseif (!is_numeric($this->FIDEelo)) { // TWZ = Zahl $this->setError(CLMText::errorText('FIDE_ELO', 'NOTANUMBER')); return false; } elseif (!is_numeric($this->twz)) { // TWZ = Zahl $this->setError(CLMText::errorText('TWZ', 'NOTANUMBER')); return false; } return true; }
function display($tpl = null) { $config =& JComponentHelper::getParams('com_clm'); $model =& $this->getModel(); $document =& JFactory::getDocument(); if ($model->pgnShow) { $document->addScript(JURI::base() . 'components/com_clm/javascript/jsPgnViewer.js'); $document->addScript(JURI::base() . 'components/com_clm/javascript/showPgnViewer.js'); // Zufallszahl $now = time() + mt_rand(); $document->addScriptDeclaration("var randomid = {$now};"); // pgn-params $document->addScriptDeclaration("var param = new Array();"); $document->addScriptDeclaration("param['fe_pgn_moveFont'] = '" . $config->get('fe_pgn_moveFont', "#666") . "';"); $document->addScriptDeclaration("param['fe_pgn_commentFont'] = '" . $config->get('fe_pgn_commentFont', "#888") . "';"); $document->addScriptDeclaration("param['fe_pgn_style'] = '" . $config->get('fe_pgn_style', "png") . "';"); // Tooltip-Texte $document->addScriptDeclaration("var text = new Array();"); $document->addScriptDeclaration("text['altRewind'] = '" . JText::_('PGN_ALT_REWIND') . "';"); $document->addScriptDeclaration("text['altBack'] = '" . JText::_('PGN_ALT_BACK') . "';"); $document->addScriptDeclaration("text['altFlip'] = '" . JText::_('PGN_ALT_FLIP') . "';"); $document->addScriptDeclaration("text['altShowMoves'] = '" . JText::_('PGN_ALT_SHOWMOVES') . "';"); $document->addScriptDeclaration("text['altComments'] = '" . JText::_('PGN_ALT_COMMENTS') . "';"); $document->addScriptDeclaration("text['altPlayMove'] = '" . JText::_('PGN_ALT_PLAYMOVE') . "';"); $document->addScriptDeclaration("text['altFastForward'] = '" . JText::_('PGN_ALT_FASTFORWARD') . "';"); $document->addScriptDeclaration("text['pgnClose'] = '" . JText::_('PGN_CLOSE') . "';"); // Pfad $document->addScriptDeclaration("var imagepath = '" . JURI::base() . "components/com_clm/images/pgnviewer/'"); } // Title in Browser $headTitle = CLMText::composeHeadTitle(array($model->turnier->name, JText::_('TOURNAMENT_PAIRINGLIST'))); $document->setTitle($headTitle); $this->assignRef('turnier', $model->turnier); $this->assignRef('pgnShow', $model->pgnShow); $this->assignRef('displayTlOK', $model->displayTlOK); $this->assignRef('players', $model->players); $this->assignRef('rounds', $model->rounds); $this->assignRef('matches', $model->matches); parent::display($tpl); }
/** * createPGNLink() * erstellt Link auf PGN-Vorlage * Parameter pgn optional */ public static function createPGNLink($view, $title, $params = array(), $pgn = 1) { // open div $string = '<div class="pdf">'; // imageTag zusammensetzen $imageTag = '<img src="' . CLMImage::imageURL('pgn.gif') . '" width="16" height="19" title="' . $title . '" alt="PGN" class="CLMTooltip" />'; // Paramter pgn ergänzen $params['pgn'] = $pgn; $string .= CLMText::createCLMLink($imageTag, $view, $params); // close div $string .= '</div>'; return $string; }
} echo '</td>'; ?> <?php } else { echo '<td align="center"></td>'; } echo '</tr>'; } } // tl_ok? Haken anzeigen! if ($this->displayTlOK and $this->round->tl_ok > 0) { echo '<tr><td colspan="9">'; echo '<div style="float:right; padding-right:1%;"><label for="name" class="hasTip" title="' . JText::_('TOURNAMENT_ROUNDOK') . '"><img src="' . CLMImage::imageURL('accept.png') . '" /></label></div>'; echo '</td></tr>'; } echo '</table>'; ?> <!--Bereich für pgn-Viewer--> <span id="pgnArea"></span> <?php if ($this->round->bemerkungen != '') { echo "<div id='desc'>"; echo CLMText::formatNote($this->round->bemerkungen); echo "</div>"; } } require_once JPATH_COMPONENT . DS . 'includes' . DS . 'copy.php'; echo '</div></div>';
} else { if (isset($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][1]->ergebnis)) { if (substr(CLMText::getResultString($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][1]->ergebnis), 0, 7) == '½') { $czelle = chr(189); } else { $czelle = CLMText::getResultString($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][1]->ergebnis, 0); } } else { $czelle = " "; } if ($this->turnier->dg == 2) { if (isset($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][2]->ergebnis)) { if (substr(CLMText::getResultString($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][2]->ergebnis), 0, 7) == '½') { $czelle .= "/" . chr(189); } else { $czelle .= "/" . CLMText::getResultString($this->matrix[$this->players[$p]->snr][$this->posToPlayers[$rnd]][2]->ergebnis, 0); } } else { $czelle .= "/"; } } $pdf->Cell($br11, $zelle, $czelle, 1, 0, 'C', 1); } } $pdf->Cell($br91, $zelle, $this->players[$p]->sum_punkte, 1, 0, 'C', 1); // mgl. Feinwertungen for ($f = 1; $f <= 3; $f++) { $fwFieldName = 'tiebr' . $f; $plTiebrField = 'sumTiebr' . $f; if ($this->turnier->{$fwFieldName} > 0) { $pdf->Cell($br92, $zelle, CLMtext::tiebrFormat($this->turnier->{$fwFieldName}, $this->players[$p]->{$plTiebrField}), 1, 0, 'C', 1);
echo $row->koRoundName; } } ?> </b> </td> <?php // nicht KO if ($this->turnier->typ != 3) { // alle Feinwertungen durchgehen for ($f = 1; $f <= 3; $f++) { $fieldName = 'tiebr' . $f; if ($this->turnier->{$fieldName} != 0 and $this->turnier->{$fieldName} < 50) { $sumFieldname = 'sumTiebr' . $f; echo '<td width="5%" align="right">'; echo CLMText::tiebrFormat($this->turnier->{$fieldName}, $row->{$sumFieldname}); echo '</td>'; } } } ?> <td class="order" width="10%"> <span><?php echo $this->pagination->orderUpIcon($i, true, 'orderup()', 'Move Up', $this->param['order']); ?> </span> <span><?php echo $this->pagination->orderDownIcon($i, $n, true, 'orderdown()', 'Move Down', $this->param['order']); ?> </span>
function _saveDo() { JRequest::checkToken() or die('Invalid Token'); // Instanz der Tabelle $row = JTable::getInstance('turniere', 'TableCLM'); $row->load($this->turnierid); // Daten zu dieser ID laden $clmAccess = clm_core::$access; if ($row->tl != clm_core::$access->getJid() and $clmAccess->access('BE_tournament_edit_detail') !== true or $clmAccess->access('BE_tournament_edit_detail') === false) { //if (clm_core::$access->getType() != 'admin' AND clm_core::$access->getType() != 'tl') { JError::raiseWarning(500, JText::_('TOURNAMENT_NO_ACCESS')); return false; } // Task $task = JRequest::getVar('task'); // Instanz der Tabelle $row =& JTable::getInstance('turnier_teilnehmer', 'TableCLM'); $row->load($this->playerid); // Daten zu dieser ID laden // Spieler existent? if (!$row->id) { JError::raiseWarning(500, CLMText::errorText('PLAYER', 'NOTEXISTING')); return false; // Runde gehört zu Turnier? } elseif ($row->turnier != $this->turnierid) { JError::raiseWarning(500, CLMText::errorText('PLAYER', 'NOACCESS')); return false; } if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError()); return false; } if (!$row->check(JRequest::get('post'))) { JError::raiseError(500, $row->getError()); return false; } if (!$row->store()) { JError::raiseError(500, $row->getError()); return false; } clm_core::$api->direct("db_tournament_delDWZ", array($this->turnierid, false)); $text = JText::_('PARTICIPANT_EDITED') . ": " . $row->name; // Log schreiben $clmLog = new CLMLog(); $clmLog->aktion = $text; $clmLog->params = array('sid' => $row->sid, 'tid' => $this->turnierid); // TurnierID wird als LigaID gespeichert $clmLog->write(); $app = JFactory::getApplication(); $app->enqueueMessage($text); // wenn 'apply', weiterleiten in form if ($task == 'apply') { // Weiterleitung bleibt im Formular $this->adminLink->more = array('playerid' => $this->playerid); } else { // Weiterleitung in Liste $this->adminLink->more = array('id' => $this->turnierid); $this->adminLink->view = "turplayers"; // WL in Liste } return true; }
$pdf->SetFont('Times', '', $font); $pdf->SetTextColor(0); if ($p1 == false) { $p1 = true; $pdf->SetFillColor(255); } else { $p1 = false; $pdf->SetFillColor(240); } $pdf->Cell($br00, $zelle, " ", 0, 0, 'C'); $pdf->Cell($br01, $zelle, CLMText::getPosString($this->players[$p]->rankingPos), 1, 0, 'C', 1); if ($turParams->get('displayPlayerTitle', 1) == 1) { $pdf->Cell($br02, $zelle, $this->players[$p]->titel, 1, 0, 'C', 1); } $pdf->Cell($br03, $zelle, utf8_decode($this->players[$p]->name), 1, 0, 'L', 1); if ($turParams->get('displayPlayerClub', 1) == 1) { $pdf->Cell($br04, $zelle, utf8_decode($this->players[$p]->verein), 1, 0, 'L', 1); } $pdf->Cell($br05, $zelle, CLMText::formatRating($this->players[$p]->twz), 1, 0, 'C', 1); $pdf->Cell($br06, $zelle, $this->players[$p]->sum_punkte, 1, 0, 'C', 1); for ($f = 1; $f <= 3; $f++) { $fwFieldName = 'tiebr' . $f; $plTiebrField = 'sumTiebr' . $f; if ($this->turnier->{$fwFieldName} > 0) { $pdf->Cell($br92, $zelle, CLMtext::tiebrFormat($this->turnier->{$fwFieldName}, $this->players[$p]->{$plTiebrField}), 1, 0, 'C', 1); } } $pdf->Cell(1, $zelle, " ", 0, 1, 'C'); } // Ausgabe $pdf->Output(utf8_decode(JText::_('TOURNAMENT_TABLE')) . ' ' . utf8_decode($this->turnier->name) . '.pdf', 'D');
function makeMinusTln() { if ($this->data->typ != 1) { JError::raiseNotice(500, CLMText::errorText('TOURNAMENT', 'WRONGMODUS')); return FALSE; } elseif ($this->checkTournamentStarted()) { JError::raiseNotice(500, CLMText::errorText('TOURNAMENT', 'ALREADYSTARTED')); return FALSE; } $query = "UPDATE #__clm_turniere" . " SET teil = teil - 1" . " WHERE id = " . $this->turnierid; $this->_db->setQuery($query); if (!$this->_db->query()) { JError::raiseNotice(500, JText::_('DB_ERROR')); return FALSE; } $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('PARTICIPANT_COUNT_LESSENED_TO') . ": " . ($this->data->teil - 1)); return TRUE; }
function checkData() { // aktuelle Turnierdaten laden $tournament = new CLMTournament($this->id, true); if (trim($this->name) == '') { // Name vorhanden $this->setError(CLMText::errorText('NAME', 'MISSING')); return false; } elseif ($this->sid <= 0) { // SaisonID > 0 $this->setError(CLMText::errorText('SEASON', 'IMPOSSIBLE')); return false; } elseif (!is_numeric($this->teil)) { // Teilnehmerzahl = Zahl $this->setError(CLMText::errorText('PARTICIPANT_COUNT', 'NOTANUMBER')); return false; } elseif ($this->teil <= 1) { // Teilnehmerzahl >= 2 $this->setError(CLMText::errorText('PARTICIPANT_COUNT', 'TOOLOW')); return false; } elseif ($this->teil > 500) { // Teilnehmerzahl $this->setError(CLMText::errorText('PARTICIPANT_COUNT', 'TOOBIG')); return false; } elseif ($this->teil < $tournament->getPlayersIn()) { $this->setError(CLMText::errorText('PARTICIPANT_COUNT', 'MOREPLAYERSIN')); return false; } elseif (!is_numeric($this->runden)) { // Runden = Zahl $this->setError(CLMText::errorText('ROUNDS_COUNT', 'NOTANUMBER')); return false; } elseif ($this->runden < 1) { // Runden >= 2 $this->setError(CLMText::errorText('ROUNDS_COUNT', 'TOOLOW')); return false; } elseif ($this->runden > 50) { // Runden $this->setError(CLMText::errorText('ROUNDS_COUNT', 'TOOBIG')); return false; } elseif ($this->typ != 3 and ($this->dg < 1 or $this->dg > 4)) { // DG möglich $this->setError(CLMText::errorText('STAGE_COUNT', 'IMPOSSIBLE')); return false; // Runden schon erstellt? dann keine Änderung Typ, Runden, dg möglich! } elseif ($this->typ != $tournament->data->typ and $tournament->data->rnd == 1) { $this->setError(CLMText::errorText('MODUS', 'ROUNDSCREATED')); return false; } elseif ($this->runden != $tournament->data->runden and $tournament->data->rnd == 1) { $this->setError(CLMText::errorText('ROUNDS_COUNT', 'ROUNDSCREATED')); return false; } elseif ($this->dg != $tournament->data->dg and $tournament->data->rnd == 1) { $this->setError(CLMText::errorText('STAGE_COUNT', 'ROUNDSCREATED')); return false; } elseif ($this->teil != $tournament->data->teil and $tournament->data->rnd == 1) { $this->setError(CLMText::errorText('PARTICIPANT_COUNT', 'ROUNDSCREATED')); return false; /* } elseif ($this->tl <= 0) { $this->setError( CLMText::errorText('TOURNAMENT_DIRECTOR', 'MISSING') ); return false; */ } elseif ($this->tiebr2 != 0 and $this->tiebr2 == $this->tiebr1 or $this->tiebr3 != 0 and ($this->tiebr3 == $this->tiebr1 or $this->tiebr3 == $this->tiebr2)) { $this->setError(CLMText::errorText('TIEBREAKERS', 'NOTDISTINCT')); return false; } // Endtag gegegeben und Datum geändert? if ($this->dateEnd != '0000-00-00' and ($this->dateStart != $tournament->data->dateStart or $this->dateEnd != $tournament->data->dateEnd)) { // zerlegen list($startY, $startM, $startD) = explode("-", $this->dateStart); list($endY, $endM, $endD) = explode("-", $this->dateEnd); // Endtag kleiner Starttag? if (mktime(0, 0, 0, $startM, $startD, $startY) > mktime(0, 0, 0, $endM, $endD, $endY)) { $this->setError(CLMText::errorText('TOURNAMENT_DAYEND', 'TOOLOW')); return false; } } // wurde eine Feinwertung verändert? if ($this->tiebr1 != $tournament->data->tiebr1 or $this->tiebr2 != $tournament->data->tiebr2 or $this->tiebr3 != $tournament->data->tiebr3) { // Rangliste neu berechnen $tournament->setRankingPositions(); } return true; }