@@ -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 |
@@ -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 | |
@@ -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'; |
@@ -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]; |
@@ -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 | } |
@@ -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 | } |
@@ -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) { |
@@ -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,15 +22,13 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * The repository for Bookmarks |
| 24 | 24 | */ |
| 25 | -class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository |
|
| 26 | -{ |
|
| 25 | +class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository { |
|
| 27 | 26 | /** |
| 28 | 27 | * @param int $feUserUid |
| 29 | 28 | * @param string $identifier |
| 30 | 29 | * @return object |
| 31 | 30 | */ |
| 32 | - public function findBookmark($feUserUid, $identifier) |
|
| 33 | - { |
|
| 31 | + public function findBookmark($feUserUid, $identifier) { |
|
| 34 | 32 | $query = $this->createQuery(); |
| 35 | 33 | |
| 36 | 34 | $query->matching( |
@@ -49,8 +47,7 @@ discard block |
||
| 49 | 47 | * @return bool |
| 50 | 48 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 51 | 49 | */ |
| 52 | - public function removeBookmark($document, $feUserUid) |
|
| 53 | - { |
|
| 50 | + public function removeBookmark($document, $feUserUid) { |
|
| 54 | 51 | $query = $this->createQuery(); |
| 55 | 52 | |
| 56 | 53 | if ($document instanceof Document) { |
@@ -82,8 +79,7 @@ discard block |
||
| 82 | 79 | * @return bool |
| 83 | 80 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 84 | 81 | */ |
| 85 | - public function addBookmark($feUserUid, Document $document) |
|
| 86 | - { |
|
| 82 | + public function addBookmark($feUserUid, Document $document) { |
|
| 87 | 83 | $identifier = $document->getDocumentIdentifier(); |
| 88 | 84 | |
| 89 | 85 | $bookmark = $this->findBookmark($feUserUid, $identifier); |