Commit fc739b3e authored by Felix Herrmann's avatar Felix Herrmann Committed by Wolf-Peter Utz
Browse files

Add tca files

 for correct extbase handling between own custom dashboard, update action and persist in database with extbase functions which requires tca.
parent f7478a61
......@@ -26,13 +26,13 @@ class Elector extends AbstractPerson
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\Election\Domain\Model\Electorate>
* @Lazy()
*/
protected $electorates = '';
protected $electorates;
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\Election\Domain\Model\ElectionInvitation>
* @Lazy()
*/
protected $electionInvitations = [];
protected $electionInvitations;
/**
* Elector constructor.
......@@ -41,6 +41,7 @@ class Elector extends AbstractPerson
{
parent::__construct();
$this->electorates = new ObjectStorage();
$this->electionInvitations = new ObjectStorage();
}
/**
......@@ -74,7 +75,7 @@ class Elector extends AbstractPerson
*/
public function getElectionInvitations()
{
return $this->electionInvitations ?? 0;
return $this->electionInvitations;
}
/**
......@@ -82,7 +83,7 @@ class Elector extends AbstractPerson
*/
public function setElectionInvitations($electionInvitations)
{
$this->electionInvitations = $electionInvitations ?? 0;
$this->electionInvitations = $electionInvitations;
}
/**
......
<?php
defined('TYPO3_MODE') or die();
(function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('Election', 'pi1', 'TYPO3 Election tool plugin');
}
)();
\ No newline at end of file
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'administration_group',
'election_manager_group',
'poll_manager_group',
'plugin_pid',
'number_of_mails',
'from_email',
'from_name',
'debug',
'test_email'
]);
return [
'ctrl' => [
'label' => 'uid',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'administration_group' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'be_groups',
'eval' => 'required',
],
],
'election_manager_group' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'be_groups',
'eval' => 'required',
],
],
'poll_manager_group' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'be_groups',
'eval' => 'required',
],
],
'plugin_pid' => [
'config' => [
'type' => 'input',
'size' => 5,
'eval' => 'int,required',
],
],
'number_of_mails' => [
'config' => [
'type' => 'input',
'size' => 5,
'eval' => 'int,required',
'default' => 10
],
],
'from_name' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
'from_email' => [
'config' => [
'type' => 'input',
'size' => 30,
'validation' => 'email',
'eval' => 'trim,required',
],
],
'debug' => [
'config' => [
'type' => 'check'
],
],
'test_email' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
],
]
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'title',
'description',
'start_date',
'end_date',
'electorate',
'nominees',
'number_of_votes',
'election_votes'
]);
return [
'ctrl' => [
'label' => 'title',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'title' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
'description' => [
'config' => [
'type' => 'text',
'rows' => 10,
'eval' => 'trim,required',
],
],
'start_date' => [
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'size' => 16,
'eval' => 'datetime,int,required',
],
],
'end_date' => [
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'size' => 16,
'eval' => 'datetime,int,required',
],
],
'electorate' => [
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_election_domain_model_electorate'
],
],
'nominees' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingleBox',
'multiple' => true,
'size' => 30,
'readOnly' => true,
'foreign_table' => 'tx_election_domain_model_nominee',
'MM' => 'tx_election_domain_model_election_nominee_mm'
],
],
'number_of_votes' => [
'config' => [
'type' => 'input',
'readOnly' => true
],
],
'election_votes' => [
'config' => [
'type' => 'input',
'readOnly' => true
],
],
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'subject',
'body',
'election'
]);
return [
'ctrl' => [
'label' => 'subject',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'subject' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
'body' => [
'config' => [
'type' => 'text',
'rows' => 10,
'eval' => 'trim,required',
],
],
'election' => [
'config' => [
'type' => 'passthrough'
]
]
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'secret',
'election_circular',
'elector',
'success',
'voted'
]);
return [
'ctrl' => [
'label' => 'elector',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'secret' => [
'config' => [
'type' => 'passthrough',
],
],
'election_circular' => [
'config' => [
'type' => 'passthrough',
],
],
'elector' => [
'config' => [
'type' => 'passthrough',
],
],
'success' => [
'config' => [
'type' => 'passthrough',
],
],
'voted' => [
'config' => [
'type' => 'passthrough',
],
],
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'elector',
'election',
'nominee'
]);
return [
'ctrl' => [
'label' => 'elector',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'elector' => [
'config' => [
'type' => 'passthrough',
],
],
'election' => [
'config' => [
'type' => 'passthrough',
],
],
'nominee' => [
'config' => [
'type' => 'passthrough',
],
],
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'first_name',
'middle_name',
'last_name',
'gender',
'email',
'electorates',
'election_invitations'
]);
return [
'ctrl' => [
'label' => 'last_name',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'first_name' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
],
],
'middle_name' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
],
],
'last_name' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
'gender' => [
'config' => [
'type' => 'input',
'size' => 1,
'eval' => 'int',
],
],
'email' => [
'config' => [
'type' => 'input',
'size' => 30,
'validation' => 'email',
'eval' => 'trim,required',
],
],
'electorate' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingleBox',
'multiple' => true,
'foreign_table' => 'tx_election_domain_model_electorate',
'MM' => 'tx_election_domain_model_electorate_elector_mm'
],
],
'election_invitations' => [
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_election_domain_model_electioninvitation',
'foreign_field' => 'elector'
]
]
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {
$fields = implode(',', [
'title',
'electors'
]);
return [
'ctrl' => [
'label' => 'title',
'crdate' => 'creation_date',
'cruser_id' => 'creation_user',
'hideTable' => true,
'adminOnly' => true
],
'types' => [
'1' => [
'showitem' => "$fields",
],
],
'columns' => [
'title' => [
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
],
],
'electors' => [
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_election_domain_model_elector',
'MM' => 'tx_election_domain_model_electorate_elector_mm'
],
]
],
];
})();
<?php
/**
* This file is part of the "election" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Wolf Utz, Felix Herrmann
*/
declare(strict_types=1);
return (
function () {