Commit aaff73d3 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Remove membership logo, no storage page respect and some code beautify

parent 6bea1c20
......@@ -67,7 +67,7 @@ class MemberController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
*
* @return void
*/
public function listAction()
public function listAction(): void
{
$filterMembership = 0;
$filterString = '';
......@@ -80,6 +80,12 @@ class MemberController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
$this->view->assign('selectedMembership', $filterMembership);
}
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->memberRepository->setDefaultQuerySettings($querySettings);
$this->membershipRepository->setDefaultQuerySettings($querySettings);
if ($filterString || $filterMembership) {
$members = $this->memberRepository->findByStringAndMembership($filterString, $filterMembership);
} else {
......
<?php
namespace T3o\T3oMembership\Domain\Model;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extbase\Annotation as Extbase;
/**
* Class \T3oMembership\Domain\Model\Membership
......@@ -29,14 +31,6 @@ class Membership extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
*/
protected $name;
/**
* logo
*
* @var string
* @Extbase\Validate("NotEmpty")
*/
protected $logo;
/**
* personalMembership
*
......@@ -105,27 +99,6 @@ class Membership extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
$this->name = $name;
}
/**
* Returns the logo
*
* @return string $logo
*/
public function getLogo()
{
return $this->logo;
}
/**
* Sets the logo
*
* @param string $logo
* @return void
*/
public function setLogo($logo)
{
$this->logo = $logo;
}
/**
* Returns the status of a membership (personal or company)
*
......@@ -137,7 +110,7 @@ class Membership extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
}
/**
* Sets the logo
* Sets the status of a membership (personal or company)
*
* @param bool $personalMembership
* @return void
......
......@@ -23,11 +23,10 @@ use TYPO3\CMS\Extbase\Persistence\QueryInterface;
*/
class MembershipRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
/**
* @var array
*/
protected $defaultOrderings = array(
'uid' => QueryInterface::ORDER_ASCENDING
);
}
\ No newline at end of file
}
......@@ -3,287 +3,264 @@ if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_t3omembership_domain_model_member',
'EXT:t3o_membership/Resources/Private/Language/locallang_csh_tx_t3omembership_domain_model_member.xlf'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_t3omembership_domain_model_member',
'EXT:t3o_membership/Resources/Private/Language/locallang_csh_tx_t3omembership_domain_model_member.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_t3omembership_domain_model_member'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_t3omembership_domain_model_member');
$tca = array(
'ctrl' => array(
'title' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
return [
'ctrl' => [
'title' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
),
'searchFields' => 'name,external_id,end_date,address,zip,city,country,email,url,membership,',
'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3o_membership') . 'Configuration/TCA/tx_t3omembership_domain_model_member.php',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3o_membership') . 'Resources/Public/Icons/tx_t3omembership_domain_model_member.gif'
),
'interface' => array(
'endtime' => 'endtime',
],
'searchFields' => 'name,external_id,end_date,address,zip,city,country,email,url,membership,',
'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3o_membership') . 'Configuration/TCA/tx_t3omembership_domain_model_member.php',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3o_membership') . 'Resources/Public/Icons/tx_t3omembership_domain_model_member.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, firstname, lastname, external_id, end_date, address, zip, city, country, email, invoice_email, url, membership, logo',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, firstname, lastname, external_id, subscription_no, end_date, address, zip, city, country, email, invoice_email, url, membership, logo,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'sys_language_uid' => array(
],
'types' => [
'1' => ['showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, firstname, lastname, external_id, subscription_no, end_date, address, zip, city, country, email, invoice_email, url, membership, logo,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime, endtime'],
],
'palettes' => [
'1' => ['showitem' => ''],
],
'columns' => [
'sys_language_uid' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'config' => [
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
'l10n_parent' => array(
'items' => [
['LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1],
['LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0]
],
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => array(
'config' => [
'type' => 'select',
'items' => array(
array('', 0),
),
'items' => [
['', 0],
],
'foreign_table' => 'tx_t3omembership_domain_model_member',
'foreign_table_where' => 'AND tx_t3omembership_domain_model_member.pid=###CURRENT_PID### AND tx_t3omembership_domain_model_member.sys_language_uid IN (-1,0)',
),
),
'l10n_diffsource' => array(
'config' => array(
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
),
),
'hidden' => array(
],
],
'hidden' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => array(
'config' => [
'type' => 'check',
),
),
'starttime' => array(
],
],
'starttime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => array(
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'endtime' => array(
],
],
],
'endtime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'name' => array(
],
],
],
'name' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.name',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'external_id' => array(
],
],
'external_id' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.external_id',
'config' => array(
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int,required'
),
),
'subscription_no' => array(
],
],
'subscription_no' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.subscription_no',
'config' => array(
'config' => [
'type' => 'input',
'size' => 4,
'eval' => 'int,required'
),
),
'end_date' => array(
],
],
'end_date' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.end_date',
'config' => array(
'config' => [
'type' => 'input',
'size' => 10,
'eval' => 'datetime,required',
'checkbox' => 1,
'default' => time()
),
),
'address' => array(
],
],
'address' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.address',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'zip' => array(
],
],
'zip' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.zip',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'city' => array(
],
],
'city' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.city',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'country' => array(
],
],
'country' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.country',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'email' => array(
],
],
'email' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.email',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'invoice_email' => array(
],
],
'invoice_email' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.invoice_email',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'url' => array(
],
],
'url' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.url',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'firstname' => array(
],
],
'firstname' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.firstname',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'lastname' => array(
],
],
'lastname' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.lastname',
'config' => array(
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'membership' => array(
],
],
'membership' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.membership',
'config' => array(
'config' => [
'type' => 'select',
'foreign_table' => 'tx_t3omembership_domain_model_membership',
'minitems' => 0,
'maxitems' => 1,
),
),
'logo' => array(
],
],
'logo' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_member.logo',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'image',
array(
'appearance' => array(
'createNewRelationLinkTitle' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
),
'foreign_types' => array(
'0' => array(
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', [
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'foreign_types' => [
'0' => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
),
],
],
'maxitems' => 1
),
'svg'
),
),
),
);
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('typo3_agencies')) {
$tca['columns']['agency'] = array(
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_typo3agencies_domain_model_agency',
'foreign_field' => 'related_member',
'minitems' => 0,
'maxitems' => 1,
),
);
}
return $tca;
\ No newline at end of file
], 'svg'),
],
],
];
......@@ -3,153 +3,137 @@ if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_t3omembership_domain_model_membership',
'EXT:t3o_membership/Resources/Private/Language/locallang_csh_tx_t3omembership_domain_model_membership.xlf'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_t3omembership_domain_model_membership',
'EXT:t3o_membership/Resources/Private/Language/locallang_csh_tx_t3omembership_domain_model_membership.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_t3omembership_domain_model_membership'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_t3omembership_domain_model_membership');
return array(
'ctrl' => array(
'title' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_membership',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
return [
'ctrl' => [
'title' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_domain_model_membership',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'sortby' => 'sorting',
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'sortby' => 'sorting',
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',