@@ -16,47 +16,47 @@ |
||
| 16 | 16 | die('Access denied.'); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -return array( |
|
| 20 | - 'ctrl' => array( |
|
| 19 | +return array ( |
|
| 20 | + 'ctrl' => array ( |
|
| 21 | 21 | 'title' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_bookmark', |
| 22 | 22 | 'label' => 'document_identifier', |
| 23 | 23 | 'searchFields' => 'document_identifier, fe_user_uid', |
| 24 | 24 | 'iconfile' => 'EXT:dpf/Resources/Public/Icons/default.gif', |
| 25 | 25 | ), |
| 26 | - 'interface' => array( |
|
| 26 | + 'interface' => array ( |
|
| 27 | 27 | 'showRecordFieldList' => 'document_identifier, fe_user_uid', |
| 28 | 28 | ), |
| 29 | - 'types' => array( |
|
| 30 | - '1' => array('showitem' => ',--palette--;;1, |
|
| 29 | + 'types' => array ( |
|
| 30 | + '1' => array ('showitem' => ',--palette--;;1, |
|
| 31 | 31 | document_identifier, fe_user_uid, |
| 32 | 32 | --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access'), |
| 33 | 33 | ), |
| 34 | - 'palettes' => array( |
|
| 35 | - '1' => array('showitem' => ''), |
|
| 34 | + 'palettes' => array ( |
|
| 35 | + '1' => array ('showitem' => ''), |
|
| 36 | 36 | ), |
| 37 | - 'columns' => array( |
|
| 37 | + 'columns' => array ( |
|
| 38 | 38 | |
| 39 | - 'document_identifier' => array( |
|
| 39 | + 'document_identifier' => array ( |
|
| 40 | 40 | 'exclude' => 0, |
| 41 | 41 | 'label' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_bookmark.document_identifier', |
| 42 | - 'config' => array( |
|
| 42 | + 'config' => array ( |
|
| 43 | 43 | 'type' => 'input', |
| 44 | 44 | 'size' => '30', |
| 45 | 45 | 'eval' => 'trim', |
| 46 | 46 | ), |
| 47 | 47 | ), |
| 48 | - 'fe_user_uid' => array( |
|
| 48 | + 'fe_user_uid' => array ( |
|
| 49 | 49 | 'exclude' => 1, |
| 50 | 50 | 'l10n_mode' => 'exclude', |
| 51 | 51 | 'label' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_bookmark.feuser', |
| 52 | - 'config' => array( |
|
| 52 | + 'config' => array ( |
|
| 53 | 53 | 'type' => 'input', |
| 54 | 54 | 'size' => 30, |
| 55 | 55 | 'eval' => 'trim' |
| 56 | 56 | ), |
| 57 | 57 | ), |
| 58 | - 'pid' => array( |
|
| 59 | - 'config' => array( |
|
| 58 | + 'pid' => array ( |
|
| 59 | + 'config' => array ( |
|
| 60 | 60 | 'type' => 'passthrough', |
| 61 | 61 | ) |
| 62 | 62 | ), |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @var array |
| 31 | 31 | */ |
| 32 | - protected $settings = array(); |
|
| 32 | + protected $settings = array (); |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @var array |
| 46 | 46 | */ |
| 47 | - protected $extensionConfiguration = array(); |
|
| 47 | + protected $extensionConfiguration = array (); |
|
| 48 | 48 | |
| 49 | 49 | public function __construct() |
| 50 | 50 | { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $clientRepository = $objectManager->get(ClientRepository::class); |
| 53 | 53 | |
| 54 | 54 | if (TYPO3_MODE === 'BE') { |
| 55 | - $selectedPageId = (int)GeneralUtility::_GP('id'); |
|
| 55 | + $selectedPageId = (int) GeneralUtility::_GP('id'); |
|
| 56 | 56 | if ($selectedPageId) { |
| 57 | 57 | $this->client = $clientRepository->findAll()->current(); |
| 58 | 58 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | public function setRepositoryState($state) |
| 107 | 107 | { |
| 108 | 108 | $stateXpath = $this->clientConfigurationManager->getStateXpath(); |
| 109 | - $this->setValue($stateXpath,$state); |
|
| 109 | + $this->setValue($stateXpath, $state); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function getProcessNumber() |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $xpath = $this->getXpath(); |
| 339 | 339 | $data = []; |
| 340 | 340 | $sourceDetailsXpaths = $this->clientConfigurationManager->getSourceDetailsXpaths(); |
| 341 | - $sourceDetailsXpathList = explode(";", trim($sourceDetailsXpaths," ;")); |
|
| 341 | + $sourceDetailsXpathList = explode(";", trim($sourceDetailsXpaths, " ;")); |
|
| 342 | 342 | $dataNodes = []; |
| 343 | 343 | |
| 344 | 344 | foreach ($sourceDetailsXpathList as $sourceDetailsXpathItem) { |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | { |
| 374 | 374 | $xpath = $this->getXpath(); |
| 375 | 375 | $personXpath = $this->clientConfigurationManager->getPersonXpath(); |
| 376 | - $fisIdentifierXpath = $this->clientConfigurationManager->getPersonFisIdentifierXpath(); |
|
| 376 | + $fisIdentifierXpath = $this->clientConfigurationManager->getPersonFisIdentifierXpath(); |
|
| 377 | 377 | $personNodes = $xpath->query(self::rootNode . $personXpath); |
| 378 | 378 | $identifiers = []; |
| 379 | 379 | foreach ($personNodes as $key => $node) { |
@@ -405,9 +405,9 @@ discard block |
||
| 405 | 405 | $xpath = $this->getXpath(); |
| 406 | 406 | $notesNodes = $xpath->query(self::rootNode . $notesXpath); |
| 407 | 407 | |
| 408 | - $notes = array(); |
|
| 408 | + $notes = array (); |
|
| 409 | 409 | |
| 410 | - for ($i=0; $i < $notesNodes->length; $i++) |
|
| 410 | + for ($i = 0; $i < $notesNodes->length; $i++) |
|
| 411 | 411 | { |
| 412 | 412 | $notes[] = $notesNodes->item($i)->nodeValue; |
| 413 | 413 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | $parserGenerator = new ParserGenerator($this->clientPid); |
| 423 | 423 | $parserGenerator->setXml($this->xml->saveXML()); |
| 424 | - $parserGenerator->customXPath($notesXpath,true, $noteContent); |
|
| 424 | + $parserGenerator->customXPath($notesXpath, true, $noteContent); |
|
| 425 | 425 | $this->xml = new \DOMDocument(); |
| 426 | 426 | $this->xml->loadXML($parserGenerator->getXMLData()); |
| 427 | 427 | } |
@@ -448,9 +448,9 @@ discard block |
||
| 448 | 448 | $familyXpath = $this->clientConfigurationManager->getPersonFamilyXpath(); |
| 449 | 449 | $givenXpath = $this->clientConfigurationManager->getPersonGivenXpath(); |
| 450 | 450 | $roleXpath = $this->clientConfigurationManager->getPersonRoleXpath(); |
| 451 | - $fisIdentifierXpath = $this->clientConfigurationManager->getPersonFisIdentifierXpath(); |
|
| 452 | - $affiliationXpath = $this->clientConfigurationManager->getPersonAffiliationXpath(); |
|
| 453 | - $affiliationIdentifierXpath = $this->clientConfigurationManager->getPersonAffiliationIdentifierXpath(); |
|
| 451 | + $fisIdentifierXpath = $this->clientConfigurationManager->getPersonFisIdentifierXpath(); |
|
| 452 | + $affiliationXpath = $this->clientConfigurationManager->getPersonAffiliationXpath(); |
|
| 453 | + $affiliationIdentifierXpath = $this->clientConfigurationManager->getPersonAffiliationIdentifierXpath(); |
|
| 454 | 454 | |
| 455 | 455 | $xpath = $this->getXpath(); |
| 456 | 456 | $personNodes = $xpath->query(self::rootNode . $personXpath); |
@@ -530,9 +530,9 @@ discard block |
||
| 530 | 530 | */ |
| 531 | 531 | public function getValidation() |
| 532 | 532 | { |
| 533 | - $validationXpath = $this->clientConfigurationManager->getValidationXpath(); |
|
| 533 | + $validationXpath = $this->clientConfigurationManager->getValidationXpath(); |
|
| 534 | 534 | $validation = $this->getValue($validationXpath); |
| 535 | - return (strtolower($validation) === 'true')? true : false; |
|
| 535 | + return (strtolower($validation) === 'true') ? true : false; |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | /** |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | */ |
| 541 | 541 | public function setValidation($validated) |
| 542 | 542 | { |
| 543 | - $validationXpath = $this->clientConfigurationManager->getValidationXpath(); |
|
| 544 | - $this->setValue($validationXpath, ($validated? 'true' : 'false')); |
|
| 543 | + $validationXpath = $this->clientConfigurationManager->getValidationXpath(); |
|
| 544 | + $this->setValue($validationXpath, ($validated ? 'true' : 'false')); |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | /** |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | */ |
| 550 | 550 | public function setFisId($fisId) |
| 551 | 551 | { |
| 552 | - $fisIdXpath = $this->clientConfigurationManager->getFisIdXpath(); |
|
| 552 | + $fisIdXpath = $this->clientConfigurationManager->getFisIdXpath(); |
|
| 553 | 553 | $this->setValue($fisIdXpath, $fisId); |
| 554 | 554 | } |
| 555 | 555 | |
@@ -577,10 +577,10 @@ discard block |
||
| 577 | 577 | $nodes = $xpath->query(self::rootNode . $xpathString); |
| 578 | 578 | if ($nodes->length > 0) { |
| 579 | 579 | $nodes->item(0)->nodeValue = $value; |
| 580 | - } elseif(!empty($value)) { |
|
| 580 | + } elseif (!empty($value)) { |
|
| 581 | 581 | $parserGenerator = new ParserGenerator($this->clientPid); |
| 582 | 582 | $parserGenerator->setXml($this->xml->saveXML()); |
| 583 | - $parserGenerator->customXPath($xpathString,true, $value); |
|
| 583 | + $parserGenerator->customXPath($xpathString, true, $value); |
|
| 584 | 584 | $this->xml = new \DOMDocument(); |
| 585 | 585 | $this->xml->loadXML($parserGenerator->getXMLData()); |
| 586 | 586 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ( |
| 133 | 133 | $this->getSettings()['deactivatePrimaryFileMandatoryCheck'] || |
| 134 | 134 | $document->getDocumentType()->getVirtualType() |
| 135 | - )? false : true |
|
| 135 | + ) ? false : true |
|
| 136 | 136 | ) |
| 137 | 137 | ); |
| 138 | 138 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData(), $this->clientPid); |
| 151 | 151 | |
| 152 | - $excludeGroupAttributes = array(); |
|
| 152 | + $excludeGroupAttributes = array (); |
|
| 153 | 153 | |
| 154 | 154 | foreach ($document->getDocumentType()->getMetadataPage() as $metadataPage) { |
| 155 | 155 | $documentFormPage = new \EWW\Dpf\Domain\Model\DocumentFormPage(); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $xpath = $internalFormat->getXpath(); |
| 181 | 181 | |
| 182 | 182 | // get fixed attributes from xpath configuration |
| 183 | - $fixedGroupAttributes = array(); |
|
| 183 | + $fixedGroupAttributes = array (); |
|
| 184 | 184 | |
| 185 | 185 | preg_match_all('/[A-Za-z0-9:@\.]+(\[@.*?\])*/', $metadataGroup->getAbsoluteMapping(), $groupMappingPathParts); |
| 186 | 186 | $groupMappingPathParts = $groupMappingPathParts[0]; |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | $documentData['documentUid'] = $documentForm->getDocumentUid(); |
| 401 | 401 | $documentData['metadata'] = $formMetaData['mods']; |
| 402 | - $documentData['files'] = array(); |
|
| 402 | + $documentData['files'] = array (); |
|
| 403 | 403 | |
| 404 | 404 | $exporter->buildXmlFromForm($documentData); |
| 405 | 405 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | foreach ($group as $groupItem) { |
| 433 | 433 | |
| 434 | - $item = array(); |
|
| 434 | + $item = array (); |
|
| 435 | 435 | |
| 436 | 436 | $uid = $groupItem->getUid(); |
| 437 | 437 | $metadataGroup = $this->metadataGroupRepository->findByUid($uid); |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | $fieldMapping = $metadataObject->getRelativeMapping(); |
| 456 | 456 | |
| 457 | - $formField = array(); |
|
| 457 | + $formField = array (); |
|
| 458 | 458 | |
| 459 | 459 | $value = $fieldItem->getValue(); |
| 460 | 460 | |
@@ -495,11 +495,11 @@ discard block |
||
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | if (!key_exists('attributes', $item)) { |
| 498 | - $item['attributes'] = array(); |
|
| 498 | + $item['attributes'] = array (); |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | if (!key_exists('values', $item)) { |
| 502 | - $item['values'] = array(); |
|
| 502 | + $item['values'] = array (); |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if ($groupItem->getMandatory() || $defaultValueCount < $fieldValueCount || $defaultValueCount == $fieldCount) { |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | public function setObjectIdentifier($objectIdentifier) |
| 360 | 360 | { |
| 361 | 361 | // Due to uniqe key uc_object_identifier, which should ignore empty object identifiers. |
| 362 | - $this->objectIdentifier = empty($objectIdentifier)? null : $objectIdentifier; |
|
| 362 | + $this->objectIdentifier = empty($objectIdentifier) ? null : $objectIdentifier; |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
@@ -541,14 +541,14 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | $fileId = new \EWW\Dpf\Services\Transfer\FileId($this); |
| 543 | 543 | |
| 544 | - $files = array(); |
|
| 544 | + $files = array (); |
|
| 545 | 545 | |
| 546 | 546 | if (is_a($this->getFile(), '\TYPO3\CMS\Extbase\Persistence\ObjectStorage')) { |
| 547 | 547 | foreach ($this->getFile() as $file) { |
| 548 | 548 | |
| 549 | 549 | if (!$file->isFileGroupDeleted()) { |
| 550 | 550 | |
| 551 | - $tmpFile = array( |
|
| 551 | + $tmpFile = array ( |
|
| 552 | 552 | 'path' => $file->getUrl(), |
| 553 | 553 | 'type' => $file->getContentType(), |
| 554 | 554 | 'title' => (($file->getLabel()) ? $file->getLabel() : $file->getTitle()), |
@@ -592,12 +592,12 @@ discard block |
||
| 592 | 592 | |
| 593 | 593 | $fileId = new \EWW\Dpf\Services\Transfer\FileId($this); |
| 594 | 594 | |
| 595 | - $files = array(); |
|
| 595 | + $files = array (); |
|
| 596 | 596 | |
| 597 | 597 | if (is_a($this->getFile(), '\TYPO3\CMS\Extbase\Persistence\ObjectStorage')) { |
| 598 | 598 | foreach ($this->getFile() as $file) { |
| 599 | 599 | |
| 600 | - $tmpFile = array( |
|
| 600 | + $tmpFile = array ( |
|
| 601 | 601 | 'path' => $file->getUrl(), |
| 602 | 602 | 'type' => $file->getContentType(), |
| 603 | 603 | 'title' => (($file->getLabel()) ? $file->getLabel() : $file->getTitle()), |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | */ |
| 750 | 750 | public function getCreator() |
| 751 | 751 | { |
| 752 | - return $this->creator? $this->creator : 0; |
|
| 752 | + return $this->creator ? $this->creator : 0; |
|
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | /** |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | |
| 905 | 905 | foreach ($availableProperties as $propertyName) { |
| 906 | 906 | if (\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertySettable($newDocument, $propertyName) |
| 907 | - && !in_array($propertyName, array('uid','pid', 'file', 'comment', 'linkedUid', 'suggestion', 'creator'))) { |
|
| 907 | + && !in_array($propertyName, array ('uid', 'pid', 'file', 'comment', 'linkedUid', 'suggestion', 'creator'))) { |
|
| 908 | 908 | |
| 909 | 909 | $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($documentToCopy, $propertyName); |
| 910 | 910 | \TYPO3\CMS\Extbase\Reflection\ObjectAccess::setProperty($newDocument, $propertyName, $propertyValue); |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | */ |
| 927 | 927 | public function getDocumentIdentifier() |
| 928 | 928 | { |
| 929 | - return $this->getObjectIdentifier()? $this->getObjectIdentifier() : $this->getUid(); |
|
| 929 | + return $this->getObjectIdentifier() ? $this->getObjectIdentifier() : $this->getUid(); |
|
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | /** |
@@ -959,8 +959,8 @@ discard block |
||
| 959 | 959 | public function getPublicationYear() |
| 960 | 960 | { |
| 961 | 961 | $internalFormat = new InternalFormat($this->getXmlData(), $this->getPid()); |
| 962 | - $year = $internalFormat->getPublishingYear(); |
|
| 963 | - return $year? $year : ""; |
|
| 962 | + $year = $internalFormat->getPublishingYear(); |
|
| 963 | + return $year ? $year : ""; |
|
| 964 | 964 | } |
| 965 | 965 | |
| 966 | 966 | /** |
@@ -338,13 +338,13 @@ |
||
| 338 | 338 | ) |
| 339 | 339 | { |
| 340 | 340 | $messageHeader = LocalizationUtility::translate( |
| 341 | - 'LLL:EXT:dpf/Resources/Private/Language/locallang_mod.xlf:admin_module.'.$headerKey, |
|
| 341 | + 'LLL:EXT:dpf/Resources/Private/Language/locallang_mod.xlf:admin_module.' . $headerKey, |
|
| 342 | 342 | 'dpf', |
| 343 | 343 | $headerArguments |
| 344 | 344 | ); |
| 345 | 345 | |
| 346 | 346 | $messageBody = LocalizationUtility::translate( |
| 347 | - 'LLL:EXT:dpf/Resources/Private/Language/locallang_mod.xlf:admin_module.'.$bodyKey, |
|
| 347 | + 'LLL:EXT:dpf/Resources/Private/Language/locallang_mod.xlf:admin_module.' . $bodyKey, |
|
| 348 | 348 | 'dpf', |
| 349 | 349 | $bodyArguments |
| 350 | 350 | ); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | throw new ElasticSearchMissingIndexNameException('Missing search index name.'); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $hosts = array( |
|
| 85 | + $hosts = array ( |
|
| 86 | 86 | $this->server . ':' . $this->port, |
| 87 | 87 | ); |
| 88 | 88 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if ($notes && is_array($notes)) { |
| 311 | 311 | $data->notes = $notes; |
| 312 | 312 | } else { |
| 313 | - $data->notes = array(); |
|
| 313 | + $data->notes = array (); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | $files = $document->getFile(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $query = [ |
| 123 | 123 | 'bool' => [ |
| 124 | 124 | 'must' => [ |
| 125 | - 'match_all' => (object)[] |
|
| 125 | + 'match_all' => (object) [] |
|
| 126 | 126 | ], |
| 127 | 127 | 'filter' => $queryFilter |
| 128 | 128 | ] |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | 'script' => [ |
| 165 | 165 | 'lang' => 'painless', |
| 166 | 166 | 'source' => |
| 167 | - "for (int i = 0; i < doc['collections'].length; ++i) {". |
|
| 168 | - " if(doc['collections'][i] =='". |
|
| 169 | - $this->clientConfigurationManager->getUniversityCollection() ."') {". |
|
| 170 | - " return 'true';". |
|
| 171 | - " }". |
|
| 172 | - "}". |
|
| 167 | + "for (int i = 0; i < doc['collections'].length; ++i) {" . |
|
| 168 | + " if(doc['collections'][i] =='" . |
|
| 169 | + $this->clientConfigurationManager->getUniversityCollection() . "') {" . |
|
| 170 | + " return 'true';" . |
|
| 171 | + " }" . |
|
| 172 | + "}" . |
|
| 173 | 173 | "return 'false';" |
| 174 | 174 | ] |
| 175 | 175 | ] |
@@ -185,23 +185,23 @@ discard block |
||
| 185 | 185 | 'script' => [ |
| 186 | 186 | 'lang' => 'painless', |
| 187 | 187 | 'source' => |
| 188 | - "if (". |
|
| 189 | - " doc['creator'].size() > 0 &&". |
|
| 190 | - " doc['creator'].value == '".$this->security->getUser()->getUid()."') {". |
|
| 191 | - " return 'self';". |
|
| 192 | - "}". |
|
| 193 | - "if (". |
|
| 194 | - " doc['creatorRole'].size() > 0 &&". |
|
| 195 | - " doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."'". |
|
| 196 | - ") {". |
|
| 197 | - " return 'librarian';". |
|
| 198 | - "}". |
|
| 199 | - "if (". |
|
| 200 | - " doc['creatorRole'].size() > 0 &&". |
|
| 201 | - " doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."'". |
|
| 202 | - ") {". |
|
| 203 | - " return 'user';". |
|
| 204 | - "}". |
|
| 188 | + "if (" . |
|
| 189 | + " doc['creator'].size() > 0 &&" . |
|
| 190 | + " doc['creator'].value == '" . $this->security->getUser()->getUid() . "') {" . |
|
| 191 | + " return 'self';" . |
|
| 192 | + "}" . |
|
| 193 | + "if (" . |
|
| 194 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 195 | + " doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "'" . |
|
| 196 | + ") {" . |
|
| 197 | + " return 'librarian';" . |
|
| 198 | + "}" . |
|
| 199 | + "if (" . |
|
| 200 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 201 | + " doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "'" . |
|
| 202 | + ") {" . |
|
| 203 | + " return 'user';" . |
|
| 204 | + "}" . |
|
| 205 | 205 | "return 'unknown';" |
| 206 | 206 | ] |
| 207 | 207 | ] |
@@ -414,8 +414,8 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | protected function buildSortQueryPart($sortField, $sortOrder) { |
| 416 | 416 | |
| 417 | - $sortField = ($sortField)? $sortField : 'title'; |
|
| 418 | - $sortOrder = ($sortOrder)? $sortOrder : 'asc'; |
|
| 417 | + $sortField = ($sortField) ? $sortField : 'title'; |
|
| 418 | + $sortOrder = ($sortOrder) ? $sortOrder : 'asc'; |
|
| 419 | 419 | |
| 420 | 420 | // Build the sorting part. |
| 421 | 421 | $script = ""; |
@@ -446,11 +446,11 @@ discard block |
||
| 446 | 446 | ]; |
| 447 | 447 | } else { |
| 448 | 448 | if ($sortField == 'title') { |
| 449 | - $sortField.= ".keyword"; |
|
| 449 | + $sortField .= ".keyword"; |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | if ($sortField == 'personsSort') { |
| 453 | - $sortField.= ".keyword"; |
|
| 453 | + $sortField .= ".keyword"; |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | $sort = [ |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | protected function getSortScriptUniversityCollection($collection) |
| 468 | 468 | { |
| 469 | 469 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 470 | - $script .= " if (doc['collections'][i] == '".$collection."') {"; |
|
| 470 | + $script .= " if (doc['collections'][i] == '" . $collection . "') {"; |
|
| 471 | 471 | $script .= " return '1';"; |
| 472 | 472 | $script .= " }"; |
| 473 | 473 | $script .= "}"; |
@@ -488,13 +488,13 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | protected function getSortScriptCreatorRole($feUserUid) |
| 490 | 490 | { |
| 491 | - $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
|
| 491 | + $script = "if (doc['creator'].value == '" . $feUserUid . "') {"; |
|
| 492 | 492 | $script .= " return '1';"; |
| 493 | 493 | $script .= "}"; |
| 494 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."') {"; |
|
| 494 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "') {"; |
|
| 495 | 495 | $script .= "return '2';"; |
| 496 | 496 | $script .= "}"; |
| 497 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."') {"; |
|
| 497 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "') {"; |
|
| 498 | 498 | $script .= " return '3';"; |
| 499 | 499 | $script .= "}"; |
| 500 | 500 | $script .= "return '4';"; |
@@ -509,15 +509,15 @@ discard block |
||
| 509 | 509 | foreach (DocumentWorkflow::PLACES as $state) { |
| 510 | 510 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) { |
| 511 | 511 | $aliasState = DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING[$state]; |
| 512 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.'.$aliasState; |
|
| 512 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.' . $aliasState; |
|
| 513 | 513 | $stateName = LocalizationUtility::translate($key, 'dpf'); |
| 514 | - $sortStates[] = "if (doc['state'].value == '".$state."') return '".$stateName."';"; |
|
| 514 | + $sortStates[] = "if (doc['state'].value == '" . $state . "') return '" . $stateName . "';"; |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | $sortStates = implode(" ", $sortStates); |
| 519 | 519 | |
| 520 | - return $sortStates." return '';"; |
|
| 520 | + return $sortStates . " return '';"; |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | |
@@ -526,14 +526,14 @@ discard block |
||
| 526 | 526 | $sortDoctypes = []; |
| 527 | 527 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 528 | 528 | if ($documentType->getName() && $documentType->getDisplayname()) { |
| 529 | - $sortDoctypes[] = "if (doc['doctype'].value == '".$documentType->getName()."')" |
|
| 530 | - ." return '".$documentType->getDisplayname()."';"; |
|
| 529 | + $sortDoctypes[] = "if (doc['doctype'].value == '" . $documentType->getName() . "')" |
|
| 530 | + ." return '" . $documentType->getDisplayname() . "';"; |
|
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $sortDoctypes = implode(" ", $sortDoctypes); |
| 535 | 535 | |
| 536 | - return $sortDoctypes." return '';"; |
|
| 536 | + return $sortDoctypes . " return '';"; |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | case Security::ROLE_RESEARCHER: |
| 47 | 47 | $query->matching( |
| 48 | 48 | $query->logicalAnd( |
| 49 | - array( |
|
| 49 | + array ( |
|
| 50 | 50 | $query->equals('suggestion', true), |
| 51 | 51 | $query->equals('creator', $creatorUid) |
| 52 | 52 | ) |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $query = $this->createQuery(); |
| 67 | 67 | |
| 68 | - $constraints = array( |
|
| 68 | + $constraints = array ( |
|
| 69 | 69 | $query->logicalNot($query->equals('object_identifier', '')), |
| 70 | 70 | $query->logicalNot($query->equals('object_identifier', null)) |
| 71 | 71 | ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $result = $query->execute(); |
| 86 | 86 | |
| 87 | - $objectIdentifiers = array(); |
|
| 87 | + $objectIdentifiers = array (); |
|
| 88 | 88 | |
| 89 | 89 | foreach ($result as $document) { |
| 90 | 90 | $objectIdentifiers[$document->getObjectIdentifier()] = $document->getObjectIdentifier(); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $query = $this->createQuery(); |
| 105 | 105 | $query->getQuerySettings()->setRespectStoragePage(false); |
| 106 | 106 | |
| 107 | - $constraints = array(); |
|
| 107 | + $constraints = array (); |
|
| 108 | 108 | $constraints[] = $query->equals('process_number', ''); |
| 109 | 109 | $constraints[] = $query->equals('process_number', null); |
| 110 | 110 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $dateTimeObj = new \DateTime(); |
| 134 | 134 | $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S")); |
| 135 | 135 | |
| 136 | - $constraints = array(); |
|
| 136 | + $constraints = array (); |
|
| 137 | 137 | $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp()); |
| 138 | 138 | |
| 139 | 139 | $query->matching( |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $dateTimeObj = new \DateTime(); |
| 160 | 160 | $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S")); |
| 161 | 161 | |
| 162 | - $constraints = array(); |
|
| 162 | + $constraints = array (); |
|
| 163 | 163 | $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp()); |
| 164 | 164 | |
| 165 | 165 | $query->matching( |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | $query = $this->createQuery(); |
| 183 | 183 | |
| 184 | - $constraints = array( |
|
| 184 | + $constraints = array ( |
|
| 185 | 185 | $query->equals('object_identifier', $objectIdentifier), |
| 186 | 186 | $query->logicalNot($query->equals('temporary', true)), |
| 187 | 187 | $query->logicalNot($query->equals('suggestion', true)) |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | return null; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - $query->setOrderings(array("tstamp" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING)); |
|
| 225 | + $query->setOrderings(array ("tstamp" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING)); |
|
| 226 | 226 | $query->matching($query->logicalAnd($constraints)); |
| 227 | 227 | |
| 228 | 228 | return $query->execute()->getFirst(); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $query = $this->createQuery(); |
| 310 | 310 | $query->matching( |
| 311 | 311 | $query->logicalAnd( |
| 312 | - array( |
|
| 312 | + array ( |
|
| 313 | 313 | $query->logicalNot( |
| 314 | 314 | $query->equals('embargo_date', 0) |
| 315 | 315 | ) |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $query->equals('suggestion', false) |
| 348 | 348 | ); |
| 349 | 349 | |
| 350 | - $query->setOrderings(array("tstamp" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING)); |
|
| 350 | + $query->setOrderings(array ("tstamp" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING)); |
|
| 351 | 351 | $query->matching($query->logicalOr($constraints)); |
| 352 | 352 | |
| 353 | 353 | return $query->execute(); |