Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_jobs
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_jobs
Commits
69815882
Commit
69815882
authored
7 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Adding static info tables options for countries & nationalities
parent
e628f2e8
No related branches found
Branches containing commit
Tags
1.6.2
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Service/TcaItemsProcessor.php
+77
-0
77 additions, 0 deletions
Classes/Service/TcaItemsProcessor.php
Configuration/TCA/tx_sgjobs_domain_model_job_application.php
+40
-7
40 additions, 7 deletions
Configuration/TCA/tx_sgjobs_domain_model_job_application.php
with
117 additions
and
7 deletions
Classes/Service/TcaItemsProcessor.php
0 → 100644
+
77
−
0
View file @
69815882
<?php
namespace
SGalinski\SgJobs\Service
;
/***************************************************************
* 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!
***************************************************************/
use
SJBR\StaticInfoTables\Domain\Model\Country
;
use
SJBR\StaticInfoTables\Domain\Repository\CountryRepository
;
use
SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSelectItemsProcessor
;
use
TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
/**
* Class TcaItemsProcessor
*
* @package SGalinski\SgJobs\Service
*/
class
TcaItemsProcessor
extends
TcaSelectItemsProcessor
{
/**
* returns the country options from static info tables
*
* @param array $PA
* @param TcaSelectItems $fObj
* @throws \InvalidArgumentException
*/
public
function
getCountryOptions
(
array
$PA
,
TcaSelectItems
$fObj
)
{
$items
=
$PA
[
'items'
];
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
/** @var CountryRepository $countryRepository */
$countryRepository
=
$objectManager
->
get
(
CountryRepository
::
class
);
$objects
=
$countryRepository
->
findAllOrderedBy
(
'shortNameEn'
)
->
toArray
();
if
(
!
empty
(
$objects
))
{
// Index rows by uid
$uidIndexedObjects
=
[];
/** @var Country $object */
foreach
(
$objects
as
$object
)
{
$uidIndexedObjects
[
$object
->
getUid
()]
=
$object
;
$items
[]
=
[
$object
->
getShortNameEn
(),
$object
->
getUid
()];
}
}
$items
=
$this
->
translateSelectorItems
(
$items
,
'static_countries'
);
if
(
count
(
$items
)
>
1
)
{
foreach
(
$items
as
$key
=>
$item
)
{
$object
=
NULL
;
if
(
$item
[
1
]
&&
$object
=
$uidIndexedObjects
[
$item
[
1
]])
{
$items
[
$key
][
1
]
=
$object
->
getIsoCodeA3
();
}
}
}
$PA
[
'items'
]
=
$items
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Configuration/TCA/tx_sgjobs_domain_model_job_application.php
+
40
−
7
View file @
69815882
<?php
return
[
use
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
;
$tx_sgjobs_domain_model_job_application
=
[
'ctrl'
=>
[
'title'
=>
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application'
,
'label'
=>
'first_name, last_name'
,
...
...
@@ -27,14 +29,14 @@ return [
],
'interface'
=>
[
'showRecordFieldList'
=>
'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job_id, area, job_function, start_date, alternative_start_date,
company, task, qualification, description, contact'
,
company, task, qualification, description, contact'
,
],
'types'
=>
[
'1'
=>
[
'showitem'
=>
'--palette--;;sysLanguageAndHidden,job_id, gender, first_name, last_name, street, city, zip,
country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, cv, certificates,
div;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'
,
country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, cv, certificates,
div;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'
,
],
],
'palettes'
=>
[
...
...
@@ -188,7 +190,7 @@ return [
],
],
'country'
=>
[
'exclude'
=>
0
,
'exclude'
=>
TRUE
,
'label'
=>
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.country'
,
'config'
=>
[
'type'
=>
'input'
,
...
...
@@ -305,4 +307,35 @@ return [
],
]
],
];
\ No newline at end of file
];
if
(
ExtensionManagementUtility
::
isLoaded
(
'static_info_tables'
))
{
$tx_sgjobs_domain_model_job_application
[
'columns'
][
'country'
]
=
[
'exclude'
=>
TRUE
,
'label'
=>
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.country'
,
'config'
=>
[
'type'
=>
'select'
,
'renderType'
=>
'selectSingle'
,
'items'
=>
[[
''
,
''
]],
'itemsProcFunc'
=>
'SGalinski\SgJobs\Service\TcaItemsProcessor->getCountryOptions'
,
'size'
=>
1
,
'minitems'
=>
0
,
'maxitems'
=>
1
,
],
];
$tx_sgjobs_domain_model_job_application
[
'columns'
][
'nationality'
]
=
[
'exclude'
=>
TRUE
,
'label'
=>
'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.nationality'
,
'config'
=>
[
'type'
=>
'select'
,
'renderType'
=>
'selectSingle'
,
'items'
=>
[[
''
,
''
]],
'itemsProcFunc'
=>
'SGalinski\SgJobs\Service\TcaItemsProcessor->getCountryOptions'
,
'size'
=>
1
,
'minitems'
=>
0
,
'maxitems'
=>
1
,
],
];
}
return
$tx_sgjobs_domain_model_job_application
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment