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
dfb552b2
Commit
dfb552b2
authored
7 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.sgalinski.de:typo3/sg_jobs
parents
916f5370
79a04105
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Controller/JoblistController.php
+17
-6
17 additions, 6 deletions
Classes/Controller/JoblistController.php
Resources/Private/Templates/Joblist/ApplyForm.html
+1
-0
1 addition, 0 deletions
Resources/Private/Templates/Joblist/ApplyForm.html
with
18 additions
and
6 deletions
Classes/Controller/JoblistController.php
+
17
−
6
View file @
dfb552b2
...
...
@@ -28,6 +28,7 @@ namespace SGalinski\SgJobs\Controller;
use
SGalinski\SgJobs\Domain\Model\JobApplication
;
use
SGalinski\SgMail\Service\MailTemplateService
;
use
TYPO3\CMS\Core\Messaging\FlashMessage
;
use
TYPO3\CMS\Core\Resource\DuplicationBehavior
;
use
TYPO3\CMS\Core\Resource\ResourceFactory
;
use
TYPO3\CMS\Core\Utility\File\ExtendedFileUtility
;
...
...
@@ -35,7 +36,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
use
TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
;
use
TYPO3\CMS\Extbase\Mvc\Controller\ActionController
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
use
TYPO3\CMS\Extbase\Utility\DebuggerUtility
;
/**
* The joblist plugin controller
...
...
@@ -68,7 +68,6 @@ class JoblistController extends ActionController {
$this
->
assignFilterValues
(
$storagePid
);
$this
->
view
->
assign
(
'recordPageId'
,
$storagePid
);
// pagination logic
$jobLimit
=
(
int
)
$this
->
settings
[
'jobLimit'
];
$offset
=
0
;
...
...
@@ -117,6 +116,9 @@ class JoblistController extends ActionController {
* Saves the application send by the applyFormAction
*
* @param JobApplication $applyData
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \InvalidArgumentException
*/
public
function
applyAction
(
JobApplication
$applyData
)
{
try
{
...
...
@@ -147,7 +149,8 @@ class JoblistController extends ActionController {
}
catch
(
\Exception
$exception
)
{
// possible errors, because of wrong mails (maybe log that somewhere? Does this makes sense?)
// @TODO handle the exception, possibley redirect to form with error message
GeneralUtility
::
makeInstance
(
FlashMessage
::
class
,
$exception
->
getMessage
());
$this
->
redirect
(
'applyFormAction'
);
}
}
...
...
@@ -155,6 +158,9 @@ class JoblistController extends ActionController {
* Pre-apply action setup, configures model-property mapping and handles file upload
*
* @return void
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
* @throws \Exception
...
...
@@ -170,9 +176,10 @@ class JoblistController extends ActionController {
$this
->
handleFileUpload
(
'coverLetter'
,
$uniqueFolderName
);
$this
->
handleFileUpload
(
'cv'
,
$uniqueFolderName
);
$this
->
handleFileUpload
(
'certificates'
,
$uniqueFolderName
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
xception
)
{
// possible errors, because of wrong mails
// @TODO output them in some way?
GeneralUtility
::
makeInstance
(
FlashMessage
::
class
,
$exception
->
getMessage
());
$this
->
redirect
(
'applyFormAction'
);
}
$propertyMappingConfiguration
=
$this
->
arguments
->
getArgument
(
'applyData'
)
->
getPropertyMappingConfiguration
();
$propertyMappingConfiguration
->
forProperty
(
'coverLetter'
)
->
allowAllProperties
();
...
...
@@ -317,6 +324,9 @@ class JoblistController extends ActionController {
* @param JobApplication $data
* @param string $filePath
* @param array $fileNames
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
private
function
writeApplicationFile
(
JobApplication
$data
,
$filePath
,
$fileNames
)
{
...
...
@@ -353,7 +363,8 @@ class JoblistController extends ActionController {
fputcsv
(
$file
,
$dataToInsertArr
);
fclose
(
$file
);
}
catch
(
\RuntimeException
$exception
)
{
throw
new
\RuntimeException
(
$exception
->
getMessage
());
GeneralUtility
::
makeInstance
(
FlashMessage
::
class
,
$exception
->
getMessage
());
$this
->
redirect
(
'applyFormAction'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Resources/Private/Templates/Joblist/ApplyForm.html
+
1
−
0
View file @
dfb552b2
<f:layout
name=
"Default"
/>
<f:section
name=
"main"
>
<f:flashMessages
/>
<f:form
action=
"apply"
controller=
"Joblist"
method=
"post"
objectName=
"applyData"
object=
"{applyData}"
enctype=
"multipart/form-data"
>
<f:if
condition=
"{job}"
>
<f:form.hidden
value=
"{job.jobId}"
property=
"jobId"
/>
...
...
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