@@ -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 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | protected function list($from = 0) |
| 99 | 99 | { |
| 100 | - $bookmarkIdentifiers = array(); |
|
| 100 | + $bookmarkIdentifiers = array (); |
|
| 101 | 101 | $bookmarks = $this->bookmarkRepository->findByFeUserUid($this->security->getUser()->getUid()); |
| 102 | 102 | foreach ($bookmarks as $bookmark) { |
| 103 | 103 | $bookmarkIdentifiers[] = $bookmark->getDocumentIdentifier(); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 146 | 146 | $this->redirect( |
| 147 | 147 | $redirectAction, $redirectController, null, |
| 148 | - array('message' => [], 'checkedDocumentIdentifiers' => []) |
|
| 148 | + array ('message' => [], 'checkedDocumentIdentifiers' => []) |
|
| 149 | 149 | ); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 174 | 174 | $this->view->assign('isWorkspace', true); |
| 175 | - } elseif ($this->security->getUserRole() === Security::ROLE_RESEARCHER){ |
|
| 175 | + } elseif ($this->security->getUserRole() === Security::ROLE_RESEARCHER) { |
|
| 176 | 176 | $this->view->assign('isWorkspace', false); |
| 177 | 177 | } else { |
| 178 | 178 | $message = LocalizationUtility::translate( |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $currentPage = 1; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - $this->list((empty($currentPage)? 0 : ($currentPage-1) * $this->itemsPerPage())); |
|
| 197 | + $this->list((empty($currentPage) ? 0 : ($currentPage - 1) * $this->itemsPerPage())); |
|
| 198 | 198 | |
| 199 | 199 | $this->view->assign('currentPage', $currentPage); |
| 200 | 200 | $this->view->assign('workspaceListAction', $this->getCurrentAction()); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $successful = []; |
| 224 | 224 | $checkedDocumentIdentifiers = []; |
| 225 | 225 | |
| 226 | - if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers']) ) { |
|
| 226 | + if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers'])) { |
|
| 227 | 227 | $checkedDocumentIdentifiers = $listData['documentIdentifiers']; |
| 228 | 228 | foreach ($listData['documentIdentifiers'] as $documentIdentifier) { |
| 229 | 229 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 294 | 294 | $this->redirect( |
| 295 | 295 | $redirectAction, $redirectController, null, |
| 296 | - array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 296 | + array ('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $successful = []; |
| 306 | 306 | $checkedDocumentIdentifiers = []; |
| 307 | 307 | |
| 308 | - if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers']) ) { |
|
| 308 | + if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers'])) { |
|
| 309 | 309 | $checkedDocumentIdentifiers = $listData['documentIdentifiers']; |
| 310 | 310 | foreach ($listData['documentIdentifiers'] as $documentIdentifier) { |
| 311 | 311 | $feUserUid = $this->security->getUser()->getUid(); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 343 | 343 | $this->redirect( |
| 344 | 344 | $redirectAction, $redirectController, null, |
| 345 | - array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 345 | + array ('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | $successful = []; |
| 378 | 378 | $checkedDocumentIdentifiers = []; |
| 379 | 379 | |
| 380 | - if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers']) ) { |
|
| 380 | + if (array_key_exists('documentIdentifiers', $listData) && is_array($listData['documentIdentifiers'])) { |
|
| 381 | 381 | $checkedDocumentIdentifiers = $listData['documentIdentifiers']; |
| 382 | 382 | foreach ($listData['documentIdentifiers'] as $documentIdentifier) { |
| 383 | 383 | |
@@ -446,15 +446,15 @@ discard block |
||
| 446 | 446 | (sizeof($successful) > 0 ? AbstractMessage::OK : AbstractMessage::WARNING) |
| 447 | 447 | ); |
| 448 | 448 | |
| 449 | - if (sizeof($successful) === 1 ) { |
|
| 449 | + if (sizeof($successful) === 1) { |
|
| 450 | 450 | $this->addFlashMessage( |
| 451 | - "1 ".LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular", "dpf"), |
|
| 451 | + "1 " . LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular", "dpf"), |
|
| 452 | 452 | '', |
| 453 | 453 | AbstractMessage::INFO |
| 454 | 454 | ); |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - if (sizeof($successful) > 1 ) { |
|
| 457 | + if (sizeof($successful) > 1) { |
|
| 458 | 458 | $this->addFlashMessage( |
| 459 | 459 | LocalizationUtility::translate( |
| 460 | 460 | "manager.workspace.bookmarkRemoved.plural", "dpf", [sizeof($successful)] |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 475 | 475 | $this->redirect( |
| 476 | 476 | $redirectAction, $redirectController, null, |
| 477 | - array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 477 | + array ('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
|
| 478 | 478 | |
| 479 | 479 | } |
| 480 | 480 | |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | * @return array |
| 492 | 492 | */ |
| 493 | 493 | protected function getWorkspaceQuery( |
| 494 | - $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 494 | + $from = 0, $bookmarkIdentifiers = [], $filters = [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 495 | 495 | ) |
| 496 | 496 | { |
| 497 | 497 | $workspaceFilter = [ |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * @return array |
| 544 | 544 | */ |
| 545 | 545 | protected function getMyPublicationsQuery( |
| 546 | - $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 546 | + $from = 0, $bookmarkIdentifiers = [], $filters = [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 547 | 547 | ) |
| 548 | 548 | { |
| 549 | 549 | $workspaceFilter = [ |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | 'query' => [ |
| 629 | 629 | 'bool' => [ |
| 630 | 630 | 'must' => [ |
| 631 | - 'match_all' => (object)[] |
|
| 631 | + 'match_all' => (object) [] |
|
| 632 | 632 | ], |
| 633 | 633 | 'filter' => $queryFilter |
| 634 | 634 | ] |
@@ -660,11 +660,11 @@ discard block |
||
| 660 | 660 | 'script' => [ |
| 661 | 661 | 'lang' => 'painless', |
| 662 | 662 | 'source' => |
| 663 | - "for (int i = 0; i < doc['collections'].length; ++i) {". |
|
| 664 | - " if(doc['collections'][i] =='".$this->settings['universityCollection']."') {". |
|
| 665 | - " return 'true';". |
|
| 666 | - " }". |
|
| 667 | - "}". |
|
| 663 | + "for (int i = 0; i < doc['collections'].length; ++i) {" . |
|
| 664 | + " if(doc['collections'][i] =='" . $this->settings['universityCollection'] . "') {" . |
|
| 665 | + " return 'true';" . |
|
| 666 | + " }" . |
|
| 667 | + "}" . |
|
| 668 | 668 | "return 'false';" |
| 669 | 669 | ] |
| 670 | 670 | ] |
@@ -679,23 +679,23 @@ discard block |
||
| 679 | 679 | 'script' => [ |
| 680 | 680 | 'lang' => 'painless', |
| 681 | 681 | 'source' => |
| 682 | - "if (". |
|
| 683 | - " doc['creator'].size() > 0 &&". |
|
| 684 | - " doc['creator'].value == '".$this->security->getUser()->getUid()."') {". |
|
| 685 | - " return 'self';". |
|
| 686 | - "}". |
|
| 687 | - "if (". |
|
| 688 | - " doc['creatorRole'].size() > 0 &&". |
|
| 689 | - " doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."'". |
|
| 690 | - ") {". |
|
| 691 | - " return 'librarian';". |
|
| 692 | - "}". |
|
| 693 | - "if (". |
|
| 694 | - " doc['creatorRole'].size() > 0 &&". |
|
| 695 | - " doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."'". |
|
| 696 | - ") {". |
|
| 697 | - " return 'user';". |
|
| 698 | - "}". |
|
| 682 | + "if (" . |
|
| 683 | + " doc['creator'].size() > 0 &&" . |
|
| 684 | + " doc['creator'].value == '" . $this->security->getUser()->getUid() . "') {" . |
|
| 685 | + " return 'self';" . |
|
| 686 | + "}" . |
|
| 687 | + "if (" . |
|
| 688 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 689 | + " doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "'" . |
|
| 690 | + ") {" . |
|
| 691 | + " return 'librarian';" . |
|
| 692 | + "}" . |
|
| 693 | + "if (" . |
|
| 694 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 695 | + " doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "'" . |
|
| 696 | + ") {" . |
|
| 697 | + " return 'user';" . |
|
| 698 | + "}" . |
|
| 699 | 699 | "return 'unknown';" |
| 700 | 700 | ] |
| 701 | 701 | ] |
@@ -920,12 +920,12 @@ discard block |
||
| 920 | 920 | ]; |
| 921 | 921 | } else { |
| 922 | 922 | if ($sortField == 'title') { |
| 923 | - $sortField.= ".keyword"; |
|
| 923 | + $sortField .= ".keyword"; |
|
| 924 | 924 | } |
| 925 | 925 | |
| 926 | 926 | $sort = [ |
| 927 | - (($sortField)? $sortField : self::DEFAULT_SORT_FIELD.".keyword") => [ |
|
| 928 | - 'order' => (($sortOrder)? $sortOrder : self::DEFAULT_SORT_ORDER) |
|
| 927 | + (($sortField) ? $sortField : self::DEFAULT_SORT_FIELD . ".keyword") => [ |
|
| 928 | + 'order' => (($sortOrder) ? $sortOrder : self::DEFAULT_SORT_ORDER) |
|
| 929 | 929 | ] |
| 930 | 930 | ]; |
| 931 | 931 | } |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | protected function getSortScriptUniversityCollection($collection) |
| 938 | 938 | { |
| 939 | 939 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 940 | - $script .= " if (doc['collections'][i] == '".$collection."') {"; |
|
| 940 | + $script .= " if (doc['collections'][i] == '" . $collection . "') {"; |
|
| 941 | 941 | $script .= " return '1';"; |
| 942 | 942 | $script .= " }"; |
| 943 | 943 | $script .= "}"; |
@@ -958,13 +958,13 @@ discard block |
||
| 958 | 958 | |
| 959 | 959 | protected function getSortScriptCreatorRole($feUserUid) |
| 960 | 960 | { |
| 961 | - $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
|
| 961 | + $script = "if (doc['creator'].value == '" . $feUserUid . "') {"; |
|
| 962 | 962 | $script .= " return '1';"; |
| 963 | 963 | $script .= "}"; |
| 964 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."') {"; |
|
| 964 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "') {"; |
|
| 965 | 965 | $script .= "return '2';"; |
| 966 | 966 | $script .= "}"; |
| 967 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."') {"; |
|
| 967 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "') {"; |
|
| 968 | 968 | $script .= " return '3';"; |
| 969 | 969 | $script .= "}"; |
| 970 | 970 | $script .= "return '4';"; |
@@ -979,15 +979,15 @@ discard block |
||
| 979 | 979 | foreach (DocumentWorkflow::PLACES as $state) { |
| 980 | 980 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_SIMPLESTATE_MAPPING)) { |
| 981 | 981 | $simpleState = DocumentWorkflow::STATE_TO_SIMPLESTATE_MAPPING[$state]; |
| 982 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.'.$simpleState; |
|
| 982 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.' . $simpleState; |
|
| 983 | 983 | $stateName = LocalizationUtility::translate($key, 'dpf'); |
| 984 | - $sortStates[] = "if (doc['state'].value == '".$state."') return '".$stateName."';"; |
|
| 984 | + $sortStates[] = "if (doc['state'].value == '" . $state . "') return '" . $stateName . "';"; |
|
| 985 | 985 | } |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | 988 | $sortStates = implode(" ", $sortStates); |
| 989 | 989 | |
| 990 | - return $sortStates." return '';"; |
|
| 990 | + return $sortStates . " return '';"; |
|
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | |
@@ -996,14 +996,14 @@ discard block |
||
| 996 | 996 | $sortDoctypes = []; |
| 997 | 997 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 998 | 998 | if ($documentType->getName() && $documentType->getDisplayname()) { |
| 999 | - $sortDoctypes[] = "if (doc['doctype'].value == '".$documentType->getName()."')" |
|
| 1000 | - ." return '".$documentType->getDisplayname()."';"; |
|
| 999 | + $sortDoctypes[] = "if (doc['doctype'].value == '" . $documentType->getName() . "')" |
|
| 1000 | + ." return '" . $documentType->getDisplayname() . "';"; |
|
| 1001 | 1001 | } |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | $sortDoctypes = implode(" ", $sortDoctypes); |
| 1005 | 1005 | |
| 1006 | - return $sortDoctypes." return '';"; |
|
| 1006 | + return $sortDoctypes . " return '';"; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | * @param int $stop |
| 1015 | 1015 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 1016 | 1016 | */ |
| 1017 | - public function initIndexAction($start=1, $stop=100) |
|
| 1017 | + public function initIndexAction($start = 1, $stop = 100) |
|
| 1018 | 1018 | { |
| 1019 | 1019 | /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */ |
| 1020 | 1020 | $signalSlotDispatcher = $this->objectManager->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class); |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $fedoraRepository = $this->objectManager->get(\EWW\Dpf\Services\Transfer\FedoraRepository::class); |
| 1026 | 1026 | $documentTransferManager->setRemoteRepository($fedoraRepository); |
| 1027 | 1027 | |
| 1028 | - for($i=$start; $i<$stop; $i++) { |
|
| 1028 | + for ($i = $start; $i < $stop; $i++) { |
|
| 1029 | 1029 | try { |
| 1030 | 1030 | $document = $documentTransferManager->retrieve('qucosa:' . $i); |
| 1031 | 1031 | |
@@ -1095,13 +1095,13 @@ discard block |
||
| 1095 | 1095 | $message = LocalizationUtility::translate( |
| 1096 | 1096 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.accessDenied', |
| 1097 | 1097 | 'dpf', |
| 1098 | - array($document->getTitle()) |
|
| 1098 | + array ($document->getTitle()) |
|
| 1099 | 1099 | ); |
| 1100 | 1100 | } else { |
| 1101 | 1101 | $message = LocalizationUtility::translate( |
| 1102 | 1102 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.failureBlocked', |
| 1103 | 1103 | 'dpf', |
| 1104 | - array($document->getTitle()) |
|
| 1104 | + array ($document->getTitle()) |
|
| 1105 | 1105 | ); |
| 1106 | 1106 | } |
| 1107 | 1107 | } |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | if ($redirectUri) { |
| 1120 | 1120 | $this->redirectToUri($redirectUri); |
| 1121 | 1121 | } else { |
| 1122 | - $this->redirect($action, $controller, null, array('message' => $message));; |
|
| 1122 | + $this->redirect($action, $controller, null, array ('message' => $message)); ; |
|
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | } |
@@ -1133,8 +1133,8 @@ discard block |
||
| 1133 | 1133 | protected function itemsPerPage() |
| 1134 | 1134 | { |
| 1135 | 1135 | $itemsPerPage = $this->session->getWorkspaceItemsPerPage(); |
| 1136 | - $default = ($this->settings['workspaceItemsPerPage'])? $this->settings['workspaceItemsPerPage'] : 10; |
|
| 1137 | - return ($itemsPerPage)? $itemsPerPage : $default; |
|
| 1136 | + $default = ($this->settings['workspaceItemsPerPage']) ? $this->settings['workspaceItemsPerPage'] : 10; |
|
| 1137 | + return ($itemsPerPage) ? $itemsPerPage : $default; |
|
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | 1140 | } |
@@ -26,8 +26,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 39 | 39 | * @inject |
| 40 | 40 | */ |
| 41 | - protected $documentRepository = null; |
|
| 41 | + protected $documentRepository = NULL; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * documentTypeRepository |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 47 | 47 | * @inject |
| 48 | 48 | */ |
| 49 | - protected $documentTypeRepository = null; |
|
| 49 | + protected $documentTypeRepository = NULL; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * bookmarkRepository |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 55 | 55 | * @inject |
| 56 | 56 | */ |
| 57 | - protected $bookmarkRepository = null; |
|
| 57 | + protected $bookmarkRepository = NULL; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * elasticSearch |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @var \EWW\Dpf\Services\ElasticSearch\ElasticSearch |
| 63 | 63 | * @inject |
| 64 | 64 | */ |
| 65 | - protected $elasticSearch = null; |
|
| 65 | + protected $elasticSearch = NULL; |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * documentManager |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @var \EWW\Dpf\Services\Document\DocumentManager |
| 71 | 71 | * @inject |
| 72 | 72 | */ |
| 73 | - protected $documentManager = null; |
|
| 73 | + protected $documentManager = NULL; |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * documentValidator |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @var \EWW\Dpf\Services\Document\EditingLockService |
| 87 | 87 | * @inject |
| 88 | 88 | */ |
| 89 | - protected $editingLockService = null; |
|
| 89 | + protected $editingLockService = NULL; |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $this->session->clearFilter(); |
| 145 | 145 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 146 | 146 | $this->redirect( |
| 147 | - $redirectAction, $redirectController, null, |
|
| 147 | + $redirectAction, $redirectController, NULL, |
|
| 148 | 148 | array('message' => [], 'checkedDocumentIdentifiers' => []) |
| 149 | 149 | ); |
| 150 | 150 | } |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | protected function listWorkspaceAction($checkedDocumentIdentifiers = []) |
| 172 | 172 | { |
| 173 | 173 | if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 174 | - $this->view->assign('isWorkspace', true); |
|
| 174 | + $this->view->assign('isWorkspace', TRUE); |
|
| 175 | 175 | } elseif ($this->security->getUserRole() === Security::ROLE_RESEARCHER){ |
| 176 | - $this->view->assign('isWorkspace', false); |
|
| 176 | + $this->view->assign('isWorkspace', FALSE); |
|
| 177 | 177 | } else { |
| 178 | 178 | $message = LocalizationUtility::translate( |
| 179 | 179 | 'manager.workspace.accessDenied', 'dpf' |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $this->uriBuilder->getRequest()->getRequestUri() |
| 186 | 186 | ); |
| 187 | 187 | |
| 188 | - $currentPage = null; |
|
| 188 | + $currentPage = NULL; |
|
| 189 | 189 | $pagination = $this->getParametersSafely('@widget_0'); |
| 190 | 190 | if ($pagination) { |
| 191 | 191 | $checkedDocumentIdentifiers = []; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | public function batchAction($listData) |
| 210 | 210 | { |
| 211 | 211 | if (array_key_exists('action', $listData)) { |
| 212 | - $this->forward($listData['action'], null, null, ['listData' => $listData]); |
|
| 212 | + $this->forward($listData['action'], NULL, NULL, ['listData' => $listData]); |
|
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | if ($this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) { |
| 238 | 238 | |
| 239 | - if ($this->documentValidator->validate($document, false)) { |
|
| 239 | + if ($this->documentValidator->validate($document, FALSE)) { |
|
| 240 | 240 | |
| 241 | 241 | if ( |
| 242 | 242 | $this->documentManager->update( |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | |
| 293 | 293 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 294 | 294 | $this->redirect( |
| 295 | - $redirectAction, $redirectController, null, |
|
| 295 | + $redirectAction, $redirectController, NULL, |
|
| 296 | 296 | array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
| 297 | 297 | } |
| 298 | 298 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 343 | 343 | $this->redirect( |
| 344 | - $redirectAction, $redirectController, null, |
|
| 344 | + $redirectAction, $redirectController, NULL, |
|
| 345 | 345 | array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
| 346 | 346 | } |
| 347 | 347 | |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | public function batchReleaseValidatedAction($listData) |
| 354 | 354 | { |
| 355 | - $this->batchRelease($listData, true); |
|
| 355 | + $this->batchRelease($listData, TRUE); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function batchReleaseUnvalidatedAction($listData) |
| 363 | 363 | { |
| 364 | - $this->batchRelease($listData, false); |
|
| 364 | + $this->batchRelease($listData, FALSE); |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | $documentWorkflowTransition = DocumentWorkflow::TRANSITION_RELEASE_ACTIVATE; |
| 405 | 405 | break; |
| 406 | 406 | default: |
| 407 | - $documentVoterAttribute = null; |
|
| 408 | - $documentWorkflowTransition = null; |
|
| 407 | + $documentVoterAttribute = NULL; |
|
| 408 | + $documentWorkflowTransition = NULL; |
|
| 409 | 409 | break; |
| 410 | 410 | } |
| 411 | 411 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | |
| 474 | 474 | list($redirectAction, $redirectController) = $this->session->getListAction(); |
| 475 | 475 | $this->redirect( |
| 476 | - $redirectAction, $redirectController, null, |
|
| 476 | + $redirectAction, $redirectController, NULL, |
|
| 477 | 477 | array('message' => $message, 'checkedDocumentIdentifiers' => $checkedDocumentIdentifiers)); |
| 478 | 478 | |
| 479 | 479 | } |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | * @return array |
| 492 | 492 | */ |
| 493 | 493 | protected function getWorkspaceQuery( |
| 494 | - $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 494 | + $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = NULL, $sortOrder = NULL |
|
| 495 | 495 | ) |
| 496 | 496 | { |
| 497 | 497 | $workspaceFilter = [ |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * @return array |
| 544 | 544 | */ |
| 545 | 545 | protected function getMyPublicationsQuery( |
| 546 | - $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 546 | + $from = 0, $bookmarkIdentifiers = [], $filters= [], $excludeFilters = [], $sortField = NULL, $sortOrder = NULL |
|
| 547 | 547 | ) |
| 548 | 548 | { |
| 549 | 549 | $workspaceFilter = [ |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | * @return array |
| 579 | 579 | */ |
| 580 | 580 | protected function buildQuery( |
| 581 | - $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], $excludeFilters = [], $sortField = null, $sortOrder = null |
|
| 581 | + $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], $excludeFilters = [], $sortField = NULL, $sortOrder = NULL |
|
| 582 | 582 | ) |
| 583 | 583 | { |
| 584 | 584 | // The base filter. |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | |
| 729 | 729 | foreach ($filters as $key => $filterValues) { |
| 730 | 730 | $queryFilterPart = []; |
| 731 | - if (in_array($key, $validKeys, true)) { |
|
| 731 | + if (in_array($key, $validKeys, TRUE)) { |
|
| 732 | 732 | if ($key == 'universityCollection') { |
| 733 | 733 | if ($filterValues && is_array($filterValues)) { |
| 734 | 734 | if (in_array("true", $filterValues)) { |
@@ -1082,14 +1082,14 @@ discard block |
||
| 1082 | 1082 | $this->redirect( |
| 1083 | 1083 | 'edit', |
| 1084 | 1084 | 'DocumentFormBackoffice', |
| 1085 | - null, |
|
| 1086 | - ['document' => $document, 'activeFileTab' => true]); |
|
| 1085 | + NULL, |
|
| 1086 | + ['document' => $document, 'activeFileTab' => TRUE]); |
|
| 1087 | 1087 | } elseif ($this->authorizationChecker->isGranted(DocumentVoter::SUGGEST_MODIFICATION, $document)) { |
| 1088 | 1088 | $this->redirect( |
| 1089 | 1089 | 'edit', |
| 1090 | 1090 | 'DocumentFormBackoffice', |
| 1091 | - null, |
|
| 1092 | - ['document' => $document, 'suggestMod' => true, 'activeFileTab' => true]); |
|
| 1091 | + NULL, |
|
| 1092 | + ['document' => $document, 'suggestMod' => TRUE, 'activeFileTab' => TRUE]); |
|
| 1093 | 1093 | } else { |
| 1094 | 1094 | if ($document->getCreator() !== $this->security->getUser()->getUid()) { |
| 1095 | 1095 | $message = LocalizationUtility::translate( |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | if ($redirectUri) { |
| 1120 | 1120 | $this->redirectToUri($redirectUri); |
| 1121 | 1121 | } else { |
| 1122 | - $this->redirect($action, $controller, null, array('message' => $message));; |
|
| 1122 | + $this->redirect($action, $controller, NULL, array('message' => $message));; |
|
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | } |
@@ -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 | } |
@@ -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->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(); |
@@ -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 | |
@@ -180,7 +180,7 @@ |
||
| 180 | 180 | // document must be active |
| 181 | 181 | if($showDeleted == false) { |
| 182 | 182 | |
| 183 | - // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
|
| 183 | + // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
|
| 184 | 184 | |
| 185 | 185 | }; |
| 186 | 186 | |
@@ -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 |
@@ -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]; |
@@ -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 | /** |
@@ -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 | |
@@ -224,10 +224,10 @@ discard block |
||
| 224 | 224 | $newDocument->setCreator($this->security->getUser()->getUid()); |
| 225 | 225 | $this->documentRepository->add($newDocument); |
| 226 | 226 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS; |
| 227 | - $this->addFlashMessage("Success", '', $severity,false); |
|
| 227 | + $this->addFlashMessage("Success", '', $severity, false); |
|
| 228 | 228 | } catch (\Throwable $t) { |
| 229 | 229 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR; |
| 230 | - $this->addFlashMessage("Failed", '', $severity,false); |
|
| 230 | + $this->addFlashMessage("Failed", '', $severity, false); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | $this->redirectToDocumentList(); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $message = LocalizationUtility::translate( |
| 282 | 282 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.accessDenied', |
| 283 | 283 | 'dpf', |
| 284 | - array($document->getTitle()) |
|
| 284 | + array ($document->getTitle()) |
|
| 285 | 285 | ); |
| 286 | 286 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 287 | 287 | $this->redirect( |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $workflowTransition = null; |
| 301 | 301 | |
| 302 | 302 | // Convert the temporary copy into a local working copy if needed. |
| 303 | - if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
|
| 303 | + if ($updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
|
| 304 | 304 | $saveWorkingCopy = true; |
| 305 | 305 | $updateDocument->setTemporary(false); |
| 306 | 306 | $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS; |
@@ -323,19 +323,19 @@ discard block |
||
| 323 | 323 | $message = LocalizationUtility::translate( |
| 324 | 324 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.success', |
| 325 | 325 | 'dpf', |
| 326 | - array($updateDocument->getTitle()) |
|
| 326 | + array ($updateDocument->getTitle()) |
|
| 327 | 327 | ); |
| 328 | 328 | $this->addFlashMessage($message, '', AbstractMessage::OK); |
| 329 | 329 | |
| 330 | 330 | if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 331 | 331 | if ($saveWorkingCopy) { |
| 332 | - if( |
|
| 332 | + if ( |
|
| 333 | 333 | $this->bookmarkRepository->addBookmark( |
| 334 | 334 | $this->security->getUser()->getUid(), $updateDocument |
| 335 | 335 | ) |
| 336 | 336 | ) { |
| 337 | 337 | $this->addFlashMessage( |
| 338 | - LocalizationUtility::translate("manager.workspace.bookmarkAdded","dpf"), '', |
|
| 338 | + LocalizationUtility::translate("manager.workspace.bookmarkAdded", "dpf"), '', |
|
| 339 | 339 | AbstractMessage::INFO |
| 340 | 340 | ); |
| 341 | 341 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | ) |
| 355 | 355 | ) { |
| 356 | 356 | $this->addFlashMessage( |
| 357 | - LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular","dpf"), '', |
|
| 357 | + LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular", "dpf"), '', |
|
| 358 | 358 | AbstractMessage::INFO |
| 359 | 359 | ); |
| 360 | 360 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $message = LocalizationUtility::translate( |
| 371 | 371 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure', |
| 372 | 372 | 'dpf', |
| 373 | - array($updateDocument->getTitle()) |
|
| 373 | + array ($updateDocument->getTitle()) |
|
| 374 | 374 | ); |
| 375 | 375 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 376 | 376 | } |
@@ -396,12 +396,12 @@ discard block |
||
| 396 | 396 | $exceptionMsg[] = LocalizationUtility::translate( |
| 397 | 397 | 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure', |
| 398 | 398 | 'dpf', |
| 399 | - array($updateDocument->getTitle()) |
|
| 399 | + array ($updateDocument->getTitle()) |
|
| 400 | 400 | ); |
| 401 | 401 | |
| 402 | 402 | $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf'); |
| 403 | 403 | |
| 404 | - $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,true); |
|
| 404 | + $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity, true); |
|
| 405 | 405 | $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]); |
| 406 | 406 | } |
| 407 | 407 | } |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | if ($redirectUri) { |
| 510 | 510 | $this->redirectToUri($redirectUri); |
| 511 | 511 | } else { |
| 512 | - $this->redirect($action, $controller, null, array('message' => $message));; |
|
| 512 | + $this->redirect($action, $controller, null, array ('message' => $message)); ; |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
@@ -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) { |
@@ -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,18 +165,18 @@ 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 | // +++delete+++ $workingCopy->setEditorUid(0); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (empty($workingCopy->getFileData())) { |
| 178 | 178 | // no files are linked to the document |
| 179 | - $hasFilesFlag = false; |
|
| 179 | + $hasFilesFlag = FALSE; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | $newDocument = $this->objectManager->get(Document::class); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $newDocument->setLinkedUid($document->getUid()); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $newDocument->setSuggestion(true); |
|
| 199 | + $newDocument->setSuggestion(TRUE); |
|
| 200 | 200 | $newDocument->setComment($document->getComment()); |
| 201 | 201 | |
| 202 | 202 | if ($restore) { |
@@ -224,10 +224,10 @@ discard block |
||
| 224 | 224 | $newDocument->setCreator($this->security->getUser()->getUid()); |
| 225 | 225 | $this->documentRepository->add($newDocument); |
| 226 | 226 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS; |
| 227 | - $this->addFlashMessage("Success", '', $severity,false); |
|
| 227 | + $this->addFlashMessage("Success", '', $severity,FALSE); |
|
| 228 | 228 | } catch (\Throwable $t) { |
| 229 | 229 | $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR; |
| 230 | - $this->addFlashMessage("Failed", '', $severity,false); |
|
| 230 | + $this->addFlashMessage("Failed", '', $severity,FALSE); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | $this->redirectToDocumentList(); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | { |
| 239 | 239 | if ($this->request->getArgument('documentData')['suggestMod']) { |
| 240 | 240 | $restore = $this->request->getArgument('documentData')['suggestRestore']; |
| 241 | - $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]); |
|
| 241 | + $this->forward('createSuggestionDocument', NULL, NULL, ['documentForm' => $documentForm, 'restore' => $restore]); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | if ($this->request->hasArgument('saveAndUpdate')) { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } elseif ($this->request->hasArgument('saveWorkingCopy')) { |
| 247 | 247 | $saveMode = 'saveWorkingCopy'; |
| 248 | 248 | } else { |
| 249 | - $saveMode = null; |
|
| 249 | + $saveMode = NULL; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | $this->forward( |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 269 | 269 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 270 | 270 | */ |
| 271 | - public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) |
|
| 271 | + public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = NULL) |
|
| 272 | 272 | { |
| 273 | 273 | try { |
| 274 | 274 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 287 | 287 | $this->redirect( |
| 288 | 288 | 'showDetails', 'Document', |
| 289 | - null, ['document' => $document] |
|
| 289 | + NULL, ['document' => $document] |
|
| 290 | 290 | ); |
| 291 | 291 | } |
| 292 | 292 | |
@@ -296,13 +296,13 @@ discard block |
||
| 296 | 296 | /** @var \EWW\Dpf\Domain\Model\Document $updateDocument */ |
| 297 | 297 | $updateDocument = $documentMapper->getDocument($documentForm); |
| 298 | 298 | |
| 299 | - $saveWorkingCopy = false; |
|
| 300 | - $workflowTransition = null; |
|
| 299 | + $saveWorkingCopy = FALSE; |
|
| 300 | + $workflowTransition = NULL; |
|
| 301 | 301 | |
| 302 | 302 | // Convert the temporary copy into a local working copy if needed. |
| 303 | 303 | if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') { |
| 304 | - $saveWorkingCopy = true; |
|
| 305 | - $updateDocument->setTemporary(false); |
|
| 304 | + $saveWorkingCopy = TRUE; |
|
| 305 | + $updateDocument->setTemporary(FALSE); |
|
| 306 | 306 | $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS; |
| 307 | 307 | } elseif ($updateDocument->isTemporaryCopy() && $saveMode == 'saveAndUpdate') { |
| 308 | 308 | $workflowTransition = DocumentWorkflow::TRANSITION_REMOTE_UPDATE; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | if ($workflowTransition && $workflowTransition === DocumentWorkflow::TRANSITION_REMOTE_UPDATE) { |
| 379 | 379 | $this->redirectToDocumentList(); |
| 380 | 380 | } else { |
| 381 | - $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]); |
|
| 381 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]); |
|
| 382 | 382 | } |
| 383 | 383 | } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) { |
| 384 | 384 | // A redirect always throws this exception, but in this case, however, |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf'); |
| 403 | 403 | |
| 404 | - $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,true); |
|
| 405 | - $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]); |
|
| 404 | + $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,TRUE); |
|
| 405 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]); |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $args[] = $document->getTitle(); |
| 420 | 420 | $message = LocalizationUtility::translate($key, 'dpf', $args); |
| 421 | 421 | $this->addFlashMessage($message, '', AbstractMessage::ERROR); |
| 422 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 422 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 423 | 423 | return FALSE; |
| 424 | 424 | } |
| 425 | 425 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $message, |
| 434 | 434 | '', |
| 435 | 435 | $severity, |
| 436 | - true |
|
| 436 | + TRUE |
|
| 437 | 437 | ); |
| 438 | 438 | |
| 439 | 439 | } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) { |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | implode(" ", $message), |
| 456 | 456 | '', |
| 457 | 457 | $severity, |
| 458 | - true |
|
| 458 | + TRUE |
|
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | 461 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | * |
| 474 | 474 | * @return void |
| 475 | 475 | */ |
| 476 | - public function cancelEditAction($documentUid = 0, $documentList = false) |
|
| 476 | + public function cancelEditAction($documentUid = 0, $documentList = FALSE) |
|
| 477 | 477 | { |
| 478 | 478 | if ($documentList) { |
| 479 | 479 | $this->redirectToDocumentList(); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | /** @var $document \EWW\Dpf\Domain\Model\Document */ |
| 484 | 484 | $document = $this->documentRepository->findByUid($documentUid); |
| 485 | 485 | |
| 486 | - $this->redirect('showDetails', 'Document', null, ['document' => $document]); |
|
| 486 | + $this->redirect('showDetails', 'Document', NULL, ['document' => $document]); |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -502,14 +502,14 @@ discard block |
||
| 502 | 502 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 503 | 503 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 504 | 504 | */ |
| 505 | - protected function redirectToDocumentList($message = null) |
|
| 505 | + protected function redirectToDocumentList($message = NULL) |
|
| 506 | 506 | { |
| 507 | 507 | list($action, $controller, $redirectUri) = $this->session->getListAction(); |
| 508 | 508 | |
| 509 | 509 | if ($redirectUri) { |
| 510 | 510 | $this->redirectToUri($redirectUri); |
| 511 | 511 | } else { |
| 512 | - $this->redirect($action, $controller, null, array('message' => $message));; |
|
| 512 | + $this->redirect($action, $controller, NULL, array('message' => $message));; |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
@@ -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 @@ discard block |
||
| 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 | /** |
| 28 | 28 | * frontendUserHelper |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @var \EWW\Dpf\Helper\FrontendUserHelper |
| 31 | 31 | * @inject |
| 32 | 32 | */ |
| 33 | - protected $frontendUserHelper = null; |
|
| 33 | + protected $frontendUserHelper = NULL; |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | const ROLE_ANONYMOUS = "ROLE_ANONYMOUS"; |