@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * SearchController |
| 28 | 28 | */ |
| 29 | -class SearchController extends \EWW\Dpf\Controller\AbstractSearchController |
|
| 30 | -{ |
|
| 29 | +class SearchController extends \EWW\Dpf\Controller\AbstractSearchController { |
|
| 31 | 30 | |
| 32 | 31 | /** |
| 33 | 32 | * documentRepository |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | * |
| 82 | 81 | * @return void |
| 83 | 82 | */ |
| 84 | - public function listAction() |
|
| 85 | - { |
|
| 83 | + public function listAction() { |
|
| 86 | 84 | $workingCopies['noneTemporary'] = $this->documentRepository->getObjectIdentifiers(FALSE); |
| 87 | 85 | $workingCopies['temporary'] = $this->documentRepository->getObjectIdentifiers(TRUE); |
| 88 | 86 | $this->view->assign('workingCopies', $workingCopies); |
@@ -107,8 +105,7 @@ discard block |
||
| 107 | 105 | * get next search results |
| 108 | 106 | * @return array ElasticSearch results |
| 109 | 107 | */ |
| 110 | - public function nextResultsAction() |
|
| 111 | - { |
|
| 108 | + public function nextResultsAction() { |
|
| 112 | 109 | try { |
| 113 | 110 | $sessionVars = $GLOBALS["TSFE"]->getSessionData("tx_dpf"); |
| 114 | 111 | if (!$sessionVars['resultCount']) { |
@@ -155,8 +152,7 @@ discard block |
||
| 155 | 152 | /** |
| 156 | 153 | * extended search action |
| 157 | 154 | */ |
| 158 | - public function extendedSearchAction() |
|
| 159 | - { |
|
| 155 | + public function extendedSearchAction() { |
|
| 160 | 156 | // show extended search template |
| 161 | 157 | $objectIdentifiers = $this->documentRepository->getObjectIdentifiers(); |
| 162 | 158 | |
@@ -174,8 +170,7 @@ discard block |
||
| 174 | 170 | /** |
| 175 | 171 | * gets a list of latest documents |
| 176 | 172 | */ |
| 177 | - public function latestAction() |
|
| 178 | - { |
|
| 173 | + public function latestAction() { |
|
| 179 | 174 | try { |
| 180 | 175 | $query = $this->searchLatest(); |
| 181 | 176 | |
@@ -210,8 +205,7 @@ discard block |
||
| 210 | 205 | * action search |
| 211 | 206 | * @return void |
| 212 | 207 | */ |
| 213 | - public function searchAction() |
|
| 214 | - { |
|
| 208 | + public function searchAction() { |
|
| 215 | 209 | $this->session->setListAction($this->getCurrentAction(), $this->getCurrentController()); |
| 216 | 210 | |
| 217 | 211 | try { |
@@ -286,8 +280,7 @@ discard block |
||
| 286 | 280 | * @param string $documentObjectIdentifier |
| 287 | 281 | * @return void |
| 288 | 282 | */ |
| 289 | - public function importForEditingAction($documentObjectIdentifier) |
|
| 290 | - { |
|
| 283 | + public function importForEditingAction($documentObjectIdentifier) { |
|
| 291 | 284 | $this->session->setListAction($this->getCurrentAction(), $this->getCurrentController()); |
| 292 | 285 | |
| 293 | 286 | /** @var \EWW\Dpf\Services\Transfer\DocumentTransferManager $documentTransferManager */ |
@@ -325,8 +318,7 @@ discard block |
||
| 325 | 318 | * @param string $documentObjectIdentifier |
| 326 | 319 | * @return void |
| 327 | 320 | */ |
| 328 | - public function showDetailsAction($documentObjectIdentifier) |
|
| 329 | - { |
|
| 321 | + public function showDetailsAction($documentObjectIdentifier) { |
|
| 330 | 322 | if ($documentObjectIdentifier) { |
| 331 | 323 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
| 332 | 324 | $document = $this->documentRepository->findWorkingCopyByObjectIdentifier($documentObjectIdentifier); |
@@ -346,8 +338,7 @@ discard block |
||
| 346 | 338 | * @param string $documentObjectIdentifier |
| 347 | 339 | * @return void |
| 348 | 340 | */ |
| 349 | - public function importAction($documentObjectIdentifier) |
|
| 350 | - { |
|
| 341 | + public function importAction($documentObjectIdentifier) { |
|
| 351 | 342 | $documentTransferManager = $this->objectManager->get(DocumentTransferManager::class); |
| 352 | 343 | $remoteRepository = $this->objectManager->get(FedoraRepository::class); |
| 353 | 344 | $documentTransferManager->setRemoteRepository($remoteRepository); |
@@ -390,8 +381,7 @@ discard block |
||
| 390 | 381 | * @param string $documentObjectIdentifier |
| 391 | 382 | * @return void |
| 392 | 383 | */ |
| 393 | - public function updateIndexAction($documentObjectIdentifier) |
|
| 394 | - { |
|
| 384 | + public function updateIndexAction($documentObjectIdentifier) { |
|
| 395 | 385 | $document = $this->documentRepository->findByObjectIdentifier($documentObjectIdentifier); |
| 396 | 386 | |
| 397 | 387 | if (is_a($document, Document::class)) { |
@@ -411,8 +401,7 @@ discard block |
||
| 411 | 401 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 412 | 402 | * @return void |
| 413 | 403 | */ |
| 414 | - public function doubletCheckAction(\EWW\Dpf\Domain\Model\Document $document) |
|
| 415 | - { |
|
| 404 | + public function doubletCheckAction(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 416 | 405 | $this->authorizationChecker->denyAccessUnlessGranted(DocumentVoter::DOUBLET_CHECK, $document); |
| 417 | 406 | |
| 418 | 407 | try { |
@@ -495,8 +484,7 @@ discard block |
||
| 495 | 484 | * returns the query to get latest documents |
| 496 | 485 | * @return mixed |
| 497 | 486 | */ |
| 498 | - public function searchLatest() |
|
| 499 | - { |
|
| 487 | + public function searchLatest() { |
|
| 500 | 488 | $client = $this->clientRepository->findAll()->current(); |
| 501 | 489 | |
| 502 | 490 | // get the latest documents /CREATED_DATE |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 36 | 36 | * @inject |
| 37 | 37 | */ |
| 38 | - protected $documentRepository = null; |
|
| 38 | + protected $documentRepository = NULL; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * clientRepository |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @var \EWW\Dpf\Domain\Repository\ClientRepository |
| 44 | 44 | * @inject |
| 45 | 45 | */ |
| 46 | - protected $clientRepository = null; |
|
| 46 | + protected $clientRepository = NULL; |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @var \EWW\Dpf\Services\ElasticSearch\ElasticSearch |
| 53 | 53 | * @inject |
| 54 | 54 | */ |
| 55 | - protected $elasticSearch = null; |
|
| 55 | + protected $elasticSearch = NULL; |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 71 | 71 | * @inject |
| 72 | 72 | */ |
| 73 | - protected $bookmarkRepository = null; |
|
| 73 | + protected $bookmarkRepository = NULL; |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | const RESULT_COUNT = 500; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $message, |
| 147 | 147 | '', |
| 148 | 148 | $severity, |
| 149 | - true |
|
| 149 | + TRUE |
|
| 150 | 150 | ); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | $message, |
| 199 | 199 | '', |
| 200 | 200 | $severity, |
| 201 | - true |
|
| 201 | + TRUE |
|
| 202 | 202 | ); |
| 203 | 203 | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $this->forward("list", null, null, array('results' => $results)); |
|
| 206 | + $this->forward("list", NULL, NULL, array('results' => $results)); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $sessionVars['resultCount'] = self::RESULT_COUNT; |
| 224 | 224 | $this->setSessionData('tx_dpf', $sessionVars); |
| 225 | 225 | |
| 226 | - $extSearch = ($args['query']['extSearch']) ? true : false; |
|
| 226 | + $extSearch = ($args['query']['extSearch']) ? TRUE : FALSE; |
|
| 227 | 227 | |
| 228 | 228 | // set sorting |
| 229 | 229 | if ($extSearch) { |
@@ -267,16 +267,16 @@ discard block |
||
| 267 | 267 | $message, |
| 268 | 268 | '', |
| 269 | 269 | $severity, |
| 270 | - true |
|
| 270 | + TRUE |
|
| 271 | 271 | ); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | if ($extSearch) { |
| 275 | 275 | // redirect to extended search view |
| 276 | - $this->forward("extendedSearch", null, null, array('results' => $results, 'query' => $args['query'])); |
|
| 276 | + $this->forward("extendedSearch", NULL, NULL, array('results' => $results, 'query' => $args['query'])); |
|
| 277 | 277 | } else { |
| 278 | 278 | // redirect to list view |
| 279 | - $this->forward("list", null, null, array('results' => $results, 'query' => $args['query'])); |
|
| 279 | + $this->forward("list", NULL, NULL, array('results' => $results, 'query' => $args['query'])); |
|
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $document = $documentTransferManager->retrieve($documentObjectIdentifier, $this->security->getUser()->getUid()); |
| 312 | 312 | |
| 313 | 313 | if ($document) { |
| 314 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 314 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $document = $this->documentRepository->findWorkingCopyByObjectIdentifier($documentObjectIdentifier); |
| 333 | 333 | |
| 334 | 334 | if ($document) { |
| 335 | - $this->redirect('showDetails', 'Document', null, ['document'=>$document]); |
|
| 335 | + $this->redirect('showDetails', 'Document', NULL, ['document'=>$document]); |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
@@ -379,10 +379,10 @@ discard block |
||
| 379 | 379 | $message, |
| 380 | 380 | '', |
| 381 | 381 | $severity, |
| 382 | - true |
|
| 382 | + TRUE |
|
| 383 | 383 | ); |
| 384 | 384 | |
| 385 | - $this->forward('updateIndex', null, null, array('documentObjectIdentifier' => $documentObjectIdentifier)); |
|
| 385 | + $this->forward('updateIndex', NULL, NULL, array('documentObjectIdentifier' => $documentObjectIdentifier)); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
@@ -483,10 +483,10 @@ discard block |
||
| 483 | 483 | $message, |
| 484 | 484 | '', |
| 485 | 485 | $severity, |
| 486 | - true |
|
| 486 | + TRUE |
|
| 487 | 487 | ); |
| 488 | 488 | |
| 489 | - $this->redirect('list', 'Document', null); |
|
| 489 | + $this->redirect('list', 'Document', NULL); |
|
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | } |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * DocumentFormController |
| 27 | 27 | */ |
| 28 | -abstract class AbstractDocumentFormController extends AbstractController |
|
| 29 | -{ |
|
| 28 | +abstract class AbstractDocumentFormController extends AbstractController { |
|
| 30 | 29 | |
| 31 | 30 | /** |
| 32 | 31 | * documentRepository |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | * |
| 82 | 81 | * @return void |
| 83 | 82 | */ |
| 84 | - public function listAction() |
|
| 85 | - { |
|
| 83 | + public function listAction() { |
|
| 86 | 84 | $documents = $this->documentRepository->findAll(); |
| 87 | 85 | |
| 88 | 86 | $documentTypes = $this->documentTypeRepository->findAll(); |
@@ -127,8 +125,7 @@ discard block |
||
| 127 | 125 | * |
| 128 | 126 | * @return void |
| 129 | 127 | */ |
| 130 | - public function initializeNewAction() |
|
| 131 | - { |
|
| 128 | + public function initializeNewAction() { |
|
| 132 | 129 | |
| 133 | 130 | $requestArguments = $this->request->getArguments(); |
| 134 | 131 | |
@@ -156,13 +153,11 @@ discard block |
||
| 156 | 153 | * @ignorevalidation $newDocumentForm |
| 157 | 154 | * @return void |
| 158 | 155 | */ |
| 159 | - public function newAction(DocumentForm $newDocumentForm = null) |
|
| 160 | - { |
|
| 156 | + public function newAction(DocumentForm $newDocumentForm = null) { |
|
| 161 | 157 | $this->view->assign('documentForm', $newDocumentForm); |
| 162 | 158 | } |
| 163 | 159 | |
| 164 | - public function initializeCreateAction() |
|
| 165 | - { |
|
| 160 | + public function initializeCreateAction() { |
|
| 166 | 161 | |
| 167 | 162 | $requestArguments = $this->request->getArguments(); |
| 168 | 163 | |
@@ -196,8 +191,7 @@ discard block |
||
| 196 | 191 | * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm |
| 197 | 192 | * @return void |
| 198 | 193 | */ |
| 199 | - public function createAction(DocumentForm $newDocumentForm) |
|
| 200 | - { |
|
| 194 | + public function createAction(DocumentForm $newDocumentForm) { |
|
| 201 | 195 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 202 | 196 | |
| 203 | 197 | /* @var $newDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -246,8 +240,7 @@ discard block |
||
| 246 | 240 | |
| 247 | 241 | } |
| 248 | 242 | |
| 249 | - public function initializeEditAction() |
|
| 250 | - { |
|
| 243 | + public function initializeEditAction() { |
|
| 251 | 244 | $requestArguments = $this->request->getArguments(); |
| 252 | 245 | |
| 253 | 246 | if (array_key_exists('document', $requestArguments)) { |
@@ -277,13 +270,11 @@ discard block |
||
| 277 | 270 | * @ignorevalidation $documentForm |
| 278 | 271 | * @return void |
| 279 | 272 | */ |
| 280 | - public function editAction(DocumentForm $documentForm) |
|
| 281 | - { |
|
| 273 | + public function editAction(DocumentForm $documentForm) { |
|
| 282 | 274 | $this->view->assign('documentForm', $documentForm); |
| 283 | 275 | } |
| 284 | 276 | |
| 285 | - public function initializeUpdateAction() |
|
| 286 | - { |
|
| 277 | + public function initializeUpdateAction() { |
|
| 287 | 278 | $requestArguments = $this->request->getArguments(); |
| 288 | 279 | |
| 289 | 280 | if ($this->request->hasArgument('documentData')) { |
@@ -316,8 +307,7 @@ discard block |
||
| 316 | 307 | * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm |
| 317 | 308 | * @return void |
| 318 | 309 | */ |
| 319 | - public function updateAction(DocumentForm $documentForm) |
|
| 320 | - { |
|
| 310 | + public function updateAction(DocumentForm $documentForm) { |
|
| 321 | 311 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 322 | 312 | |
| 323 | 313 | /* @var $updateDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -358,18 +348,15 @@ discard block |
||
| 358 | 348 | * |
| 359 | 349 | * @return void |
| 360 | 350 | */ |
| 361 | - public function cancelAction() |
|
| 362 | - { |
|
| 351 | + public function cancelAction() { |
|
| 363 | 352 | $this->redirectToList(); |
| 364 | 353 | } |
| 365 | 354 | |
| 366 | - protected function redirectAfterUpdate() |
|
| 367 | - { |
|
| 355 | + protected function redirectAfterUpdate() { |
|
| 368 | 356 | $this->redirect('list'); |
| 369 | 357 | } |
| 370 | 358 | |
| 371 | - protected function redirectToList($message = null) |
|
| 372 | - { |
|
| 359 | + protected function redirectToList($message = null) { |
|
| 373 | 360 | $this->redirect('list'); |
| 374 | 361 | } |
| 375 | 362 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 35 | 35 | * @inject |
| 36 | 36 | */ |
| 37 | - protected $documentRepository = null; |
|
| 37 | + protected $documentRepository = NULL; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * fileRepository |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 43 | 43 | * @inject |
| 44 | 44 | */ |
| 45 | - protected $fileRepository = null; |
|
| 45 | + protected $fileRepository = NULL; |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * documentTypeRepository |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 51 | 51 | * @inject |
| 52 | 52 | */ |
| 53 | - protected $documentTypeRepository = null; |
|
| 53 | + protected $documentTypeRepository = NULL; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * metadataGroupRepository |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository |
| 59 | 59 | * @inject |
| 60 | 60 | */ |
| 61 | - protected $metadataGroupRepository = null; |
|
| 61 | + protected $metadataGroupRepository = NULL; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * metadataObjectRepository |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository |
| 67 | 67 | * @inject |
| 68 | 68 | */ |
| 69 | - protected $metadataObjectRepository = null; |
|
| 69 | + protected $metadataObjectRepository = NULL; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * persistence manager |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @ignorevalidation $newDocumentForm |
| 157 | 157 | * @return void |
| 158 | 158 | */ |
| 159 | - public function newAction(DocumentForm $newDocumentForm = null) |
|
| 159 | + public function newAction(DocumentForm $newDocumentForm = NULL) |
|
| 160 | 160 | { |
| 161 | 161 | $this->view->assign('documentForm', $newDocumentForm); |
| 162 | 162 | } |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | $documentType = $this->documentTypeRepository->findByUid($docTypeUid); |
| 180 | 180 | $virtual = $documentType->getVirtual(); |
| 181 | 181 | |
| 182 | - if (!$formDataReader->uploadError() || $virtual === true) { |
|
| 182 | + if (!$formDataReader->uploadError() || $virtual === TRUE) { |
|
| 183 | 183 | $this->request->setArguments($requestArguments); |
| 184 | 184 | } else { |
| 185 | 185 | $t = $docForm->getNewFileNames(); |
| 186 | - $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 186 | + $this->redirect('list', 'DocumentForm', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 187 | 187 | } |
| 188 | 188 | } else { |
| 189 | 189 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -299,11 +299,11 @@ discard block |
||
| 299 | 299 | $documentType = $this->documentTypeRepository->findByUid($docTypeUid); |
| 300 | 300 | $virtual = $documentType->getVirtual(); |
| 301 | 301 | |
| 302 | - if (!$formDataReader->uploadError() || $virtual === true) { |
|
| 302 | + if (!$formDataReader->uploadError() || $virtual === TRUE) { |
|
| 303 | 303 | $this->request->setArguments($requestArguments); |
| 304 | 304 | } else { |
| 305 | 305 | $t = $docForm->getNewFileNames(); |
| 306 | - $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 306 | + $this->redirect('list', 'Document', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 307 | 307 | } |
| 308 | 308 | } else { |
| 309 | 309 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | throw new \EWW\Dpf\Exceptions\DocumentMaxSizeErrorException("Maximum document size exceeded."); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - $updateDocument->setChanged(true); |
|
| 331 | + $updateDocument->setChanged(TRUE); |
|
| 332 | 332 | $this->documentRepository->update($updateDocument); |
| 333 | 333 | |
| 334 | 334 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $this->redirect('list'); |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - protected function redirectToList($message = null) |
|
| 371 | + protected function redirectToList($message = NULL) |
|
| 372 | 372 | { |
| 373 | 373 | $this->redirect('list'); |
| 374 | 374 | } |
@@ -35,8 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * DocumentController |
| 37 | 37 | */ |
| 38 | -class DocumentController extends AbstractController |
|
| 39 | -{ |
|
| 38 | +class DocumentController extends AbstractController { |
|
| 40 | 39 | |
| 41 | 40 | /** |
| 42 | 41 | * documentRepository |
@@ -135,8 +134,7 @@ discard block |
||
| 135 | 134 | /** |
| 136 | 135 | * DocumentController constructor. |
| 137 | 136 | */ |
| 138 | - public function __construct() |
|
| 139 | - { |
|
| 137 | + public function __construct() { |
|
| 140 | 138 | parent::__construct(); |
| 141 | 139 | |
| 142 | 140 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
@@ -151,8 +149,7 @@ discard block |
||
| 151 | 149 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 152 | 150 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 153 | 151 | */ |
| 154 | - public function logoutAction() |
|
| 155 | - { |
|
| 152 | + public function logoutAction() { |
|
| 156 | 153 | $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); |
| 157 | 154 | $uri = $cObj->typolink_URL([ |
| 158 | 155 | 'parameter' => $this->settings['loginPage'], |
@@ -390,8 +387,7 @@ discard block |
||
| 390 | 387 | * @param string $reason |
| 391 | 388 | * @return void |
| 392 | 389 | */ |
| 393 | - public function discardAction(Document $document, $tstamp, $reason = NULL) |
|
| 394 | - { |
|
| 390 | + public function discardAction(Document $document, $tstamp, $reason = NULL) { |
|
| 395 | 391 | if (!$this->authorizationChecker->isGranted(DocumentVoter::DISCARD, $document)) { |
| 396 | 392 | if ( |
| 397 | 393 | $this->editingLockService->isLocked( |
@@ -419,8 +415,7 @@ discard block |
||
| 419 | 415 | * @param string $reason |
| 420 | 416 | * @return void |
| 421 | 417 | */ |
| 422 | - public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL) |
|
| 423 | - { |
|
| 418 | + public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL) { |
|
| 424 | 419 | if (!$this->authorizationChecker->isGranted(DocumentVoter::POSTPONE, $document)) { |
| 425 | 420 | if ( |
| 426 | 421 | $this->editingLockService->isLocked( |
@@ -449,8 +444,7 @@ discard block |
||
| 449 | 444 | * @param integer $tstamp |
| 450 | 445 | * @return void |
| 451 | 446 | */ |
| 452 | - public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 453 | - { |
|
| 447 | + public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 454 | 448 | if ($document->getObjectIdentifier()) { |
| 455 | 449 | $voterAttribute = DocumentVoter::DELETE_WORKING_COPY; |
| 456 | 450 | } else { |
@@ -527,8 +521,7 @@ discard block |
||
| 527 | 521 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 528 | 522 | * @return void |
| 529 | 523 | */ |
| 530 | - public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document) |
|
| 531 | - { |
|
| 524 | + public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 532 | 525 | if (!$this->authorizationChecker->isGranted(DocumentVoter::DUPLICATE, $document)) { |
| 533 | 526 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_duplicate.accessDenied'; |
| 534 | 527 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -595,8 +588,7 @@ discard block |
||
| 595 | 588 | * @param integer $tstamp |
| 596 | 589 | * @return void |
| 597 | 590 | */ |
| 598 | - public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 599 | - { |
|
| 591 | + public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 600 | 592 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_PUBLISH, $document)) { |
| 601 | 593 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_ingest.accessDenied'; |
| 602 | 594 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -616,8 +608,7 @@ discard block |
||
| 616 | 608 | * @param integer $tstamp |
| 617 | 609 | * @return void |
| 618 | 610 | */ |
| 619 | - public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 620 | - { |
|
| 611 | + public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 621 | 612 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_ACTIVATE, $document)) { |
| 622 | 613 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_activate.accessDenied'; |
| 623 | 614 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -635,8 +626,7 @@ discard block |
||
| 635 | 626 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 636 | 627 | * @return void |
| 637 | 628 | */ |
| 638 | - public function registerAction(\EWW\Dpf\Domain\Model\Document $document) |
|
| 639 | - { |
|
| 629 | + public function registerAction(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 640 | 630 | if (!$this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) { |
| 641 | 631 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.accessDenied'; |
| 642 | 632 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -674,8 +664,7 @@ discard block |
||
| 674 | 664 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 675 | 665 | * @return void |
| 676 | 666 | */ |
| 677 | - public function showDetailsAction(Document $document) |
|
| 678 | - { |
|
| 667 | + public function showDetailsAction(Document $document) { |
|
| 679 | 668 | if (!$this->authorizationChecker->isGranted(DocumentVoter::SHOW_DETAILS, $document)) { |
| 680 | 669 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_showDetails.accessDenied'; |
| 681 | 670 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -701,8 +690,7 @@ discard block |
||
| 701 | 690 | } |
| 702 | 691 | |
| 703 | 692 | |
| 704 | - public function cancelListTaskAction() |
|
| 705 | - { |
|
| 693 | + public function cancelListTaskAction() { |
|
| 706 | 694 | $this->redirectToDocumentList(); |
| 707 | 695 | } |
| 708 | 696 | |
@@ -745,8 +733,7 @@ discard block |
||
| 745 | 733 | /** |
| 746 | 734 | * initializeAction |
| 747 | 735 | */ |
| 748 | - public function initializeAction() |
|
| 749 | - { |
|
| 736 | + public function initializeAction() { |
|
| 750 | 737 | $this->authorizationChecker->denyAccessUnlessLoggedIn(); |
| 751 | 738 | |
| 752 | 739 | parent::initializeAction(); |
@@ -772,8 +759,7 @@ discard block |
||
| 772 | 759 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 773 | 760 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 774 | 761 | */ |
| 775 | - protected function redirectToDocumentList($message = null) |
|
| 776 | - { |
|
| 762 | + protected function redirectToDocumentList($message = null) { |
|
| 777 | 763 | list($action, $controller, $redirectUri) = $this->session->getListAction(); |
| 778 | 764 | |
| 779 | 765 | if ($redirectUri) { |
@@ -788,8 +774,7 @@ discard block |
||
| 788 | 774 | * |
| 789 | 775 | * @return mixed |
| 790 | 776 | */ |
| 791 | - protected function getStoragePID() |
|
| 792 | - { |
|
| 777 | + protected function getStoragePID() { |
|
| 793 | 778 | return $this->settings['persistence']['classes']['EWW\Dpf\Domain\Model\Document']['newRecordStoragePid']; |
| 794 | 779 | } |
| 795 | 780 | |
@@ -800,8 +785,7 @@ discard block |
||
| 800 | 785 | * @param string $severity |
| 801 | 786 | * @param string $defaultMessage |
| 802 | 787 | */ |
| 803 | - protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "") |
|
| 804 | - { |
|
| 788 | + protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "") { |
|
| 805 | 789 | // Show success or failure of the action in a flash message |
| 806 | 790 | if ($document) { |
| 807 | 791 | $args[] = $document->getTitle(); |
@@ -828,8 +812,7 @@ discard block |
||
| 828 | 812 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 829 | 813 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 830 | 814 | */ |
| 831 | - protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason) |
|
| 832 | - { |
|
| 815 | + protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason) { |
|
| 833 | 816 | switch ($workflowTransition) { |
| 834 | 817 | case DocumentWorkflow::TRANSITION_DISCARD: |
| 835 | 818 | $messageKeyPart = 'document_discard'; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 45 | 45 | * @inject |
| 46 | 46 | */ |
| 47 | - protected $documentRepository = null; |
|
| 47 | + protected $documentRepository = NULL; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * inputOptionListRepository |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @var \EWW\Dpf\Domain\Repository\InputOptionListRepository |
| 53 | 53 | * @inject |
| 54 | 54 | */ |
| 55 | - protected $inputOptionListRepository = null; |
|
| 55 | + protected $inputOptionListRepository = NULL; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * persistence manager |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @var \EWW\Dpf\Services\Document\EditingLockService |
| 69 | 69 | * @inject |
| 70 | 70 | */ |
| 71 | - protected $editingLockService = null; |
|
| 71 | + protected $editingLockService = NULL; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * documentValidator |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 106 | 106 | * @inject |
| 107 | 107 | */ |
| 108 | - protected $fileRepository = null; |
|
| 108 | + protected $fileRepository = NULL; |
|
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
| 115 | 115 | * @inject |
| 116 | 116 | */ |
| 117 | - protected $frontendUserRepository = null; |
|
| 117 | + protected $frontendUserRepository = NULL; |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * documentManager |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @var \EWW\Dpf\Services\Document\DocumentManager |
| 123 | 123 | * @inject |
| 124 | 124 | */ |
| 125 | - protected $documentManager = null; |
|
| 125 | + protected $documentManager = NULL; |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * bookmarkRepository |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 131 | 131 | * @inject |
| 132 | 132 | */ |
| 133 | - protected $bookmarkRepository = null; |
|
| 133 | + protected $bookmarkRepository = NULL; |
|
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | 136 | * DocumentController constructor. |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @param Document $document |
| 197 | 197 | * @param bool $acceptAll |
| 198 | 198 | */ |
| 199 | - public function acceptSuggestionAction(\EWW\Dpf\Domain\Model\Document $document, bool $acceptAll = true) { |
|
| 199 | + public function acceptSuggestionAction(\EWW\Dpf\Domain\Model\Document $document, bool $acceptAll = TRUE) { |
|
| 200 | 200 | |
| 201 | 201 | $args = $this->request->getArguments(); |
| 202 | 202 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | if ($acceptAll) { |
| 220 | 220 | // all changes are confirmed |
| 221 | 221 | // copy suggest to origin document |
| 222 | - $originDocument->copy($document, true); |
|
| 222 | + $originDocument->copy($document, TRUE); |
|
| 223 | 223 | |
| 224 | 224 | if ($originDocument->getTransferStatus() == 'RESTORE') { |
| 225 | 225 | if ($originDocument->getObjectIdentifier()) { |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $this->documentRepository->remove($document); |
| 244 | 244 | |
| 245 | 245 | // redirect to document |
| 246 | - $this->redirect('showDetails', 'Document', null, ['document' => $originDocument]); |
|
| 246 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $originDocument]); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | $this->redirectToDocumentList(); |
@@ -294,11 +294,11 @@ discard block |
||
| 294 | 294 | // groups |
| 295 | 295 | foreach ($valueRepeatPage->getItems() as $keyGroup => $valueGroup) { |
| 296 | 296 | |
| 297 | - $checkFieldsForAdding = false; |
|
| 297 | + $checkFieldsForAdding = FALSE; |
|
| 298 | 298 | $valueGroupCounter = count($valueGroup); |
| 299 | 299 | |
| 300 | 300 | if ($valueGroupCounter < count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup])) { |
| 301 | - $checkFieldsForAdding = true; |
|
| 301 | + $checkFieldsForAdding = TRUE; |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | foreach ($valueGroup as $keyRepeatGroup => $valueRepeatGroup) { |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $valueFieldCounter = count($valueField); |
| 312 | 312 | |
| 313 | 313 | // check if group or field is not existing |
| 314 | - $notExisting = false; |
|
| 314 | + $notExisting = FALSE; |
|
| 315 | 315 | try { |
| 316 | 316 | $flag = 'page'; |
| 317 | 317 | $value2 = $docForm2->getItems()[$keyPage]; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $value2 = $value2[$keyRepeatGroup]->getItems()[$keyField]; |
| 322 | 322 | $flag = 'field'; |
| 323 | 323 | } catch (\Throwable $t) { |
| 324 | - $notExisting = true; |
|
| 324 | + $notExisting = TRUE; |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | $item = NULL; |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_discard.accessDenied'; |
| 405 | 405 | } |
| 406 | 406 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 407 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 407 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 408 | 408 | return FALSE; |
| 409 | 409 | } |
| 410 | 410 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_postpone.accessDenied'; |
| 434 | 434 | } |
| 435 | 435 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 436 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 436 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 437 | 437 | return FALSE; |
| 438 | 438 | } |
| 439 | 439 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_deleteLocally.accessDenied'; |
| 470 | 470 | } |
| 471 | 471 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 472 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 472 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 473 | 473 | return FALSE; |
| 474 | 474 | } |
| 475 | 475 | |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | } else { |
| 518 | 518 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_deleteLocally.failureNewVersion'; |
| 519 | 519 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 520 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 520 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | if (!$this->authorizationChecker->isGranted(DocumentVoter::DUPLICATE, $document)) { |
| 533 | 533 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_duplicate.accessDenied'; |
| 534 | 534 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 535 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 535 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 536 | 536 | return FALSE; |
| 537 | 537 | } |
| 538 | 538 | |
@@ -600,11 +600,11 @@ discard block |
||
| 600 | 600 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_PUBLISH, $document)) { |
| 601 | 601 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_ingest.accessDenied'; |
| 602 | 602 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 603 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 603 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 604 | 604 | return FALSE; |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | - $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_PUBLISH, null); |
|
| 607 | + $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_PUBLISH, NULL); |
|
| 608 | 608 | |
| 609 | 609 | } |
| 610 | 610 | |
@@ -621,11 +621,11 @@ discard block |
||
| 621 | 621 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_ACTIVATE, $document)) { |
| 622 | 622 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_activate.accessDenied'; |
| 623 | 623 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 624 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 624 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 625 | 625 | return FALSE; |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | - $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_ACTIVATE, null); |
|
| 628 | + $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_ACTIVATE, NULL); |
|
| 629 | 629 | |
| 630 | 630 | } |
| 631 | 631 | |
@@ -640,13 +640,13 @@ discard block |
||
| 640 | 640 | if (!$this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) { |
| 641 | 641 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.accessDenied'; |
| 642 | 642 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 643 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 643 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 644 | 644 | } |
| 645 | 645 | |
| 646 | - if (!$this->documentValidator->validate($document, false)) { |
|
| 646 | + if (!$this->documentValidator->validate($document, FALSE)) { |
|
| 647 | 647 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.missingValues'; |
| 648 | 648 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 649 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 649 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | $this->workflow->apply($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER); |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | |
| 666 | 666 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.success'; |
| 667 | 667 | $this->flashMessage($document, $key, AbstractMessage::OK); |
| 668 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 668 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /** |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | if (!$this->authorizationChecker->isGranted(DocumentVoter::SUGGEST_RESTORE, $document)) { |
| 718 | 718 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_suggestRestore.accessDenied'; |
| 719 | 719 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 720 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 720 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 721 | 721 | return FALSE; |
| 722 | 722 | } |
| 723 | 723 | |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | /* @var $newDocument \EWW\Dpf\Domain\Model\Document */ |
| 738 | 738 | $documentForm = $documentMapper->getDocumentForm($document); |
| 739 | 739 | |
| 740 | - $this->view->assign('suggestMod', true); |
|
| 741 | - $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => true]); |
|
| 740 | + $this->view->assign('suggestMod', TRUE); |
|
| 741 | + $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => TRUE]); |
|
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 773 | 773 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 774 | 774 | */ |
| 775 | - protected function redirectToDocumentList($message = null) |
|
| 775 | + protected function redirectToDocumentList($message = NULL) |
|
| 776 | 776 | { |
| 777 | 777 | list($action, $controller, $redirectUri) = $this->session->getListAction(); |
| 778 | 778 | |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | $message, |
| 816 | 816 | '', |
| 817 | 817 | $severity, |
| 818 | - true |
|
| 818 | + TRUE |
|
| 819 | 819 | ); |
| 820 | 820 | } |
| 821 | 821 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | // check if new document form has more field items as the existing form |
| 354 | 354 | if ($valueFieldCounter < $fieldCounter && !$checkFieldsForAdding) { |
| 355 | 355 | // field added |
| 356 | - for ($i = count($valueField); $i < $fieldCounter;$i++) { |
|
| 356 | + for ($i = count($valueField); $i < $fieldCounter; $i++) { |
|
| 357 | 357 | $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$keyRepeatGroup]->getItems()[$keyField][$i]; |
| 358 | 358 | |
| 359 | 359 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | if ($valueGroupCounter < count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup])) { |
| 366 | 366 | // group added |
| 367 | 367 | $counter = count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup]); |
| 368 | - for ($i = $valueGroupCounter; $i < $counter;$i++) { |
|
| 368 | + for ($i = $valueGroupCounter; $i < $counter; $i++) { |
|
| 369 | 369 | $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$i]; |
| 370 | 370 | } |
| 371 | 371 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | $this->editingLockService->lock( |
| 686 | - ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()), |
|
| 686 | + ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()), |
|
| 687 | 687 | $this->security->getUser()->getUid() |
| 688 | 688 | ); |
| 689 | 689 | |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | $documentForm = $documentMapper->getDocumentForm($document); |
| 739 | 739 | |
| 740 | 740 | $this->view->assign('suggestMod', true); |
| 741 | - $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => true]); |
|
| 741 | + $this->forward('edit', 'DocumentFormBackoffice', NULL, ['documentForm' => $documentForm, 'suggestMod' => true]); |
|
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | |
| 871 | 871 | if ($this->documentManager->update($document, $workflowTransition)) { |
| 872 | 872 | |
| 873 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.success'; |
|
| 873 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.success'; |
|
| 874 | 874 | $this->flashMessage($document, $key, AbstractMessage::OK); |
| 875 | 875 | |
| 876 | 876 | if ($this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN) { |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | |
| 900 | 900 | $this->redirectToDocumentList(); |
| 901 | 901 | } else { |
| 902 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure'; |
|
| 902 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure'; |
|
| 903 | 903 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 904 | 904 | $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
| 905 | 905 | } |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | if ($exception instanceof DPFExceptionInterface) { |
| 911 | 911 | $key = $exception->messageLanguageKey(); |
| 912 | 912 | } else { |
| 913 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure'; |
|
| 913 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure'; |
|
| 914 | 914 | } |
| 915 | 915 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
| 916 | 916 | $this->redirectToDocumentList(); |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 18 | 18 | use EWW\Dpf\Services\ElasticSearch\ElasticSearch; |
| 19 | 19 | |
| 20 | -abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController |
|
| 21 | -{ |
|
| 20 | +abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController { |
|
| 22 | 21 | // search terms |
| 23 | 22 | private static $terms = ['_id', 'OWNER_ID', 'submitter', 'project']; |
| 24 | 23 | |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * @param array $query elasticsearch search query |
| 32 | 31 | * @return array results |
| 33 | 32 | */ |
| 34 | - public function getResultList($query, $type) |
|
| 35 | - { |
|
| 33 | + public function getResultList($query, $type) { |
|
| 36 | 34 | |
| 37 | 35 | $elasticSearch = $this->objectManager->get(ElasticSearch::class); |
| 38 | 36 | $results = $elasticSearch->search($query, $type); |
@@ -45,8 +43,7 @@ discard block |
||
| 45 | 43 | * @param string $searchString |
| 46 | 44 | * @return array query |
| 47 | 45 | */ |
| 48 | - public function searchFulltext($searchString) |
|
| 49 | - { |
|
| 46 | + public function searchFulltext($searchString) { |
|
| 50 | 47 | // don't return query if searchString is empty |
| 51 | 48 | if (empty($searchString)) { |
| 52 | 49 | return null; |
@@ -71,8 +68,7 @@ discard block |
||
| 71 | 68 | * build array for elasticsearch |
| 72 | 69 | * @return array Elasticsearch query array |
| 73 | 70 | */ |
| 74 | - public function extendedSearch($searchArray = array()) |
|
| 75 | - { |
|
| 71 | + public function extendedSearch($searchArray = array()) { |
|
| 76 | 72 | |
| 77 | 73 | $query = array(); |
| 78 | 74 | $filter = array(); |
@@ -119,8 +115,7 @@ discard block |
||
| 119 | 115 | * @param array Elasticsearch query array |
| 120 | 116 | * @return array Elasticsearch queryFilter array |
| 121 | 117 | */ |
| 122 | - public function resultsFilter($query, $showDeleted = false) |
|
| 123 | - { |
|
| 118 | + public function resultsFilter($query, $showDeleted = false) { |
|
| 124 | 119 | |
| 125 | 120 | $queryFilter = array(); |
| 126 | 121 | |
@@ -209,8 +204,7 @@ discard block |
||
| 209 | 204 | * @param bool $intervalEnd Fills missing values with the maximum possible date if true |
| 210 | 205 | * @return DateTime Determined date |
| 211 | 206 | */ |
| 212 | - public function convertFormDate($dateString, $intervalEnd = false) |
|
| 213 | - { |
|
| 207 | + public function convertFormDate($dateString, $intervalEnd = false) { |
|
| 214 | 208 | try { |
| 215 | 209 | if (strlen($dateString) == 4) { |
| 216 | 210 | // assuming year |
@@ -231,8 +225,7 @@ discard block |
||
| 231 | 225 | * @param $string |
| 232 | 226 | * @return mixed |
| 233 | 227 | */ |
| 234 | - private function escapeQuery($string) |
|
| 235 | - { |
|
| 228 | + private function escapeQuery($string) { |
|
| 236 | 229 | $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\'); |
| 237 | 230 | $string = preg_replace_callback( |
| 238 | 231 | '/([' . $luceneReservedCharacters . '])/', |
@@ -252,8 +245,7 @@ discard block |
||
| 252 | 245 | * @param $date |
| 253 | 246 | * @return string |
| 254 | 247 | */ |
| 255 | - public function formatDate($date) |
|
| 256 | - { |
|
| 248 | + public function formatDate($date) { |
|
| 257 | 249 | // convert date from dd.mm.yyy to yyyy-dd-mm |
| 258 | 250 | $date = explode(".", $date); |
| 259 | 251 | return $date[2] . '-' . $date[1] . '-' . $date[0]; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $searchString = $this->escapeQuery(trim($searchString)); |
| 56 | 56 | |
| 57 | - $query['body']['query']['bool']['should'][0]['query_string']['query'] = $searchString; |
|
| 57 | + $query['body']['query']['bool']['should'][0]['query_string']['query'] = $searchString; |
|
| 58 | 58 | //$query['body']['query']['bool']['should'][1]['has_child']['query']['query_string']['query'] = $searchString; |
| 59 | 59 | $query['body']['query']['bool']['minimum_should_match'] = "1"; // 1 |
| 60 | 60 | |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | * build array for elasticsearch |
| 72 | 72 | * @return array Elasticsearch query array |
| 73 | 73 | */ |
| 74 | - public function extendedSearch($searchArray = array()) |
|
| 74 | + public function extendedSearch($searchArray = array ()) |
|
| 75 | 75 | { |
| 76 | 76 | |
| 77 | - $query = array(); |
|
| 78 | - $filter = array(); |
|
| 77 | + $query = array (); |
|
| 78 | + $filter = array (); |
|
| 79 | 79 | foreach ($searchArray as $key => $qry) { |
| 80 | 80 | $qry = trim($qry); |
| 81 | 81 | |
| 82 | 82 | if (!empty($qry) && in_array($key, self::$matches)) { |
| 83 | 83 | |
| 84 | - $query['body']['query']['bool']['must'][] = array('match' => array($key => $qry)); |
|
| 84 | + $query['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry)); |
|
| 85 | 85 | |
| 86 | 86 | } elseif (!empty($qry) && in_array($key, self::$terms)) { |
| 87 | 87 | |
| 88 | - $query['body']['query']['bool']['must'][] = array('term' => array($key => $qry)); |
|
| 88 | + $query['body']['query']['bool']['must'][] = array ('term' => array ($key => $qry)); |
|
| 89 | 89 | |
| 90 | 90 | } elseif (!empty($qry) && $key == 'from') { |
| 91 | 91 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if (isset($filter['gte']) || isset($filter['lte'])) { |
| 106 | 106 | |
| 107 | - $query['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $filter)); |
|
| 107 | + $query['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $filter)); |
|
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
@@ -122,19 +122,19 @@ discard block |
||
| 122 | 122 | public function resultsFilter($query, $showDeleted = false) |
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - $queryFilter = array(); |
|
| 125 | + $queryFilter = array (); |
|
| 126 | 126 | |
| 127 | 127 | // Frontend only |
| 128 | 128 | $searchResultsFilter = $this->settings['searchResultsFilter']; |
| 129 | - if(!empty($searchResultsFilter)) { |
|
| 129 | + if (!empty($searchResultsFilter)) { |
|
| 130 | 130 | |
| 131 | 131 | // add doctypes |
| 132 | - if($searchResultsFilter['doctype']) { |
|
| 132 | + if ($searchResultsFilter['doctype']) { |
|
| 133 | 133 | |
| 134 | 134 | $uids = GeneralUtility::trimExplode(',', $searchResultsFilter['doctype']); |
| 135 | 135 | $documentTypeRepository = $this->documentTypeRepository; |
| 136 | - $documentTypes = array(); |
|
| 137 | - foreach($uids as $uid) { |
|
| 136 | + $documentTypes = array (); |
|
| 137 | + foreach ($uids as $uid) { |
|
| 138 | 138 | $documentType = $documentTypeRepository->findByUid($uid); |
| 139 | 139 | $documentTypes[] = $documentType->getName(); |
| 140 | 140 | }; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | // add date filter |
| 145 | - $dateFilter = array(); |
|
| 145 | + $dateFilter = array (); |
|
| 146 | 146 | if ($searchResultsFilter['from']) { |
| 147 | 147 | |
| 148 | 148 | $from = date('d.m.Y', $searchResultsFilter['from']); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | if ($searchResultsFilter['till']) { |
| 156 | 156 | |
| 157 | - $till = date('d.m.Y', $searchResultsFilter['till']); |
|
| 157 | + $till = date('d.m.Y', $searchResultsFilter['till']); |
|
| 158 | 158 | $dateTime = $this->convertFormDate($till, true); |
| 159 | 159 | $dateFilter['lte'] = $dateTime->format('Y-m-d'); |
| 160 | 160 | unset($searchResultsFilter['till']); |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | if (isset($dateFilter['gte']) || isset($dateFilter['lte'])) { |
| 165 | 165 | |
| 166 | - $queryFilter['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $dateFilter)); |
|
| 166 | + $queryFilter['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $dateFilter)); |
|
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | foreach ($searchResultsFilter as $key => $qry) { |
| 171 | 171 | |
| 172 | - if(!empty($qry)) { |
|
| 173 | - $queryFilter['body']['query']['bool']['must'][] = array('match' => array($key => $qry)); |
|
| 172 | + if (!empty($qry)) { |
|
| 173 | + $queryFilter['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry)); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // document must be active |
| 181 | - if($showDeleted == false) { |
|
| 181 | + if ($showDeleted == false) { |
|
| 182 | 182 | |
| 183 | 183 | // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
| 184 | 184 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\'); |
| 237 | 237 | $string = preg_replace_callback( |
| 238 | 238 | '/([' . $luceneReservedCharacters . '])/', |
| 239 | - function ($matches) { |
|
| 239 | + function($matches) { |
|
| 240 | 240 | return '\\' . $matches[0]; |
| 241 | 241 | }, |
| 242 | 242 | $string |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | // don't return query if searchString is empty |
| 51 | 51 | if (empty($searchString)) { |
| 52 | - return null; |
|
| 52 | + return NULL; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $searchString = $this->escapeQuery(trim($searchString)); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // child_type is invalid in elasticsearch 7.5 |
| 62 | 62 | //$query['body']['query']['bool']['should'][1]['has_child']['type'] = "datastream"; // 1 |
| 63 | 63 | |
| 64 | - $query = $this->resultsFilter($query, false); |
|
| 64 | + $query = $this->resultsFilter($query, FALSE); |
|
| 65 | 65 | |
| 66 | 66 | return $query; |
| 67 | 67 | |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | } elseif (!empty($qry) && $key == 'from') { |
| 91 | 91 | |
| 92 | - if ($dateTime = $this->convertFormDate($qry, false)) { |
|
| 92 | + if ($dateTime = $this->convertFormDate($qry, FALSE)) { |
|
| 93 | 93 | $filter['gte'] = $dateTime->format('Y-m-d'); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | } elseif (!empty($qry) && $key == 'till') { |
| 97 | 97 | |
| 98 | - if ($dateTime = $this->convertFormDate($qry, true)) { |
|
| 98 | + if ($dateTime = $this->convertFormDate($qry, TRUE)) { |
|
| 99 | 99 | $filter['lte'] = $dateTime->format('Y-m-d'); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $showDeleted = ($searchArray['showDeleted'] == 'true') ? true : false; |
|
| 111 | + $showDeleted = ($searchArray['showDeleted'] == 'true') ? TRUE : FALSE; |
|
| 112 | 112 | $query = $this->resultsFilter($query, $showDeleted); |
| 113 | 113 | return $query; |
| 114 | 114 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param array Elasticsearch query array |
| 120 | 120 | * @return array Elasticsearch queryFilter array |
| 121 | 121 | */ |
| 122 | - public function resultsFilter($query, $showDeleted = false) |
|
| 122 | + public function resultsFilter($query, $showDeleted = FALSE) |
|
| 123 | 123 | { |
| 124 | 124 | |
| 125 | 125 | $queryFilter = array(); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if ($searchResultsFilter['from']) { |
| 147 | 147 | |
| 148 | 148 | $from = date('d.m.Y', $searchResultsFilter['from']); |
| 149 | - $dateTime = $this->convertFormDate($from, false); |
|
| 149 | + $dateTime = $this->convertFormDate($from, FALSE); |
|
| 150 | 150 | $dateFilter['gte'] = $dateTime->format('Y-m-d'); |
| 151 | 151 | unset($searchResultsFilter['from']); |
| 152 | 152 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | if ($searchResultsFilter['till']) { |
| 156 | 156 | |
| 157 | 157 | $till = date('d.m.Y', $searchResultsFilter['till']); |
| 158 | - $dateTime = $this->convertFormDate($till, true); |
|
| 158 | + $dateTime = $this->convertFormDate($till, TRUE); |
|
| 159 | 159 | $dateFilter['lte'] = $dateTime->format('Y-m-d'); |
| 160 | 160 | unset($searchResultsFilter['till']); |
| 161 | 161 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // document must be active |
| 181 | - if($showDeleted == false) { |
|
| 181 | + if($showDeleted == FALSE) { |
|
| 182 | 182 | |
| 183 | 183 | // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
| 184 | 184 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param bool $intervalEnd Fills missing values with the maximum possible date if true |
| 210 | 210 | * @return DateTime Determined date |
| 211 | 211 | */ |
| 212 | - public function convertFormDate($dateString, $intervalEnd = false) |
|
| 212 | + public function convertFormDate($dateString, $intervalEnd = FALSE) |
|
| 213 | 213 | { |
| 214 | 214 | try { |
| 215 | 215 | if (strlen($dateString) == 4) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | return new \DateTime($dateString); |
| 223 | 223 | } |
| 224 | 224 | } catch (\Exception $_) { |
| 225 | - return false; |
|
| 225 | + return FALSE; |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * AjaxBackofficeController |
| 21 | 21 | */ |
| 22 | -class AjaxBackofficeController extends \EWW\Dpf\Controller\AbstractController |
|
| 23 | -{ |
|
| 22 | +class AjaxBackofficeController extends \EWW\Dpf\Controller\AbstractController { |
|
| 24 | 23 | /** |
| 25 | 24 | * bookmarkRepository |
| 26 | 25 | * |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * @param string $identifier |
| 37 | 36 | * @return bool |
| 38 | 37 | */ |
| 39 | - public function addBookmarkAction($identifier) |
|
| 40 | - { |
|
| 38 | + public function addBookmarkAction($identifier) { |
|
| 41 | 39 | /** @var \EWW\Dpf\Domain\Model\Bookmark $bookmark */ |
| 42 | 40 | $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier); |
| 43 | 41 | if (!$bookmark) { |
@@ -57,8 +55,7 @@ discard block |
||
| 57 | 55 | * @param string $identifier |
| 58 | 56 | * @return bool |
| 59 | 57 | */ |
| 60 | - public function removeBookmarkAction($identifier) |
|
| 61 | - { |
|
| 58 | + public function removeBookmarkAction($identifier) { |
|
| 62 | 59 | /** @var \EWW\Dpf\Domain\Model\Bookmark $bookmark */ |
| 63 | 60 | $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier); |
| 64 | 61 | if ($bookmark) { |
@@ -75,8 +72,7 @@ discard block |
||
| 75 | 72 | * @param string $name |
| 76 | 73 | * @param array $values |
| 77 | 74 | */ |
| 78 | - public function addWorkspaceFilterAction($name, $values = []) |
|
| 79 | - { |
|
| 75 | + public function addWorkspaceFilterAction($name, $values = []) { |
|
| 80 | 76 | if ($name && $values && is_array($values)) { |
| 81 | 77 | $workspaceFilters = $this->getSessionData('workspaceFilters'); |
| 82 | 78 | if ($workspaceFilters && is_array($workspaceFilters)) { |
@@ -103,8 +99,7 @@ discard block |
||
| 103 | 99 | * @param string $field |
| 104 | 100 | * @param string $order |
| 105 | 101 | */ |
| 106 | - public function addWorkspaceSortAction($field, $order) |
|
| 107 | - { |
|
| 102 | + public function addWorkspaceSortAction($field, $order) { |
|
| 108 | 103 | $this->session->setWorkspaceSort($field, $order); |
| 109 | 104 | return; |
| 110 | 105 | } |
@@ -113,8 +108,7 @@ discard block |
||
| 113 | 108 | * Toggles the filter to exclude discarded documents. |
| 114 | 109 | * |
| 115 | 110 | */ |
| 116 | - public function toggleWorkspaceExcludeDiscardedAction() |
|
| 117 | - { |
|
| 111 | + public function toggleWorkspaceExcludeDiscardedAction() { |
|
| 118 | 112 | $this->session->toggleWorkspaceExcludeDiscardedFilter(); |
| 119 | 113 | return; |
| 120 | 114 | } |
@@ -123,8 +117,7 @@ discard block |
||
| 123 | 117 | * Toggles the filter to hide bookmarked documents. |
| 124 | 118 | * |
| 125 | 119 | */ |
| 126 | - public function toggleWorkspaceBookmarksOnlyAction() |
|
| 127 | - { |
|
| 120 | + public function toggleWorkspaceBookmarksOnlyAction() { |
|
| 128 | 121 | $this->session->toggleWorkspaceBookmarksOnlyFilter(); |
| 129 | 122 | return; |
| 130 | 123 | } |
@@ -134,8 +127,7 @@ discard block |
||
| 134 | 127 | * |
| 135 | 128 | * @param int $itemsPerPage |
| 136 | 129 | */ |
| 137 | - public function setWorkspaceItemsPerPageAction($itemsPerPage) |
|
| 138 | - { |
|
| 130 | + public function setWorkspaceItemsPerPageAction($itemsPerPage) { |
|
| 139 | 131 | $this->session->setWorkspaceItemsPerPage($itemsPerPage); |
| 140 | 132 | return; |
| 141 | 133 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 28 | 28 | * @inject |
| 29 | 29 | */ |
| 30 | - protected $bookmarkRepository = null; |
|
| 30 | + protected $bookmarkRepository = NULL; |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | $bookmark->setDocumentIdentifier($identifier); |
| 46 | 46 | $bookmark->setFeUserUid($this->security->getUser()->getUid()); |
| 47 | 47 | $this->bookmarkRepository->add($bookmark); |
| 48 | - return true; |
|
| 48 | + return TRUE; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return false; |
|
| 51 | + return FALSE; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier); |
| 64 | 64 | if ($bookmark) { |
| 65 | 65 | $this->bookmarkRepository->remove($bookmark); |
| 66 | - return true; |
|
| 66 | + return TRUE; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - return false; |
|
| 69 | + return FALSE; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 18 | 18 | use TYPO3\CMS\Extbase\SignalSlot\Dispatcher; |
| 19 | 19 | |
| 20 | -abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController |
|
| 21 | -{ |
|
| 20 | +abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { |
|
| 22 | 21 | /** |
| 23 | 22 | * authorizationChecker |
| 24 | 23 | * |
@@ -60,8 +59,7 @@ discard block |
||
| 60 | 59 | protected $session = null; |
| 61 | 60 | |
| 62 | 61 | |
| 63 | - protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) |
|
| 64 | - { |
|
| 62 | + protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) { |
|
| 65 | 63 | parent::initializeView($view); |
| 66 | 64 | |
| 67 | 65 | $client = $this->clientRepository->findAll()->current(); |
@@ -87,8 +85,7 @@ discard block |
||
| 87 | 85 | * @param string $key |
| 88 | 86 | * @param string $data |
| 89 | 87 | */ |
| 90 | - public function setSessionData($key, $data) |
|
| 91 | - { |
|
| 88 | + public function setSessionData($key, $data) { |
|
| 92 | 89 | if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) { |
| 93 | 90 | |
| 94 | 91 | $userGlobals = $GLOBALS['TSFE']->fe_user; |
@@ -111,8 +108,7 @@ discard block |
||
| 111 | 108 | * |
| 112 | 109 | * @return |
| 113 | 110 | */ |
| 114 | - public function getSessionData($key) |
|
| 115 | - { |
|
| 111 | + public function getSessionData($key) { |
|
| 116 | 112 | if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) { |
| 117 | 113 | |
| 118 | 114 | $userGlobals = $GLOBALS['TSFE']->fe_user; |
@@ -133,8 +129,7 @@ discard block |
||
| 133 | 129 | * |
| 134 | 130 | * @return null|string |
| 135 | 131 | */ |
| 136 | - protected function getParametersSafely($parameterName) |
|
| 137 | - { |
|
| 132 | + protected function getParametersSafely($parameterName) { |
|
| 138 | 133 | if ($this->request->hasArgument($parameterName)) { |
| 139 | 134 | return $this->filterSafelyParameters($this->request->getArgument($parameterName)); |
| 140 | 135 | } |
@@ -148,8 +143,7 @@ discard block |
||
| 148 | 143 | * |
| 149 | 144 | * @return string |
| 150 | 145 | */ |
| 151 | - protected function filterSafelyParameters($param) |
|
| 152 | - { |
|
| 146 | + protected function filterSafelyParameters($param) { |
|
| 153 | 147 | if (is_array($param)) { |
| 154 | 148 | foreach ($param as $key => $item) { |
| 155 | 149 | $param[$key] = $this->filterSafelyParameters($item); |
@@ -160,8 +154,7 @@ discard block |
||
| 160 | 154 | } |
| 161 | 155 | } |
| 162 | 156 | |
| 163 | - public function initializeAction() |
|
| 164 | - { |
|
| 157 | + public function initializeAction() { |
|
| 165 | 158 | parent::initializeAction(); |
| 166 | 159 | |
| 167 | 160 | $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
@@ -169,13 +162,11 @@ discard block |
||
| 169 | 162 | } |
| 170 | 163 | |
| 171 | 164 | |
| 172 | - public function getCurrentAction() |
|
| 173 | - { |
|
| 165 | + public function getCurrentAction() { |
|
| 174 | 166 | return str_replace('Action', '', $this->actionMethodName); |
| 175 | 167 | } |
| 176 | 168 | |
| 177 | - public function getCurrentController() |
|
| 178 | - { |
|
| 169 | + public function getCurrentController() { |
|
| 179 | 170 | $controllerName = end(explode('\\', get_Class($this))); |
| 180 | 171 | return str_replace('Controller', '', $controllerName); |
| 181 | 172 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @var \EWW\Dpf\Security\AuthorizationChecker |
| 26 | 26 | * @inject |
| 27 | 27 | */ |
| 28 | - protected $authorizationChecker = null; |
|
| 28 | + protected $authorizationChecker = NULL; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * security |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @var \EWW\Dpf\Security\Security |
| 34 | 34 | * @inject |
| 35 | 35 | */ |
| 36 | - protected $security = null; |
|
| 36 | + protected $security = NULL; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * clientRepository |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @var \EWW\Dpf\Domain\Repository\ClientRepository |
| 42 | 42 | * @inject |
| 43 | 43 | */ |
| 44 | - protected $clientRepository = null; |
|
| 44 | + protected $clientRepository = NULL; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * signalSlotDispatcher |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher |
| 50 | 50 | * @inject |
| 51 | 51 | */ |
| 52 | - protected $signalSlotDispatcher = null; |
|
| 52 | + protected $signalSlotDispatcher = NULL; |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * session |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @var \EWW\Dpf\Helper\Session |
| 58 | 58 | * @inject |
| 59 | 59 | */ |
| 60 | - protected $session = null; |
|
| 60 | + protected $session = NULL; |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $message, |
| 75 | 75 | $messageTitle = '', |
| 76 | 76 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING, |
| 77 | - $storeInSession = true |
|
| 77 | + $storeInSession = TRUE |
|
| 78 | 78 | ); |
| 79 | 79 | } else { |
| 80 | 80 | $view->assign('client', $client); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | if ($this->request->hasArgument($parameterName)) { |
| 139 | 139 | return $this->filterSafelyParameters($this->request->getArgument($parameterName)); |
| 140 | 140 | } |
| 141 | - return null; |
|
| 141 | + return NULL; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | use TYPO3\CMS\Extbase\Persistence\ObjectStorage; |
| 30 | 30 | |
| 31 | -class DocumentFormBackofficeController extends AbstractDocumentFormController |
|
| 32 | -{ |
|
| 31 | +class DocumentFormBackofficeController extends AbstractDocumentFormController { |
|
| 33 | 32 | /** |
| 34 | 33 | * documentTransferManager |
| 35 | 34 | * |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * DocumentController constructor. |
| 73 | 72 | */ |
| 74 | - public function __construct() |
|
| 75 | - { |
|
| 73 | + public function __construct() { |
|
| 76 | 74 | parent::__construct(); |
| 77 | 75 | |
| 78 | 76 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
@@ -113,8 +111,7 @@ discard block |
||
| 113 | 111 | */ |
| 114 | 112 | public function editAction( |
| 115 | 113 | \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = false, $activeFileTab = false |
| 116 | - ) |
|
| 117 | - { |
|
| 114 | + ) { |
|
| 118 | 115 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
| 119 | 116 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
| 120 | 117 | |
@@ -161,8 +158,7 @@ discard block |
||
| 161 | 158 | * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm |
| 162 | 159 | * @param bool $restore |
| 163 | 160 | */ |
| 164 | - public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE) |
|
| 165 | - { |
|
| 161 | + public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE) { |
|
| 166 | 162 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 167 | 163 | |
| 168 | 164 | $hasFilesFlag = true; |
@@ -234,8 +230,7 @@ discard block |
||
| 234 | 230 | } |
| 235 | 231 | |
| 236 | 232 | |
| 237 | - public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) |
|
| 238 | - { |
|
| 233 | + public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) { |
|
| 239 | 234 | if ($this->request->getArgument('documentData')['suggestMod']) { |
| 240 | 235 | $restore = $this->request->getArgument('documentData')['suggestRestore']; |
| 241 | 236 | $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]); |
@@ -268,8 +263,7 @@ discard block |
||
| 268 | 263 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 269 | 264 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 270 | 265 | */ |
| 271 | - public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) |
|
| 272 | - { |
|
| 266 | + public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) { |
|
| 273 | 267 | try { |
| 274 | 268 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
| 275 | 269 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
@@ -406,8 +400,7 @@ discard block |
||
| 406 | 400 | } |
| 407 | 401 | } |
| 408 | 402 | |
| 409 | - public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) |
|
| 410 | - { |
|
| 403 | + public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) { |
|
| 411 | 404 | /** @var \EWW\Dpf\Helper\DocumentMapper $documentMapper */ |
| 412 | 405 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 413 | 406 | |
@@ -473,8 +466,7 @@ discard block |
||
| 473 | 466 | * |
| 474 | 467 | * @return void |
| 475 | 468 | */ |
| 476 | - public function cancelEditAction($documentUid = 0, $documentList = false) |
|
| 477 | - { |
|
| 469 | + public function cancelEditAction($documentUid = 0, $documentList = false) { |
|
| 478 | 470 | if ($documentList) { |
| 479 | 471 | $this->redirectToDocumentList(); |
| 480 | 472 | } |
@@ -487,8 +479,7 @@ discard block |
||
| 487 | 479 | } |
| 488 | 480 | } |
| 489 | 481 | |
| 490 | - public function initializeAction() |
|
| 491 | - { |
|
| 482 | + public function initializeAction() { |
|
| 492 | 483 | $this->authorizationChecker->denyAccessUnlessLoggedIn(); |
| 493 | 484 | |
| 494 | 485 | parent::initializeAction(); |
@@ -502,8 +493,7 @@ discard block |
||
| 502 | 493 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 503 | 494 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 504 | 495 | */ |
| 505 | - protected function redirectToDocumentList($message = null) |
|
| 506 | - { |
|
| 496 | + protected function redirectToDocumentList($message = null) { |
|
| 507 | 497 | list($action, $controller, $redirectUri) = $this->session->getListAction(); |
| 508 | 498 | |
| 509 | 499 | if ($redirectUri) { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function arrayRecursiveDiff($aArray1, $aArray2) { |
| 85 | - $aReturn = array(); |
|
| 85 | + $aReturn = array (); |
|
| 86 | 86 | |
| 87 | 87 | foreach ($aArray1 as $mKey => $mValue) { |
| 88 | 88 | if (array_key_exists($mKey, $aArray2)) { |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | $message = LocalizationUtility::translate( |
| 131 | 131 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.accessDenied', |
| 132 | 132 | 'dpf', |
| 133 | - array($document->getTitle()) |
|
| 133 | + array ($document->getTitle()) |
|
| 134 | 134 | ); |
| 135 | 135 | } else { |
| 136 | 136 | $message = LocalizationUtility::translate( |
| 137 | 137 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.failureBlocked', |
| 138 | 138 | 'dpf', |
| 139 | - array($document->getTitle()) |
|
| 139 | + array ($document->getTitle()) |
|
| 140 | 140 | ); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->view->assign('suggestMod', $suggestMod); |
| 150 | 150 | |
| 151 | 151 | $this->editingLockService->lock( |
| 152 | - ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()), |
|
| 152 | + ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()), |
|
| 153 | 153 | $this->security->getUser()->getUid() |
| 154 | 154 | ); |
| 155 | 155 | |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | $newDocument->setCreator($this->security->getUser()->getUid()); |
| 224 | 224 | $this->documentRepository->add($newDocument); |
| 225 | 225 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS; |
| 226 | - $this->addFlashMessage("Success", '', $severity,false); |
|
| 226 | + $this->addFlashMessage("Success", '', $severity, false); |
|
| 227 | 227 | } catch (\Throwable $t) { |
| 228 | 228 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR; |
| 229 | - $this->addFlashMessage("Failed", '', $severity,false); |
|
| 229 | + $this->addFlashMessage("Failed", '', $severity, false); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $this->redirectToDocumentList(); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $message = LocalizationUtility::translate( |
| 284 | 284 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.accessDenied', |
| 285 | 285 | 'dpf', |
| 286 | - array($document->getTitle()) |
|
| 286 | + array ($document->getTitle()) |
|
| 287 | 287 | ); |
| 288 | 288 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 289 | 289 | $this->redirect( |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $workflowTransition = null; |
| 303 | 303 | |
| 304 | 304 | // Convert the temporary copy into a local working copy if needed. |
| 305 | - if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
|
| 305 | + if ($updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
|
| 306 | 306 | $saveWorkingCopy = true; |
| 307 | 307 | $updateDocument->setTemporary(false); |
| 308 | 308 | $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS; |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $message = LocalizationUtility::translate( |
| 326 | 326 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.success', |
| 327 | 327 | 'dpf', |
| 328 | - array($updateDocument->getTitle()) |
|
| 328 | + array ($updateDocument->getTitle()) |
|
| 329 | 329 | ); |
| 330 | 330 | $this->addFlashMessage($message, '', AbstractMessage::OK); |
| 331 | 331 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $message = LocalizationUtility::translate( |
| 379 | 379 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure', |
| 380 | 380 | 'dpf', |
| 381 | - array($updateDocument->getTitle()) |
|
| 381 | + array ($updateDocument->getTitle()) |
|
| 382 | 382 | ); |
| 383 | 383 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 384 | 384 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $exceptionMsg[] = LocalizationUtility::translate( |
| 405 | 405 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure', |
| 406 | 406 | 'dpf', |
| 407 | - array($updateDocument->getTitle()) |
|
| 407 | + array ($updateDocument->getTitle()) |
|
| 408 | 408 | ); |
| 409 | 409 | |
| 410 | 410 | $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf'); |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | if ($redirectUri) { |
| 518 | 518 | $this->redirectToUri($redirectUri); |
| 519 | 519 | } else { |
| 520 | - $this->redirect($action, $controller, null, array('message' => $message)); |
|
| 520 | + $this->redirect($action, $controller, null, array ('message' => $message)); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @var \EWW\Dpf\Services\Document\EditingLockService |
| 51 | 51 | * @inject |
| 52 | 52 | */ |
| 53 | - protected $editingLockService = null; |
|
| 53 | + protected $editingLockService = NULL; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * documentManager |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @var \EWW\Dpf\Services\Document\DocumentManager |
| 59 | 59 | * @inject |
| 60 | 60 | */ |
| 61 | - protected $documentManager = null; |
|
| 61 | + protected $documentManager = NULL; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * bookmarkRepository |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 67 | 67 | * @inject |
| 68 | 68 | */ |
| 69 | - protected $bookmarkRepository = null; |
|
| 69 | + protected $bookmarkRepository = NULL; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * DocumentController constructor. |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @return void |
| 113 | 113 | */ |
| 114 | 114 | public function editAction( |
| 115 | - \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = false, $activeFileTab = false |
|
| 115 | + \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = FALSE, $activeFileTab = FALSE |
|
| 116 | 116 | ) |
| 117 | 117 | { |
| 118 | 118 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 144 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 144 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 145 | 145 | return FALSE; |
| 146 | 146 | } |
| 147 | 147 | |
@@ -165,17 +165,17 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 167 | 167 | |
| 168 | - $hasFilesFlag = true; |
|
| 168 | + $hasFilesFlag = TRUE; |
|
| 169 | 169 | |
| 170 | 170 | $workingCopy = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
| 171 | 171 | |
| 172 | 172 | if ($workingCopy->isTemporary()) { |
| 173 | - $workingCopy->setTemporary(false); |
|
| 173 | + $workingCopy->setTemporary(FALSE); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | if (empty($workingCopy->getFileData())) { |
| 177 | 177 | // no files are linked to the document |
| 178 | - $hasFilesFlag = false; |
|
| 178 | + $hasFilesFlag = FALSE; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $newDocument = $this->objectManager->get(Document::class); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $newDocument->setLinkedUid($document->getUid()); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - $newDocument->setSuggestion(true); |
|
| 198 | + $newDocument->setSuggestion(TRUE); |
|
| 199 | 199 | $newDocument->setComment($document->getComment()); |
| 200 | 200 | |
| 201 | 201 | if ($restore) { |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | $newDocument->setCreator($this->security->getUser()->getUid()); |
| 224 | 224 | $this->documentRepository->add($newDocument); |
| 225 | 225 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS; |
| 226 | - $this->addFlashMessage("Success", '', $severity,false); |
|
| 226 | + $this->addFlashMessage("Success", '', $severity,FALSE); |
|
| 227 | 227 | } catch (\Throwable $t) { |
| 228 | 228 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR; |
| 229 | - $this->addFlashMessage("Failed", '', $severity,false); |
|
| 229 | + $this->addFlashMessage("Failed", '', $severity,FALSE); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $this->redirectToDocumentList(); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | if ($this->request->getArgument('documentData')['suggestMod']) { |
| 239 | 239 | $restore = $this->request->getArgument('documentData')['suggestRestore']; |
| 240 | - $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]); |
|
| 240 | + $this->forward('createSuggestionDocument', NULL, NULL, ['documentForm' => $documentForm, 'restore' => $restore]); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if ($this->request->hasArgument('saveAndUpdate')) { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } elseif ($this->request->hasArgument('saveWorkingCopy')) { |
| 246 | 246 | $saveMode = 'saveWorkingCopy'; |
| 247 | 247 | } else { |
| 248 | - $saveMode = null; |
|
| 248 | + $saveMode = NULL; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | $this->forward( |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 268 | 268 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 269 | 269 | */ |
| 270 | - public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) |
|
| 270 | + public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = NULL) |
|
| 271 | 271 | { |
| 272 | 272 | try { |
| 273 | 273 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 289 | 289 | $this->redirect( |
| 290 | 290 | 'showDetails', 'Document', |
| 291 | - null, ['document' => $document] |
|
| 291 | + NULL, ['document' => $document] |
|
| 292 | 292 | ); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -298,13 +298,13 @@ discard block |
||
| 298 | 298 | /** @var \EWW\Dpf\Domain\Model\Document $updateDocument */ |
| 299 | 299 | $updateDocument = $documentMapper->getDocument($documentForm); |
| 300 | 300 | |
| 301 | - $saveWorkingCopy = false; |
|
| 302 | - $workflowTransition = null; |
|
| 301 | + $saveWorkingCopy = FALSE; |
|
| 302 | + $workflowTransition = NULL; |
|
| 303 | 303 | |
| 304 | 304 | // Convert the temporary copy into a local working copy if needed. |
| 305 | 305 | if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
| 306 | - $saveWorkingCopy = true; |
|
| 307 | - $updateDocument->setTemporary(false); |
|
| 306 | + $saveWorkingCopy = TRUE; |
|
| 307 | + $updateDocument->setTemporary(FALSE); |
|
| 308 | 308 | $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS; |
| 309 | 309 | } elseif ($updateDocument->isTemporaryCopy() && $saveMode == 'saveAndUpdate') { |
| 310 | 310 | $workflowTransition = DocumentWorkflow::TRANSITION_REMOTE_UPDATE; |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | if ($workflowTransition && $workflowTransition === DocumentWorkflow::TRANSITION_REMOTE_UPDATE) { |
| 387 | 387 | $this->redirectToDocumentList(); |
| 388 | 388 | } else { |
| 389 | - $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]); |
|
| 389 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]); |
|
| 390 | 390 | } |
| 391 | 391 | } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) { |
| 392 | 392 | // A redirect always throws this exception, but in this case, however, |
@@ -409,8 +409,8 @@ discard block |
||
| 409 | 409 | |
| 410 | 410 | $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf'); |
| 411 | 411 | |
| 412 | - $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity, true); |
|
| 413 | - $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]); |
|
| 412 | + $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity, TRUE); |
|
| 413 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]); |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $args[] = $document->getTitle(); |
| 428 | 428 | $message = LocalizationUtility::translate($key, 'dpf', $args); |
| 429 | 429 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 430 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 430 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 431 | 431 | return FALSE; |
| 432 | 432 | } |
| 433 | 433 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | $message, |
| 442 | 442 | '', |
| 443 | 443 | $severity, |
| 444 | - true |
|
| 444 | + TRUE |
|
| 445 | 445 | ); |
| 446 | 446 | |
| 447 | 447 | } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) { |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | implode(" ", $message), |
| 464 | 464 | '', |
| 465 | 465 | $severity, |
| 466 | - true |
|
| 466 | + TRUE |
|
| 467 | 467 | ); |
| 468 | 468 | } |
| 469 | 469 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | * |
| 482 | 482 | * @return void |
| 483 | 483 | */ |
| 484 | - public function cancelEditAction($documentUid = 0, $documentList = false) |
|
| 484 | + public function cancelEditAction($documentUid = 0, $documentList = FALSE) |
|
| 485 | 485 | { |
| 486 | 486 | if ($documentList) { |
| 487 | 487 | $this->redirectToDocumentList(); |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | /** @var $document \EWW\Dpf\Domain\Model\Document */ |
| 492 | 492 | $document = $this->documentRepository->findByUid($documentUid); |
| 493 | 493 | |
| 494 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 494 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 495 | 495 | } |
| 496 | 496 | } |
| 497 | 497 | |
@@ -510,14 +510,14 @@ discard block |
||
| 510 | 510 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 511 | 511 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 512 | 512 | */ |
| 513 | - protected function redirectToDocumentList($message = null) |
|
| 513 | + protected function redirectToDocumentList($message = NULL) |
|
| 514 | 514 | { |
| 515 | 515 | list($action, $controller, $redirectUri) = $this->session->getListAction(); |
| 516 | 516 | |
| 517 | 517 | if ($redirectUri) { |
| 518 | 518 | $this->redirectToUri($redirectUri); |
| 519 | 519 | } else { |
| 520 | - $this->redirect($action, $controller, null, array('message' => $message)); |
|
| 520 | + $this->redirect($action, $controller, NULL, array('message' => $message)); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * The TYPO3 project - inspiring people to share! |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -class Security |
|
| 18 | -{ |
|
| 17 | +class Security { |
|
| 19 | 18 | /** |
| 20 | 19 | * frontendUserRepository |
| 21 | 20 | * |
@@ -43,8 +42,7 @@ discard block |
||
| 43 | 42 | * |
| 44 | 43 | * @return null|\EWW\Dpf\Domain\Model\FrontendUser |
| 45 | 44 | */ |
| 46 | - public function getUser() |
|
| 47 | - { |
|
| 45 | + public function getUser() { |
|
| 48 | 46 | $user = $GLOBALS['TSFE']->fe_user->user; |
| 49 | 47 | if (!empty($user) && is_array($user) && array_key_exists('uid', $user)) { |
| 50 | 48 | return $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
| 23 | 23 | * @inject |
| 24 | 24 | */ |
| 25 | - protected $frontendUserRepository = null; |
|
| 25 | + protected $frontendUserRepository = NULL; |
|
| 26 | 26 | |
| 27 | 27 | const ROLE_ANONYMOUS = "ROLE_ANONYMOUS"; |
| 28 | 28 | const ROLE_RESEARCHER = "ROLE_RESEARCHER"; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function __construct() |
| 66 | 66 | { |
| 67 | - $this->workflow = DocumentWorkflow::getWorkflow(); |
|
| 67 | + $this->workflow = DocumentWorkflow::getWorkflow(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) && |
| 310 | 310 | $document->getCreator() === $this->security->getUser()->getUid() |
| 311 | 311 | ) { |
| 312 | - return TRUE; |
|
| 312 | + return TRUE; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | return FALSE; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected static function getAttributes() |
| 77 | 77 | { |
| 78 | - return array( |
|
| 78 | + return array ( |
|
| 79 | 79 | self::CREATE, |
| 80 | 80 | self::CREATE_REGISTER, |
| 81 | 81 | self::UPDATE, |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | { |
| 462 | 462 | if ($this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER) { |
| 463 | 463 | |
| 464 | - $objectManager =GeneralUtility::makeInstance(ObjectManager::class); |
|
| 464 | + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
|
| 465 | 465 | $documentRepository = $objectManager->get(DocumentRepository::class); |
| 466 | 466 | |
| 467 | 467 | $linkedDocument = $documentRepository->findOneByLinkedUid($document->getUid()); |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | protected function isDocumentLocked($document) |
| 563 | 563 | { |
| 564 | - $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid(); |
|
| 564 | + $identifier = $document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid(); |
|
| 565 | 565 | return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid()); |
| 566 | 566 | } |
| 567 | 567 | |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | use TYPO3\CMS\Core\Log\LogManager; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | -class DocumentVoter extends Voter |
|
| 26 | -{ |
|
| 25 | +class DocumentVoter extends Voter { |
|
| 27 | 26 | const CREATE = "DOCUMENT_CREATE"; |
| 28 | 27 | const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER"; |
| 29 | 28 | const UPDATE = "DOCUMENT_UPDATE"; |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | */ |
| 65 | 64 | protected $workflow; |
| 66 | 65 | |
| 67 | - public function __construct() |
|
| 68 | - { |
|
| 66 | + public function __construct() { |
|
| 69 | 67 | $this->workflow = DocumentWorkflow::getWorkflow(); |
| 70 | 68 | } |
| 71 | 69 | |
@@ -75,8 +73,7 @@ discard block |
||
| 75 | 73 | * |
| 76 | 74 | * @return array |
| 77 | 75 | */ |
| 78 | - protected static function getAttributes() |
|
| 79 | - { |
|
| 76 | + protected static function getAttributes() { |
|
| 80 | 77 | return array( |
| 81 | 78 | self::CREATE, |
| 82 | 79 | self::CREATE_REGISTER, |
@@ -111,8 +108,7 @@ discard block |
||
| 111 | 108 | * @param mixed $subject |
| 112 | 109 | * @return mixed |
| 113 | 110 | */ |
| 114 | - public static function supports($attribute, $subject = NULL) |
|
| 115 | - { |
|
| 111 | + public static function supports($attribute, $subject = NULL) { |
|
| 116 | 112 | if (!in_array($attribute, self::getAttributes())) { |
| 117 | 113 | return FALSE; |
| 118 | 114 | } |
@@ -131,8 +127,7 @@ discard block |
||
| 131 | 127 | * @param mixed $subject |
| 132 | 128 | * @return mixed |
| 133 | 129 | */ |
| 134 | - public function voteOnAttribute($attribute, $subject = NULL) |
|
| 135 | - { |
|
| 130 | + public function voteOnAttribute($attribute, $subject = NULL) { |
|
| 136 | 131 | if (!$subject instanceof Document) { |
| 137 | 132 | return FALSE; |
| 138 | 133 | } |
@@ -242,8 +237,7 @@ discard block |
||
| 242 | 237 | /** |
| 243 | 238 | * @return bool |
| 244 | 239 | */ |
| 245 | - protected function defaultAccess() |
|
| 246 | - { |
|
| 240 | + protected function defaultAccess() { |
|
| 247 | 241 | return ( |
| 248 | 242 | $this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN || |
| 249 | 243 | $this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER |
@@ -253,8 +247,7 @@ discard block |
||
| 253 | 247 | /** |
| 254 | 248 | * @return bool |
| 255 | 249 | */ |
| 256 | - protected function librarianOnly() |
|
| 257 | - { |
|
| 250 | + protected function librarianOnly() { |
|
| 258 | 251 | return $this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN; |
| 259 | 252 | } |
| 260 | 253 | |
@@ -262,8 +255,7 @@ discard block |
||
| 262 | 255 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 263 | 256 | * @return bool |
| 264 | 257 | */ |
| 265 | - protected function canDiscard($document) |
|
| 266 | - { |
|
| 258 | + protected function canDiscard($document) { |
|
| 267 | 259 | if ($this->isDocumentLocked($document)) { |
| 268 | 260 | return FALSE; |
| 269 | 261 | } |
@@ -286,8 +278,7 @@ discard block |
||
| 286 | 278 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 287 | 279 | * @return bool |
| 288 | 280 | */ |
| 289 | - protected function canShowDetails($document) |
|
| 290 | - { |
|
| 281 | + protected function canShowDetails($document) { |
|
| 291 | 282 | if ($this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 292 | 283 | return ( |
| 293 | 284 | $document->getState() !== DocumentWorkflow::STATE_NEW_NONE || |
@@ -313,8 +304,7 @@ discard block |
||
| 313 | 304 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 314 | 305 | * @return bool |
| 315 | 306 | */ |
| 316 | - protected function canRegister($document) |
|
| 317 | - { |
|
| 307 | + protected function canRegister($document) { |
|
| 318 | 308 | if ( |
| 319 | 309 | $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) && |
| 320 | 310 | $document->getCreator() === $this->security->getUser()->getUid() |
@@ -330,8 +320,7 @@ discard block |
||
| 330 | 320 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 331 | 321 | * @return bool |
| 332 | 322 | */ |
| 333 | - protected function canReleasePublish($document) |
|
| 334 | - { |
|
| 323 | + protected function canReleasePublish($document) { |
|
| 335 | 324 | if ($this->isDocumentLocked($document)) { |
| 336 | 325 | return FALSE; |
| 337 | 326 | } |
@@ -349,8 +338,7 @@ discard block |
||
| 349 | 338 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 350 | 339 | * @return bool |
| 351 | 340 | */ |
| 352 | - protected function canReleaseActivate($document) |
|
| 353 | - { |
|
| 341 | + protected function canReleaseActivate($document) { |
|
| 354 | 342 | if ($this->isDocumentLocked($document)) { |
| 355 | 343 | return FALSE; |
| 356 | 344 | } |
@@ -367,8 +355,7 @@ discard block |
||
| 367 | 355 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 368 | 356 | * @return bool |
| 369 | 357 | */ |
| 370 | - protected function canDeleteLocally($document) |
|
| 371 | - { |
|
| 358 | + protected function canDeleteLocally($document) { |
|
| 372 | 359 | if ($this->isDocumentLocked($document)) { |
| 373 | 360 | return FALSE; |
| 374 | 361 | } |
@@ -393,8 +380,7 @@ discard block |
||
| 393 | 380 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 394 | 381 | * @return bool |
| 395 | 382 | */ |
| 396 | - protected function canDeleteWorkingCopy($document) |
|
| 397 | - { |
|
| 383 | + protected function canDeleteWorkingCopy($document) { |
|
| 398 | 384 | if ($document->isTemporary() || $this->isDocumentLocked($document)) { |
| 399 | 385 | return FALSE; |
| 400 | 386 | } |
@@ -411,8 +397,7 @@ discard block |
||
| 411 | 397 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 412 | 398 | * @return bool |
| 413 | 399 | */ |
| 414 | - protected function canEdit($document) |
|
| 415 | - { |
|
| 400 | + protected function canEdit($document) { |
|
| 416 | 401 | if ($this->isDocumentLocked($document)) { |
| 417 | 402 | return FALSE; |
| 418 | 403 | } |
@@ -439,8 +424,7 @@ discard block |
||
| 439 | 424 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 440 | 425 | * @return bool |
| 441 | 426 | */ |
| 442 | - protected function canUpdate($document) |
|
| 443 | - { |
|
| 427 | + protected function canUpdate($document) { |
|
| 444 | 428 | if ($this->isDocumentLocked($document)) { |
| 445 | 429 | return FALSE; |
| 446 | 430 | } |
@@ -467,8 +451,7 @@ discard block |
||
| 467 | 451 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 468 | 452 | * @return bool |
| 469 | 453 | */ |
| 470 | - protected function canSuggestRestore($document) |
|
| 471 | - { |
|
| 454 | + protected function canSuggestRestore($document) { |
|
| 472 | 455 | if ($this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER) { |
| 473 | 456 | |
| 474 | 457 | $objectManager =GeneralUtility::makeInstance(ObjectManager::class); |
@@ -493,8 +476,7 @@ discard block |
||
| 493 | 476 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 494 | 477 | * @return bool |
| 495 | 478 | */ |
| 496 | - protected function canSuggestModification($document) |
|
| 497 | - { |
|
| 479 | + protected function canSuggestModification($document) { |
|
| 498 | 480 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 499 | 481 | $documentRepository = $objectManager->get(DocumentRepository::class); |
| 500 | 482 | |
@@ -523,8 +505,7 @@ discard block |
||
| 523 | 505 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 524 | 506 | * @return bool |
| 525 | 507 | */ |
| 526 | - protected function canSuggestionAccept($document) |
|
| 527 | - { |
|
| 508 | + protected function canSuggestionAccept($document) { |
|
| 528 | 509 | // TODO: What if a document should be restored? |
| 529 | 510 | |
| 530 | 511 | return $this->librarianOnly(); |
@@ -534,8 +515,7 @@ discard block |
||
| 534 | 515 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 535 | 516 | * @return bool |
| 536 | 517 | */ |
| 537 | - protected function canPostpone($document) |
|
| 538 | - { |
|
| 518 | + protected function canPostpone($document) { |
|
| 539 | 519 | if ($this->isDocumentLocked($document)) { |
| 540 | 520 | return FALSE; |
| 541 | 521 | } |
@@ -552,8 +532,7 @@ discard block |
||
| 552 | 532 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 553 | 533 | * @return bool |
| 554 | 534 | */ |
| 555 | - protected function canCreateRegister($document) |
|
| 556 | - { |
|
| 535 | + protected function canCreateRegister($document) { |
|
| 557 | 536 | if ($this->security->getUser()->getUserRole()) { |
| 558 | 537 | return FALSE; |
| 559 | 538 | } |
@@ -569,8 +548,7 @@ discard block |
||
| 569 | 548 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 570 | 549 | * @return bool |
| 571 | 550 | */ |
| 572 | - protected function isDocumentLocked($document) |
|
| 573 | - { |
|
| 551 | + protected function isDocumentLocked($document) { |
|
| 574 | 552 | $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid(); |
| 575 | 553 | return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid()); |
| 576 | 554 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | const CREATE = "DOCUMENT_CREATE"; |
| 28 | 28 | const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER"; |
| 29 | 29 | const UPDATE = "DOCUMENT_UPDATE"; |
| 30 | - const LIST = "DOCUMENT_LIST"; |
|
| 30 | + const list = "DOCUMENT_LIST"; |
|
| 31 | 31 | const LIST_REGISTERED = "DOCUMENT_LIST_REGISTERED"; |
| 32 | 32 | const LIST_IN_PROGRESS = "DOCUMENT_LIST_IN_PROGRESS"; |
| 33 | 33 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @var \EWW\Dpf\Services\Document\EditingLockService |
| 56 | 56 | * @inject |
| 57 | 57 | */ |
| 58 | - protected $editingLockService = null; |
|
| 58 | + protected $editingLockService = NULL; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * workflow |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | self::CREATE, |
| 82 | 82 | self::CREATE_REGISTER, |
| 83 | 83 | self::UPDATE, |
| 84 | - self::LIST, |
|
| 84 | + self::list, |
|
| 85 | 85 | self::LIST_REGISTERED, |
| 86 | 86 | self::LIST_IN_PROGRESS, |
| 87 | 87 | self::DISCARD, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | return $this->canUpdate($subject); |
| 152 | 152 | break; |
| 153 | 153 | |
| 154 | - case self::LIST: |
|
| 154 | + case self::list: |
|
| 155 | 155 | return $this->defaultAccess(); |
| 156 | 156 | break; |
| 157 | 157 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | ] |
| 237 | 237 | ); |
| 238 | 238 | |
| 239 | - return false; |
|
| 239 | + return FALSE; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | ); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | - return false; |
|
| 463 | + return FALSE; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |