Passed
Pull Request — master (#166)
by
unknown
17:57
created
Classes/Controller/SearchController.php 1 patch
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Classes/Controller/WorkspaceController.php 1 patch
Braces   +20 added lines, -39 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 /**
27 27
  * Controller for the "workspace"/"my publications" area.
28 28
  */
29
-class WorkspaceController  extends AbstractController
30
-{
29
+class WorkspaceController  extends AbstractController {
31 30
     const MAXIMUM_NUMBER_OF_LINKS = 5;
32 31
     const DEFAULT_SORT_FIELD = 'title';
33 32
     const DEFAULT_SORT_ORDER = 'asc';
@@ -168,11 +167,10 @@  discard block
 block discarded – undo
168 167
      *
169 168
      * @return void
170 169
      */
171
-    protected function listWorkspaceAction($checkedDocumentIdentifiers = [])
172
-    {
170
+    protected function listWorkspaceAction($checkedDocumentIdentifiers = []) {
173 171
         if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) {
174 172
             $this->view->assign('isWorkspace', true);
175
-        } elseif ($this->security->getUserRole() === Security::ROLE_RESEARCHER){
173
+        } elseif ($this->security->getUserRole() === Security::ROLE_RESEARCHER) {
176 174
             $this->view->assign('isWorkspace', false);
177 175
         } else {
178 176
             $message = LocalizationUtility::translate(
@@ -206,8 +204,7 @@  discard block
 block discarded – undo
206 204
      * Batch operations action.
207 205
      * @param array $listData
208 206
      */
209
-    public function batchAction($listData)
210
-    {
207
+    public function batchAction($listData) {
211 208
         if (array_key_exists('action', $listData)) {
212 209
             $this->forward($listData['action'], null, null, ['listData' => $listData]);
213 210
         }
@@ -218,8 +215,7 @@  discard block
 block discarded – undo
218 215
      * @param array $listData
219 216
      * @throws \EWW\Dpf\Exceptions\DocumentMaxSizeErrorException
220 217
      */
221
-    public function batchRegisterAction($listData)
222
-    {
218
+    public function batchRegisterAction($listData) {
223 219
         $successful = [];
224 220
         $checkedDocumentIdentifiers = [];
225 221
 
@@ -300,8 +296,7 @@  discard block
 block discarded – undo
300 296
      * Batch operation, remove documents.
301 297
      * @param array $listData
302 298
      */
303
-    public function batchRemoveAction($listData)
304
-    {
299
+    public function batchRemoveAction($listData) {
305 300
         $successful = [];
306 301
         $checkedDocumentIdentifiers = [];
307 302
 
@@ -350,8 +345,7 @@  discard block
 block discarded – undo
350 345
      * Batch operation, release documents.
351 346
      * @param array $listData
352 347
      */
353
-    public function batchReleaseValidatedAction($listData)
354
-    {
348
+    public function batchReleaseValidatedAction($listData) {
355 349
         $this->batchRelease($listData, true);
356 350
     }
357 351
 
@@ -359,8 +353,7 @@  discard block
 block discarded – undo
359 353
      * Batch operation, release as unvalidated documents.
360 354
      * @param array $listData
361 355
      */
362
-    public function batchReleaseUnvalidatedAction($listData)
363
-    {
356
+    public function batchReleaseUnvalidatedAction($listData) {
364 357
         $this->batchRelease($listData, false);
365 358
     }
366 359
 
@@ -372,8 +365,7 @@  discard block
 block discarded – undo
372 365
      * @param array $listData
373 366
      * @param bool $validated
374 367
      */
375
-    protected function batchRelease($listData, $validated)
376
-    {
368
+    protected function batchRelease($listData, $validated) {
377 369
         $successful = [];
378 370
         $checkedDocumentIdentifiers = [];
379 371
 
@@ -492,8 +484,7 @@  discard block
 block discarded – undo
492 484
      */
493 485
     protected function getWorkspaceQuery(
494 486
         $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null
495
-    )
496
-    {
487
+    ) {
497 488
         $workspaceFilter = [
498 489
             'bool' => [
499 490
                 'must' => [
@@ -544,8 +535,7 @@  discard block
 block discarded – undo
544 535
      */
545 536
     protected function getMyPublicationsQuery(
546 537
         $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null
547
-    )
548
-    {
538
+    ) {
549 539
         $workspaceFilter = [
550 540
             'bool' => [
551 541
                 'must' => [
@@ -579,8 +569,7 @@  discard block
 block discarded – undo
579 569
      */
580 570
     protected function buildQuery(
581 571
         $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], $excludeFilters = [], $sortField = null, $sortOrder = null
582
-    )
583
-    {
572
+    ) {
584 573
         // The base filter.
585 574
         $queryFilter = [
586 575
             'bool' => [
@@ -934,8 +923,7 @@  discard block
 block discarded – undo
934 923
     }
935 924
 
936 925
 
937
-    protected function getSortScriptUniversityCollection($collection)
938
-    {
926
+    protected function getSortScriptUniversityCollection($collection) {
939 927
         $script  = "for (int i = 0; i < doc['collections'].length; ++i) {";
940 928
         $script .= "    if (doc['collections'][i] == '".$collection."') {";
941 929
         $script .= "        return '1';";
@@ -946,8 +934,7 @@  discard block
 block discarded – undo
946 934
         return $script;
947 935
     }
948 936
 
949
-    protected function getSortScriptHasFiles()
950
-    {
937
+    protected function getSortScriptHasFiles() {
951 938
         $script = "if (doc['hasFiles'].value == 'true') {";
952 939
         $script .= "    return '1';";
953 940
         $script .= "}";
@@ -956,8 +943,7 @@  discard block
 block discarded – undo
956 943
         return $script;
957 944
     }
958 945
 
959
-    protected function getSortScriptCreatorRole($feUserUid)
960
-    {
946
+    protected function getSortScriptCreatorRole($feUserUid) {
961 947
         $script = "if (doc['creator'].value == '".$feUserUid."') {";
962 948
         $script .= "    return '1';";
963 949
         $script .= "}";
@@ -973,8 +959,7 @@  discard block
 block discarded – undo
973 959
     }
974 960
 
975 961
 
976
-    protected function getSortScriptState()
977
-    {
962
+    protected function getSortScriptState() {
978 963
         $sortStates = [];
979 964
         foreach (DocumentWorkflow::PLACES as $state) {
980 965
             if (array_key_exists($state, DocumentWorkflow::STATE_TO_SIMPLESTATE_MAPPING)) {
@@ -991,8 +976,7 @@  discard block
 block discarded – undo
991 976
     }
992 977
 
993 978
 
994
-    protected function getSortScriptDoctype()
995
-    {
979
+    protected function getSortScriptDoctype() {
996 980
         $sortDoctypes = [];
997 981
         foreach ($this->documentTypeRepository->findAll() as $documentType) {
998 982
             if ($documentType->getName() && $documentType->getDisplayname()) {
@@ -1014,8 +998,7 @@  discard block
 block discarded – undo
1014 998
      * @param int $stop
1015 999
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
1016 1000
      */
1017
-    public function initIndexAction($start=1, $stop=100)
1018
-    {
1001
+    public function initIndexAction($start=1, $stop=100) {
1019 1002
         /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
1020 1003
         $signalSlotDispatcher = $this->objectManager->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
1021 1004
 
@@ -1070,8 +1053,7 @@  discard block
 block discarded – undo
1070 1053
      * @param string $documentIdentifier
1071 1054
      * @return void
1072 1055
      */
1073
-    public function uploadFilesAction($documentIdentifier)
1074
-    {
1056
+    public function uploadFilesAction($documentIdentifier) {
1075 1057
         $document = $this->documentManager->read(
1076 1058
             $documentIdentifier,
1077 1059
             $this->security->getUser()->getUID()
@@ -1130,8 +1112,7 @@  discard block
 block discarded – undo
1130 1112
      *
1131 1113
      * @return int
1132 1114
      */
1133
-    protected function itemsPerPage()
1134
-    {
1115
+    protected function itemsPerPage() {
1135 1116
         $itemsPerPage = $this->session->getWorkspaceItemsPerPage();
1136 1117
         $default = ($this->settings['workspaceItemsPerPage'])? $this->settings['workspaceItemsPerPage'] : 10;
1137 1118
         return ($itemsPerPage)? $itemsPerPage : $default;
Please login to merge, or discard this patch.
Classes/Controller/AbstractDocumentFormController.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Classes/Controller/DocumentController.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
Classes/Controller/AbstractSearchController.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.
Classes/Controller/AjaxBackofficeController.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Controller/DocumentFormBackofficeController.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Classes/Security/Security.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.