@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | use EWW\Dpf\Domain\Model\FrontendUser; |
18 | 18 | use EWW\Dpf\Domain\Model\FrontendUserGroup; |
19 | 19 | |
20 | -class Security |
|
21 | -{ |
|
20 | +class Security { |
|
22 | 21 | /** |
23 | 22 | * frontendUserRepository |
24 | 23 | * |
@@ -45,8 +44,7 @@ discard block |
||
45 | 44 | * |
46 | 45 | * @return null|\EWW\Dpf\Domain\Model\FrontendUser |
47 | 46 | */ |
48 | - public function getUser() |
|
49 | - { |
|
47 | + public function getUser() { |
|
50 | 48 | $token = $GLOBALS['_GET']['tx_dpf_rest_api']['token']; |
51 | 49 | $user = $GLOBALS['TSFE']->fe_user->user; |
52 | 50 | if (!empty($user) && is_array($user) && array_key_exists('uid', $user)) { |
@@ -87,8 +85,7 @@ discard block |
||
87 | 85 | * Gets the role of the current frontend user |
88 | 86 | * @return string |
89 | 87 | */ |
90 | - public function getUserRole() |
|
91 | - { |
|
88 | + public function getUserRole() { |
|
92 | 89 | if ($this->getUser()) { |
93 | 90 | return $this->getUser()->getUserRole(); |
94 | 91 | } |
@@ -99,8 +96,7 @@ discard block |
||
99 | 96 | * Gets the name of the current frontend user |
100 | 97 | * @return string |
101 | 98 | */ |
102 | - public function getUsername() |
|
103 | - { |
|
99 | + public function getUsername() { |
|
104 | 100 | if ($this->getUser()) { |
105 | 101 | return $this->getUser()->getUsername(); |
106 | 102 | } |
@@ -111,8 +107,7 @@ discard block |
||
111 | 107 | * Gets the fis person id of the current frontend user |
112 | 108 | * @return string |
113 | 109 | */ |
114 | - public function getFisPersId() |
|
115 | - { |
|
110 | + public function getFisPersId() { |
|
116 | 111 | if ($this->getUser()) { |
117 | 112 | return $this->getUser()->getFisPersId(); |
118 | 113 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
26 | 26 | * @TYPO3\CMS\Extbase\Annotation\Inject |
27 | 27 | */ |
28 | - protected $frontendUserRepository = null; |
|
28 | + protected $frontendUserRepository = NULL; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * frontendUserGroupRepository |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @var \EWW\Dpf\Domain\Repository\FrontendUserGroupRepository |
34 | 34 | * @TYPO3\CMS\Extbase\Annotation\Inject |
35 | 35 | */ |
36 | - protected $frontendUserGroupRepository = null; |
|
36 | + protected $frontendUserGroupRepository = NULL; |
|
37 | 37 | |
38 | 38 | const ROLE_ANONYMOUS = "ROLE_ANONYMOUS"; |
39 | 39 | const ROLE_RESEARCHER = "ROLE_RESEARCHER"; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | if (empty($accessToIds[0])) { |
91 | - return null; |
|
91 | + return NULL; |
|
92 | 92 | } else { |
93 | 93 | return $accessToIds; |
94 | 94 | } |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Frontend user group |
19 | 19 | */ |
20 | -class FrontendUserGroup extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup |
|
21 | -{ |
|
20 | +class FrontendUserGroup extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup { |
|
22 | 21 | /** |
23 | 22 | * Gets the kitodo role |
24 | 23 | * |
@@ -32,8 +31,7 @@ discard block |
||
32 | 31 | */ |
33 | 32 | protected $accessToGroups = ''; |
34 | 33 | |
35 | - public function getKitodoRole() |
|
36 | - { |
|
34 | + public function getKitodoRole() { |
|
37 | 35 | return $this->kitodoRole; |
38 | 36 | } |
39 | 37 | |
@@ -42,8 +40,7 @@ discard block |
||
42 | 40 | * |
43 | 41 | * @param $kitodoRole |
44 | 42 | */ |
45 | - public function setKitodoRole($kitodoRole) |
|
46 | - { |
|
43 | + public function setKitodoRole($kitodoRole) { |
|
47 | 44 | $this->kitodoRole = $kitodoRole; |
48 | 45 | } |
49 | 46 |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * DocumentFormController |
29 | 29 | */ |
30 | -abstract class AbstractDocumentFormController extends AbstractController |
|
31 | -{ |
|
30 | +abstract class AbstractDocumentFormController extends AbstractController { |
|
32 | 31 | |
33 | 32 | /** |
34 | 33 | * documentRepository |
@@ -99,8 +98,7 @@ discard block |
||
99 | 98 | * |
100 | 99 | * @return void |
101 | 100 | */ |
102 | - public function listAction() |
|
103 | - { |
|
101 | + public function listAction() { |
|
104 | 102 | $documents = $this->documentRepository->findAll(); |
105 | 103 | $docTypes = $this->documentTypeRepository->getDocumentTypesAlphabetically(); |
106 | 104 | |
@@ -121,8 +119,7 @@ discard block |
||
121 | 119 | * |
122 | 120 | * @return void |
123 | 121 | */ |
124 | - public function initializeNewAction() |
|
125 | - { |
|
122 | + public function initializeNewAction() { |
|
126 | 123 | |
127 | 124 | $requestArguments = $this->request->getArguments(); |
128 | 125 | |
@@ -151,8 +148,7 @@ discard block |
||
151 | 148 | * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("newDocumentForm") |
152 | 149 | * @return void |
153 | 150 | */ |
154 | - public function newAction(DocumentForm $newDocumentForm = null, $returnDocumentId = 0) |
|
155 | - { |
|
151 | + public function newAction(DocumentForm $newDocumentForm = null, $returnDocumentId = 0) { |
|
156 | 152 | $this->view->assign('returnDocumentId', $returnDocumentId); |
157 | 153 | $this->view->assign('documentForm', $newDocumentForm); |
158 | 154 | |
@@ -165,8 +161,7 @@ discard block |
||
165 | 161 | } |
166 | 162 | } |
167 | 163 | |
168 | - public function initializeCreateAction() |
|
169 | - { |
|
164 | + public function initializeCreateAction() { |
|
170 | 165 | |
171 | 166 | $requestArguments = $this->request->getArguments(); |
172 | 167 | |
@@ -200,8 +195,7 @@ discard block |
||
200 | 195 | * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm |
201 | 196 | * @return void |
202 | 197 | */ |
203 | - public function createAction(DocumentForm $newDocumentForm) |
|
204 | - { |
|
198 | + public function createAction(DocumentForm $newDocumentForm) { |
|
205 | 199 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
206 | 200 | |
207 | 201 | /* @var $newDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -281,8 +275,7 @@ discard block |
||
281 | 275 | |
282 | 276 | } |
283 | 277 | |
284 | - public function initializeEditAction() |
|
285 | - { |
|
278 | + public function initializeEditAction() { |
|
286 | 279 | $requestArguments = $this->request->getArguments(); |
287 | 280 | |
288 | 281 | if (array_key_exists('document', $requestArguments)) { |
@@ -312,8 +305,7 @@ discard block |
||
312 | 305 | * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("documentForm") |
313 | 306 | * @return void |
314 | 307 | */ |
315 | - public function editAction(DocumentForm $documentForm) |
|
316 | - { |
|
308 | + public function editAction(DocumentForm $documentForm) { |
|
317 | 309 | $this->view->assign('documentForm', $documentForm); |
318 | 310 | |
319 | 311 | if (!empty($this->security->getUserAccessToGroups())) { |
@@ -325,8 +317,7 @@ discard block |
||
325 | 317 | } |
326 | 318 | } |
327 | 319 | |
328 | - public function initializeUpdateAction() |
|
329 | - { |
|
320 | + public function initializeUpdateAction() { |
|
330 | 321 | $requestArguments = $this->request->getArguments(); |
331 | 322 | |
332 | 323 | if ($this->request->hasArgument('documentData')) { |
@@ -359,8 +350,7 @@ discard block |
||
359 | 350 | * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm |
360 | 351 | * @return void |
361 | 352 | */ |
362 | - public function updateAction(DocumentForm $documentForm) |
|
363 | - { |
|
353 | + public function updateAction(DocumentForm $documentForm) { |
|
364 | 354 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
365 | 355 | |
366 | 356 | /* @var $updateDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -409,18 +399,15 @@ discard block |
||
409 | 399 | * |
410 | 400 | * @return void |
411 | 401 | */ |
412 | - public function cancelAction() |
|
413 | - { |
|
402 | + public function cancelAction() { |
|
414 | 403 | $this->redirectToList(); |
415 | 404 | } |
416 | 405 | |
417 | - protected function redirectAfterUpdate() |
|
418 | - { |
|
406 | + protected function redirectAfterUpdate() { |
|
419 | 407 | $this->redirect('list'); |
420 | 408 | } |
421 | 409 | |
422 | - protected function redirectToList($message = null) |
|
423 | - { |
|
410 | + protected function redirectToList($message = null) { |
|
424 | 411 | $this->redirect('list'); |
425 | 412 | } |
426 | 413 |