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); ...@@ -4,14 +4,18 @@ declare(strict_types=1);
// if you need to change this, keep in mind the changes need to be done in // 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 // 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 [ return [
\SGalinski\SgJobs\Domain\Model\FileReference::class => [ FileReference::class => [
'tableName' => 'sys_file_reference' 'tableName' => 'sys_file_reference'
], ],
\SGalinski\SgJobs\Domain\Model\JobApplication::class => [ JobApplication::class => [
'tableName' => 'tx_sgjobs_domain_model_job_application' 'tableName' => 'tx_sgjobs_domain_model_job_application'
], ],
\SGalinski\SgJobs\Domain\Model\ExperienceLevel::class => [ ExperienceLevel::class => [
'tableName' => 'tx_sgjobs_domain_model_experience_level' 'tableName' => 'tx_sgjobs_domain_model_experience_level'
] ]
]; ];
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Either use a closure here, or do not call your variable $icons. * Either use a closure here, or do not call your variable $icons.
*/ */
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
$iconList = []; $iconList = [];
$sgJobsIcons = [ $sgJobsIcons = [
'extension-sg_jobs-module' => 'module-sgjobs.svg', 'extension-sg_jobs-module' => 'module-sgjobs.svg',
...@@ -13,7 +15,7 @@ $sgJobsIcons = [ ...@@ -13,7 +15,7 @@ $sgJobsIcons = [
foreach ($sgJobsIcons as $identifier => $path) { foreach ($sgJobsIcons as $identifier => $path) {
$iconList[$identifier] = [ $iconList[$identifier] = [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, 'provider' => SvgIconProvider::class,
'source' => 'EXT:sg_jobs/Resources/Public/Icons/' . $path, 'source' => 'EXT:sg_jobs/Resources/Public/Icons/' . $path,
]; ];
} }
......
<?php <?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. // Adds the static TypoScript template.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
ExtensionManagementUtility::addStaticFile(
'sg_jobs', 'sg_jobs',
'Configuration/TypoScript/Frontend', 'Configuration/TypoScript/Frontend',
'SgJobs - Configuration' 'SgJobs - Configuration'
......
<?php <?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 // 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', 'sg_jobs',
'Joblist', 'Joblist',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:listPlugin' 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:listPlugin'
); );
// Register frontend plugins // Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( ExtensionUtility::registerPlugin(
'sg_jobs', 'sg_jobs',
'JobApplication', 'JobApplication',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:applyPlugin' 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:applyPlugin'
); );
// Register frontend plugins // Register frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( ExtensionUtility::registerPlugin(
'sg_jobs', 'sg_jobs',
'JobTeaser', 'JobTeaser',
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:teaserPlugin' 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_backend.xlf:teaserPlugin'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_joblist'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_joblist'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_joblist', 'sgjobs_joblist',
'FILE:EXT:sg_jobs/Configuration/FlexForms/Joblist.xml' 'FILE:EXT:sg_jobs/Configuration/FlexForms/Joblist.xml'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobapplication'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobapplication'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_jobapplication', 'sgjobs_jobapplication',
'FILE:EXT:sg_jobs/Configuration/FlexForms/JobApplication.xml' 'FILE:EXT:sg_jobs/Configuration/FlexForms/JobApplication.xml'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobteaser'] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgjobs_jobteaser'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( ExtensionManagementUtility::addPiFlexFormValue(
'sgjobs_jobteaser', 'sgjobs_jobteaser',
'FILE:EXT:sg_jobs/Configuration/FlexForms/JobTeaser.xml' '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 = [ ...@@ -174,16 +174,11 @@ $columns = [
'image' => [ 'image' => [
'exclude' => TRUE, 'exclude' => TRUE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.image', 'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => [
'image', 'type' => 'file',
[ 'minitems' => 0,
'appearance' => [ 'maxitems' => 1,
'useSortable' => TRUE, ]
],
'minitems' => 0,
'maxitems' => 1,
]
),
], ],
'phone' => [ 'phone' => [
'exclude' => TRUE, 'exclude' => TRUE,
......
...@@ -209,11 +209,11 @@ $columns = [ ...@@ -209,11 +209,11 @@ $columns = [
'attachment' => [ 'attachment' => [
'exclude' => TRUE, 'exclude' => TRUE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.attachment', 'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.attachment',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'config' => [
'attachment', 'type' => 'file',
['maxitems' => 1], 'maxitems' => 1,
'pdf' 'allowed' => ['pdf']
) ]
], ],
'department' => [ 'department' => [
'exclude' => TRUE, 'exclude' => TRUE,
......
...@@ -332,29 +332,32 @@ $columns = [ ...@@ -332,29 +332,32 @@ $columns = [
'cover_letter' => [ 'cover_letter' => [
'exclude' => FALSE, 'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cover_letter', '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( 'config' => [
'cover_letter', 'type' => 'file',
['maxitems' => 1, 'minitems' => 1], 'maxitems' => 1,
'pdf' 'minitems' => 1,
), 'allowed' => ['pdf']
]
], ],
'certificate' => [ 'certificate' => [
'exclude' => FALSE, 'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.certificate', '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( 'config' => [
'certificate', 'type' => 'file',
['maxitems' => 1, 'minitems' => 1], 'maxitems' => 1,
'pdf' 'minitems' => 1,
), 'allowed' => ['pdf']
]
], ],
'cv' => [ 'cv' => [
'exclude' => FALSE, 'exclude' => FALSE,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cv', '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( 'config' => [
'cv', 'type' => 'file',
['maxitems' => 1, 'minitems' => 1], 'maxitems' => 1,
'pdf' 'minitems' => 1,
), 'allowed' => ['pdf']
]
], ],
'privacy_policy' => [ 'privacy_policy' => [
'exclude' => FALSE, 'exclude' => FALSE,
......
<?php <?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( call_user_func(
static function () { static function () {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup( ExtensionManagementUtility::addTypoScriptSetup(
'@import "EXT:sg_jobs/Configuration/TypoScript/Common/setup.typoscript"' '@import "EXT:sg_jobs/Configuration/TypoScript/Common/setup.typoscript"'
); );
// Configure frontend plugins // Configure frontend plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( ExtensionUtility::configurePlugin(
'SgJobs', 'SgJobs',
'Joblist', 'Joblist',
[ [
// Available actions // Available actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'index' JoblistController::class => 'index'
], ],
[ [
// Non-Cache actions // Non-Cache actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'index' JoblistController::class => 'index'
] ]
); );
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( ExtensionUtility::configurePlugin(
'SgJobs', 'SgJobs',
'JobApplication', 'JobApplication',
[ [
// Available actions // Available actions
\SGalinski\SgJobs\Controller\JoblistController::class => 'applyForm, apply, empty' JoblistController::class => 'applyForm, apply, empty'
], ],
[ [
// Non-Cache actions // 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', 'SgJobs',
'JobTeaser', 'JobTeaser',
[ [
// Available actions // Available actions
\SGalinski\SgJobs\Controller\JobTeaserController::class => 'index' JobTeaserController::class => 'index'
], ],
[ [
// Non-Cache actions // Non-Cache actions
\SGalinski\SgJobs\Controller\JobTeaserController::class => '' JobTeaserController::class => ''
] ]
); );
\SGalinski\SgAjax\Service\AjaxRegistration::configureAjaxFrontendPlugin( AjaxRegistration::configureAjaxFrontendPlugin(
'sg_jobs', '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"' '@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"' '@import "EXT:sg_jobs/Configuration/TypoScript/Backend/setup.typoscript"'
); );
...@@ -63,7 +70,7 @@ call_user_func( ...@@ -63,7 +70,7 @@ call_user_func(
$GLOBALS['sg_mail']['sg_jobs']['ApplicantMail'] = 'EXT:sg_jobs/Configuration/SgMail/ApplicantMail.php'; $GLOBALS['sg_mail']['sg_jobs']['ApplicantMail'] = 'EXT:sg_jobs/Configuration/SgMail/ApplicantMail.php';
//include Plugin sg_jobs //include Plugin sg_jobs
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( ExtensionManagementUtility::addPageTSConfig(
'@import "EXT:sg_jobs/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"' '@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