Exemplo n.º 1
0
 function edit()
 {
     global $mainframe, $option;
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $task = JRequest::getVar('task');
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     $option = JRequest::getCmd('option');
     $section = JRequest::getVar('section');
     JArrayHelper::toInteger($cid, array(0));
     $row =& JTable::getInstance('gruppen', 'TableCLM');
     // load the row from the db table
     $row->load($cid[0]);
     $sql = " SELECT sl FROM #__clm_liga " . " WHERE id =" . $row->liga;
     $db->setQuery($sql);
     $lid = $db->loadObjectList();
     if ($lid[0]->sl != $jid and CLM_usertype !== 'admin' and $task == 'edit') {
         JError::raiseWarning(500, JText::_('GRUPPEN_STAFFFEL'));
         $link = 'index.php?option=' . $option . '&section=' . $section;
         $mainframe->redirect($link);
     }
     if ($task == 'edit') {
         // illegaler Einbruchversuch über URL !
         // evtl. mitschneiden !?!
         $saison =& JTable::getInstance('saisons', 'TableCLM');
         $saison->load($row->sid);
         if ($saison->archiv == "1" and CLM_usertype !== 'admin') {
             JError::raiseWarning(500, JText::_('GRUPPEN_RANG'));
             $mainframe->redirect('index.php?option=' . $option . '&section=vereine', $msg);
         }
         if ($cid[0] == "" and $task == 'edit') {
             JError::raiseWarning(500, JText::_('GRUPPEN_FALSCH'));
             $mainframe->redirect('index.php?option=' . $option . '&section=vereine', $msg);
         }
         // do stuff for existing records
         $row->checkout($user->get('id'));
     } else {
         // do stuff for new records  //
         $row->published = 0;
     }
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published);
     // Saisonlist //
     $sql = 'SELECT id as sid, name FROM #__clm_saison WHERE archiv =0';
     $db->setQuery($sql);
     if (!$db->query()) {
         $this->setRedirect('index.php?option=' . $option . '&section=' . $section);
         return JError::raiseWarning(500, $db->getErrorMsg());
     }
     $saisonlist[] = JHTML::_('select.option', '0', JText::_('GRUPPEN_SAISON'), 'sid', 'name');
     $saisonlist = array_merge($saisonlist, $db->loadObjectList());
     $lists['saison'] = JHTML::_('select.genericlist', $saisonlist, 'sid', 'class="inputbox" size="1"', 'sid', 'name', $row->sid);
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'gruppen.php';
     CLMViewGruppen::gruppe($row, $lists, $option, $jid, $user_group);
 }
Exemplo n.º 2
0
    function gruppe(&$row, $lists, $option, $jid, $user_clm)
    {
        CLMViewGruppen::setGruppeToolbar();
        JRequest::setVar('hidemainmenu', 1);
        JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'extrainfo');
        ?>
	<script language="javascript" type="text/javascript">
		<!--
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// do field validation
			if (form.Gruppe.value == "") {
				alert( "<?php 
        echo JText::_('GROUPS_OVERVIEW_SCRIPT_GROUP', true);
        ?>
" );
			} else if (form.Meldeschluss.value == "") {
				alert( "<?php 
        echo JText::_('GROUPS_OVERVIEW_SCRIPT_END', true);
        ?>
" );
			}
			 else if ( getSelectedValue('adminForm','sid') == 0 ) {
				alert( "<?php 
        echo JText::_('GROUPS_OVERVIEW_SCRIPT_SEASON', true);
        ?>
" );
			} else {
				submitform( pressbutton );
			}
		}
		//-->
		</script>

		<form action="index.php" method="post" name="adminForm">

		<div class="col width-50">
		<fieldset class="adminform">
		<legend><?php 
        echo JText::_('GROUPS_OVERVIEW_DETAILS');
        ?>
</legend>

		<table class="admintable">
		<tr>
			<td class="key" width="20%" nowrap="nowrap">
			<label for="Gruppe"><?php 
        echo JText::_('GROUPS_OVERVIEW_GROUP_NAME');
        ?>
</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="Gruppe" id="Gruppe" size="50" maxlength="60" value="<?php 
        echo $row->Gruppe;
        ?>
" />
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap">
			<label for="Meldeschluss"><?php 
        echo JText::_('GROUPS_OVERVIEW_END');
        ?>
</label>
			</td>
            		<td>
                	<?php 
        echo JHTML::_('calendar', $row->Meldeschluss, JText::_('GROUPS_OVERVIEW_END_CALENDAR'), JText::_('GROUPS_OVERVIEW_END_CALENDAR'), '%Y-%m-%d', array('class' => 'text_area', 'size' => '10', 'maxlength' => '10'));
        ?>
            		</td>

		</tr>

		<tr>
			<td class="key" nowrap="nowrap">
			<label for="geschlecht">
			<?php 
        echo JText::_('GROUPS_OVERVIEW_SEX_DD');
        ?>
			</label>
			</td>
			<td>
			<select name="geschlecht" id="geschlecht">" size="1">
			<option>- wählen -</option>
			<option <?php 
        if ($row->geschlecht == "1") {
            echo '"selected"';
        }
        ?>
 value="1"><?php 
        echo JText::_('GROUPS_OVERVIEW_SEX_DD1');
        ?>
</option>
			<option <?php 
        if ($row->geschlecht == "2") {
            echo '"selected"';
        }
        ?>
 value="2"><?php 
        echo JText::_('GROUPS_OVERVIEW_SEX_DD2');
        ?>
</option>
			<option <?php 
        if ($row->geschlecht == 0) {
            echo '"selected"';
        }
        ?>
 value="0"><?php 
        echo JText::_('GROUPS_OVERVIEW_SEX_DD3');
        ?>
</option>
			</select>
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap">
			<label for="durchgang">
			<?php 
        echo JText::_('GROUPS_OVERVIEW_AGE_DD1');
        ?>
			</label>
			</td>
			<td>
			<select name="alter_grenze" id="alter_grenze" >" size="1">
			<option>- wählen -</option>
			<option <?php 
        if ($row->alter_grenze == "1") {
            echo '"selected"';
        }
        ?>
 value="1"><?php 
        echo JText::_('GROUPS_OVERVIEW_AGE_DD2');
        ?>
</option>
			<option <?php 
        if ($row->alter_grenze == "2") {
            echo '"selected"';
        }
        ?>
 value="2"><?php 
        echo JText::_('GROUPS_OVERVIEW_AGE_DD3');
        ?>
</option>
			<option <?php 
        if ($row->alter_grenze == 0) {
            echo '"selected"';
        }
        ?>
 value="0"><?php 
        echo JText::_('GROUPS_OVERVIEW_AGE_DD4');
        ?>
</option>
			</select>
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap">
			<label for="alter">
			<?php 
        echo JText::_('GROUPS_OVERVIEW_AGE_DD5');
        ?>
			</label>
			</td>
			<td>
			<input class="inputbox" type="text" name="alter" id="alter" size="2" maxlength="3" value="<?php 
        echo $row->alter;
        ?>
" />
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="sid"><?php 
        echo JText::_('');
        ?>
</label>
			</td>
			<td>
			<?php 
        echo $lists['saison'];
        ?>
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="sid"><?php 
        echo JText::_('');
        ?>
</label>
			</td>
			<td>
				<input type="checkbox" id="delete" name="delete" value="1" /><?php 
        echo JText::_('GROUPS_OVERVIEW_TEXT_DELETE_HINT');
        ?>
			</td>
		</tr>

		<tr>
			<td class="key" nowrap="nowrap"><label for="sid"><?php 
        echo JText::_('GROUPS_OVERVIEW_TEXT_LEVEL');
        ?>
</label>
			</td>
			<td>
				<input type="checkbox" id="create" name="create" value="1" /><?php 
        echo JText::_('GROUPS_OVERVIEW_TEXT_LEVEL_HINT');
        ?>
			</td>
		</tr>
		<tr>
			<td class="key" nowrap="nowrap"><label for="published"><?php 
        echo JText::_('published : ');
        ?>
</label>
			</td>
			<td>
			<?php 
        echo $lists['published'];
        ?>
			</td>
		</tr>


		</table>
		</fieldset>
		</div>

 <div class="col width-50">
  <fieldset class="adminform">
   <legend><?php 
        echo JText::_('Bemerkungen');
        ?>
</legend>
	<legend><?php 
        echo JText::_('öffentliche');
        ?>
</legend>
	<br>
	<textarea class="inputbox" name="bemerkungen" id="bemerkungen" cols="40" rows="5" style="width:90%"><?php 
        echo str_replace('&', '&amp;', $row->bemerkungen);
        ?>
</textarea>
	<br>
	<legend><?php 
        echo JText::_('interne');
        ?>
</legend>
	<br>
	<textarea class="inputbox" name="bem_int" id="bem_int" cols="40" rows="5" style="width:90%"><?php 
        echo str_replace('&', '&amp;', $row->bem_int);
        ?>
</textarea>
  </fieldset>
  </div>

		<div class="clr"></div>

		<input type="hidden" name="section" value="gruppen" />
		<input type="hidden" name="option" value="com_clm" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="cid" value="<?php 
        echo $row->cid;
        ?>
" />
		<input type="hidden" name="user" value="<?php 
        echo $jid;
        ?>
" />
		<input type="hidden" name="user_clm" value="<?php 
        echo $user_clm;
        ?>
" />
		<input type="hidden" name="liste" value="<?php 
        echo $row->liste;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }