Ejemplo n.º 1
0
    public static function runden($rows, $lists, $pageNav, $option)
    {
        $mainframe = JFactory::getApplication();
        $cliga = intval(JRequest::getVar('liga'));
        // Liga-Parameter holen
        $db = JFactory::getDBO();
        $sql = "SELECT params FROM #__clm_liga as l" . " WHERE l.id = " . $rows[0]->liga;
        $db->setQuery($sql);
        $tparams = $db->loadObjectList();
        //Liga-Parameter aufbereiten
        $paramsStringArray = explode("\n", $tparams[0]->params);
        $lparams = array();
        foreach ($paramsStringArray as $value) {
            $ipos = strpos($value, '=');
            if ($ipos !== false) {
                $key = substr($value, 0, $ipos);
                if (substr($key, 0, 2) == "\\'") {
                    $key = substr($key, 2, strlen($key) - 4);
                }
                if (substr($key, 0, 1) == "'") {
                    $key = substr($key, 1, strlen($key) - 2);
                }
                $lparams[$key] = substr($value, $ipos + 1);
            }
        }
        if (!isset($lparams['round_date'])) {
            //Standardbelegung
            $lparams['round_date'] = '0';
        }
        CLMViewRunden::setRundenToolbar($rows[0]->sid, $lparams['round_date']);
        $user = JFactory::getUser();
        // Konfigurationsparameter auslesen
        $config = clm_core::$db->config();
        $val = $config->menue;
        $dropdown = $config->dropdown;
        //Ordering allowed ?
        $ordering = $lists['order'] == 'a.ordering';
        JHtml::_('behavior.tooltip');
        if (isset($rows[0]) && $rows[0]->sid_pub == "0" and $val != 0) {
            JError::raiseNotice(6000, JText::_('RUNDE_ERROR_SAISON_UNPUBLISHED'));
        }
        ?>
		<form action="index.php?option=com_clm&section=runden" method="post" name="adminForm" id="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
		<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
		<button onclick="this.form.submit();"><?php 
        echo JText::_('GO');
        ?>
</button>
		<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        // eigenes Dropdown Menue
        if ($val == 0 or $val == 1 and $dropdown == 1) {
            echo "&nbsp;&nbsp;&nbsp;" . $lists['sid'];
            echo "&nbsp;&nbsp;&nbsp;" . $lists['lid'];
        }
        echo "&nbsp;&nbsp;&nbsp;" . $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="3%">
						#
					</th>
					<th width="3%">
						<?php 
        echo $GLOBALS["clm"]["grid.checkall"];
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE', 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="3%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_NR', 'a.nr', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>

					<th width="7%">
						<?php 
        echo JHtml::_('grid.sort', 'JDATE', 'a.datum', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				<?php 
        if ($lparams['round_date'] == '0') {
            ?>
					<th width="4%">
						<?php 
            echo JHtml::_('grid.sort', 'RUNDE_STARTTIME', 'a.startzeit', @$lists['order_Dir'], @$lists['order']);
            ?>
					</th>
				<?php 
        }
        if ($lparams['round_date'] == '1') {
            ?>
					<th width="7%">
						<?php 
            echo JHtml::_('grid.sort', 'RUNDE_ENDDATUM', 'a.enddatum', @$lists['order_Dir'], @$lists['order']);
            ?>
					</th>
				<?php 
        }
        ?>
					<th width="8%">
						<?php 
        echo JHtml::_('grid.sort', 'ERGEBNISSE', 'e.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="15%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_LIGA', 'd.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="9%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_SAISON', 'c.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_MELDUNG', 'a.meldung', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_SL_OK', 'a.sl_ok', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHtml::_('grid.sort', 'RUNDE_INFO', 'a.bemerkungen', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHtml::_('grid.sort', 'JPUBLISHED', 'a.published', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="9%" nowrap="nowrap">
						<?php 
        echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'a.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        echo JHtml::_('grid.order', $rows);
        ?>
					</th>
					<th width="3%" nowrap="nowrap">
						<?php 
        echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="13">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        $row = JTable::getInstance('runden', 'TableCLM');
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row->load($rows[$i]->id);
            if ($val == 0) {
                $menu = 'index.php?option=com_clm&section=runden&task=edit&cid[]=' . $row->id;
            } else {
                if ($rows[$i]->durchgang > 1) {
                    if ($row->nr > 3 * $rows[$i]->runden) {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . ($row->nr - 3 * $rows[$i]->runden) . '&dg=4&liga=' . $row->liga;
                    } elseif ($row->nr > 2 * $rows[$i]->runden) {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . ($row->nr - 2 * $rows[$i]->runden) . '&dg=3&liga=' . $row->liga;
                    } elseif ($row->nr > $rows[$i]->runden) {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . ($row->nr - $rows[$i]->runden) . '&dg=2&liga=' . $row->liga;
                    } else {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . $row->nr . '&dg=1&liga=' . $row->liga;
                    }
                } else {
                    $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . $row->nr . '&dg=1' . '&liga=' . $row->liga;
                }
            }
            $link = JRoute::_($menu);
            $checked = JHtml::_('grid.checkedout', $row, $i);
            $published = JHtml::_('grid.published', $row, $i);
            ?>
				<tr class="<?php 
            echo 'row' . $k;
            ?>
">


					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>

					<td>
						<?php 
            echo $checked;
            ?>
					</td>

					<td>
	
								<span class="editlinktip hasTip" title="<?php 
            echo JText::_('Edit Runde');
            ?>
::<?php 
            echo $row->name;
            ?>
">
							<a href="index.php?option=com_clm&section=runden&task=edit&cid[]=<?php 
            echo $row->id;
            ?>
&liga=<?php 
            echo $cliga;
            ?>
">
								<?php 
            echo $row->name;
            ?>
</a></span>
	
					</td>

					<td align="center">
						<?php 
            echo $row->nr;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->datum;
            ?>
					</td>
				<?php 
            if ($lparams['round_date'] == '0') {
                ?>
					<td align="center">
						<?php 
                echo substr($row->startzeit, 0, 5);
                ?>
					</td>
				<?php 
            }
            if ($lparams['round_date'] == '1') {
                ?>
					<td align="center">
						<?php 
                echo $row->enddatum;
                ?>
					</td>
				<?php 
            }
            ?>
					<td align="center">
						<a href="<?php 
            echo $link;
            ?>
"><?php 
            echo JText::_('ERGEBNISSE');
            ?>
</a>
					</td>
					<td align="center">
						<?php 
            echo $rows[$i]->liga_name;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $rows[$i]->saison;
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->meldung == '1') {
                ?>
<img width="16" height="16" src="components/com_clm/images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="components/com_clm/images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->sl_ok == '1') {
                ?>
<img width="16" height="16" src="components/com_clm/images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="components/com_clm/images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->bemerkungen != '') {
                ?>
<img width="16" height="16" src="components/com_clm/images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="components/com_clm/images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>

	<td class="order">
	<span><?php 
            echo $pageNav->orderUpIcon($i, isset($rows[$i - 1]) and $rows[$i]->liga == $rows[$i - 1]->liga, 'orderup()', 'Move Up', $ordering);
            ?>
</span>
	<span><?php 
            echo $pageNav->orderDownIcon($i, $n, isset($rows[$i + 1]) and $rows[$i]->liga == $rows[$i + 1]->liga, 'orderdown()', 'Move Down', $ordering);
            ?>
</span>
	<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
	<input type="text" name="order[]" size="4" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>

					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="liga" value="<?php 
        echo JRequest::getVar('liga');
        ?>
" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHtml::_('form.token');
        ?>
		</form>
		<?php 
    }
Ejemplo n.º 2
0
    function runden(&$rows, &$lists, &$pageNav, $option)
    {
        global $mainframe;
        CLMViewRunden::setRundenToolbar();
        $user =& JFactory::getUser();
        // Konfigurationsparameter auslesen
        $config =& JComponentHelper::getParams('com_clm');
        $val = $config->get('menue', 1);
        $dropdown = $config->get('dropdown', 1);
        //Ordering allowed ?
        $ordering = $lists['order'] == 'a.ordering';
        JHTML::_('behavior.tooltip');
        if ($rows[0]->sid_pub == "0" and $val != 0) {
            JError::raiseNotice(6000, JText::_('RUNDE_ERROR_SAISON_UNPUBLISHED'));
        }
        ?>
		<form action="index.php?option=com_clm&section=runden" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
		<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
		<button onclick="this.form.submit();"><?php 
        echo JText::_('GO');
        ?>
</button>
		<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        // eigenes Dropdown Menue
        if ($val == 0 or $val == 1 and $dropdown == 1) {
            echo "&nbsp;&nbsp;&nbsp;" . $lists['sid'];
            echo "&nbsp;&nbsp;&nbsp;" . $lists['lid'];
        }
        echo "&nbsp;&nbsp;&nbsp;" . $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="10">
						<?php 
        echo JText::_('NUM');
        ?>
					</th>
					<th width="10">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE', 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="3%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_NR', 'a.nr', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>

					<th width="7%">
						<?php 
        echo JHTML::_('grid.sort', 'DATE', 'a.datum', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="11%">
						<?php 
        echo JHTML::_('grid.sort', 'ERGEBNISSE', 'e.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="15%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_LIGA', 'd.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="11%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_SAISON', 'c.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_MELDUNG', 'a.meldung', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_SL_OK', 'a.sl_ok', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_INFO', 'a.bemerkungen', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="4%">
						<?php 
        echo JHTML::_('grid.sort', 'RUNDE_DWZ', 'a.dwz', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>

					<th width="6%">
						<?php 
        echo JHTML::_('grid.sort', 'PUBLISHED', 'a.published', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ORDER', 'a.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
					</th>
					<th width="1%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'a.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="13">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            if ($val == 0) {
                $menu = 'index.php?option=com_clm&section=runden&task=edit&cid[]=' . $row->id;
            } else {
                if ($row->durchgang > 1) {
                    if ($row->nr > $row->runden) {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . ($row->nr - $row->runden) . '&dg=' . $row->durchgang;
                    } else {
                        $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . $row->nr . '&dg=1';
                    }
                } else {
                    $menu = 'index.php?option=com_clm&section=ergebnisse&runde=' . $row->nr . '&dg=1';
                }
            }
            $link = JRoute::_($menu);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
				<tr class="<?php 
            echo 'row' . $k;
            ?>
">


					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>

					<td>
						<?php 
            echo $checked;
            ?>
					</td>

					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out) or $row->sid_pub == "0" and $val != 0) {
                echo $row->name;
            } else {
                ?>
								<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Runde');
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="index.php?option=com_clm&section=runden&task=edit&cid[]=<?php 
                echo $row->id;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a></span>
							<?php 
            }
            ?>
					</td>

					<td align="center">
						<?php 
            echo $row->nr;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->datum;
            ?>
					</td>
					<td align="center">
						<a href="<?php 
            echo $link;
            ?>
"><?php 
            echo JText::_('ERGEBNISSE');
            ?>
</a>
					</td>
					<td align="center">
						<?php 
            echo $row->liga_name;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->saison;
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->meldung == '1') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->sl_ok == '1') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            if ($row->bemerkungen != '') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            ?>
					</td>

					<td align="center">
						<?php 
            if ($row->dwz == '1') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            }
            if ($row->dwz == '0') {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            if ($row->dwz == '2') {
                ?>
<img width="16" height="16" src="/administrator/components/com_clm/images/lupe.png" /> <?php 
            }
            ?>
					</td>

					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>

	<td class="order">
	<span><?php 
            echo $pageNav->orderUpIcon($i, $row->liga == @$rows[$i - 1]->liga, 'orderup()', 'Move Up', $ordering);
            ?>
</span>
	<span><?php 
            echo $pageNav->orderDownIcon($i, $n, $row->liga == @$rows[$i + 1]->liga, 'orderdown()', 'Move Down', $ordering);
            ?>
</span>
	<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
	<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>

					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }