Made clubs view in the backend working generally (no CUD)

This commit is contained in:
Christian Wolf 2019-05-20 13:02:04 +02:00
parent f8df0c3fc4
commit 4dc78c21af
3 changed files with 24 additions and 15 deletions

View File

@ -10,7 +10,7 @@ class ClubsClub extends AbstractClubsModel
protected $name;
protected $address;
protected $city;
protected $homapge;
protected $homepage;
protected $mail;
protected $iban;
protected $bic;
@ -36,9 +36,9 @@ class ClubsClub extends AbstractClubsModel
/**
* @return string
*/
public function getHomapge()
public function getHomepage()
{
return $this->homapge;
return $this->homepage;
}
/**
@ -110,7 +110,7 @@ class ClubsClub extends AbstractClubsModel
*/
public function setHomapge(string $homapge)
{
$this->homapge = $homapge;
$this->homepage = $homapge;
}
/**
@ -209,10 +209,10 @@ class ClubsClub extends AbstractClubsModel
}
public function getOffers()
{
// public function getOffers()
// {
}
// }
protected function loadCustomData($assoc)
@ -232,12 +232,12 @@ class ClubsClub extends AbstractClubsModel
protected function getDataMappings()
{
return array('neme', 'address', 'city', 'homepage', 'mail', 'iban', 'bic', 'charitable');
return array('name', 'address', 'city', 'homepage', 'mail', 'iban', 'bic', 'charitable');
}
protected function getRequiredDataMappings()
{
return array('neme', 'address', 'city', 'mail', 'iban', 'bic', 'charitable');
return array('name', 'address', 'city', 'mail', 'iban', 'bic', 'charitable');
}
private const tableName = '#__club_clubs';

View File

@ -11,18 +11,26 @@ defined('_JEXEC') or die;
<thead>
<tr>
<th width='30%'>Bezeichnung</th>
<th width='25%'>Stadt</th>
<th width='20%'>Homepage</th>
<th width='25%'>E-Mail</th>
<th width='5%'>L&ouml;schen?</th>
<th width='5%'>id</th>
</tr>
</thead>
<?php foreach($this->offers as $offer): ?>
<?php $link = Route::_('index.php?option=com_clubs&view=offer&id=' . $offer->getId()); ?>
<?php foreach($this->clubs as $club): ?>
<?php $link = Route::_('index.php?option=com_clubs&view=club&id=' . $club->getId()); ?>
<?php $url = htmlentities($club->getHomepage()); ?>
<?php $mail = htmlentities($club->getMail()); ?>
<tr>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($offer->getName()); ?></a></td>
<td><a href='<?php echo Route::_('index.php?option=com_clubs&task=offer.delete&id=' . $offer->getId()); ?>'>Del</a></td>
<td><?php echo htmlentities($offer->getId()); ?></td>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($club->getName()); ?></a></td>
<td><?php echo htmlentities($club->getCity()); ?></td>
<td><a href='<?php echo $url; ?>' target='_blank'><?php echo $url; ?></a></td>
<td><a href='mailto:<?php echo $mail; ?>'><?php echo $mail; ?></a></td>
<td><!--<a href='<?php echo Route::_('index.php?option=com_clubs&task=club.delete&id=' . $club->getId()); ?>'>Del</a> --></td>
<td><?php echo htmlentities($club->getId()); ?></td>
</tr>
<?php endforeach; ?>
</table>
<div><a href='<?php echo Route::_('index.php?option=com_clubs&view=offer&id=new'); ?>'>Neues Angebot anlegen</a></div>
<div><a href='<?php echo Route::_('index.php?option=com_clubs&view=club&id=new'); ?>'>Neuen Verein anlegen</a></div>

View File

@ -12,6 +12,7 @@ class ClubsViewClubs extends HtmlView
function display($tpl = null)
{
// $this->offers = ClubsOffer::loadOffers();
$this->clubs = ClubsClub::loadClubs();
ToolbarHelper::title('Club-Management - Clubs');
parent::display($tpl);