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
b09bed59
Commit
b09bed59
authored
7 years ago
by
Stefan Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Cleanup and fix obvious errors
parent
51f4fc83
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
+8
-12
8 additions, 12 deletions
Classes/Controller/JoblistController.php
with
8 additions
and
12 deletions
Classes/Controller/JoblistController.php
+
8
−
12
View file @
b09bed59
...
...
@@ -29,13 +29,13 @@ namespace SGalinski\SgJobs\Controller;
use
SGalinski\SgJobs\Domain\Model\JobApplication
;
use
SGalinski\SgMail\Service\MailTemplateService
;
use
TYPO3\CMS\Core\Log\LogLevel
;
use
TYPO3\CMS\Core\Log\LogManager
;
use
TYPO3\CMS\Core\Resource\DuplicationBehavior
;
use
TYPO3\CMS\Core\Resource\ResourceFactory
;
use
TYPO3\CMS\Core\Utility\File\ExtendedFileUtility
;
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
;
/**
* The joblist plugin controller
...
...
@@ -93,6 +93,7 @@ class JoblistController extends ActionController {
*
* @param JobApplication $applyData
* @param string $error
* @throws \InvalidArgumentException
*/
public
function
applyFormAction
(
JobApplication
$applyData
=
NULL
,
$error
=
NULL
)
{
if
(
$this
->
request
->
getOriginalRequest
())
{
...
...
@@ -100,8 +101,8 @@ class JoblistController extends ActionController {
$this
->
view
->
assign
(
'uploadedFiles'
,
$uploadedFiles
);
}
if
(
$error
!==
NULL
)
{
$logger
=
GeneralUtility
::
makeInstance
(
'TYPO3\CMS\Core\Log\
LogManager
'
)
->
getLogger
(
__CLASS__
);
if
(
$error
!==
NULL
&&
$error
!==
''
)
{
$logger
=
$this
->
objectManager
->
get
(
LogManager
::
class
)
->
getLogger
(
__CLASS__
);
$logger
->
log
(
LogLevel
::
ALERT
,
$error
);
$this
->
view
->
assign
(
'error'
,
1
);
}
...
...
@@ -248,8 +249,7 @@ class JoblistController extends ActionController {
* @throws \InvalidArgumentException
*/
private
function
getExistingFiles
(
$folder
):
array
{
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$resourceFactory
=
$objectManager
->
get
(
ResourceFactory
::
class
);
$resourceFactory
=
$this
->
objectManager
->
get
(
ResourceFactory
::
class
);
$storage
=
$resourceFactory
->
getStorageObject
(
1
);
$folderObject
=
$storage
->
getFolder
(
'/Extension/'
.
$folder
);
...
...
@@ -288,8 +288,7 @@ class JoblistController extends ActionController {
* @throws \InvalidArgumentException
*/
private
function
submitApplicationFiles
(
JobApplication
$applicationData
,
$folderName
)
{
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$resourceFactory
=
$objectManager
->
get
(
ResourceFactory
::
class
);
$resourceFactory
=
$this
->
objectManager
->
get
(
ResourceFactory
::
class
);
$storage
=
$resourceFactory
->
getStorageObject
(
1
);
$newName
=
date
(
'Ymd-His'
)
.
'_'
.
$applicationData
->
getFirstName
();
...
...
@@ -416,8 +415,7 @@ class JoblistController extends ActionController {
$data
=
[];
$namespace
=
key
(
$_FILES
);
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$resourceFactory
=
$objectManager
->
get
(
ResourceFactory
::
class
);
$resourceFactory
=
$this
->
objectManager
->
get
(
ResourceFactory
::
class
);
$storage
=
$resourceFactory
->
getStorageObject
(
1
);
if
(
!
$storage
->
hasFolder
(
'/Extension/temp/'
.
$folderName
.
'/'
.
$fieldName
))
{
$storage
->
createFolder
(
'/Extension/temp/'
.
$folderName
.
'/'
.
$fieldName
);
...
...
@@ -428,9 +426,7 @@ class JoblistController extends ActionController {
// Register every upload field from the form:
$this
->
registerUploadField
(
$data
,
$namespace
,
$fieldName
,
$targetFalDirectory
);
// Initializing:
/** @var \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $fileProcessor */
$fileProcessor
=
GeneralUtility
::
makeInstance
(
ExtendedFileUtility
::
class
);
$fileProcessor
=
$this
->
objectManager
->
get
(
ExtendedFileUtility
::
class
);
$fileProcessor
->
setActionPermissions
([
'addFile'
=>
TRUE
]);
$fileProcessor
->
setFileExtensionPermissions
(
$this
->
settings
[
'allowedFileExtensions'
],
''
);
...
...
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