@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | $doc->setProcessNumber($processNumber); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if ($this->documentManager->update($doc, null,true)) { |
|
| 262 | - return '{"success": "Document '.$document.' added '.$id.'"}'; |
|
| 261 | + if ($this->documentManager->update($doc, null, true)) { |
|
| 262 | + return '{"success": "Document ' . $document . ' added ' . $id . '"}'; |
|
| 263 | 263 | } else { |
| 264 | 264 | return '{"failed": Could not update the Document"}'; |
| 265 | 265 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | return '{"error": "Invalid data in parameter json."}'; |
| 299 | 299 | } |
| 300 | 300 | } else { |
| 301 | - if (empty($json) || json_decode($json,true) === []) { |
|
| 301 | + if (empty($json) || json_decode($json, true) === []) { |
|
| 302 | 302 | return '{"error": "Parameter json can not be empty."}'; |
| 303 | 303 | } |
| 304 | 304 | if (is_null(json_decode($json))) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $doc = $this->documentManager->read($document); |
| 311 | 311 | |
| 312 | 312 | if (!$doc) { |
| 313 | - return '{"failed": "Document does not exist: '.$document.'"}'; |
|
| 313 | + return '{"failed": "Document does not exist: ' . $document . '"}'; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | if ($doc->getState() === DocumentWorkflow::STATE_NEW_NONE) { |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if ($linkedDocument) { |
| 326 | - return '{"failed": "There is already a suggestion for the document: '.$linkedDocument->getUid().'"}'; |
|
| 326 | + return '{"failed": "There is already a suggestion for the document: ' . $linkedDocument->getUid() . '"}'; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | $mapper = $this->objectManager->get(\EWW\Dpf\Services\Api\JsonToDocumentMapper::class); |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | $missingArguments = []; |
| 682 | 682 | foreach ($parameterNames as $parameterName) { |
| 683 | 683 | if (!$this->request->hasArgument($parameterName)) { |
| 684 | - $missingArguments[] = $parameterName; |
|
| 684 | + $missingArguments[] = $parameterName; |
|
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | $this->throwStatus( |
| 690 | 690 | 400, |
| 691 | 691 | null, |
| 692 | - '{"error": "Missing parameters: '.implode(", ", $missingArguments).'"}' |
|
| 692 | + '{"error": "Missing parameters: ' . implode(", ", $missingArguments) . '"}' |
|
| 693 | 693 | ); |
| 694 | 694 | } |
| 695 | 695 | |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $this->throwStatus( |
| 720 | 720 | 400, |
| 721 | 721 | null, |
| 722 | - '{"error": "An invalid action hes been called: '.$actionName.'"}' |
|
| 722 | + '{"error": "An invalid action hes been called: ' . $actionName . '"}' |
|
| 723 | 723 | ); |
| 724 | 724 | } |
| 725 | 725 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @var \EWW\Dpf\Security\Security |
| 52 | 52 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 53 | 53 | */ |
| 54 | - protected $security = null; |
|
| 54 | + protected $security = NULL; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * documentRepository |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 60 | 60 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 61 | 61 | */ |
| 62 | - protected $documentRepository = null; |
|
| 62 | + protected $documentRepository = NULL; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * frontendUserRepository |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
| 68 | 68 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 69 | 69 | */ |
| 70 | - protected $frontendUserRepository = null; |
|
| 70 | + protected $frontendUserRepository = NULL; |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * documentManager |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * @var \EWW\Dpf\Services\Document\DocumentManager |
| 76 | 76 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 77 | 77 | */ |
| 78 | - protected $documentManager = null; |
|
| 78 | + protected $documentManager = NULL; |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * clientRepository |
@@ -99,16 +99,16 @@ discard block |
||
| 99 | 99 | * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher |
| 100 | 100 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 101 | 101 | */ |
| 102 | - protected $signalSlotDispatcher = null; |
|
| 102 | + protected $signalSlotDispatcher = NULL; |
|
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * logger |
| 106 | 106 | * |
| 107 | 107 | * @var \TYPO3\CMS\Core\Log\Logger |
| 108 | 108 | */ |
| 109 | - protected $logger = null; |
|
| 109 | + protected $logger = NULL; |
|
| 110 | 110 | |
| 111 | - protected $frontendUser = null; |
|
| 111 | + protected $frontendUser = NULL; |
|
| 112 | 112 | |
| 113 | 113 | protected $validActions = [ |
| 114 | 114 | 'show', 'create', 'suggestion', 'importDoiWithoutSaving', |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | if ($frontendUser) { |
| 131 | 131 | $this->frontendUser = $frontendUser; |
| 132 | - return true; |
|
| 132 | + return TRUE; |
|
| 133 | 133 | } else { |
| 134 | - return false; |
|
| 134 | + return FALSE; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $doc->setProcessNumber($processNumber); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if ($this->documentManager->update($doc, null,true)) { |
|
| 261 | + if ($this->documentManager->update($doc, NULL,TRUE)) { |
|
| 262 | 262 | return '{"success": "Document '.$document.' added '.$id.'"}'; |
| 263 | 263 | } else { |
| 264 | 264 | return '{"failed": Could not update the Document"}'; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * @param bool $restore |
| 290 | 290 | * @return string |
| 291 | 291 | */ |
| 292 | - public function suggestionAction($document, $json, $comment, $token, $restore = false) { |
|
| 292 | + public function suggestionAction($document, $json, $comment, $token, $restore = FALSE) { |
|
| 293 | 293 | |
| 294 | 294 | if ($this->checkToken($token)) { |
| 295 | 295 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | return '{"error": "Invalid data in parameter json."}'; |
| 299 | 299 | } |
| 300 | 300 | } else { |
| 301 | - if (empty($json) || json_decode($json,true) === []) { |
|
| 301 | + if (empty($json) || json_decode($json,TRUE) === []) { |
|
| 302 | 302 | return '{"error": "Parameter json can not be empty."}'; |
| 303 | 303 | } |
| 304 | 304 | if (is_null(json_decode($json))) { |
@@ -525,14 +525,14 @@ discard block |
||
| 525 | 525 | * @param bool $force |
| 526 | 526 | * @return string |
| 527 | 527 | */ |
| 528 | - public function importBibtexWithoutSavingAction($bibtex, $token, $force = false) { |
|
| 528 | + public function importBibtexWithoutSavingAction($bibtex, $token, $force = FALSE) { |
|
| 529 | 529 | |
| 530 | 530 | if ($this->checkToken($token)) { |
| 531 | 531 | $importer = $this->objectManager->get(BibTexFileImporter::class); |
| 532 | 532 | $importer->deactivateProcessNumberGeneration(); |
| 533 | 533 | |
| 534 | 534 | try { |
| 535 | - $externalMetadata = $importer->loadFile($bibtex, $this->settings['bibTexMandatoryFields'], true); |
|
| 535 | + $externalMetadata = $importer->loadFile($bibtex, $this->settings['bibTexMandatoryFields'], TRUE); |
|
| 536 | 536 | $mandatoryErrors = $importer->getMandatoryErrors(); |
| 537 | 537 | } catch (\Throwable $throwable) { |
| 538 | 538 | return '{"failed": "' . $throwable->getMessage() . '"}'; |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | * @param bool $force |
| 606 | 606 | * @return string |
| 607 | 607 | */ |
| 608 | - public function importRisWithoutSavingAction($ris, $token, $force = false) { |
|
| 608 | + public function importRisWithoutSavingAction($ris, $token, $force = FALSE) { |
|
| 609 | 609 | |
| 610 | 610 | if ($this->checkToken($token)) { |
| 611 | 611 | /** @var FileImporter $fileImporter */ |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | $importer->deactivateProcessNumberGeneration(); |
| 614 | 614 | |
| 615 | 615 | try { |
| 616 | - $externalMetadata = $importer->loadFile($ris, $this->settings['riswosMandatoryFields'], true); |
|
| 616 | + $externalMetadata = $importer->loadFile($ris, $this->settings['riswosMandatoryFields'], TRUE); |
|
| 617 | 617 | $mandatoryErrors = $importer->getMandatoryErrors(); |
| 618 | 618 | } catch (\Throwable $throwable) { |
| 619 | 619 | return '{"failed": "' . $throwable->getMessage() . '"}'; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | if ($missingArguments) { |
| 689 | 689 | $this->throwStatus( |
| 690 | 690 | 400, |
| 691 | - null, |
|
| 691 | + NULL, |
|
| 692 | 692 | '{"error": "Missing parameters: '.implode(", ", $missingArguments).'"}' |
| 693 | 693 | ); |
| 694 | 694 | } |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | if (empty($actionName)) { |
| 710 | 710 | $this->throwStatus( |
| 711 | 711 | 400, |
| 712 | - null, |
|
| 712 | + NULL, |
|
| 713 | 713 | '{"error": "No action has been specified"}' |
| 714 | 714 | ); |
| 715 | 715 | |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | if (!in_array($actionName, $this->validActions)) { |
| 719 | 719 | $this->throwStatus( |
| 720 | 720 | 400, |
| 721 | - null, |
|
| 721 | + NULL, |
|
| 722 | 722 | '{"error": "An invalid action hes been called: '.$actionName.'"}' |
| 723 | 723 | ); |
| 724 | 724 | } |
@@ -18,11 +18,9 @@ discard block |
||
| 18 | 18 | use EWW\Dpf\Helper\DocumentMapper; |
| 19 | 19 | use EWW\Dpf\Services\Email\Notifier; |
| 20 | 20 | |
| 21 | -class DocumentFormController extends AbstractDocumentFormController |
|
| 22 | -{ |
|
| 21 | +class DocumentFormController extends AbstractDocumentFormController { |
|
| 23 | 22 | |
| 24 | - protected function redirectToList($message = null) |
|
| 25 | - { |
|
| 23 | + protected function redirectToList($message = null) { |
|
| 26 | 24 | $this->redirect('list', 'DocumentForm', null, array('message' => $message)); |
| 27 | 25 | } |
| 28 | 26 | |
@@ -34,8 +32,7 @@ discard block |
||
| 34 | 32 | * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("newDocumentForm") |
| 35 | 33 | * @return void |
| 36 | 34 | */ |
| 37 | - public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null, $returnDocumentId = 0) |
|
| 38 | - { |
|
| 35 | + public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null, $returnDocumentId = 0) { |
|
| 39 | 36 | $this->view->assign('documentForm', $newDocumentForm); |
| 40 | 37 | } |
| 41 | 38 | |
@@ -45,8 +42,7 @@ discard block |
||
| 45 | 42 | * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm |
| 46 | 43 | * @return void |
| 47 | 44 | */ |
| 48 | - public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) |
|
| 49 | - { |
|
| 45 | + public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) { |
|
| 50 | 46 | foreach ($newDocumentForm->getFiles() as $file) { |
| 51 | 47 | $uid = $file->getUID(); |
| 52 | 48 | if (empty($uid)) { |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | class DocumentFormController extends AbstractDocumentFormController |
| 22 | 22 | { |
| 23 | 23 | |
| 24 | - protected function redirectToList($message = null) |
|
| 24 | + protected function redirectToList($message = NULL) |
|
| 25 | 25 | { |
| 26 | - $this->redirect('list', 'DocumentForm', null, array('message' => $message)); |
|
| 26 | + $this->redirect('list', 'DocumentForm', NULL, array('message' => $message)); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("newDocumentForm") |
| 35 | 35 | * @return void |
| 36 | 36 | */ |
| 37 | - public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null, $returnDocumentId = 0) |
|
| 37 | + public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = NULL, $returnDocumentId = 0) |
|
| 38 | 38 | { |
| 39 | 39 | $this->view->assign('documentForm', $newDocumentForm); |
| 40 | 40 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | foreach ($newDocumentForm->getFiles() as $file) { |
| 51 | 51 | $uid = $file->getUID(); |
| 52 | 52 | if (empty($uid)) { |
| 53 | - $file->setDownload(true); |
|
| 53 | + $file->setDownload(TRUE); |
|
| 54 | 54 | } |
| 55 | 55 | $files[] = $file; |
| 56 | 56 | } |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $message[] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, 'dpf'); |
| 92 | 92 | |
| 93 | - $this->addFlashMessage(implode(" ", $message), '', $severity,true); |
|
| 94 | - $this->forward('new', 'DocumentForm', null, array('newDocumentForm' => $newDocumentForm)); |
|
| 93 | + $this->addFlashMessage(implode(" ", $message), '', $severity,TRUE); |
|
| 94 | + $this->forward('new', 'DocumentForm', NULL, array('newDocumentForm' => $newDocumentForm)); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $this->request->setArguments($requestArguments); |
| 193 | 193 | } else { |
| 194 | 194 | $t = $docForm->getFileNames(); |
| 195 | - $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 195 | + $this->redirect('list', 'DocumentForm', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 196 | 196 | } |
| 197 | 197 | } else { |
| 198 | 198 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $this->request->setArguments($requestArguments); |
| 356 | 356 | } else { |
| 357 | 357 | $t = $docForm->getFileNames(); |
| 358 | - $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 358 | + $this->redirect('list', 'Document', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 359 | 359 | } |
| 360 | 360 | } else { |
| 361 | 361 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 37 | 37 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 38 | 38 | */ |
| 39 | - protected $documentRepository = null; |
|
| 39 | + protected $documentRepository = NULL; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * fileRepository |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 45 | 45 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 46 | 46 | */ |
| 47 | - protected $fileRepository = null; |
|
| 47 | + protected $fileRepository = NULL; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * documentTypeRepository |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 53 | 53 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 54 | 54 | */ |
| 55 | - protected $documentTypeRepository = null; |
|
| 55 | + protected $documentTypeRepository = NULL; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * metadataGroupRepository |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository |
| 61 | 61 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 62 | 62 | */ |
| 63 | - protected $metadataGroupRepository = null; |
|
| 63 | + protected $metadataGroupRepository = NULL; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * metadataObjectRepository |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository |
| 69 | 69 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 70 | 70 | */ |
| 71 | - protected $metadataObjectRepository = null; |
|
| 71 | + protected $metadataObjectRepository = NULL; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * depositLicenseLogRepository |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @var \EWW\Dpf\Domain\Repository\DepositLicenseLogRepository |
| 77 | 77 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 78 | 78 | */ |
| 79 | - protected $depositLicenseLogRepository = null; |
|
| 79 | + protected $depositLicenseLogRepository = NULL; |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * persistence manager |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @var \EWW\Dpf\Services\FeUser\FisDataService |
| 93 | 93 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 94 | 94 | */ |
| 95 | - protected $fisDataService = null; |
|
| 95 | + protected $fisDataService = NULL; |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * action list |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("newDocumentForm") |
| 152 | 152 | * @return void |
| 153 | 153 | */ |
| 154 | - public function newAction(DocumentForm $newDocumentForm = null, $returnDocumentId = 0) |
|
| 154 | + public function newAction(DocumentForm $newDocumentForm = NULL, $returnDocumentId = 0) |
|
| 155 | 155 | { |
| 156 | 156 | $this->view->assign('returnDocumentId', $returnDocumentId); |
| 157 | 157 | $this->view->assign('documentForm', $newDocumentForm); |
@@ -188,11 +188,11 @@ discard block |
||
| 188 | 188 | $documentType = $this->documentTypeRepository->findByUid($docTypeUid); |
| 189 | 189 | $virtualType = $documentType->getVirtualType(); |
| 190 | 190 | |
| 191 | - if (!$formDataReader->uploadError() || $virtualType === true) { |
|
| 191 | + if (!$formDataReader->uploadError() || $virtualType === TRUE) { |
|
| 192 | 192 | $this->request->setArguments($requestArguments); |
| 193 | 193 | } else { |
| 194 | 194 | $t = $docForm->getFileNames(); |
| 195 | - $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 195 | + $this->redirect('list', 'DocumentForm', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 196 | 196 | } |
| 197 | 197 | } else { |
| 198 | 198 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -351,11 +351,11 @@ discard block |
||
| 351 | 351 | $virtualType = $documentType->getVirtualType(); |
| 352 | 352 | |
| 353 | 353 | |
| 354 | - if (!$formDataReader->uploadError() || $virtualType === true) { |
|
| 354 | + if (!$formDataReader->uploadError() || $virtualType === TRUE) { |
|
| 355 | 355 | $this->request->setArguments($requestArguments); |
| 356 | 356 | } else { |
| 357 | 357 | $t = $docForm->getFileNames(); |
| 358 | - $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 358 | + $this->redirect('list', 'Document', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 359 | 359 | } |
| 360 | 360 | } else { |
| 361 | 361 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | // send document to index |
| 389 | 389 | $elasticsearchRepository->add($updateDocument, $json); |
| 390 | 390 | |
| 391 | - $updateDocument->setChanged(true); |
|
| 391 | + $updateDocument->setChanged(TRUE); |
|
| 392 | 392 | $this->documentRepository->update($updateDocument); |
| 393 | 393 | |
| 394 | 394 | // index the document |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $this->redirect('list'); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - protected function redirectToList($message = null) |
|
| 413 | + protected function redirectToList($message = NULL) |
|
| 414 | 414 | { |
| 415 | 415 | $this->redirect('list'); |
| 416 | 416 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function __construct(ObjectStorage $documentFiles) |
| 29 | 29 | { |
| 30 | - $idList = array(); |
|
| 30 | + $idList = array (); |
|
| 31 | 31 | $this->id = 0; |
| 32 | 32 | |
| 33 | 33 | if (is_a($documentFiles, ObjectStorage::class)) { |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | use TYPO3\CMS\Extbase\Persistence\ObjectStorage; |
| 18 | 18 | |
| 19 | -class FileId |
|
| 20 | -{ |
|
| 19 | +class FileId { |
|
| 21 | 20 | |
| 22 | 21 | protected $id = 0; |
| 23 | 22 | |
@@ -25,8 +24,7 @@ discard block |
||
| 25 | 24 | * FileId constructor. |
| 26 | 25 | * @param ObjectStorage $documentFiles |
| 27 | 26 | */ |
| 28 | - public function __construct(ObjectStorage $documentFiles) |
|
| 29 | - { |
|
| 27 | + public function __construct(ObjectStorage $documentFiles) { |
|
| 30 | 28 | $idList = array(); |
| 31 | 29 | $this->id = 0; |
| 32 | 30 | |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | |
| 48 | 46 | } |
| 49 | 47 | |
| 50 | - public function getId($file) |
|
| 51 | - { |
|
| 48 | + public function getId($file) { |
|
| 52 | 49 | |
| 53 | 50 | $fileId = $file->getDatastreamIdentifier(); |
| 54 | 51 | if (empty($fileId)) { |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $formData = array(); |
|
| 48 | + protected $formData = array (); |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * files from form |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $files = array(); |
|
| 54 | + protected $files = array (); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * metsData |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $this->xmlHeader = '<data' . $this->namespaceString . '></data>'; |
| 113 | 113 | |
| 114 | - $this->xmlData = new \DOMDocument(); |
|
| 114 | + $this->xmlData = new \DOMDocument(); |
|
| 115 | 115 | $this->xmlData->loadXML($this->xmlHeader); |
| 116 | 116 | |
| 117 | 117 | // Parser |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | // mods extension |
| 165 | 165 | if ($group['modsExtensionMapping']) { |
| 166 | 166 | $counter = sprintf("%'03d", $this->counter); |
| 167 | - $attributeXPath .= '[@ID="'.$fedoraNamespace.'_' . $counter . '"]'; |
|
| 167 | + $attributeXPath .= '[@ID="' . $fedoraNamespace . '_' . $counter . '"]'; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $existsExtensionFlag = false; |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | if (!$existsExtensionFlag && $group['modsExtensionMapping']) { |
| 208 | - $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="'.$fedoraNamespace.'_' . $counter . '"]'; |
|
| 208 | + $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="' . $fedoraNamespace . '_' . $counter . '"]'; |
|
| 209 | 209 | $xml = $this->customXPath($xPath, true, '', true); |
| 210 | 210 | } |
| 211 | 211 | if ($group['modsExtensionMapping']) { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $nestedXml = $this->parseXPath($nested); |
| 291 | 291 | |
| 292 | 292 | // object xpath without nested element [] |
| 293 | - $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]); |
|
| 293 | + $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]); |
|
| 294 | 294 | |
| 295 | 295 | $xml = $this->parseXPath($newPath[1]); |
| 296 | 296 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $nestedXml = $this->parseXPathWrapped($nested); |
| 361 | 361 | |
| 362 | 362 | // object xpath without nested element [] |
| 363 | - $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]); |
|
| 363 | + $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]); |
|
| 364 | 364 | |
| 365 | 365 | $xml2 = $this->parseXPathWrapped($path . $newPath[1]); |
| 366 | 366 | } |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * ParserGenerator |
| 25 | 25 | */ |
| 26 | -class ParserGenerator |
|
| 27 | -{ |
|
| 26 | +class ParserGenerator { |
|
| 28 | 27 | /** |
| 29 | 28 | * clientConfigurationManager |
| 30 | 29 | * |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * ParserGenerator constructor. |
| 94 | 93 | * @param int $clientPid |
| 95 | 94 | */ |
| 96 | - public function __construct($clientPid = 0) |
|
| 97 | - { |
|
| 95 | + public function __construct($clientPid = 0) { |
|
| 98 | 96 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
| 99 | 97 | $this->clientConfigurationManager = $objectManager->get(ClientConfigurationManager::class); |
| 100 | 98 | |
@@ -128,8 +126,7 @@ discard block |
||
| 128 | 126 | * returns the mods xml string |
| 129 | 127 | * @return string mods xml |
| 130 | 128 | */ |
| 131 | - public function getXMLData() |
|
| 132 | - { |
|
| 129 | + public function getXMLData() { |
|
| 133 | 130 | $xml = $this->xmlData->saveXML(); |
| 134 | 131 | $xml = preg_replace("/eww=\"\d-\d-\d\"/", '${1}${2}${3}', $xml); |
| 135 | 132 | |
@@ -140,8 +137,7 @@ discard block |
||
| 140 | 137 | * build mods from form array |
| 141 | 138 | * @param array $array structured form data array |
| 142 | 139 | */ |
| 143 | - public function buildXmlFromForm($array) |
|
| 144 | - { |
|
| 140 | + public function buildXmlFromForm($array) { |
|
| 145 | 141 | $fedoraNamespace = $this->clientConfigurationManager->getFedoraNamespace(); |
| 146 | 142 | |
| 147 | 143 | $this->xmlData = $this->xmlData; |
@@ -223,8 +219,7 @@ discard block |
||
| 223 | 219 | * @param xpath $xPath xPath expression |
| 224 | 220 | * @return xml |
| 225 | 221 | */ |
| 226 | - public function parseXPath($xPath) |
|
| 227 | - { |
|
| 222 | + public function parseXPath($xPath) { |
|
| 228 | 223 | |
| 229 | 224 | $this->parser->generateXmlFromXPath($xPath); |
| 230 | 225 | $xml = $this->parser->getXML(); |
@@ -232,8 +227,7 @@ discard block |
||
| 232 | 227 | return $xml; |
| 233 | 228 | } |
| 234 | 229 | |
| 235 | - public function parseXPathWrapped($xPath) |
|
| 236 | - { |
|
| 230 | + public function parseXPathWrapped($xPath) { |
|
| 237 | 231 | $this->parser->generateXmlFromXPath($xPath); |
| 238 | 232 | $xml = $this->parser->getXML(); |
| 239 | 233 | |
@@ -248,8 +242,7 @@ discard block |
||
| 248 | 242 | * @param string $value form value |
| 249 | 243 | * @return xml created xml |
| 250 | 244 | */ |
| 251 | - public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) |
|
| 252 | - { |
|
| 245 | + public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) { |
|
| 253 | 246 | if (!$attributeOnly) { |
| 254 | 247 | // Explode xPath |
| 255 | 248 | $newPath = explode('%', $xPath); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 40 | 40 | */ |
| 41 | - protected $documentTypeRepository = null; |
|
| 41 | + protected $documentTypeRepository = NULL; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * formData |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * xPathXMLGenerator |
| 77 | 77 | * @var object |
| 78 | 78 | */ |
| 79 | - protected $parser = null; |
|
| 79 | + protected $parser = NULL; |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * ref id counter |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $attributeXPath .= '[@ID="'.$fedoraNamespace.'_' . $counter . '"]'; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - $existsExtensionFlag = false; |
|
| 174 | + $existsExtensionFlag = FALSE; |
|
| 175 | 175 | $i = 0; |
| 176 | 176 | // loop each object |
| 177 | 177 | if (!empty($values)) { |
@@ -179,21 +179,21 @@ discard block |
||
| 179 | 179 | foreach ($values as $value) { |
| 180 | 180 | |
| 181 | 181 | if ($value['modsExtension']) { |
| 182 | - $existsExtensionFlag = true; |
|
| 182 | + $existsExtensionFlag = TRUE; |
|
| 183 | 183 | // mods extension |
| 184 | 184 | $counter = sprintf("%'03d", $this->counter); |
| 185 | 185 | $referenceAttribute = $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="' . $fedoraNamespace . '_' . $counter . '"]'; |
| 186 | 186 | |
| 187 | 187 | $path = $group['modsExtensionMapping'] . $referenceAttribute . '%/' . $value['mapping']; |
| 188 | 188 | |
| 189 | - $xml = $this->customXPath($path, false, $value['value']); |
|
| 189 | + $xml = $this->customXPath($path, FALSE, $value['value']); |
|
| 190 | 190 | } else { |
| 191 | 191 | $path = $mapping . $attributeXPath . '%/' . $value['mapping']; |
| 192 | 192 | |
| 193 | 193 | if ($i == 0) { |
| 194 | - $newGroupFlag = true; |
|
| 194 | + $newGroupFlag = TRUE; |
|
| 195 | 195 | } else { |
| 196 | - $newGroupFlag = false; |
|
| 196 | + $newGroupFlag = FALSE; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | $this->customXPath($path, $newGroupFlag, $value['value']); |
@@ -205,12 +205,12 @@ discard block |
||
| 205 | 205 | } else { |
| 206 | 206 | if (!empty($attributeXPath)) { |
| 207 | 207 | $path = $mapping . $attributeXPath; |
| 208 | - $this->customXPath($path, true, '', true); |
|
| 208 | + $this->customXPath($path, TRUE, '', TRUE); |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | if (!$existsExtensionFlag && $group['modsExtensionMapping']) { |
| 212 | 212 | $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="'.$fedoraNamespace.'_' . $counter . '"]'; |
| 213 | - $xml = $this->customXPath($xPath, true, '', true); |
|
| 213 | + $xml = $this->customXPath($xPath, TRUE, '', TRUE); |
|
| 214 | 214 | } |
| 215 | 215 | if ($group['modsExtensionMapping']) { |
| 216 | 216 | $this->counter++; |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | * @param string $value form value |
| 249 | 249 | * @return xml created xml |
| 250 | 250 | */ |
| 251 | - public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) |
|
| 251 | + public function customXPath($xPath, $newGroupFlag = FALSE, $value = '', $attributeOnly = FALSE) |
|
| 252 | 252 | { |
| 253 | 253 | if (!$attributeOnly) { |
| 254 | 254 | // Explode xPath |
| 255 | 255 | $newPath = explode('%', $xPath); |
| 256 | 256 | |
| 257 | - $praedicateFlag = false; |
|
| 257 | + $praedicateFlag = FALSE; |
|
| 258 | 258 | $explodedXPath = explode('[', $newPath[0]); |
| 259 | 259 | if (count($explodedXPath) > 1) { |
| 260 | 260 | // praedicate is given |
@@ -266,12 +266,12 @@ discard block |
||
| 266 | 266 | $path = $explodedXPath[0]; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - $praedicateFlag = true; |
|
| 269 | + $praedicateFlag = TRUE; |
|
| 270 | 270 | } else { |
| 271 | 271 | $path = $newPath[0]; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - if (isset($value) === true && $value !== '') { |
|
| 274 | + if (isset($value) === TRUE && $value !== '') { |
|
| 275 | 275 | $newPath[1] = $newPath[1] . '="' . $value . '"'; |
| 276 | 276 | } |
| 277 | 277 | |
@@ -303,10 +303,10 @@ discard block |
||
| 303 | 303 | // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces, |
| 304 | 304 | // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here, |
| 305 | 305 | // since it is about child elements that are then added to the overall XML. |
| 306 | - libxml_use_internal_errors(true); |
|
| 306 | + libxml_use_internal_errors(TRUE); |
|
| 307 | 307 | $docXML = new \DOMDocument(); |
| 308 | 308 | $docXML->loadXML($xml); |
| 309 | - libxml_use_internal_errors(false); |
|
| 309 | + libxml_use_internal_errors(FALSE); |
|
| 310 | 310 | |
| 311 | 311 | $domXPath = \EWW\Dpf\Helper\XPath::create($this->xmlData); |
| 312 | 312 | |
@@ -317,17 +317,17 @@ discard block |
||
| 317 | 317 | // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces, |
| 318 | 318 | // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here, |
| 319 | 319 | // since it is about child elements that are then added to the overall XML. |
| 320 | - libxml_use_internal_errors(true); |
|
| 320 | + libxml_use_internal_errors(TRUE); |
|
| 321 | 321 | $docXMLNested = new \DOMDocument(); |
| 322 | 322 | $docXMLNested->loadXML($nestedXml); |
| 323 | - libxml_use_internal_errors(false); |
|
| 323 | + libxml_use_internal_errors(FALSE); |
|
| 324 | 324 | |
| 325 | 325 | $xPath = \EWW\Dpf\Helper\XPath::create($docXML); |
| 326 | 326 | |
| 327 | 327 | $nodeList = $xPath->query($match[1]); |
| 328 | 328 | $node = $nodeList->item(0); |
| 329 | 329 | |
| 330 | - $importNode = $docXML->importNode($docXMLNested->getElementsByTagName("mods")->item(0)->firstChild, true); |
|
| 330 | + $importNode = $docXML->importNode($docXMLNested->getElementsByTagName("mods")->item(0)->firstChild, TRUE); |
|
| 331 | 331 | |
| 332 | 332 | $node->appendChild($importNode); |
| 333 | 333 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $domNode = $domXPath->query('/data/' . $path); |
| 336 | 336 | $node = $docXML->documentElement; |
| 337 | 337 | |
| 338 | - $nodeAppendModsData = $this->xmlData->importNode($node, true); |
|
| 338 | + $nodeAppendModsData = $this->xmlData->importNode($node, TRUE); |
|
| 339 | 339 | $domNode->item($domNode->length - 1)->appendChild($nodeAppendModsData); |
| 340 | 340 | } else { |
| 341 | 341 | // first xpath doesn't exist |
@@ -384,14 +384,14 @@ discard block |
||
| 384 | 384 | $nodeList = $xPath->query('//' . $path . $match[1]); |
| 385 | 385 | $node = $nodeList->item(0); |
| 386 | 386 | |
| 387 | - $importNode = $doc2->importNode($docXMLNested->documentElement, true); |
|
| 387 | + $importNode = $doc2->importNode($docXMLNested->documentElement, TRUE); |
|
| 388 | 388 | |
| 389 | 389 | $node->appendChild($importNode); |
| 390 | 390 | } |
| 391 | 391 | $domNode2 = $domXPath2->query('//' . $path)->item(0)->childNodes->item(0); |
| 392 | 392 | |
| 393 | 393 | // merge xml nodes |
| 394 | - $nodeToBeAppended = $doc1->importNode($domNode2, true); |
|
| 394 | + $nodeToBeAppended = $doc1->importNode($domNode2, TRUE); |
|
| 395 | 395 | $domNode->item(0)->appendChild($nodeToBeAppended); |
| 396 | 396 | |
| 397 | 397 | // add to modsData (merge not required) |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | //$firstChild = $this->xmlData->childNodes->item(0); |
| 407 | 407 | $firstItem = $doc1->documentElement->firstChild; |
| 408 | - $nodeAppendModsData = $this->xmlData->importNode($firstItem, true); |
|
| 408 | + $nodeAppendModsData = $this->xmlData->importNode($firstItem, TRUE); |
|
| 409 | 409 | $firstChild->appendChild($nodeAppendModsData); |
| 410 | 410 | |
| 411 | 411 | return $doc1->saveXML(); |
@@ -417,17 +417,17 @@ discard block |
||
| 417 | 417 | // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces, |
| 418 | 418 | // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here, |
| 419 | 419 | // since it is about child elements that are then added to the overall XML. |
| 420 | - libxml_use_internal_errors(true); |
|
| 420 | + libxml_use_internal_errors(TRUE); |
|
| 421 | 421 | $docXML = new \DOMDocument(); |
| 422 | 422 | $docXML->loadXML($xml); |
| 423 | - libxml_use_internal_errors(false); |
|
| 423 | + libxml_use_internal_errors(FALSE); |
|
| 424 | 424 | |
| 425 | 425 | $domXPath = \EWW\Dpf\Helper\XPath::create($this->xmlData); |
| 426 | 426 | $domNode = $domXPath->query('/data'); |
| 427 | 427 | |
| 428 | 428 | $node = $docXML->documentElement; |
| 429 | 429 | |
| 430 | - $nodeAppendModsData = $this->xmlData->importNode($node, true); |
|
| 430 | + $nodeAppendModsData = $this->xmlData->importNode($node, TRUE); |
|
| 431 | 431 | $domNode->item($domNode->length - 1)->appendChild($nodeAppendModsData); |
| 432 | 432 | |
| 433 | 433 | return $docXML->saveXML(); |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | use Symfony\Component\Workflow\Workflow; |
| 16 | 16 | use Httpful\Request; |
| 17 | 17 | |
| 18 | -class DocumentManager |
|
| 19 | -{ |
|
| 18 | +class DocumentManager { |
|
| 20 | 19 | /** |
| 21 | 20 | * objectManager |
| 22 | 21 | * |
@@ -155,8 +154,7 @@ discard block |
||
| 155 | 154 | * @param string $identifier |
| 156 | 155 | * @return Document|null |
| 157 | 156 | */ |
| 158 | - public function read($identifier) |
|
| 159 | - { |
|
| 157 | + public function read($identifier) { |
|
| 160 | 158 | if (!$identifier) { |
| 161 | 159 | return null; |
| 162 | 160 | } |
@@ -199,8 +197,7 @@ discard block |
||
| 199 | 197 | */ |
| 200 | 198 | public function update( |
| 201 | 199 | Document $document, $workflowTransition = null, $addedFisIdOnly = false |
| 202 | - ) |
|
| 203 | - { |
|
| 200 | + ) { |
|
| 204 | 201 | // xml data fields are limited to 64 KB |
| 205 | 202 | // FIXME: Code duplication should be removed and it should be encapsulated or made configurable. |
| 206 | 203 | if (strlen($document->getXmlData()) >= Document::XML_DATA_SIZE_LIMIT) { |
@@ -261,7 +258,7 @@ discard block |
||
| 261 | 258 | } |
| 262 | 259 | |
| 263 | 260 | // check embargo |
| 264 | - if(!$this->hasActiveEmbargo($document)){ |
|
| 261 | + if(!$this->hasActiveEmbargo($document)) { |
|
| 265 | 262 | $this->removeDocument($document); |
| 266 | 263 | } else { |
| 267 | 264 | $document->setState(DocumentWorkflow::constructState(DocumentWorkflow::LOCAL_STATE_IN_PROGRESS, $document->getRemoteState())); |
@@ -307,8 +304,7 @@ discard block |
||
| 307 | 304 | /** |
| 308 | 305 | * @return DocumentTransferManager |
| 309 | 306 | */ |
| 310 | - protected function getDocumentTransferManager() |
|
| 311 | - { |
|
| 307 | + protected function getDocumentTransferManager() { |
|
| 312 | 308 | /** @var DocumentTransferManager $documentTransferManager */ |
| 313 | 309 | $documentTransferManager = $this->objectManager->get(DocumentTransferManager::class); |
| 314 | 310 | |
@@ -326,8 +322,7 @@ discard block |
||
| 326 | 322 | * @param $document |
| 327 | 323 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 328 | 324 | */ |
| 329 | - protected function removeDocument($document) |
|
| 330 | - { |
|
| 325 | + protected function removeDocument($document) { |
|
| 331 | 326 | $files = $this->fileRepository->findByDocument($document->getUid()); |
| 332 | 327 | foreach ($files as $file) { |
| 333 | 328 | $this->fileRepository->remove($file); |
@@ -342,8 +337,7 @@ discard block |
||
| 342 | 337 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 343 | 338 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 344 | 339 | */ |
| 345 | - protected function updateRemotely($document, $workflowTransition = null) |
|
| 346 | - { |
|
| 340 | + protected function updateRemotely($document, $workflowTransition = null) { |
|
| 347 | 341 | $lastModDate = $this->getDocumentTransferManager()->getLastModDate($document->getObjectIdentifier()); |
| 348 | 342 | $docLastModDate = $document->getRemoteLastModDate(); |
| 349 | 343 | if ($lastModDate !== $docLastModDate && !empty($docLastModDate)) { |
@@ -379,7 +373,7 @@ discard block |
||
| 379 | 373 | |
| 380 | 374 | if ($this->getDocumentTransferManager()->update($document)) { |
| 381 | 375 | |
| 382 | - if(!$this->hasActiveEmbargo($document)){ |
|
| 376 | + if(!$this->hasActiveEmbargo($document)) { |
|
| 383 | 377 | $this->removeDocument($document); |
| 384 | 378 | } else { |
| 385 | 379 | $document->setState(DocumentWorkflow::LOCAL_STATE_IN_PROGRESS . ':' . $document->getRemoteState()); |
@@ -435,10 +429,9 @@ discard block |
||
| 435 | 429 | * @return bool (true: if no embargo is set or embargo is expired, false: embargo is active) |
| 436 | 430 | * @throws \Exception |
| 437 | 431 | */ |
| 438 | - protected function hasActiveEmbargo($document) |
|
| 439 | - { |
|
| 432 | + protected function hasActiveEmbargo($document) { |
|
| 440 | 433 | $currentDate = new \DateTime('now'); |
| 441 | - if($currentDate > $document->getEmbargoDate()){ |
|
| 434 | + if($currentDate > $document->getEmbargoDate()) { |
|
| 442 | 435 | // embargo is expired |
| 443 | 436 | return false; |
| 444 | 437 | } else { |
@@ -460,8 +453,7 @@ discard block |
||
| 460 | 453 | * @param Document $document |
| 461 | 454 | * @return array |
| 462 | 455 | */ |
| 463 | - public function getAssignedUsers(Document $document) |
|
| 464 | - { |
|
| 456 | + public function getAssignedUsers(Document $document) { |
|
| 465 | 457 | $assignedUsers = []; |
| 466 | 458 | |
| 467 | 459 | foreach ($document->getAssignedFobIdentifiers() as $fobId) { |
@@ -479,8 +471,7 @@ discard block |
||
| 479 | 471 | * @param Document $document |
| 480 | 472 | * @return array |
| 481 | 473 | */ |
| 482 | - public function getNewlyAssignedUsers(Document $document) |
|
| 483 | - { |
|
| 474 | + public function getNewlyAssignedUsers(Document $document) { |
|
| 484 | 475 | $assignedUsers = []; |
| 485 | 476 | |
| 486 | 477 | foreach ($document->getNewlyAssignedFobIdentifiers() as $fobId) { |
@@ -515,8 +506,7 @@ discard block |
||
| 515 | 506 | * @param Document $document |
| 516 | 507 | * @return array |
| 517 | 508 | */ |
| 518 | - public function getUpdateNotificationRecipients(Document $document) |
|
| 519 | - { |
|
| 509 | + public function getUpdateNotificationRecipients(Document $document) { |
|
| 520 | 510 | $users = []; |
| 521 | 511 | |
| 522 | 512 | if ($document->getCreator()) { |
@@ -621,8 +611,7 @@ discard block |
||
| 621 | 611 | * @param Document $document |
| 622 | 612 | * @return array |
| 623 | 613 | */ |
| 624 | - public function getNewPublicationNotificationRecipients(Document $document) |
|
| 625 | - { |
|
| 614 | + public function getNewPublicationNotificationRecipients(Document $document) { |
|
| 626 | 615 | $users = []; |
| 627 | 616 | |
| 628 | 617 | /** @var FrontendUser $user */ |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @var \TYPO3\CMS\Extbase\Object\ObjectManager |
| 24 | 24 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 25 | 25 | */ |
| 26 | - protected $objectManager = null; |
|
| 26 | + protected $objectManager = NULL; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * documentRepository |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 32 | 32 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 33 | 33 | */ |
| 34 | - protected $documentRepository = null; |
|
| 34 | + protected $documentRepository = NULL; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * fileRepository |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 40 | 40 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 41 | 41 | */ |
| 42 | - protected $fileRepository = null; |
|
| 42 | + protected $fileRepository = NULL; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * bookmarkRepository |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @var \EWW\Dpf\Domain\Repository\BookmarkRepository |
| 48 | 48 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 49 | 49 | */ |
| 50 | - protected $bookmarkRepository = null; |
|
| 50 | + protected $bookmarkRepository = NULL; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * persistence manager |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher |
| 64 | 64 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 65 | 65 | */ |
| 66 | - protected $signalSlotDispatcher = null; |
|
| 66 | + protected $signalSlotDispatcher = NULL; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * notifier |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @var \EWW\Dpf\Services\Email\Notifier |
| 72 | 72 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 73 | 73 | */ |
| 74 | - protected $notifier = null; |
|
| 74 | + protected $notifier = NULL; |
|
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * security |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @var \EWW\Dpf\Security\Security |
| 80 | 80 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 81 | 81 | */ |
| 82 | - protected $security = null; |
|
| 82 | + protected $security = NULL; |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * frontendUserRepository |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
| 88 | 88 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 89 | 89 | */ |
| 90 | - protected $frontendUserRepository = null; |
|
| 90 | + protected $frontendUserRepository = NULL; |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * elasticSearch |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @var \EWW\Dpf\Services\ElasticSearch\ElasticSearch |
| 96 | 96 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 97 | 97 | */ |
| 98 | - protected $elasticSearch = null; |
|
| 98 | + protected $elasticSearch = NULL; |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * queryBuilder |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @var \EWW\Dpf\Services\ElasticSearch\QueryBuilder |
| 104 | 104 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 105 | 105 | */ |
| 106 | - protected $queryBuilder = null; |
|
| 106 | + protected $queryBuilder = NULL; |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Returns the localized document identifiers (uid/objectIdentifier). |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | $query = $this->queryBuilder->buildQuery( |
| 132 | 132 | 1, [], 0, |
| 133 | - [], [], [], null, null, |
|
| 133 | + [], [], [], NULL, NULL, |
|
| 134 | 134 | 'identifier:"'.$identifier.'"' |
| 135 | 135 | ); |
| 136 | 136 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function read($identifier) |
| 159 | 159 | { |
| 160 | 160 | if (!$identifier) { |
| 161 | - return null; |
|
| 161 | + return NULL; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $localizedIdentifiers = $this->resolveIdentifier($identifier); |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | return $document; |
| 181 | 181 | } catch (\Exception $exception) { |
| 182 | - return null; |
|
| 182 | + return NULL; |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - return null; |
|
| 186 | + return NULL; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 199 | 199 | */ |
| 200 | 200 | public function update( |
| 201 | - Document $document, $workflowTransition = null, $addedFisIdOnly = false |
|
| 201 | + Document $document, $workflowTransition = NULL, $addedFisIdOnly = FALSE |
|
| 202 | 202 | ) |
| 203 | 203 | { |
| 204 | 204 | // xml data fields are limited to 64 KB |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | if ($workflowTransition) { |
| 214 | 214 | if (!$workflow->can($document, $workflowTransition)) { |
| 215 | - return false; |
|
| 215 | + return FALSE; |
|
| 216 | 216 | } |
| 217 | 217 | $workflow->apply($document, $workflowTransition); |
| 218 | 218 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if ($document->isSuggestion()) { |
| 221 | 221 | |
| 222 | 222 | // if local suggestion copy |
| 223 | - $updateResult = false; |
|
| 223 | + $updateResult = FALSE; |
|
| 224 | 224 | |
| 225 | 225 | } elseif ($document->isTemporaryCopy()) { |
| 226 | 226 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | $updateResult = $document->getDocumentIdentifier(); |
| 270 | 270 | } else { |
| 271 | - $updateResult = false; |
|
| 271 | + $updateResult = FALSE; |
|
| 272 | 272 | } |
| 273 | 273 | } else { |
| 274 | 274 | $this->documentRepository->update($document); |
@@ -342,13 +342,13 @@ discard block |
||
| 342 | 342 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 343 | 343 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 344 | 344 | */ |
| 345 | - protected function updateRemotely($document, $workflowTransition = null) |
|
| 345 | + protected function updateRemotely($document, $workflowTransition = NULL) |
|
| 346 | 346 | { |
| 347 | 347 | $lastModDate = $this->getDocumentTransferManager()->getLastModDate($document->getObjectIdentifier()); |
| 348 | 348 | $docLastModDate = $document->getRemoteLastModDate(); |
| 349 | 349 | if ($lastModDate !== $docLastModDate && !empty($docLastModDate)) { |
| 350 | 350 | // There is a newer version in the fedora repository. |
| 351 | - return false; |
|
| 351 | + return FALSE; |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | $this->documentRepository->update($document); |
@@ -367,13 +367,13 @@ discard block |
||
| 367 | 367 | break; |
| 368 | 368 | |
| 369 | 369 | default: |
| 370 | - $transferState = null; |
|
| 370 | + $transferState = NULL; |
|
| 371 | 371 | break; |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | if ($transferState) { |
| 375 | 375 | if (!$this->getDocumentTransferManager()->delete($document, $transferState)) { |
| 376 | - return false; |
|
| 376 | + return FALSE; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
@@ -387,10 +387,10 @@ discard block |
||
| 387 | 387 | return $document->getDocumentIdentifier(); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - return false; |
|
| 390 | + return FALSE; |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - public function addSuggestion($editDocument, $restore = false, $comment = '') { |
|
| 393 | + public function addSuggestion($editDocument, $restore = FALSE, $comment = '') { |
|
| 394 | 394 | // add new document |
| 395 | 395 | /** @var Document $suggestionDocument */ |
| 396 | 396 | $suggestionDocument = $this->objectManager->get(Document::class); |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | $suggestionDocument->setCreator($editDocument->getCreator()); |
| 403 | 403 | |
| 404 | 404 | if ($suggestionDocument->isTemporary()) { |
| 405 | - $suggestionDocument->setTemporary(false); |
|
| 405 | + $suggestionDocument->setTemporary(FALSE); |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | if ($editDocument->getObjectIdentifier()) { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $suggestionDocument->setLinkedUid($editDocument->getUid()); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - $suggestionDocument->setSuggestion(true); |
|
| 414 | + $suggestionDocument->setSuggestion(TRUE); |
|
| 415 | 415 | if ($comment) { |
| 416 | 416 | $suggestionDocument->setComment($comment); |
| 417 | 417 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | try { |
| 424 | 424 | $this->documentRepository->add($suggestionDocument); |
| 425 | 425 | } catch (\Throwable $t) { |
| 426 | - return null; |
|
| 426 | + return NULL; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | return $suggestionDocument; |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | $currentDate = new \DateTime('now'); |
| 441 | 441 | if($currentDate > $document->getEmbargoDate()){ |
| 442 | 442 | // embargo is expired |
| 443 | - return false; |
|
| 443 | + return FALSE; |
|
| 444 | 444 | } else { |
| 445 | - return true; |
|
| 445 | + return TRUE; |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | } |
@@ -586,13 +586,13 @@ discard block |
||
| 586 | 586 | $embargoDate = $document->getEmbargoDate(); |
| 587 | 587 | $currentDate = new \DateTime('now'); |
| 588 | 588 | |
| 589 | - $fulltextPublished = false; |
|
| 589 | + $fulltextPublished = FALSE; |
|
| 590 | 590 | foreach ($document->getFile() as $file) { |
| 591 | 591 | if ($file->getStatus() != 'added') { |
| 592 | - $fulltextPublished = false; |
|
| 592 | + $fulltextPublished = FALSE; |
|
| 593 | 593 | break; |
| 594 | 594 | } else { |
| 595 | - $fulltextPublished = true; |
|
| 595 | + $fulltextPublished = TRUE; |
|
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $logger->log( |
| 89 | 89 | LogLevel::WARNING, |
| 90 | 90 | "Input XML: No transformation file is present. The given xml data was taken over as it is", |
| 91 | - array( |
|
| 91 | + array ( |
|
| 92 | 92 | 'documentTypeName' => $documentTypeName |
| 93 | 93 | ) |
| 94 | 94 | ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $filePath = $transformationFile->getFile()->getOriginalResource()->getIdentifier(); |
| 120 | 120 | $documentTransformer = new DocumentTransformer(); |
| 121 | 121 | |
| 122 | - if ( !$document->getRemoteState() || $document->getRemoteState() == 'NONE' ) { |
|
| 122 | + if (!$document->getRemoteState() || $document->getRemoteState() == 'NONE') { |
|
| 123 | 123 | $remoteState = 'ACTIVE'; |
| 124 | 124 | } else { |
| 125 | 125 | $remoteState = $document->getRemoteState(); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ); |
| 139 | 139 | } else { |
| 140 | 140 | $transformedXml = $documentTransformer->transform( |
| 141 | - Environment::getPublicPath(). '/fileadmin' . $filePath, $document->publicXml(), $transformParams |
|
| 141 | + Environment::getPublicPath() . '/fileadmin' . $filePath, $document->publicXml(), $transformParams |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $logger->log( |
| 155 | 155 | LogLevel::WARNING, |
| 156 | 156 | "Output XML: No transformation file is present. The generated xml data was taken over as it is", |
| 157 | - array( |
|
| 157 | + array ( |
|
| 158 | 158 | 'documentTypeName' => $documentTypeName |
| 159 | 159 | ) |
| 160 | 160 | ); |
@@ -25,8 +25,7 @@ |
||
| 25 | 25 | use \TYPO3\CMS\Core\Log\LogLevel; |
| 26 | 26 | use \TYPO3\CMS\Core\Log\LogManager; |
| 27 | 27 | |
| 28 | -class XSLTransformator |
|
| 29 | -{ |
|
| 28 | +class XSLTransformator { |
|
| 30 | 29 | |
| 31 | 30 | /** |
| 32 | 31 | * clientConfigurationManager |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | * @param string $xmlData |
| 103 | 103 | * @return string The transformed xml |
| 104 | 104 | */ |
| 105 | - public function getTransformedOutputXML(Document $document, $xmlData = null): string |
|
| 105 | + public function getTransformedOutputXML(Document $document, $xmlData = NULL): string |
|
| 106 | 106 | { |
| 107 | 107 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
| 108 | 108 | $this->clientConfigurationManager = $objectManager->get(ClientConfigurationManager::class); |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | use EWW\Dpf\Domain\Workflow\DocumentWorkflow; |
| 23 | 23 | use EWW\Dpf\Services\ProcessNumber\ProcessNumberGenerator; |
| 24 | 24 | |
| 25 | -class DocumentMapper |
|
| 26 | -{ |
|
| 25 | +class DocumentMapper { |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * objectManager |
@@ -101,8 +100,7 @@ discard block |
||
| 101 | 100 | * |
| 102 | 101 | * @return mixed |
| 103 | 102 | */ |
| 104 | - public function getSettings() |
|
| 105 | - { |
|
| 103 | + public function getSettings() { |
|
| 106 | 104 | $frameworkConfiguration = $this->configurationManager->getConfiguration( |
| 107 | 105 | \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK |
| 108 | 106 | ); |
@@ -116,8 +114,7 @@ discard block |
||
| 116 | 114 | * @param bool $generateEmptyFields |
| 117 | 115 | * @return \EWW\Dpf\Domain\Model\DocumentForm |
| 118 | 116 | */ |
| 119 | - public function getDocumentForm(Document $document, $generateEmptyFields = true) |
|
| 120 | - { |
|
| 117 | + public function getDocumentForm(Document $document, $generateEmptyFields = true) { |
|
| 121 | 118 | $documentForm = new \EWW\Dpf\Domain\Model\DocumentForm(); |
| 122 | 119 | $documentForm->generateCsrfToken(); |
| 123 | 120 | $documentForm->setUid($document->getDocumentType()->getUid()); |
@@ -365,8 +362,7 @@ discard block |
||
| 365 | 362 | return $documentForm; |
| 366 | 363 | } |
| 367 | 364 | |
| 368 | - public function getDocument($documentForm) |
|
| 369 | - { |
|
| 365 | + public function getDocument($documentForm) { |
|
| 370 | 366 | /** @var Document $document */ |
| 371 | 367 | |
| 372 | 368 | if ($documentForm->getDocumentUid()) { |
@@ -431,8 +427,7 @@ discard block |
||
| 431 | 427 | * @return array |
| 432 | 428 | * @throws \Exception |
| 433 | 429 | */ |
| 434 | - public function getMetadata(DocumentForm $documentForm) |
|
| 435 | - { |
|
| 430 | + public function getMetadata(DocumentForm $documentForm) { |
|
| 436 | 431 | foreach ($documentForm->getItems() as $page) { |
| 437 | 432 | |
| 438 | 433 | foreach ($page[0]->getItems() as $group) { |
@@ -543,8 +538,7 @@ discard block |
||
| 543 | 538 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 544 | 539 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 545 | 540 | */ |
| 546 | - protected function updateFiles(Document $document, $files) |
|
| 547 | - { |
|
| 541 | + protected function updateFiles(Document $document, $files) { |
|
| 548 | 542 | $filesToBeDeleted = []; |
| 549 | 543 | foreach ($document->getFile() as $docFile) { |
| 550 | 544 | $filesToBeDeleted[$docFile->getFileIdentifier()] = $docFile; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ( |
| 143 | 143 | $this->getSettings()['deactivatePrimaryFileMandatoryCheck'] || |
| 144 | 144 | $document->getDocumentType()->getVirtualType() |
| 145 | - )? false : true |
|
| 145 | + ) ? false : true |
|
| 146 | 146 | ) |
| 147 | 147 | ); |
| 148 | 148 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData(), $this->clientPid); |
| 161 | 161 | |
| 162 | - $excludeGroupAttributes = array(); |
|
| 162 | + $excludeGroupAttributes = array (); |
|
| 163 | 163 | |
| 164 | 164 | foreach ($document->getDocumentType()->getMetadataPage() as $metadataPage) { |
| 165 | 165 | $documentFormPage = new \EWW\Dpf\Domain\Model\DocumentFormPage(); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $xpath = $internalFormat->getXpath(); |
| 191 | 191 | |
| 192 | 192 | // get fixed attributes from xpath configuration |
| 193 | - $fixedGroupAttributes = array(); |
|
| 193 | + $fixedGroupAttributes = array (); |
|
| 194 | 194 | |
| 195 | 195 | preg_match_all('/[A-Za-z0-9:@\.]+(\[@.*?\])*/', $metadataGroup->getAbsoluteMapping(), $groupMappingPathParts); |
| 196 | 196 | $groupMappingPathParts = $groupMappingPathParts[0]; |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | foreach ($group as $groupItem) { |
| 460 | 460 | |
| 461 | - $item = array(); |
|
| 461 | + $item = array (); |
|
| 462 | 462 | |
| 463 | 463 | $uid = $groupItem->getUid(); |
| 464 | 464 | $metadataGroup = $this->metadataGroupRepository->findByUid($uid); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | $fieldMapping = $metadataObject->getRelativeMapping(); |
| 485 | 485 | |
| 486 | - $formField = array(); |
|
| 486 | + $formField = array (); |
|
| 487 | 487 | |
| 488 | 488 | $value = $fieldItem->getValue(); |
| 489 | 489 | |
@@ -533,11 +533,11 @@ discard block |
||
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | if (!key_exists('attributes', $item)) { |
| 536 | - $item['attributes'] = array(); |
|
| 536 | + $item['attributes'] = array (); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | if (!key_exists('values', $item)) { |
| 540 | - $item['values'] = array(); |
|
| 540 | + $item['values'] = array (); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | if ($groupItem->getMandatory() || $defaultValueCount < $fieldValueCount || $defaultValueCount == $fieldCount) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository |
| 47 | 47 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 48 | 48 | */ |
| 49 | - protected $metadataGroupRepository = null; |
|
| 49 | + protected $metadataGroupRepository = NULL; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * metadataObjectRepository |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository |
| 55 | 55 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 56 | 56 | */ |
| 57 | - protected $metadataObjectRepository = null; |
|
| 57 | + protected $metadataObjectRepository = NULL; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * documentTypeRepository |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 63 | 63 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 64 | 64 | */ |
| 65 | - protected $documentTypeRepository = null; |
|
| 65 | + protected $documentTypeRepository = NULL; |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * documentRepository |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 71 | 71 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 72 | 72 | */ |
| 73 | - protected $documentRepository = null; |
|
| 73 | + protected $documentRepository = NULL; |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * fileRepository |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 79 | 79 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 80 | 80 | */ |
| 81 | - protected $fileRepository = null; |
|
| 81 | + protected $fileRepository = NULL; |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * depositLicenseRepository |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @var \EWW\Dpf\Domain\Repository\DepositLicenseRepository |
| 87 | 87 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 88 | 88 | */ |
| 89 | - protected $depositLicenseRepository = null; |
|
| 89 | + protected $depositLicenseRepository = NULL; |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * clientPid |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | /** |
| 99 | 99 | * @var bool |
| 100 | 100 | */ |
| 101 | - protected $customClientPid = false; |
|
| 101 | + protected $customClientPid = FALSE; |
|
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * clientConfigurationManager |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @param bool $generateEmptyFields |
| 129 | 129 | * @return \EWW\Dpf\Domain\Model\DocumentForm |
| 130 | 130 | */ |
| 131 | - public function getDocumentForm(Document $document, $generateEmptyFields = true) |
|
| 131 | + public function getDocumentForm(Document $document, $generateEmptyFields = TRUE) |
|
| 132 | 132 | { |
| 133 | 133 | $documentForm = new \EWW\Dpf\Domain\Model\DocumentForm(); |
| 134 | 134 | $documentForm->generateCsrfToken(); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ( |
| 143 | 143 | $this->getSettings()['deactivatePrimaryFileMandatoryCheck'] || |
| 144 | 144 | $document->getDocumentType()->getVirtualType() |
| 145 | - )? false : true |
|
| 145 | + )? FALSE : TRUE |
|
| 146 | 146 | ) |
| 147 | 147 | ); |
| 148 | 148 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | // build mapping path, previous fixed attributes which are differ from |
| 206 | 206 | // the own fixed attributes are excluded |
| 207 | 207 | $queryGroupMapping = $metadataGroup->getAbsoluteMapping(); |
| 208 | - if (strpos($queryGroupMapping, "@displayLabel") === false && is_array($excludeGroupAttributes[$groupMappingName])) { |
|
| 208 | + if (strpos($queryGroupMapping, "@displayLabel") === FALSE && is_array($excludeGroupAttributes[$groupMappingName])) { |
|
| 209 | 209 | foreach ($excludeGroupAttributes[$groupMappingName] as $excludeAttr => $excludeAttrValue) { |
| 210 | 210 | if (!in_array($excludeAttr, $fixedGroupAttributes)) { |
| 211 | 211 | $queryGroupMapping .= $excludeAttrValue; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | // ensure that e.g. <mods:detail> and <mods:detail type="volume"> |
| 267 | 267 | // are not recognized as the same node |
| 268 | - if ((strpos($value, "@") === false) && ($value != '.')) { |
|
| 268 | + if ((strpos($value, "@") === FALSE) && ($value != '.')) { |
|
| 269 | 269 | $objectMappingPath[$key] .= "[not(@*)]"; |
| 270 | 270 | } |
| 271 | 271 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | } else { |
| 342 | 342 | |
| 343 | - $documentFormGroup->setEmptyGroup(true); |
|
| 343 | + $documentFormGroup->setEmptyGroup(TRUE); |
|
| 344 | 344 | |
| 345 | 345 | foreach ($metadataGroup->getMetadataObject() as $metadataObject) { |
| 346 | 346 | $documentFormField = new \EWW\Dpf\Domain\Model\DocumentFormField(); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | if ($documentForm->getDocumentUid()) { |
| 389 | 389 | if ($this->isCustomClientPid()) { |
| 390 | - $this->documentRepository->crossClient(true); |
|
| 390 | + $this->documentRepository->crossClient(TRUE); |
|
| 391 | 391 | } |
| 392 | 392 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
| 393 | 393 | $tempInternalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData(), $this->clientPid); |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | */ |
| 567 | 567 | public function setClientPid(int $clientPid): void |
| 568 | 568 | { |
| 569 | - $this->customClientPid = true; |
|
| 569 | + $this->customClientPid = TRUE; |
|
| 570 | 570 | $this->clientPid = $clientPid; |
| 571 | 571 | } |
| 572 | 572 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 29 | 29 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 30 | 30 | */ |
| 31 | - protected $documentTypeRepository = null; |
|
| 31 | + protected $documentTypeRepository = NULL; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * metadataPageRepository |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @var \EWW\Dpf\Domain\Repository\MetadataPageRepository |
| 37 | 37 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 38 | 38 | */ |
| 39 | - protected $metadataPageRepository = null; |
|
| 39 | + protected $metadataPageRepository = NULL; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * metadataGroupRepository |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository |
| 45 | 45 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 46 | 46 | */ |
| 47 | - protected $metadataGroupRepository = null; |
|
| 47 | + protected $metadataGroupRepository = NULL; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * metadataObjectRepository |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository |
| 53 | 53 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 54 | 54 | */ |
| 55 | - protected $metadataObjectRepository = null; |
|
| 55 | + protected $metadataObjectRepository = NULL; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * fileRepository |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 61 | 61 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 62 | 62 | */ |
| 63 | - protected $fileRepository = null; |
|
| 63 | + protected $fileRepository = NULL; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * documentRepository |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 69 | 69 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 70 | 70 | */ |
| 71 | - protected $documentRepository = null; |
|
| 71 | + protected $documentRepository = NULL; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * objectManager |
@@ -173,35 +173,35 @@ discard block |
||
| 173 | 173 | public function uploadError() |
| 174 | 174 | { |
| 175 | 175 | // todo: To be updated or implemented elsewhere |
| 176 | - return false; |
|
| 176 | + return FALSE; |
|
| 177 | 177 | |
| 178 | 178 | if ( |
| 179 | 179 | $this->formData['primaryFile'] && |
| 180 | 180 | $this->formData['primaryFile']['error'] != UPLOAD_ERR_OK && |
| 181 | 181 | $this->formData['primaryFile']['error'] != UPLOAD_ERR_NO_FILE |
| 182 | 182 | ) { |
| 183 | - return true; |
|
| 183 | + return TRUE; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if (is_array($this->formData['secondaryFiles'])) { |
| 187 | 187 | foreach ($this->formData['secondaryFiles'] as $tmpFile) { |
| 188 | 188 | if ($tmpFile['error'] != UPLOAD_ERR_OK && $tmpFile['error'] != UPLOAD_ERR_NO_FILE) { |
| 189 | - return true; |
|
| 189 | + return TRUE; |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - return false; |
|
| 194 | + return FALSE; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) |
|
| 197 | + protected function getUploadedFile($tmpFile, $primary = FALSE, \EWW\Dpf\Domain\Model\File $file = NULL) |
|
| 198 | 198 | { |
| 199 | 199 | |
| 200 | 200 | if (empty($file)) { |
| 201 | 201 | $file = $this->objectManager->get(File::class); |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - $fileName = uniqid(time(), true); |
|
| 204 | + $fileName = uniqid(time(), TRUE); |
|
| 205 | 205 | |
| 206 | 206 | \TYPO3\CMS\Core\Utility\GeneralUtility::upload_copy_move($tmpFile['tmp_name'], $this->uploadPath . $fileName); |
| 207 | 207 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $file->setTitle($tmpFile['name']); |
| 215 | 215 | $file->setLink($fileName); |
| 216 | 216 | $file->setPrimaryFile($primary); |
| 217 | - $file->setFileIdentifier(uniqid(time(), true)); |
|
| 217 | + $file->setFileIdentifier(uniqid(time(), TRUE)); |
|
| 218 | 218 | |
| 219 | 219 | if ($primary) { |
| 220 | 220 | if ($file->getDatastreamIdentifier()) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | if ($metadataGroup->isFileGroup()) { |
| 322 | 322 | |
| 323 | 323 | // Use the existing file entry |
| 324 | - $file = null; |
|
| 324 | + $file = NULL; |
|
| 325 | 325 | $document = $this->documentRepository->findByUid($this->formData['documentUid']); |
| 326 | 326 | if ($document) { |
| 327 | 327 | if ($metadataGroup->isPrimaryFileGroup()) { |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | protected function getFields() |
| 139 | 139 | { |
| 140 | 140 | |
| 141 | - $fields = array(); |
|
| 141 | + $fields = array (); |
|
| 142 | 142 | |
| 143 | 143 | if (is_array($this->formData['metadata'])) { |
| 144 | 144 | foreach ($this->formData['metadata'] as $key => $value) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | protected function getDeletedFiles() |
| 154 | 154 | { |
| 155 | - $deletedFiles = array(); |
|
| 155 | + $deletedFiles = array (); |
|
| 156 | 156 | |
| 157 | 157 | if (is_array($this->formData['deleteFile'])) { |
| 158 | 158 | foreach ($this->formData['deleteFile'] as $key => $value) { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $documentForm->setComment($this->formData['comment']); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $documentData = array(); |
|
| 249 | + $documentData = array (); |
|
| 250 | 250 | |
| 251 | 251 | foreach ($fields as $field) { |
| 252 | 252 | $pageUid = $field->getPageUid(); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - if ($metadataObject->isUploadField() ) { |
|
| 335 | + if ($metadataObject->isUploadField()) { |
|
| 336 | 336 | if ($object && is_array($object) && |
| 337 | 337 | array_key_exists('error', $object) && |
| 338 | 338 | $object['error'] != UPLOAD_ERR_NO_FILE) |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | use EWW\Dpf\Domain\Model\MetadataObject; |
| 21 | 21 | use TYPO3\CMS\Core\Core\Environment; |
| 22 | 22 | |
| 23 | -class FormDataReader |
|
| 24 | -{ |
|
| 23 | +class FormDataReader { |
|
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * documentTypeRepository |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | */ |
| 115 | 114 | protected $uploadBaseUrl; |
| 116 | 115 | |
| 117 | - public function __construct() |
|
| 118 | - { |
|
| 116 | + public function __construct() { |
|
| 119 | 117 | |
| 120 | 118 | $uploadFileUrl = new \EWW\Dpf\Helper\UploadFileUrl; |
| 121 | 119 | |
@@ -129,14 +127,12 @@ discard block |
||
| 129 | 127 | * |
| 130 | 128 | * @param array $formData |
| 131 | 129 | */ |
| 132 | - public function setFormData($formData) |
|
| 133 | - { |
|
| 130 | + public function setFormData($formData) { |
|
| 134 | 131 | $this->formData = $formData; |
| 135 | 132 | $this->documentType = $this->documentTypeRepository->findByUid($formData['type']); |
| 136 | 133 | } |
| 137 | 134 | |
| 138 | - protected function getFields() |
|
| 139 | - { |
|
| 135 | + protected function getFields() { |
|
| 140 | 136 | |
| 141 | 137 | $fields = array(); |
| 142 | 138 | |
@@ -150,8 +146,7 @@ discard block |
||
| 150 | 146 | return $fields; |
| 151 | 147 | } |
| 152 | 148 | |
| 153 | - protected function getDeletedFiles() |
|
| 154 | - { |
|
| 149 | + protected function getDeletedFiles() { |
|
| 155 | 150 | $deletedFiles = array(); |
| 156 | 151 | |
| 157 | 152 | if (is_array($this->formData['deleteFile'])) { |
@@ -171,8 +166,7 @@ discard block |
||
| 171 | 166 | return $deletedFiles; |
| 172 | 167 | } |
| 173 | 168 | |
| 174 | - public function uploadError() |
|
| 175 | - { |
|
| 169 | + public function uploadError() { |
|
| 176 | 170 | // todo: To be updated or implemented elsewhere |
| 177 | 171 | return false; |
| 178 | 172 | |
@@ -195,8 +189,7 @@ discard block |
||
| 195 | 189 | return false; |
| 196 | 190 | } |
| 197 | 191 | |
| 198 | - protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) |
|
| 199 | - { |
|
| 192 | + protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) { |
|
| 200 | 193 | |
| 201 | 194 | if (empty($file)) { |
| 202 | 195 | $file = $this->objectManager->get(File::class); |
@@ -230,8 +223,7 @@ discard block |
||
| 230 | 223 | return $file; |
| 231 | 224 | } |
| 232 | 225 | |
| 233 | - public function getDocumentForm() |
|
| 234 | - { |
|
| 226 | + public function getDocumentForm() { |
|
| 235 | 227 | $fields = $this->getFields(); |
| 236 | 228 | |
| 237 | 229 | $documentForm = new \EWW\Dpf\Domain\Model\DocumentForm(); |
@@ -335,8 +327,7 @@ discard block |
||
| 335 | 327 | if ($metadataObject->isUploadField() ) { |
| 336 | 328 | if ($object && is_array($object) && |
| 337 | 329 | array_key_exists('error', $object) && |
| 338 | - $object['error'] != UPLOAD_ERR_NO_FILE) |
|
| 339 | - { |
|
| 330 | + $object['error'] != UPLOAD_ERR_NO_FILE) { |
|
| 340 | 331 | if (empty($file)) { |
| 341 | 332 | $file = $this->objectManager->get(File::class); |
| 342 | 333 | $file = $this->getUploadedFile( |