@@ -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 |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | case Security::ROLE_RESEARCHER: |
| 45 | 45 | $query->matching( |
| 46 | 46 | $query->logicalAnd( |
| 47 | - array( |
|
| 47 | + array ( |
|
| 48 | 48 | $query->equals('suggestion', true), |
| 49 | 49 | $query->equals('creator', $creatorUid) |
| 50 | 50 | ) |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $query = $this->createQuery(); |
| 65 | 65 | |
| 66 | - $constraints = array( |
|
| 66 | + $constraints = array ( |
|
| 67 | 67 | $query->logicalNot($query->equals('object_identifier', '')), |
| 68 | 68 | $query->logicalNot($query->equals('object_identifier', NULL))); |
| 69 | 69 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $result = $query->execute(); |
| 83 | 83 | |
| 84 | - $objectIdentifiers = array(); |
|
| 84 | + $objectIdentifiers = array (); |
|
| 85 | 85 | |
| 86 | 86 | foreach ($result as $document) { |
| 87 | 87 | $objectIdentifiers[$document->getObjectIdentifier()] = $document->getObjectIdentifier(); |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | $query = $this->createQuery(); |
| 102 | 102 | $query->getQuerySettings()->setRespectStoragePage(FALSE); |
| 103 | 103 | |
| 104 | - $constraints = array(); |
|
| 105 | - $constraints[] = $query->equals('process_number', ''); |
|
| 106 | - $constraints[] = $query->equals('process_number', NULL); |
|
| 104 | + $constraints = array (); |
|
| 105 | + $constraints[] = $query->equals('process_number', ''); |
|
| 106 | + $constraints[] = $query->equals('process_number', NULL); |
|
| 107 | 107 | |
| 108 | 108 | if (count($constraints)) { |
| 109 | 109 | $query->matching( |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $query = $this->createQuery(); |
| 129 | 129 | |
| 130 | - $dateTimeObj= new \DateTime(); |
|
| 131 | - $dateTimeObj->sub(new \DateInterval("PT".$timeout."S")); |
|
| 130 | + $dateTimeObj = new \DateTime(); |
|
| 131 | + $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S")); |
|
| 132 | 132 | |
| 133 | - $constraints = array(); |
|
| 133 | + $constraints = array (); |
|
| 134 | 134 | $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp()); |
| 135 | 135 | |
| 136 | 136 | $query->matching( |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | $query = $this->createQuery(); |
| 155 | 155 | |
| 156 | - $dateTimeObj= new \DateTime(); |
|
| 157 | - $dateTimeObj->sub(new \DateInterval("PT".$timeout."S")); |
|
| 156 | + $dateTimeObj = new \DateTime(); |
|
| 157 | + $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S")); |
|
| 158 | 158 | |
| 159 | - $constraints = array(); |
|
| 159 | + $constraints = array (); |
|
| 160 | 160 | $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp()); |
| 161 | 161 | |
| 162 | 162 | $query->matching( |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | { |
| 179 | 179 | $query = $this->createQuery(); |
| 180 | 180 | |
| 181 | - $constraints = array( |
|
| 181 | + $constraints = array ( |
|
| 182 | 182 | $query->equals('object_identifier', $objectIdentifier), |
| 183 | 183 | $query->logicalNot($query->equals('temporary', TRUE)), |
| 184 | 184 | $query->logicalNot($query->equals('suggestion', TRUE)) |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | |
| 278 | 278 | $query = $this->createQuery(); |
| 279 | - $query->statement( "update tx_dpf_domain_model_document set creator = owner"); |
|
| 279 | + $query->statement("update tx_dpf_domain_model_document set creator = owner"); |
|
| 280 | 280 | $query->execute(); |
| 281 | 281 | |
| 282 | 282 | } |
@@ -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."); |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $xpath = $this->getModsXpath(); |
| 78 | 78 | |
| 79 | - $authorNode = $xpath->query('/mods:mods/mods:name[mods:role/mods:roleTerm[@type="code"]="'.$role.'"]'); |
|
| 79 | + $authorNode = $xpath->query('/mods:mods/mods:name[mods:role/mods:roleTerm[@type="code"]="' . $role . '"]'); |
|
| 80 | 80 | |
| 81 | - $authors = array(); |
|
| 81 | + $authors = array (); |
|
| 82 | 82 | |
| 83 | 83 | foreach ($authorNode as $key => $author) { |
| 84 | 84 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | $givenNodes = $xpath->query('mods:namePart[@type="given"]', $author); |
| 88 | 88 | |
| 89 | - $name = array(); |
|
| 89 | + $name = array (); |
|
| 90 | 90 | |
| 91 | 91 | if ($givenNodes->length > 0) { |
| 92 | 92 | $name[] = $givenNodes->item(0)->nodeValue; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | public function getOriginalSourceTitle() |
| 157 | 157 | { |
| 158 | - $node= $this->getModsXpath()->query('/mods:mods/mods:relatedItem[@type="original"]/mods:titleInfo/mods:title'); |
|
| 158 | + $node = $this->getModsXpath()->query('/mods:mods/mods:relatedItem[@type="original"]/mods:titleInfo/mods:title'); |
|
| 159 | 159 | if ($node->length > 0) { |
| 160 | 160 | return $node->item(0)->nodeValue; |
| 161 | 161 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | $node = $this->getSlubXpath()->query("/slub:info/slub:validation/slub:validated"); |
| 118 | 118 | $value = $node->item(0)->nodeValue; |
| 119 | - return ($value === 'true')? true : false; |
|
| 119 | + return ($value === 'true') ? true : false; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $validation = $this->slubDom->createElement('slub:validation'); |
| 138 | 138 | |
| 139 | 139 | $validated = $this->slubDom->createElement('slub:validated'); |
| 140 | - $validated->nodeValue = ($validated)? 'true' : 'false'; |
|
| 140 | + $validated->nodeValue = ($validated) ? 'true' : 'false'; |
|
| 141 | 141 | |
| 142 | 142 | $validation->appendChild($validated); |
| 143 | 143 | |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $node = $this->getSlubXpath()->query("/slub:info/slub:note"); |
| 172 | 172 | |
| 173 | - $notes = array(); |
|
| 173 | + $notes = array (); |
|
| 174 | 174 | |
| 175 | - for ($i=0; $i < $node->length; $i++) |
|
| 175 | + for ($i = 0; $i < $node->length; $i++) |
|
| 176 | 176 | { |
| 177 | 177 | $notes[] = $node->item($i)->nodeValue; |
| 178 | 178 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function render($documentCount, $currentPage, $itemsPerPage) |
| 26 | 26 | { |
| 27 | - $from = ($currentPage > 1)? (($currentPage-1) * $itemsPerPage) + 1 : $currentPage; |
|
| 27 | + $from = ($currentPage > 1) ? (($currentPage - 1) * $itemsPerPage) + 1 : $currentPage; |
|
| 28 | 28 | |
| 29 | 29 | if ($currentPage >= 1) { |
| 30 | 30 | if ($currentPage * $itemsPerPage > $documentCount) { |