User assiciations are changable from within the backend interface from the clubs.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user