Skip to content
Snippets Groups Projects
Verified Commit af56e83d authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Change TCA file types to the new file type

parent 31d96cf2
No related branches found
No related tags found
1 merge request!48[TASK] Require TYPO3 12
......@@ -4,14 +4,18 @@ declare(strict_types=1);
// if you need to change this, keep in mind the changes need to be done in
// Configuration/TypoScript/Common/setup.typoscript for TYPO3 9, too
use SGalinski\SgJobs\Domain\Model\ExperienceLevel;
use SGalinski\SgJobs\Domain\Model\FileReference;
use SGalinski\SgJobs\Domain\Model\JobApplication;
return [
\SGalinski\SgJobs\Domain\Model\FileReference::class => [
FileReference::class => [
'tableName' => 'sys_file_reference'
],
\SGalinski\SgJobs\Domain\Model\JobApplication::class => [
JobApplication::class => [
'tableName' => 'tx_sgjobs_domain_model_job_application'
],
\SGalinski\SgJobs\Domain\Model\ExperienceLevel::class => [
ExperienceLevel::class => [
'tableName' => 'tx_sgjobs_domain_model_experience_level'
]
];
......@@ -6,6 +6,8 @@
* Either use a closure here, or do not call your variable $icons.
*/
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
$iconList = [];
$sgJobsIcons = [
'extension-sg_jobs-module' => 'module-sgjobs.svg',
......@@ -13,7 +15,7 @@ $sgJobsIcons = [
foreach ($sgJobsIcons as $identifier => $path) {
$iconList[$identifier] = [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'provider' => SvgIconProvider::class,
'source' => 'EXT:sg_jobs/Resources/Public/Icons/' . $path,
];
}
......
<?php
defined('TYPO3') or die();
/**
*
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/
// Adds the static TypoScript template.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
ExtensionManagementUtility::addStaticFile(
'sg_jobs',
'Configuration/TypoScript/Frontend',
'SgJobs - Configuration'
......
<?php
defined('TYPO3') or die();
/**
*
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/
// Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
ExtensionUtility::registerPlugin(
'sg_jobs',
'Joblist',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:listPlugin'
);
// Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
ExtensionUtility::registerPlugin(
'sg_jobs',
'JobApplication',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:applyPlugin'
);
// Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
ExtensionUtility::registerPlugin(
'sg_jobs',
'JobTeaser',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:teaserPlugin'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_joblist'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_joblist',
'FILE:EXT:sg_jobs/Configuration/FlexForms/Joblist.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobapplication'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_jobapplication',
'FILE:EXT:sg_jobs/Configuration/FlexForms/JobApplication.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobteaser'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_jobteaser',
'FILE:EXT:sg_jobs/Configuration/FlexForms/JobTeaser.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgjobs_joblist'] = \SGalinski\SgJobs\Preview\PreviewRenderer::class;
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgjobs_jobapplication'] = \SGalinski\SgJobs\Preview\PreviewRenderer::class;
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgjobs_jobteaser'] = \SGalinski\SgJobs\Preview\PreviewRenderer::class;
......@@ -174,16 +174,11 @@ $columns = [
'image' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'image',
[
'appearance' => [
'useSortable' => TRUE,
],
'minitems' => 0,
'maxitems' => 1,
]
),
'config' => [
'type' => 'file',
'minitems' => 0,
'maxitems' => 1,
]
],
'phone' => [
'exclude' => TRUE,
......
......@@ -209,11 +209,11 @@ $columns = [
'attachment' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.attachment',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'attachment',
['maxitems' => 1],
'pdf'
)
'config' => [
'type' => 'file',
'maxitems' => 1,
'allowed' => ['pdf']
]
],
'department' => [
'exclude' => TRUE,
......
......@@ -332,29 +332,32 @@ $columns = [
'cover_letter' => [
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cover_letter',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'cover_letter',
['maxitems' => 1, 'minitems' => 1],
'pdf'
),
'config' => [
'type' => 'file',
'maxitems' => 1,
'minitems' => 1,
'allowed' => ['pdf']
]
],
'certificate' => [
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.certificate',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'certificate',
['maxitems' => 1, 'minitems' => 1],
'pdf'
),
'config' => [
'type' => 'file',
'maxitems' => 1,
'minitems' => 1,
'allowed' => ['pdf']
]
],
'cv' => [
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cv',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'cv',
['maxitems' => 1, 'minitems' => 1],
'pdf'
),
'config' => [
'type' => 'file',
'maxitems' => 1,
'minitems' => 1,
'allowed' => ['pdf']
]
],
'privacy_policy' => [
'exclude' => FALSE,
......
<?php
use SGalinski\SgAjax\Service\AjaxRegistration;
use SGalinski\SgJobs\Controller\Ajax\UploadController;
use SGalinski\SgJobs\Controller\JoblistController;
use SGalinski\SgJobs\Controller\JobTeaserController;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
call_user_func(
static function () {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
ExtensionManagementUtility::addTypoScriptSetup(
'@import "EXT:sg_jobs/Configuration/TypoScript/Common/setup.typoscript"'
);
// Configure frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
ExtensionUtility::configurePlugin(
'SgJobs',
'Joblist',
[
// Available actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'index'
JoblistController::class => 'index'
],
[
// Non-Cache actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'index'
JoblistController::class => 'index'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
ExtensionUtility::configurePlugin(
'SgJobs',
'JobApplication',
[
// Available actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'applyForm, apply, empty'
JoblistController::class => 'applyForm, apply, empty'
],
[
// Non-Cache actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'applyForm, apply, empty'
JoblistController::class => 'applyForm, apply, empty'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
ExtensionUtility::configurePlugin(
'SgJobs',
'JobTeaser',
[
// Available actions
\SGalinski\SgJobs\Controller\JobTeaserController::class => 'index'
JobTeaserController::class => 'index'
],
[
// Non-Cache actions
\SGalinski\SgJobs\Controller\JobTeaserController::class => ''
JobTeaserController::class => ''
]
);
\SGalinski\SgAjax\Service\AjaxRegistration::configureAjaxFrontendPlugin(
AjaxRegistration::configureAjaxFrontendPlugin(
'sg_jobs',
[
\SGalinski\SgJobs\Controller\Ajax\UploadController::class => 'uploadCoverletter, uploadCv, uploadCertificate',
UploadController::class => 'uploadCoverletter, uploadCv, uploadCertificate',
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants(
ExtensionManagementUtility::addTypoScriptConstants(
'@import "EXT:sg_jobs/Configuration/TypoScript/Backend/constants.typoscript"'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
ExtensionManagementUtility::addTypoScriptSetup(
'@import "EXT:sg_jobs/Configuration/TypoScript/Backend/setup.typoscript"'
);
......@@ -63,7 +70,7 @@ call_user_func(
$GLOBALS['sg_mail']['sg_jobs']['ApplicantMail'] = 'EXT:sg_jobs/Configuration/SgMail/ApplicantMail.php';
//include Plugin sg_jobs
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
ExtensionManagementUtility::addPageTSConfig(
'@import "EXT:sg_jobs/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"'
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment