Skip to content

Commit

Permalink
[FEATURE] added options for detail plugin
Browse files Browse the repository at this point in the history
fields: layout, jobsStorage, jobsListView
  • Loading branch information
Teisi committed Jun 24, 2024
1 parent 5984ab8 commit 74a9374
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 7 deletions.
8 changes: 8 additions & 0 deletions Classes/Controller/JobpostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ public function showAction(Jobpost $jobpost = null): ResponseInterface {
$jobpost = $this->jobpostRepository->findByUid(intval($queryParams['tx_hhsimplejobposts_jobslist']['jobpost']));
}

$jobPostStorageString = isset($this->settings['jobsStorage']) ? $this->settings['jobsStorage'] : '';
if(!empty($jobPostStorageString)) {
$jobPostStorageArray = \explode(',', $jobPostStorageString);
if(!in_array($jobpost->getPid(), $jobPostStorageArray)) {
$jobpost = [];
}
}

if(!empty($jobpost)) {
$contactPointEmail = null;
$contactPointTelephone = null;
Expand Down
76 changes: 76 additions & 0 deletions Configuration/FlexForms/hhsimplejobposts_jobsdetail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Jobs Detail View</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.layout>
<TCEforms>
<exclude>1</exclude>
<label>
LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.layout
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">default</numIndex>
<numIndex index="1">default</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</settings.layout>

<settings.jobsStorage>
<TCEforms>
<exclude>1</exclude>
<label>
LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.jobsStorage
</label>
<description>
LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.jobsStorage.description
</description>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>3</size>
<maxitems>10</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
<wizards>
<suggest>
<type>suggest</type>
</suggest>
</wizards>
</config>
</TCEforms>
</settings.jobsStorage>

<settings.jobsListView>
<TCEforms>
<exclude>1</exclude>
<label>
LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.jobsListView
</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.jobsListView>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
13 changes: 10 additions & 3 deletions Configuration/FlexForms/hhsimplejobposts_jobslist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<el>
<!-- <settings.companiesStorage>
<TCEforms>
<exclude>1</exclude>
<label>
Wo sind die Companies gespeichert?
</label>
Expand All @@ -32,7 +33,7 @@
<settings.layout>
<TCEforms>
<exclude>1</exclude>
<label>Layout</label>
<label>LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.layout</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
Expand All @@ -48,6 +49,7 @@

<settings.useExternalApi>
<TCEforms>
<exclude>1</exclude>
<label>
Use external API?
</label>
Expand All @@ -67,6 +69,7 @@

<settings.orderJobsDefaultToApi>
<TCEforms>
<exclude>1</exclude>
<label>Show default jobs before API-jobs (order)?</label>
<description>Default: first show jobs from API then jobs from TYPO3 backend (default-jobs).</description>
<displayCond>FIELD:settings.useExternalApi:!=:default</displayCond>
Expand Down Expand Up @@ -228,6 +231,7 @@

<settings.jobsStorageApi>
<TCEforms>
<exclude>1</exclude>
<label>
Wo sind / sollen die Jobs aus der API gespeichert werden?
</label>
Expand All @@ -250,9 +254,10 @@
</settings.jobsStorageApi>

<settings.jobsStorage>
<exclude>1</exclude>
<TCEforms>
<label>
Wo sind die Jobs (default) gespeichert?
LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.jobsStorage
</label>
<config>
<type>group</type>
Expand All @@ -273,6 +278,7 @@

<!-- <settings.companiesDetailView>
<TCEforms>
<exclude>1</exclude>
<label>Company Detail Page</label>
<config>
<type>group</type>
Expand All @@ -288,7 +294,8 @@

<settings.jobsDetailView>
<TCEforms>
<label>Jobs Detail Page (optional)</label>
<exclude>1</exclude>
<label>LLL:EXT:hh_simple_job_posts/Resources/Private/Language/locallang_plugin.xlf:settings.jobsDetailView</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
Expand Down
11 changes: 10 additions & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@
);
// ---------------

$pluginName2 = 'jobsdetail';
$pluginSignature2 = $extensionNameLower . '_' . strtolower($pluginName2);
ExtensionUtility::registerPlugin(
'HhSimpleJobPosts',
'Jobsdetail',
$pluginName2,
'Jobs Detail'
);

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature2] = 'select_key,recursive,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature2] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature2,
'FILE:EXT:' . $extensionKey . '/Configuration/FlexForms/' . $pluginSignature2 . '.xml'
);
});
17 changes: 17 additions & 0 deletions Resources/Private/Language/locallang_plugin.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@
<source>Descending</source>
</trans-unit>

<trans-unit id="settings.layout" xml:space="preserve">
<source>Layout</source>
</trans-unit>
<trans-unit id="settings.jobsStorage" xml:space="preserve">
<source>Define the pages/sysfolders which hold the job records (optional)</source>
</trans-unit>
<trans-unit id="settings.jobsStorage.description" xml:space="preserve">
<source>If set, the system checks whether the job is located in the selected storage locations when it is called up!</source>
</trans-unit>
<trans-unit id="settings.jobsListView" xml:space="preserve">
<source>Select the page which is used to return to on detail view</source>
</trans-unit>
<trans-unit id="settings.jobsDetailView" xml:space="preserve">
<source>PageId for single job display</source>
</trans-unit>


</body>
</file>
</xliff>
4 changes: 3 additions & 1 deletion Resources/Private/Templates/Jobpost/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ <h5><f:translate key="LLL:EXT:hh_simple_job_posts/Resources/Private/Language/loc
</f:else>
</f:if>

<f:comment><f:link.action action="list">Back to list</f:link.action></f:comment>
<f:comment>
<f:link.action action="list" pageUid="{settings.jobsListView}">Back to list</f:link.action>
</f:comment>
</f:section>

</html>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"url": "https://www.paypal.com/paypalme/hauerheinrich"
}
],
"version": "4.1.1",
"version": "4.1.2",
"license": ["GPL-2.0-or-later"],
"keywords": ["TYPO3 CMS", "jobs", "Extension"],
"replace": {
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'state' => 'beta',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '4.1.1',
'version' => '4.1.2',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-12.4.99',
Expand Down

0 comments on commit 74a9374

Please sign in to comment.