Removed some bugs in Imlpementation of club's details

This commit is contained in:
Christian Wolf 2019-05-20 14:55:27 +02:00
parent 5ce47c288d
commit f4f59dcc81
3 changed files with 14 additions and 10 deletions

View File

@ -23,7 +23,7 @@ class ClubsControllerClub extends AbstractClubsController
'iban' => array('required'=>true, 'name'=>'IBAN', 'filter'=>'string'),
'bic' => array('required'=>true, 'name'=>'BIC', 'filter'=>'string'),
'charitable' => array('skip_null_check'=>True),
'president' => array('required'=>true, 'name'=>'Vorsitzender', 'skip_null_check'=>True)
'president' => array('required'=>true, 'name'=>'Vorsitzender', 'skip_null_check'=>True, 'setter'=>'setPresidentId')
);
}
@ -36,4 +36,9 @@ class ClubsControllerClub extends AbstractClubsController
$values['president'] = ClubsUser::loadUser((int)($values['president']));
}
protected function filterPrePacking(&$values)
{
$values['president'] = $values['president']->getId();
}
}

View File

@ -92,7 +92,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $address
*/
public function setAddress(string $address)
public function setAddress( $address)
{
$this->address = $address;
}
@ -100,7 +100,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $city
*/
public function setCity(string $city)
public function setCity($city)
{
$this->city = $city;
}
@ -108,7 +108,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $homapge
*/
public function setHomepage(string $homapge)
public function setHomepage($homapge)
{
$this->homepage = $homapge;
}
@ -116,7 +116,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $mail
*/
public function setMail(string$mail)
public function setMail($mail)
{
$this->mail = $mail;
}
@ -124,7 +124,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $iban
*/
public function setIban(string $iban)
public function setIban($iban)
{
$this->iban = $iban;
}
@ -132,7 +132,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $bic
*/
public function setBic(string $bic)
public function setBic($bic)
{
$this->bic = $bic;
}
@ -172,7 +172,7 @@ class ClubsClub extends AbstractClubsModel
/**
* @param string $name
*/
public function setName(string $name)
public function setName($name)
{
$this->name = $name;
}

View File

@ -54,10 +54,9 @@ defined('_JEXEC') or die;
<tr>
<td>Vorsitzende/r</td>
<td>
<!-- <input type='text' name='president' value='<?php echo htmlentities($this->object->getName()); ?>'> -->
<select name='president'>
<?php foreach($this->users as $u): ?>
<option value='<?php echo $u->getId(); ?>' <?php if ($this->object->getPresident()->getId() == $u->getId()) echo 'selected="selected"'; ?>>
<option value='<?php echo $u->getId(); ?>' <?php if ($this->object->getPresident() !== null && $this->object->getPresident()->getId() == $u->getId()) echo 'selected="selected"'; ?>>
<?php echo htmlentities("{$u->getName()}, {$u->getCity()}"); ?>
</option>
<?php endforeach; ?>