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
2e16bea0
Commit
2e16bea0
authored
7 years ago
by
Stefan Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[FEATURE] Cleanups and add the title / description for each single view
parent
7116ce80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Controller/JoblistController.php
+28
-10
28 additions, 10 deletions
Classes/Controller/JoblistController.php
with
28 additions
and
10 deletions
Classes/Controller/JoblistController.php
+
28
−
10
View file @
2e16bea0
...
...
@@ -76,7 +76,7 @@ class JoblistController extends ActionController {
* @return void
* @throws \InvalidArgumentException
*/
public
function
indexAction
(
array
$filters
=
[],
$jobId
=
null
)
{
public
function
indexAction
(
array
$filters
=
[],
$jobId
=
NULL
)
{
if
(
$filters
)
{
$this
->
view
->
assign
(
'selectedCountry'
,
$filters
[
'filterCountry'
]);
$this
->
view
->
assign
(
'selectedCompany'
,
$filters
[
'filterCompany'
]);
...
...
@@ -94,7 +94,16 @@ class JoblistController extends ActionController {
$jobLimit
=
(
int
)
$this
->
settings
[
'jobLimit'
];
if
(
$jobId
)
{
$jobs
=
[
$this
->
jobRepository
->
findByUid
(
$jobId
)];
/** @var Job $job */
$job
=
$this
->
jobRepository
->
findByUid
(
$jobId
);
if
(
!
$job
)
{
throw
new
\InvalidArgumentException
(
'Given Job Id is invalid!'
);
}
$GLOBALS
[
'TSFE'
]
->
page
[
'titlebyextension'
]
=
$job
->
getTitle
();
$GLOBALS
[
'TSFE'
]
->
page
[
'description'
]
=
substr
(
$job
->
getDescription
(),
0
,
200
);
$jobs
=
[
$job
];
$numberOfPages
=
1
;
}
else
{
// pagination logic
...
...
@@ -123,6 +132,7 @@ class JoblistController extends ActionController {
* @param JobApplication $applyData
* @param string $error
* @param int $uid
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
*/
public
function
applyFormAction
(
JobApplication
$applyData
=
NULL
,
$error
=
NULL
,
$uid
=
NULL
)
{
...
...
@@ -135,19 +145,25 @@ class JoblistController extends ActionController {
try
{
$folderName
=
$this
->
request
->
getArgument
(
'folderName'
);
}
catch
(
\Exception
$exception
)
{
// nope
// this happens for the initial call, but works for any follow-up call as the form validation
// throws you back to this one if something has failed
}
if
(
$folderName
===
NULL
)
{
$folderName
=
md5
(
uniqid
(
'sgjobs-'
,
TRUE
));
$this
->
request
->
setArgument
(
'folderName'
,
$folderName
);
}
$this
->
view
->
assign
(
'folderName'
,
$folderName
);
$job
Data
=
NULL
;
$job
=
NULL
;
if
(
!
$uid
!==
NULL
)
{
/** @var Job $jobData */
$jobData
=
$this
->
jobRepository
->
findByUid
(
$uid
);
$this
->
view
->
assign
(
'job'
,
$jobData
);
/** @var Job $job */
$job
=
$this
->
jobRepository
->
findByUid
(
$uid
);
if
(
$job
)
{
$GLOBALS
[
'TSFE'
]
->
page
[
'titlebyextension'
]
=
$job
->
getTitle
();
$GLOBALS
[
'TSFE'
]
->
page
[
'description'
]
=
substr
(
$job
->
getDescription
(),
0
,
200
);
}
$this
->
view
->
assign
(
'job'
,
$job
);
}
// display country options
...
...
@@ -164,8 +180,8 @@ class JoblistController extends ActionController {
if
(
$applyData
===
NULL
)
{
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
$applyData
=
$this
->
objectManager
->
get
(
JobApplication
::
class
);
if
(
$job
Data
)
{
$applyData
->
setJobId
(
$job
Data
->
getJobId
());
if
(
$job
)
{
$applyData
->
setJobId
(
$job
->
getJobId
());
}
}
...
...
@@ -238,8 +254,11 @@ class JoblistController extends ActionController {
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @throws NoSuchArgumentException
*/
public
function
applyAction
(
JobApplication
$applyData
)
{
$folderName
=
$this
->
request
->
getArgument
(
'folderName'
);
try
{
$applyData
->
setPid
(
$GLOBALS
[
'TSFE'
]
->
id
);
...
...
@@ -258,7 +277,6 @@ class JoblistController extends ActionController {
$this
->
jobApplicationRepository
->
update
(
$applyData
);
}
$folderName
=
$this
->
request
->
getArgument
(
'folderName'
);
$this
->
submitApplicationFiles
(
$applyData
,
$folderName
);
/** @noinspection PhpMethodParametersCountMismatchInspection */
...
...
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