User assiciations are changable from within the backend interface from the clubs.

This commit is contained in:
2019-06-12 18:15:06 +02:00
parent 7210dff28c
commit 28494f6142
8 changed files with 299 additions and 102 deletions

View File

@@ -1,6 +1,7 @@
<?php
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Factory;
// No direct access.
defined('_JEXEC') or die;
@@ -12,13 +13,37 @@ class ClubsViewClubPosition extends HtmlView
function display($tpl = null)
{
$input = Factory::getApplication()->input->get;
$positonFactory = new CommonClubsModelFactoryPosition();
$userFactory = new CommonClubsModelFactoryUser();
$this->positions = $positonFactory->loadElements();
$this->users = $userFactory->loadElements();
$this->id = 'new';
$id = $input->getCmd('id', 'new');
$assocFactory = new CommonClubsModelFactoryUserassoc();
if($id !== 'new')
{
$id = (int) $id;
$this->assoc = $assocFactory->loadById($id);
}
else
{
$this->assoc = $assocFactory->createNew();
}
$this->id = $id;
$this->clubid = $input->getInt('club');
$this->username = '<i>Derzeit vakant.</i>';
$this->usercity = '';
if($this->assoc->getUser() !== null)
{
$u = $this->assoc->getUser();
$this->username = htmlentities($u->getName());
$this->usercity = htmlentities($u->getCity());
}
parent::display($tpl);