@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected static function getAttributes() |
| 77 | 77 | { |
| 78 | - return array( |
|
| 78 | + return array ( |
|
| 79 | 79 | self::CREATE, |
| 80 | 80 | self::CREATE_REGISTER, |
| 81 | 81 | self::UPDATE, |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | { |
| 462 | 462 | if ($this->security->getUserRole() === Security::ROLE_RESEARCHER) { |
| 463 | 463 | |
| 464 | - $objectManager =GeneralUtility::makeInstance(ObjectManager::class); |
|
| 464 | + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
|
| 465 | 465 | $documentRepository = $objectManager->get(DocumentRepository::class); |
| 466 | 466 | |
| 467 | 467 | $linkedDocument = $documentRepository->findOneByLinkedUid($document->getUid()); |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | protected function isDocumentLocked($document) |
| 563 | 563 | { |
| 564 | - $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid(); |
|
| 564 | + $identifier = $document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid(); |
|
| 565 | 565 | return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid()); |
| 566 | 566 | } |
| 567 | 567 | |
@@ -29,8 +29,8 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $query = $this->createQuery(); |
| 31 | 31 | |
| 32 | - $dateTimeObj= new \DateTime(); |
|
| 33 | - $dateTimeObj->sub(new \DateInterval("PT".$timeout."S")); |
|
| 32 | + $dateTimeObj = new \DateTime(); |
|
| 33 | + $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S")); |
|
| 34 | 34 | |
| 35 | 35 | $query->matching( |
| 36 | 36 | $query->lessThan('tstamp', $dateTimeObj->getTimestamp()) |
@@ -34,30 +34,30 @@ |
||
| 34 | 34 | const REMOTE_STATE_INACTIVE = "INACTIVE"; |
| 35 | 35 | const REMOTE_STATE_DELETED = "DELETED"; |
| 36 | 36 | |
| 37 | - const STATE_NONE_NONE = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_NONE; |
|
| 37 | + const STATE_NONE_NONE = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_NONE; |
|
| 38 | 38 | |
| 39 | 39 | // New |
| 40 | - const STATE_NEW_NONE = self::LOCAL_STATE_NEW.':'.self::REMOTE_STATE_NONE; |
|
| 40 | + const STATE_NEW_NONE = self::LOCAL_STATE_NEW . ':' . self::REMOTE_STATE_NONE; |
|
| 41 | 41 | |
| 42 | 42 | // Registered |
| 43 | - const STATE_REGISTERED_NONE = self::LOCAL_STATE_REGISTERED.':'.self::REMOTE_STATE_NONE; |
|
| 43 | + const STATE_REGISTERED_NONE = self::LOCAL_STATE_REGISTERED . ':' . self::REMOTE_STATE_NONE; |
|
| 44 | 44 | |
| 45 | 45 | // In progress |
| 46 | - const STATE_IN_PROGRESS_NONE = self::LOCAL_STATE_IN_PROGRESS.':'.self::REMOTE_STATE_NONE; |
|
| 47 | - const STATE_IN_PROGRESS_ACTIVE = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_ACTIVE; |
|
| 48 | - const STATE_IN_PROGRESS_INACTIVE = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_INACTIVE; |
|
| 49 | - const STATE_IN_PROGRESS_DELETED = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_DELETED; |
|
| 46 | + const STATE_IN_PROGRESS_NONE = self::LOCAL_STATE_IN_PROGRESS . ':' . self::REMOTE_STATE_NONE; |
|
| 47 | + const STATE_IN_PROGRESS_ACTIVE = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_ACTIVE; |
|
| 48 | + const STATE_IN_PROGRESS_INACTIVE = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_INACTIVE; |
|
| 49 | + const STATE_IN_PROGRESS_DELETED = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_DELETED; |
|
| 50 | 50 | |
| 51 | 51 | // Active |
| 52 | - const STATE_NONE_ACTIVE = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_ACTIVE; |
|
| 52 | + const STATE_NONE_ACTIVE = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_ACTIVE; |
|
| 53 | 53 | |
| 54 | 54 | // Postponed |
| 55 | - const STATE_POSTPONED_NONE = self::LOCAL_STATE_POSTPONED.':'.self::REMOTE_STATE_NONE; |
|
| 56 | - const STATE_NONE_INACTIVE = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_INACTIVE; |
|
| 55 | + const STATE_POSTPONED_NONE = self::LOCAL_STATE_POSTPONED . ':' . self::REMOTE_STATE_NONE; |
|
| 56 | + const STATE_NONE_INACTIVE = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_INACTIVE; |
|
| 57 | 57 | |
| 58 | 58 | // Discarded |
| 59 | - const STATE_DISCARDED_NONE = self::LOCAL_STATE_DISCARDED.':'.self::REMOTE_STATE_NONE; |
|
| 60 | - const STATE_NONE_DELETED = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_DELETED; |
|
| 59 | + const STATE_DISCARDED_NONE = self::LOCAL_STATE_DISCARDED . ':' . self::REMOTE_STATE_NONE; |
|
| 60 | + const STATE_NONE_DELETED = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_DELETED; |
|
| 61 | 61 | |
| 62 | 62 | const TRANSITION_CREATE = "CREATE_TRANSITION"; |
| 63 | 63 | const TRANSITION_CREATE_REGISTER = "CREATE_REGISTER_TRANSITION"; |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | |
| 124 | 124 | public function getLockedDocumentIdentifiersByUserUid($userUid) |
| 125 | 125 | { |
| 126 | - $identifiers = array(); |
|
| 126 | + $identifiers = array (); |
|
| 127 | 127 | |
| 128 | 128 | $locks = $this->editingLockRepository->findByEditorUid($userUid); |
| 129 | 129 | /** @var \EWW\Dpf\Domain\Model\EditingLock $lock */ |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->server = $clientConfigurationManager->getElasticSearchHost(); |
| 65 | 65 | $this->port = $clientConfigurationManager->getElasticSearchPort(); |
| 66 | 66 | |
| 67 | - $hosts = array( |
|
| 67 | + $hosts = array ( |
|
| 68 | 68 | $this->server . ':' . $this->port, |
| 69 | 69 | ); |
| 70 | 70 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | if ($notes && is_array($notes)) { |
| 190 | 190 | $data->notes = $notes; |
| 191 | 191 | } else { |
| 192 | - $data->notes = array(); |
|
| 192 | + $data->notes = array (); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $files = $document->getFile(); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $this->results = $results; |
| 287 | 287 | |
| 288 | 288 | return $this->results; |
| 289 | - } catch ( \Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) { |
|
| 289 | + } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) { |
|
| 290 | 290 | throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server."); |
| 291 | 291 | } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotResolveHostException $exception) { |
| 292 | 292 | throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server."); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function getUserRole() |
| 39 | 39 | { |
| 40 | 40 | // Get frontend user groups of the client. |
| 41 | - $clientFrontendGroups = array(); |
|
| 41 | + $clientFrontendGroups = array (); |
|
| 42 | 42 | foreach ($this->frontendUserGroupRepository->findAll() as $clientGroup) { |
| 43 | 43 | if ($clientGroup->getKitodoRole()) { |
| 44 | 44 | $clientFrontendGroups[$clientGroup->getUid()] = $clientGroup; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // Get frontend user groups of the user. |
| 49 | - $frontendUserGroups = array(); |
|
| 49 | + $frontendUserGroups = array (); |
|
| 50 | 50 | foreach ($this->getUsergroup() as $userGroup) { |
| 51 | 51 | // Because getUsergroup() does not return objects of the class |
| 52 | 52 | // \EWW\Dpf\Domain\Model\FrontendUserRepository |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // Get the roles the user has in the current client. |
| 58 | - $roles = array(); |
|
| 58 | + $roles = array (); |
|
| 59 | 59 | foreach ($frontendUserGroups as $uid => $group) { |
| 60 | 60 | if (array_key_exists($uid, $clientFrontendGroups)) { |
| 61 | 61 | $roles[$uid] = $group->getKitodoRole(); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $searchString = $this->escapeQuery(trim($searchString)); |
| 56 | 56 | |
| 57 | - $query['body']['query']['bool']['should'][0]['query_string']['query'] = $searchString; |
|
| 57 | + $query['body']['query']['bool']['should'][0]['query_string']['query'] = $searchString; |
|
| 58 | 58 | //$query['body']['query']['bool']['should'][1]['has_child']['query']['query_string']['query'] = $searchString; |
| 59 | 59 | $query['body']['query']['bool']['minimum_should_match'] = "1"; // 1 |
| 60 | 60 | |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | * build array for elasticsearch |
| 72 | 72 | * @return array Elasticsearch query array |
| 73 | 73 | */ |
| 74 | - public function extendedSearch($searchArray = array()) |
|
| 74 | + public function extendedSearch($searchArray = array ()) |
|
| 75 | 75 | { |
| 76 | 76 | |
| 77 | - $query = array(); |
|
| 78 | - $filter = array(); |
|
| 77 | + $query = array (); |
|
| 78 | + $filter = array (); |
|
| 79 | 79 | foreach ($searchArray as $key => $qry) { |
| 80 | 80 | $qry = trim($qry); |
| 81 | 81 | |
| 82 | 82 | if (!empty($qry) && in_array($key, self::$matches)) { |
| 83 | 83 | |
| 84 | - $query['body']['query']['bool']['must'][] = array('match' => array($key => $qry)); |
|
| 84 | + $query['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry)); |
|
| 85 | 85 | |
| 86 | 86 | } elseif (!empty($qry) && in_array($key, self::$terms)) { |
| 87 | 87 | |
| 88 | - $query['body']['query']['bool']['must'][] = array('term' => array($key => $qry)); |
|
| 88 | + $query['body']['query']['bool']['must'][] = array ('term' => array ($key => $qry)); |
|
| 89 | 89 | |
| 90 | 90 | } elseif (!empty($qry) && $key == 'from') { |
| 91 | 91 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if (isset($filter['gte']) || isset($filter['lte'])) { |
| 106 | 106 | |
| 107 | - $query['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $filter)); |
|
| 107 | + $query['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $filter)); |
|
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
@@ -122,19 +122,19 @@ discard block |
||
| 122 | 122 | public function resultsFilter($query, $showDeleted = false) |
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - $queryFilter = array(); |
|
| 125 | + $queryFilter = array (); |
|
| 126 | 126 | |
| 127 | 127 | // Frontend only |
| 128 | 128 | $searchResultsFilter = $this->settings['searchResultsFilter']; |
| 129 | - if(!empty($searchResultsFilter)) { |
|
| 129 | + if (!empty($searchResultsFilter)) { |
|
| 130 | 130 | |
| 131 | 131 | // add doctypes |
| 132 | - if($searchResultsFilter['doctype']) { |
|
| 132 | + if ($searchResultsFilter['doctype']) { |
|
| 133 | 133 | |
| 134 | 134 | $uids = GeneralUtility::trimExplode(',', $searchResultsFilter['doctype']); |
| 135 | 135 | $documentTypeRepository = $this->documentTypeRepository; |
| 136 | - $documentTypes = array(); |
|
| 137 | - foreach($uids as $uid) { |
|
| 136 | + $documentTypes = array (); |
|
| 137 | + foreach ($uids as $uid) { |
|
| 138 | 138 | $documentType = $documentTypeRepository->findByUid($uid); |
| 139 | 139 | $documentTypes[] = $documentType->getName(); |
| 140 | 140 | }; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | // add date filter |
| 145 | - $dateFilter = array(); |
|
| 145 | + $dateFilter = array (); |
|
| 146 | 146 | if ($searchResultsFilter['from']) { |
| 147 | 147 | |
| 148 | 148 | $from = date('d.m.Y', $searchResultsFilter['from']); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | if ($searchResultsFilter['till']) { |
| 156 | 156 | |
| 157 | - $till = date('d.m.Y', $searchResultsFilter['till']); |
|
| 157 | + $till = date('d.m.Y', $searchResultsFilter['till']); |
|
| 158 | 158 | $dateTime = $this->convertFormDate($till, true); |
| 159 | 159 | $dateFilter['lte'] = $dateTime->format('Y-m-d'); |
| 160 | 160 | unset($searchResultsFilter['till']); |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | if (isset($dateFilter['gte']) || isset($dateFilter['lte'])) { |
| 165 | 165 | |
| 166 | - $queryFilter['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $dateFilter)); |
|
| 166 | + $queryFilter['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $dateFilter)); |
|
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | foreach ($searchResultsFilter as $key => $qry) { |
| 171 | 171 | |
| 172 | - if(!empty($qry)) { |
|
| 173 | - $queryFilter['body']['query']['bool']['must'][] = array('match' => array($key => $qry)); |
|
| 172 | + if (!empty($qry)) { |
|
| 173 | + $queryFilter['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry)); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // document must be active |
| 181 | - if($showDeleted == false) { |
|
| 181 | + if ($showDeleted == false) { |
|
| 182 | 182 | |
| 183 | 183 | // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
| 184 | 184 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\'); |
| 237 | 237 | $string = preg_replace_callback( |
| 238 | 238 | '/([' . $luceneReservedCharacters . '])/', |
| 239 | - function ($matches) { |
|
| 239 | + function($matches) { |
|
| 240 | 240 | return '\\' . $matches[0]; |
| 241 | 241 | }, |
| 242 | 242 | $string |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function access() { |
| 32 | 32 | $registry = GeneralUtility::makeInstance(Registry::class); |
| 33 | - $version = $registry->get('tx_dpf','updatescript-'.self::VERSION); |
|
| 33 | + $version = $registry->get('tx_dpf', 'updatescript-' . self::VERSION); |
|
| 34 | 34 | |
| 35 | 35 | // If the version has already been registered in the table sys_register the updatscript will be blocked. |
| 36 | 36 | if ($version) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function main() { |
| 44 | 44 | // This script registers itself into the sys_registry table to prevent a re-run with the same version number. |
| 45 | 45 | $registry = GeneralUtility::makeInstance(Registry::class); |
| 46 | - $version = $registry->get('tx_dpf','updatescript-'.self::VERSION); |
|
| 46 | + $version = $registry->get('tx_dpf', 'updatescript-' . self::VERSION); |
|
| 47 | 47 | if ($version) { |
| 48 | 48 | return FALSE; |
| 49 | 49 | } else { |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | (new UpdateVirtualType)->execute(); |
| 56 | 56 | //$GLOBALS['TYPO3_DB']->sql_query("update tx_dpf_domain_model_document set creator = owner"); |
| 57 | 57 | } catch (\Throwable $throwable) { |
| 58 | - return "Error while updating the extension: ".($throwable->getMessage()); |
|
| 58 | + return "Error while updating the extension: " . ($throwable->getMessage()); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $registry->set('tx_dpf','updatescript-'.self::VERSION,TRUE); |
|
| 61 | + $registry->set('tx_dpf', 'updatescript-' . self::VERSION, TRUE); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | return "The extension has been successfully updated."; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | foreach ($repository->crossClientFindAll() as $record) { |
| 124 | 124 | if ($record['backend_only']) { |
| 125 | 125 | $recordObject = $repository->findByUid($record['uid']); |
| 126 | - $recordObject->setAccessRestrictionRoles(array(Security::ROLE_LIBRARIAN, Security::ROLE_RESEARCHER)); |
|
| 126 | + $recordObject->setAccessRestrictionRoles(array (Security::ROLE_LIBRARIAN, Security::ROLE_RESEARCHER)); |
|
| 127 | 127 | $repository->update($recordObject); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -86,28 +86,28 @@ |
||
| 86 | 86 | ), |
| 87 | 87 | ) |
| 88 | 88 | ), |
| 89 | - 'fis_pers_id' => array( |
|
| 89 | + 'fis_pers_id' => array ( |
|
| 90 | 90 | 'exclude' => 0, |
| 91 | 91 | 'label' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.fis_pers_id', |
| 92 | - 'config' => array( |
|
| 92 | + 'config' => array ( |
|
| 93 | 93 | 'type' => 'input', |
| 94 | 94 | 'size' => '30', |
| 95 | 95 | 'eval' => 'trim', |
| 96 | 96 | ), |
| 97 | 97 | ), |
| 98 | - 'orga_name' => array( |
|
| 98 | + 'orga_name' => array ( |
|
| 99 | 99 | 'exclude' => 0, |
| 100 | 100 | 'label' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.orga_name', |
| 101 | - 'config' => array( |
|
| 101 | + 'config' => array ( |
|
| 102 | 102 | 'type' => 'input', |
| 103 | 103 | 'size' => '30', |
| 104 | 104 | 'eval' => 'trim', |
| 105 | 105 | ), |
| 106 | 106 | ), |
| 107 | - 'api_token' => array( |
|
| 107 | + 'api_token' => array ( |
|
| 108 | 108 | 'exclude' => 0, |
| 109 | 109 | 'label' => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.api_token', |
| 110 | - 'config' => array( |
|
| 110 | + 'config' => array ( |
|
| 111 | 111 | 'type' => 'input', |
| 112 | 112 | 'size' => '30', |
| 113 | 113 | 'eval' => 'trim', |