@@ -377,7 +377,7 @@ |
||
| 377 | 377 | if ($this->accessRestrictionRoles) { |
| 378 | 378 | return array_map('trim', explode(',', $this->accessRestrictionRoles)); |
| 379 | 379 | } else { |
| 380 | - return array(); |
|
| 380 | + return array (); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * MetadataGroup |
| 19 | 19 | */ |
| 20 | -class MetadataGroup extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements MetadataMandatoryInterface |
|
| 21 | -{ |
|
| 20 | +class MetadataGroup extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements MetadataMandatoryInterface { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * name |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | /** |
| 115 | 114 | * __construct |
| 116 | 115 | */ |
| 117 | - public function __construct() |
|
| 118 | - { |
|
| 116 | + public function __construct() { |
|
| 119 | 117 | //Do not remove the next line: It would break the functionality |
| 120 | 118 | $this->initStorageObjects(); |
| 121 | 119 | } |
@@ -125,8 +123,7 @@ discard block |
||
| 125 | 123 | * |
| 126 | 124 | * @return void |
| 127 | 125 | */ |
| 128 | - protected function initStorageObjects() |
|
| 129 | - { |
|
| 126 | + protected function initStorageObjects() { |
|
| 130 | 127 | $this->metadataObject = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
| 131 | 128 | } |
| 132 | 129 | |
@@ -135,8 +132,7 @@ discard block |
||
| 135 | 132 | * |
| 136 | 133 | * @return string $name |
| 137 | 134 | */ |
| 138 | - public function getName() |
|
| 139 | - { |
|
| 135 | + public function getName() { |
|
| 140 | 136 | return $this->name; |
| 141 | 137 | } |
| 142 | 138 | |
@@ -146,8 +142,7 @@ discard block |
||
| 146 | 142 | * @param string $name |
| 147 | 143 | * @return void |
| 148 | 144 | */ |
| 149 | - public function setName($name) |
|
| 150 | - { |
|
| 145 | + public function setName($name) { |
|
| 151 | 146 | $this->name = $name; |
| 152 | 147 | } |
| 153 | 148 | |
@@ -156,8 +151,7 @@ discard block |
||
| 156 | 151 | * |
| 157 | 152 | * @return string $displayName |
| 158 | 153 | */ |
| 159 | - public function getDisplayName() |
|
| 160 | - { |
|
| 154 | + public function getDisplayName() { |
|
| 161 | 155 | return $this->displayName; |
| 162 | 156 | } |
| 163 | 157 | |
@@ -167,8 +161,7 @@ discard block |
||
| 167 | 161 | * @param string $displayName |
| 168 | 162 | * @return void |
| 169 | 163 | */ |
| 170 | - public function setDisplayName($displayName) |
|
| 171 | - { |
|
| 164 | + public function setDisplayName($displayName) { |
|
| 172 | 165 | $this->displayName = $displayName; |
| 173 | 166 | } |
| 174 | 167 | |
@@ -177,8 +170,7 @@ discard block |
||
| 177 | 170 | * |
| 178 | 171 | * @return string $mandatory |
| 179 | 172 | */ |
| 180 | - public function getMandatory() |
|
| 181 | - { |
|
| 173 | + public function getMandatory() { |
|
| 182 | 174 | return $this->mandatory; |
| 183 | 175 | } |
| 184 | 176 | |
@@ -188,8 +180,7 @@ discard block |
||
| 188 | 180 | * @param string $mandatory |
| 189 | 181 | * @return void |
| 190 | 182 | */ |
| 191 | - public function setMandatory($mandatory) |
|
| 192 | - { |
|
| 183 | + public function setMandatory($mandatory) { |
|
| 193 | 184 | $this->mandatory = $mandatory; |
| 194 | 185 | } |
| 195 | 186 | |
@@ -198,8 +189,7 @@ discard block |
||
| 198 | 189 | * |
| 199 | 190 | * @return string $mapping |
| 200 | 191 | */ |
| 201 | - public function getMapping() |
|
| 202 | - { |
|
| 192 | + public function getMapping() { |
|
| 203 | 193 | return $this->mapping; |
| 204 | 194 | } |
| 205 | 195 | |
@@ -209,8 +199,7 @@ discard block |
||
| 209 | 199 | * @param string $mapping |
| 210 | 200 | * @return void |
| 211 | 201 | */ |
| 212 | - public function setMapping($mapping) |
|
| 213 | - { |
|
| 202 | + public function setMapping($mapping) { |
|
| 214 | 203 | $this->mapping = $mapping; |
| 215 | 204 | } |
| 216 | 205 | |
@@ -219,8 +208,7 @@ discard block |
||
| 219 | 208 | * |
| 220 | 209 | * @return string $mappingForReading |
| 221 | 210 | */ |
| 222 | - public function getMappingForReading() |
|
| 223 | - { |
|
| 211 | + public function getMappingForReading() { |
|
| 224 | 212 | return $this->mappingForReading; |
| 225 | 213 | } |
| 226 | 214 | |
@@ -230,8 +218,7 @@ discard block |
||
| 230 | 218 | * @param string $mappingForReading |
| 231 | 219 | * @return void |
| 232 | 220 | */ |
| 233 | - public function setMappingForReading($mappingForReading) |
|
| 234 | - { |
|
| 221 | + public function setMappingForReading($mappingForReading) { |
|
| 235 | 222 | $this->mappingForReading = $mappingForReading; |
| 236 | 223 | } |
| 237 | 224 | |
@@ -240,8 +227,7 @@ discard block |
||
| 240 | 227 | * |
| 241 | 228 | * @return bool |
| 242 | 229 | */ |
| 243 | - public function hasMappingForReading() |
|
| 244 | - { |
|
| 230 | + public function hasMappingForReading() { |
|
| 245 | 231 | $mapping = trim($this->mappingForReading); |
| 246 | 232 | return !empty($mapping); |
| 247 | 233 | } |
@@ -252,8 +238,7 @@ discard block |
||
| 252 | 238 | * @param $mapping |
| 253 | 239 | * @return string $relativeMapping |
| 254 | 240 | */ |
| 255 | - protected function relativeMapping($mapping) |
|
| 256 | - { |
|
| 241 | + protected function relativeMapping($mapping) { |
|
| 257 | 242 | return trim($mapping, " /"); |
| 258 | 243 | } |
| 259 | 244 | |
@@ -262,8 +247,7 @@ discard block |
||
| 262 | 247 | * |
| 263 | 248 | * @return string $relativeMappingForWriting |
| 264 | 249 | */ |
| 265 | - public function getRelativeMapping() |
|
| 266 | - { |
|
| 250 | + public function getRelativeMapping() { |
|
| 267 | 251 | return $this->relativeMapping($this->mapping); |
| 268 | 252 | } |
| 269 | 253 | |
@@ -272,8 +256,7 @@ discard block |
||
| 272 | 256 | * |
| 273 | 257 | * @return string $relativeMappingForReading |
| 274 | 258 | */ |
| 275 | - public function getRelativeMappingForReading() |
|
| 276 | - { |
|
| 259 | + public function getRelativeMappingForReading() { |
|
| 277 | 260 | return $this->relativeMapping($this->mappingForReading); |
| 278 | 261 | } |
| 279 | 262 | |
@@ -282,8 +265,7 @@ discard block |
||
| 282 | 265 | * |
| 283 | 266 | * @return string $absoluteMappingForWriting |
| 284 | 267 | */ |
| 285 | - public function getAbsoluteMapping() |
|
| 286 | - { |
|
| 268 | + public function getAbsoluteMapping() { |
|
| 287 | 269 | return "/data/" . $this->getRelativeMapping(); |
| 288 | 270 | } |
| 289 | 271 | |
@@ -292,8 +274,7 @@ discard block |
||
| 292 | 274 | * |
| 293 | 275 | * @return string $absoluteMappingForReading |
| 294 | 276 | */ |
| 295 | - public function getAbsoluteMappingForReading() |
|
| 296 | - { |
|
| 277 | + public function getAbsoluteMappingForReading() { |
|
| 297 | 278 | return "/data/" . $this->getRelativeMappingForReading(); |
| 298 | 279 | } |
| 299 | 280 | |
@@ -302,8 +283,7 @@ discard block |
||
| 302 | 283 | * |
| 303 | 284 | * @return string $modsExtensionMapping |
| 304 | 285 | */ |
| 305 | - public function getModsExtensionMapping() |
|
| 306 | - { |
|
| 286 | + public function getModsExtensionMapping() { |
|
| 307 | 287 | return $this->modsExtensionMapping; |
| 308 | 288 | } |
| 309 | 289 | |
@@ -313,8 +293,7 @@ discard block |
||
| 313 | 293 | * @param string $modsExtensionMapping |
| 314 | 294 | * @return void |
| 315 | 295 | */ |
| 316 | - public function setModsExtensionMapping($modsExtensionMapping) |
|
| 317 | - { |
|
| 296 | + public function setModsExtensionMapping($modsExtensionMapping) { |
|
| 318 | 297 | $this->modsExtensionMapping = $modsExtensionMapping; |
| 319 | 298 | } |
| 320 | 299 | |
@@ -323,8 +302,7 @@ discard block |
||
| 323 | 302 | * |
| 324 | 303 | * @return string $relativeModsExtensionMapping |
| 325 | 304 | */ |
| 326 | - public function getRelativeModsExtensionMapping() |
|
| 327 | - { |
|
| 305 | + public function getRelativeModsExtensionMapping() { |
|
| 328 | 306 | // $modsRegExp = "/^.*?mods:mods/i"; |
| 329 | 307 | // $mapping = preg_replace($modsRegExp, "", $this->modsExtensionMapping); |
| 330 | 308 | return trim($this->modsExtensionMapping, " /"); |
@@ -335,8 +313,7 @@ discard block |
||
| 335 | 313 | * |
| 336 | 314 | * @return string $absoluteModsExtensionMapping |
| 337 | 315 | */ |
| 338 | - public function getAbsoluteModsExtensionMapping() |
|
| 339 | - { |
|
| 316 | + public function getAbsoluteModsExtensionMapping() { |
|
| 340 | 317 | return "/data/" . $this->getRelativeModsExtensionMapping(); |
| 341 | 318 | } |
| 342 | 319 | |
@@ -346,8 +323,7 @@ discard block |
||
| 346 | 323 | * @param string $modsExtensionReference |
| 347 | 324 | * @return void |
| 348 | 325 | */ |
| 349 | - public function setModsExtensionReference($modsExtensionReference) |
|
| 350 | - { |
|
| 326 | + public function setModsExtensionReference($modsExtensionReference) { |
|
| 351 | 327 | $this->modsExtensionReference = $modsExtensionReference; |
| 352 | 328 | } |
| 353 | 329 | |
@@ -356,8 +332,7 @@ discard block |
||
| 356 | 332 | * |
| 357 | 333 | * @return string $modsExtensionReference |
| 358 | 334 | */ |
| 359 | - public function getModsExtensionReference() |
|
| 360 | - { |
|
| 335 | + public function getModsExtensionReference() { |
|
| 361 | 336 | return $this->modsExtensionReference; |
| 362 | 337 | } |
| 363 | 338 | |
@@ -366,8 +341,7 @@ discard block |
||
| 366 | 341 | * |
| 367 | 342 | * @return integer $maxIteration |
| 368 | 343 | */ |
| 369 | - public function getMaxIteration() |
|
| 370 | - { |
|
| 344 | + public function getMaxIteration() { |
|
| 371 | 345 | return $this->maxIteration; |
| 372 | 346 | } |
| 373 | 347 | |
@@ -377,8 +351,7 @@ discard block |
||
| 377 | 351 | * @param integer $maxIteration |
| 378 | 352 | * @return void |
| 379 | 353 | */ |
| 380 | - public function setMaxIteration($maxIteration) |
|
| 381 | - { |
|
| 354 | + public function setMaxIteration($maxIteration) { |
|
| 382 | 355 | $this->maxIteration = $maxIteration; |
| 383 | 356 | } |
| 384 | 357 | |
@@ -388,8 +361,7 @@ discard block |
||
| 388 | 361 | * @param \EWW\Dpf\Domain\Model\MetadataObject $metadataObject |
| 389 | 362 | * @return void |
| 390 | 363 | */ |
| 391 | - public function addMetadataObject(\EWW\Dpf\Domain\Model\MetadataObject $metadataObject) |
|
| 392 | - { |
|
| 364 | + public function addMetadataObject(\EWW\Dpf\Domain\Model\MetadataObject $metadataObject) { |
|
| 393 | 365 | $this->metadataObject->attach($metadataObject); |
| 394 | 366 | } |
| 395 | 367 | |
@@ -399,8 +371,7 @@ discard block |
||
| 399 | 371 | * @param \EWW\Dpf\Domain\Model\MetadataObject $metadataObjectToRemove The MetadataObject to be removed |
| 400 | 372 | * @return void |
| 401 | 373 | */ |
| 402 | - public function removeMetadataObject(\EWW\Dpf\Domain\Model\MetadataObject $metadataObjectToRemove) |
|
| 403 | - { |
|
| 374 | + public function removeMetadataObject(\EWW\Dpf\Domain\Model\MetadataObject $metadataObjectToRemove) { |
|
| 404 | 375 | $this->metadataObject->detach($metadataObjectToRemove); |
| 405 | 376 | } |
| 406 | 377 | |
@@ -409,8 +380,7 @@ discard block |
||
| 409 | 380 | * |
| 410 | 381 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\MetadataObject> $metadataObject |
| 411 | 382 | */ |
| 412 | - public function getMetadataObject() |
|
| 413 | - { |
|
| 383 | + public function getMetadataObject() { |
|
| 414 | 384 | return $this->metadataObject; |
| 415 | 385 | } |
| 416 | 386 | |
@@ -420,8 +390,7 @@ discard block |
||
| 420 | 390 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\MetadataObject> $metadataObject |
| 421 | 391 | * @return void |
| 422 | 392 | */ |
| 423 | - public function setMetadataObject(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $metadataObject) |
|
| 424 | - { |
|
| 393 | + public function setMetadataObject(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $metadataObject) { |
|
| 425 | 394 | $this->metadataObject = $metadataObject; |
| 426 | 395 | } |
| 427 | 396 | |
@@ -430,8 +399,7 @@ discard block |
||
| 430 | 399 | * |
| 431 | 400 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\MetadataObject> $metadataObject |
| 432 | 401 | */ |
| 433 | - public function getChildren() |
|
| 434 | - { |
|
| 402 | + public function getChildren() { |
|
| 435 | 403 | return $this->getMetadataObject(); |
| 436 | 404 | } |
| 437 | 405 | |
@@ -440,8 +408,7 @@ discard block |
||
| 440 | 408 | * |
| 441 | 409 | * @return array $accessRestrictionRoles |
| 442 | 410 | */ |
| 443 | - public function getAccessRestrictionRoles() |
|
| 444 | - { |
|
| 411 | + public function getAccessRestrictionRoles() { |
|
| 445 | 412 | if ($this->accessRestrictionRoles) { |
| 446 | 413 | return array_map('trim', explode(',', $this->accessRestrictionRoles)); |
| 447 | 414 | } else { |
@@ -455,8 +422,7 @@ discard block |
||
| 455 | 422 | * @param array $accessRestrictionRoles |
| 456 | 423 | * @return void |
| 457 | 424 | */ |
| 458 | - public function setAccessRestrictionRoles($accessRestrictionRoles) |
|
| 459 | - { |
|
| 425 | + public function setAccessRestrictionRoles($accessRestrictionRoles) { |
|
| 460 | 426 | $this->accessRestrictionRoles = implode(',', $accessRestrictionRoles); |
| 461 | 427 | } |
| 462 | 428 | |
@@ -465,8 +431,7 @@ discard block |
||
| 465 | 431 | * |
| 466 | 432 | * @return string $infoText |
| 467 | 433 | */ |
| 468 | - public function getInfoText() |
|
| 469 | - { |
|
| 434 | + public function getInfoText() { |
|
| 470 | 435 | return $this->infoText; |
| 471 | 436 | } |
| 472 | 437 | |
@@ -476,8 +441,7 @@ discard block |
||
| 476 | 441 | * @param string $infoText |
| 477 | 442 | * @return void |
| 478 | 443 | */ |
| 479 | - public function setInfoText($infoText) |
|
| 480 | - { |
|
| 444 | + public function setInfoText($infoText) { |
|
| 481 | 445 | $this->infoText = $infoText; |
| 482 | 446 | } |
| 483 | 447 | |
@@ -492,8 +456,7 @@ discard block |
||
| 492 | 456 | /** |
| 493 | 457 | * @param string $groupType |
| 494 | 458 | */ |
| 495 | - public function setGroupType(string $groupType) |
|
| 496 | - { |
|
| 459 | + public function setGroupType(string $groupType) { |
|
| 497 | 460 | $this->groupType = $groupType; |
| 498 | 461 | } |
| 499 | 462 | |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\MetadataObject> |
| 83 | 83 | * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") |
| 84 | 84 | */ |
| 85 | - protected $metadataObject = null; |
|
| 85 | + protected $metadataObject = NULL; |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * accessRestrictionRoles |
@@ -14,8 +14,7 @@ |
||
| 14 | 14 | * The TYPO3 project - inspiring people to share! |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -interface MetadataMandatoryInterface |
|
| 18 | -{ |
|
| 17 | +interface MetadataMandatoryInterface { |
|
| 19 | 18 | const MANDATORY = "1"; |
| 20 | 19 | const MANDATORY_FILE_ONLY = "FILE_ONLY"; |
| 21 | 20 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | protected function getFields() |
| 135 | 135 | { |
| 136 | 136 | |
| 137 | - $fields = array(); |
|
| 137 | + $fields = array (); |
|
| 138 | 138 | |
| 139 | 139 | if (is_array($this->formData['metadata'])) { |
| 140 | 140 | foreach ($this->formData['metadata'] as $key => $value) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | protected function getDeletedFiles() |
| 150 | 150 | { |
| 151 | - $deletedFiles = array(); |
|
| 151 | + $deletedFiles = array (); |
|
| 152 | 152 | |
| 153 | 153 | if (is_array($this->formData['deleteFile'])) { |
| 154 | 154 | foreach ($this->formData['deleteFile'] as $key => $value) { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); |
| 174 | 174 | $fullTextLabel = $frameworkConfiguration['settings']['defaultValue']['fullTextLabel']; |
| 175 | 175 | |
| 176 | - $newFiles = array(); |
|
| 176 | + $newFiles = array (); |
|
| 177 | 177 | |
| 178 | 178 | // Primary file |
| 179 | 179 | if ($this->formData['primaryFile'] && $this->formData['primaryFile']['error'] != UPLOAD_ERR_NO_FILE) { |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $documentForm->setComment($this->formData['comment']); |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - $documentData = array(); |
|
| 336 | + $documentData = array (); |
|
| 337 | 337 | |
| 338 | 338 | foreach ($fields as $field) { |
| 339 | 339 | $pageUid = $field->getPageUid(); |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | use EWW\Dpf\Domain\Model\File; |
| 18 | 18 | use TYPO3\CMS\Core\Core\Environment; |
| 19 | 19 | |
| 20 | -class FormDataReader |
|
| 21 | -{ |
|
| 20 | +class FormDataReader { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * documentTypeRepository |
@@ -111,8 +110,7 @@ discard block |
||
| 111 | 110 | */ |
| 112 | 111 | protected $uploadBaseUrl; |
| 113 | 112 | |
| 114 | - public function __construct() |
|
| 115 | - { |
|
| 113 | + public function __construct() { |
|
| 116 | 114 | |
| 117 | 115 | $uploadFileUrl = new \EWW\Dpf\Helper\UploadFileUrl; |
| 118 | 116 | |
@@ -126,14 +124,12 @@ discard block |
||
| 126 | 124 | * |
| 127 | 125 | * @param array $formData |
| 128 | 126 | */ |
| 129 | - public function setFormData($formData) |
|
| 130 | - { |
|
| 127 | + public function setFormData($formData) { |
|
| 131 | 128 | $this->formData = $formData; |
| 132 | 129 | $this->documentType = $this->documentTypeRepository->findByUid($formData['type']); |
| 133 | 130 | } |
| 134 | 131 | |
| 135 | - protected function getFields() |
|
| 136 | - { |
|
| 132 | + protected function getFields() { |
|
| 137 | 133 | |
| 138 | 134 | $fields = array(); |
| 139 | 135 | |
@@ -147,8 +143,7 @@ discard block |
||
| 147 | 143 | return $fields; |
| 148 | 144 | } |
| 149 | 145 | |
| 150 | - protected function getDeletedFiles() |
|
| 151 | - { |
|
| 146 | + protected function getDeletedFiles() { |
|
| 152 | 147 | $deletedFiles = array(); |
| 153 | 148 | |
| 154 | 149 | if (is_array($this->formData['deleteFile'])) { |
@@ -168,8 +163,7 @@ discard block |
||
| 168 | 163 | return $deletedFiles; |
| 169 | 164 | } |
| 170 | 165 | |
| 171 | - protected function getNewAndUpdatedFiles() |
|
| 172 | - { |
|
| 166 | + protected function getNewAndUpdatedFiles() { |
|
| 173 | 167 | |
| 174 | 168 | $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); |
| 175 | 169 | $fullTextLabel = $frameworkConfiguration['settings']['defaultValue']['fullTextLabel']; |
@@ -260,8 +254,7 @@ discard block |
||
| 260 | 254 | |
| 261 | 255 | } |
| 262 | 256 | |
| 263 | - public function uploadError() |
|
| 264 | - { |
|
| 257 | + public function uploadError() { |
|
| 265 | 258 | if ( |
| 266 | 259 | $this->formData['primaryFile'] && |
| 267 | 260 | $this->formData['primaryFile']['error'] != UPLOAD_ERR_OK && |
@@ -281,8 +274,7 @@ discard block |
||
| 281 | 274 | return false; |
| 282 | 275 | } |
| 283 | 276 | |
| 284 | - protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) |
|
| 285 | - { |
|
| 277 | + protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) { |
|
| 286 | 278 | |
| 287 | 279 | if (empty($file)) { |
| 288 | 280 | $file = $this->objectManager->get(File::class); |
@@ -318,8 +310,7 @@ discard block |
||
| 318 | 310 | return $file; |
| 319 | 311 | } |
| 320 | 312 | |
| 321 | - public function getDocumentForm() |
|
| 322 | - { |
|
| 313 | + public function getDocumentForm() { |
|
| 323 | 314 | |
| 324 | 315 | $fields = $this->getFields(); |
| 325 | 316 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 27 | 27 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 28 | 28 | */ |
| 29 | - protected $documentTypeRepository = null; |
|
| 29 | + protected $documentTypeRepository = NULL; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * metadataPageRepository |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @var \EWW\Dpf\Domain\Repository\MetadataPageRepository |
| 35 | 35 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 36 | 36 | */ |
| 37 | - protected $metadataPageRepository = null; |
|
| 37 | + protected $metadataPageRepository = NULL; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * metadataGroupRepository |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository |
| 43 | 43 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 44 | 44 | */ |
| 45 | - protected $metadataGroupRepository = null; |
|
| 45 | + protected $metadataGroupRepository = NULL; |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * metadataObjectRepository |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository |
| 51 | 51 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 52 | 52 | */ |
| 53 | - protected $metadataObjectRepository = null; |
|
| 53 | + protected $metadataObjectRepository = NULL; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * fileRepository |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @var \EWW\Dpf\Domain\Repository\FileRepository |
| 59 | 59 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 60 | 60 | */ |
| 61 | - protected $fileRepository = null; |
|
| 61 | + protected $fileRepository = NULL; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * documentRepository |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @var \EWW\Dpf\Domain\Repository\DocumentRepository |
| 67 | 67 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 68 | 68 | */ |
| 69 | - protected $documentRepository = null; |
|
| 69 | + protected $documentRepository = NULL; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * objectManager |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | if ($this->formData['primaryFile'] && $this->formData['primaryFile']['error'] != UPLOAD_ERR_NO_FILE) { |
| 181 | 181 | |
| 182 | 182 | // Use the existing file entry |
| 183 | - $file = null; |
|
| 183 | + $file = NULL; |
|
| 184 | 184 | $document = $this->documentRepository->findByUid($this->formData['documentUid']); |
| 185 | 185 | if ($document) { |
| 186 | 186 | $file = $this->fileRepository->getPrimaryFileByDocument($document); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $newPrimaryFile = $this->getUploadedFile($this->formData['primaryFile'], true, $file); |
|
| 189 | + $newPrimaryFile = $this->getUploadedFile($this->formData['primaryFile'], TRUE, $file); |
|
| 190 | 190 | $newPrimaryFile->setLabel($fullTextLabel); |
| 191 | 191 | |
| 192 | 192 | $newFiles[] = $newPrimaryFile; |
@@ -267,28 +267,28 @@ discard block |
||
| 267 | 267 | $this->formData['primaryFile']['error'] != UPLOAD_ERR_OK && |
| 268 | 268 | $this->formData['primaryFile']['error'] != UPLOAD_ERR_NO_FILE |
| 269 | 269 | ) { |
| 270 | - return true; |
|
| 270 | + return TRUE; |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | if (is_array($this->formData['secondaryFiles'])) { |
| 274 | 274 | foreach ($this->formData['secondaryFiles'] as $tmpFile) { |
| 275 | 275 | if ($tmpFile['error'] != UPLOAD_ERR_OK && $tmpFile['error'] != UPLOAD_ERR_NO_FILE) { |
| 276 | - return true; |
|
| 276 | + return TRUE; |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - return false; |
|
| 281 | + return FALSE; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - protected function getUploadedFile($tmpFile, $primary = false, \EWW\Dpf\Domain\Model\File $file = null) |
|
| 284 | + protected function getUploadedFile($tmpFile, $primary = FALSE, \EWW\Dpf\Domain\Model\File $file = NULL) |
|
| 285 | 285 | { |
| 286 | 286 | |
| 287 | 287 | if (empty($file)) { |
| 288 | 288 | $file = $this->objectManager->get(File::class); |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $fileName = uniqid(time(), true); |
|
| 291 | + $fileName = uniqid(time(), TRUE); |
|
| 292 | 292 | |
| 293 | 293 | \TYPO3\CMS\Core\Utility\GeneralUtility::upload_copy_move($tmpFile['tmp_name'], $this->uploadPath . $fileName); |
| 294 | 294 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function __construct() |
| 66 | 66 | { |
| 67 | - $this->workflow = DocumentWorkflow::getWorkflow(); |
|
| 67 | + $this->workflow = DocumentWorkflow::getWorkflow(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) && |
| 310 | 310 | $document->getCreator() === $this->security->getUser()->getUid() |
| 311 | 311 | ) { |
| 312 | - return TRUE; |
|
| 312 | + return TRUE; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | return FALSE; |
@@ -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 | |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | use TYPO3\CMS\Core\Log\LogManager; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | -class DocumentVoter extends Voter |
|
| 26 | -{ |
|
| 25 | +class DocumentVoter extends Voter { |
|
| 27 | 26 | const CREATE = "DOCUMENT_CREATE"; |
| 28 | 27 | const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER"; |
| 29 | 28 | const UPDATE = "DOCUMENT_UPDATE"; |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | */ |
| 65 | 64 | protected $workflow; |
| 66 | 65 | |
| 67 | - public function __construct() |
|
| 68 | - { |
|
| 66 | + public function __construct() { |
|
| 69 | 67 | $this->workflow = DocumentWorkflow::getWorkflow(); |
| 70 | 68 | } |
| 71 | 69 | |
@@ -75,8 +73,7 @@ discard block |
||
| 75 | 73 | * |
| 76 | 74 | * @return array |
| 77 | 75 | */ |
| 78 | - protected static function getAttributes() |
|
| 79 | - { |
|
| 76 | + protected static function getAttributes() { |
|
| 80 | 77 | return array( |
| 81 | 78 | self::CREATE, |
| 82 | 79 | self::CREATE_REGISTER, |
@@ -111,8 +108,7 @@ discard block |
||
| 111 | 108 | * @param mixed $subject |
| 112 | 109 | * @return mixed |
| 113 | 110 | */ |
| 114 | - public static function supports($attribute, $subject = NULL) |
|
| 115 | - { |
|
| 111 | + public static function supports($attribute, $subject = NULL) { |
|
| 116 | 112 | if (!in_array($attribute, self::getAttributes())) { |
| 117 | 113 | return FALSE; |
| 118 | 114 | } |
@@ -131,8 +127,7 @@ discard block |
||
| 131 | 127 | * @param mixed $subject |
| 132 | 128 | * @return mixed |
| 133 | 129 | */ |
| 134 | - public function voteOnAttribute($attribute, $subject = NULL) |
|
| 135 | - { |
|
| 130 | + public function voteOnAttribute($attribute, $subject = NULL) { |
|
| 136 | 131 | if (!$subject instanceof Document) { |
| 137 | 132 | return FALSE; |
| 138 | 133 | } |
@@ -242,8 +237,7 @@ discard block |
||
| 242 | 237 | /** |
| 243 | 238 | * @return bool |
| 244 | 239 | */ |
| 245 | - protected function defaultAccess() |
|
| 246 | - { |
|
| 240 | + protected function defaultAccess() { |
|
| 247 | 241 | return ( |
| 248 | 242 | $this->security->getUserRole() === Security::ROLE_LIBRARIAN || |
| 249 | 243 | $this->security->getUserRole() === Security::ROLE_RESEARCHER |
@@ -253,8 +247,7 @@ discard block |
||
| 253 | 247 | /** |
| 254 | 248 | * @return bool |
| 255 | 249 | */ |
| 256 | - protected function librarianOnly() |
|
| 257 | - { |
|
| 250 | + protected function librarianOnly() { |
|
| 258 | 251 | return $this->security->getUserRole() === Security::ROLE_LIBRARIAN; |
| 259 | 252 | } |
| 260 | 253 | |
@@ -262,8 +255,7 @@ discard block |
||
| 262 | 255 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 263 | 256 | * @return bool |
| 264 | 257 | */ |
| 265 | - protected function canDiscard($document) |
|
| 266 | - { |
|
| 258 | + protected function canDiscard($document) { |
|
| 267 | 259 | if ($this->isDocumentLocked($document)) { |
| 268 | 260 | return FALSE; |
| 269 | 261 | } |
@@ -286,8 +278,7 @@ discard block |
||
| 286 | 278 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 287 | 279 | * @return bool |
| 288 | 280 | */ |
| 289 | - protected function canShowDetails($document) |
|
| 290 | - { |
|
| 281 | + protected function canShowDetails($document) { |
|
| 291 | 282 | if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 292 | 283 | return ( |
| 293 | 284 | $document->getState() !== DocumentWorkflow::STATE_NEW_NONE || |
@@ -313,8 +304,7 @@ discard block |
||
| 313 | 304 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 314 | 305 | * @return bool |
| 315 | 306 | */ |
| 316 | - protected function canRegister($document) |
|
| 317 | - { |
|
| 307 | + protected function canRegister($document) { |
|
| 318 | 308 | if ( |
| 319 | 309 | $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) && |
| 320 | 310 | $document->getCreator() === $this->security->getUser()->getUid() |
@@ -330,8 +320,7 @@ discard block |
||
| 330 | 320 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 331 | 321 | * @return bool |
| 332 | 322 | */ |
| 333 | - protected function canReleasePublish($document) |
|
| 334 | - { |
|
| 323 | + protected function canReleasePublish($document) { |
|
| 335 | 324 | if ($this->isDocumentLocked($document)) { |
| 336 | 325 | return FALSE; |
| 337 | 326 | } |
@@ -349,8 +338,7 @@ discard block |
||
| 349 | 338 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 350 | 339 | * @return bool |
| 351 | 340 | */ |
| 352 | - protected function canReleaseActivate($document) |
|
| 353 | - { |
|
| 341 | + protected function canReleaseActivate($document) { |
|
| 354 | 342 | if ($this->isDocumentLocked($document)) { |
| 355 | 343 | return FALSE; |
| 356 | 344 | } |
@@ -367,8 +355,7 @@ discard block |
||
| 367 | 355 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 368 | 356 | * @return bool |
| 369 | 357 | */ |
| 370 | - protected function canDeleteLocally($document) |
|
| 371 | - { |
|
| 358 | + protected function canDeleteLocally($document) { |
|
| 372 | 359 | if ($this->isDocumentLocked($document)) { |
| 373 | 360 | return FALSE; |
| 374 | 361 | } |
@@ -393,8 +380,7 @@ discard block |
||
| 393 | 380 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 394 | 381 | * @return bool |
| 395 | 382 | */ |
| 396 | - protected function canDeleteWorkingCopy($document) |
|
| 397 | - { |
|
| 383 | + protected function canDeleteWorkingCopy($document) { |
|
| 398 | 384 | if ($document->isTemporary() || $this->isDocumentLocked($document)) { |
| 399 | 385 | return FALSE; |
| 400 | 386 | } |
@@ -411,8 +397,7 @@ discard block |
||
| 411 | 397 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 412 | 398 | * @return bool |
| 413 | 399 | */ |
| 414 | - protected function canEdit($document) |
|
| 415 | - { |
|
| 400 | + protected function canEdit($document) { |
|
| 416 | 401 | if ($this->isDocumentLocked($document)) { |
| 417 | 402 | return FALSE; |
| 418 | 403 | } |
@@ -439,8 +424,7 @@ discard block |
||
| 439 | 424 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 440 | 425 | * @return bool |
| 441 | 426 | */ |
| 442 | - protected function canUpdate($document) |
|
| 443 | - { |
|
| 427 | + protected function canUpdate($document) { |
|
| 444 | 428 | if ($this->isDocumentLocked($document)) { |
| 445 | 429 | return FALSE; |
| 446 | 430 | } |
@@ -467,8 +451,7 @@ discard block |
||
| 467 | 451 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 468 | 452 | * @return bool |
| 469 | 453 | */ |
| 470 | - protected function canSuggestRestore($document) |
|
| 471 | - { |
|
| 454 | + protected function canSuggestRestore($document) { |
|
| 472 | 455 | if ($this->security->getUserRole() === Security::ROLE_RESEARCHER) { |
| 473 | 456 | |
| 474 | 457 | $objectManager =GeneralUtility::makeInstance(ObjectManager::class); |
@@ -493,8 +476,7 @@ discard block |
||
| 493 | 476 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 494 | 477 | * @return bool |
| 495 | 478 | */ |
| 496 | - protected function canSuggestModification($document) |
|
| 497 | - { |
|
| 479 | + protected function canSuggestModification($document) { |
|
| 498 | 480 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 499 | 481 | $documentRepository = $objectManager->get(DocumentRepository::class); |
| 500 | 482 | |
@@ -523,8 +505,7 @@ discard block |
||
| 523 | 505 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 524 | 506 | * @return bool |
| 525 | 507 | */ |
| 526 | - protected function canSuggestionAccept($document) |
|
| 527 | - { |
|
| 508 | + protected function canSuggestionAccept($document) { |
|
| 528 | 509 | // TODO: What if a document should be restored? |
| 529 | 510 | |
| 530 | 511 | return $this->librarianOnly(); |
@@ -534,8 +515,7 @@ discard block |
||
| 534 | 515 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 535 | 516 | * @return bool |
| 536 | 517 | */ |
| 537 | - protected function canPostpone($document) |
|
| 538 | - { |
|
| 518 | + protected function canPostpone($document) { |
|
| 539 | 519 | if ($this->isDocumentLocked($document)) { |
| 540 | 520 | return FALSE; |
| 541 | 521 | } |
@@ -552,8 +532,7 @@ discard block |
||
| 552 | 532 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 553 | 533 | * @return bool |
| 554 | 534 | */ |
| 555 | - protected function canCreateRegister($document) |
|
| 556 | - { |
|
| 535 | + protected function canCreateRegister($document) { |
|
| 557 | 536 | if ($this->security->getUserRole()) { |
| 558 | 537 | return FALSE; |
| 559 | 538 | } |
@@ -569,8 +548,7 @@ discard block |
||
| 569 | 548 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 570 | 549 | * @return bool |
| 571 | 550 | */ |
| 572 | - protected function canDuplicate($document) |
|
| 573 | - { |
|
| 551 | + protected function canDuplicate($document) { |
|
| 574 | 552 | if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) { |
| 575 | 553 | return ( |
| 576 | 554 | $document->getState() !== DocumentWorkflow::STATE_NEW_NONE || |
@@ -592,8 +570,7 @@ discard block |
||
| 592 | 570 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 593 | 571 | * @return bool |
| 594 | 572 | */ |
| 595 | - protected function isDocumentLocked($document) |
|
| 596 | - { |
|
| 573 | + protected function isDocumentLocked($document) { |
|
| 597 | 574 | $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid(); |
| 598 | 575 | return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid()); |
| 599 | 576 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | const CREATE = "DOCUMENT_CREATE"; |
| 28 | 28 | const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER"; |
| 29 | 29 | const UPDATE = "DOCUMENT_UPDATE"; |
| 30 | - const LIST = "DOCUMENT_LIST"; |
|
| 30 | + const list = "DOCUMENT_LIST"; |
|
| 31 | 31 | const LIST_REGISTERED = "DOCUMENT_LIST_REGISTERED"; |
| 32 | 32 | const LIST_IN_PROGRESS = "DOCUMENT_LIST_IN_PROGRESS"; |
| 33 | 33 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @var \EWW\Dpf\Services\Document\EditingLockService |
| 56 | 56 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 57 | 57 | */ |
| 58 | - protected $editingLockService = null; |
|
| 58 | + protected $editingLockService = NULL; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * workflow |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | self::CREATE, |
| 82 | 82 | self::CREATE_REGISTER, |
| 83 | 83 | self::UPDATE, |
| 84 | - self::LIST, |
|
| 84 | + self::list, |
|
| 85 | 85 | self::LIST_REGISTERED, |
| 86 | 86 | self::LIST_IN_PROGRESS, |
| 87 | 87 | self::DISCARD, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | return $this->canUpdate($subject); |
| 152 | 152 | break; |
| 153 | 153 | |
| 154 | - case self::LIST: |
|
| 154 | + case self::list: |
|
| 155 | 155 | return $this->defaultAccess(); |
| 156 | 156 | break; |
| 157 | 157 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | ] |
| 237 | 237 | ); |
| 238 | 238 | |
| 239 | - return false; |
|
| 239 | + return FALSE; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | ); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | - return false; |
|
| 463 | + return FALSE; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |
@@ -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()) |
@@ -17,16 +17,14 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * The repository for editing lock objects |
| 19 | 19 | */ |
| 20 | -class EditingLockRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository |
|
| 21 | -{ |
|
| 20 | +class EditingLockRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository { |
|
| 22 | 21 | /** |
| 23 | 22 | * Finds all outdated locks, |
| 24 | 23 | * |
| 25 | 24 | * @param integer $timeout : Time interval (in seconds) in which locks are not outdated. |
| 26 | 25 | * @return array The found Document Objects |
| 27 | 26 | */ |
| 28 | - public function findOutdatedLocks($timeout) |
|
| 29 | - { |
|
| 27 | + public function findOutdatedLocks($timeout) { |
|
| 30 | 28 | $query = $this->createQuery(); |
| 31 | 29 | |
| 32 | 30 | $dateTimeObj= new \DateTime(); |
@@ -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 */ |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | use EWW\Dpf\Domain\Model\EditingLock; |
| 18 | 18 | |
| 19 | -class EditingLockService |
|
| 20 | -{ |
|
| 19 | +class EditingLockService { |
|
| 21 | 20 | /** |
| 22 | 21 | * editingLockRepository |
| 23 | 22 | * |
@@ -41,8 +40,7 @@ discard block |
||
| 41 | 40 | * @param int $userUid |
| 42 | 41 | * @return bool |
| 43 | 42 | */ |
| 44 | - public function lock($documentIdentifier, $userUid) |
|
| 45 | - { |
|
| 43 | + public function lock($documentIdentifier, $userUid) { |
|
| 46 | 44 | if ($this->editingLockRepository->findOneByDocumentIdentifier($documentIdentifier)) { |
| 47 | 45 | return FALSE; |
| 48 | 46 | } |
@@ -63,8 +61,7 @@ discard block |
||
| 63 | 61 | * @param string $documentIdentifier |
| 64 | 62 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 65 | 63 | */ |
| 66 | - public function unlock($documentIdentifier) |
|
| 67 | - { |
|
| 64 | + public function unlock($documentIdentifier) { |
|
| 68 | 65 | /** @var \EWW\Dpf\Domain\Model\EditingLock $editingLock */ |
| 69 | 66 | $editingLock = $this->editingLockRepository->findOneByDocumentIdentifyer($documentIdentifier); |
| 70 | 67 | $this->editingLockRepository->remove($editingLock); |
@@ -78,8 +75,7 @@ discard block |
||
| 78 | 75 | * @param int $userUid |
| 79 | 76 | * @return bool |
| 80 | 77 | */ |
| 81 | - public function isLocked($documentIdentifier, $userUid) |
|
| 82 | - { |
|
| 78 | + public function isLocked($documentIdentifier, $userUid) { |
|
| 83 | 79 | $locks = $this->editingLockRepository->findByDocumentIdentifier($documentIdentifier); |
| 84 | 80 | |
| 85 | 81 | /** @var \EWW\Dpf\Domain\Model\EditingLock $lock */ |
@@ -96,8 +92,7 @@ discard block |
||
| 96 | 92 | * |
| 97 | 93 | * @param int $timeout : Time interval (in seconds) in which locks are not outdated, default is 1 hour. |
| 98 | 94 | */ |
| 99 | - public function unlockOutdatedLocks($timeout = 3600) |
|
| 100 | - { |
|
| 95 | + public function unlockOutdatedLocks($timeout = 3600) { |
|
| 101 | 96 | // Unlock outdated editing locks. |
| 102 | 97 | $outdatedLocks = $this->editingLockRepository->findOutdatedLocks($timeout); |
| 103 | 98 | foreach ($outdatedLocks as $outdatedLock) { |
@@ -111,8 +106,7 @@ discard block |
||
| 111 | 106 | * |
| 112 | 107 | * @param int $editorUid |
| 113 | 108 | */ |
| 114 | - public function unlockAllByEditor($editorUid) |
|
| 115 | - { |
|
| 109 | + public function unlockAllByEditor($editorUid) { |
|
| 116 | 110 | $locks = $this->editingLockRepository->findByEditorUid($editorUid); |
| 117 | 111 | foreach ($locks as $lock) { |
| 118 | 112 | $this->editingLockRepository->remove($lock); |
@@ -121,8 +115,7 @@ discard block |
||
| 121 | 115 | $this->persistenceManager->persistAll(); |
| 122 | 116 | } |
| 123 | 117 | |
| 124 | - public function getLockedDocumentIdentifiersByUserUid($userUid) |
|
| 125 | - { |
|
| 118 | + public function getLockedDocumentIdentifiersByUserUid($userUid) { |
|
| 126 | 119 | $identifiers = array(); |
| 127 | 120 | |
| 128 | 121 | $locks = $this->editingLockRepository->findByEditorUid($userUid); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @var \EWW\Dpf\Domain\Repository\EditingLockRepository |
| 25 | 25 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 26 | 26 | */ |
| 27 | - protected $editingLockRepository = null; |
|
| 27 | + protected $editingLockRepository = NULL; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * persistence manager |
@@ -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(); |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * Frontend user |
| 21 | 21 | */ |
| 22 | -class FrontendUser extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser |
|
| 23 | -{ |
|
| 22 | +class FrontendUser extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser { |
|
| 24 | 23 | /** |
| 25 | 24 | * storedSearches |
| 26 | 25 | * |
@@ -80,8 +79,7 @@ discard block |
||
| 80 | 79 | /** |
| 81 | 80 | * __construct |
| 82 | 81 | */ |
| 83 | - public function __construct() |
|
| 84 | - { |
|
| 82 | + public function __construct() { |
|
| 85 | 83 | parent::__construct(); |
| 86 | 84 | |
| 87 | 85 | //Do not remove the next line: It would break the functionality |
@@ -93,8 +91,7 @@ discard block |
||
| 93 | 91 | * |
| 94 | 92 | * @return void |
| 95 | 93 | */ |
| 96 | - protected function initStorageObjects() |
|
| 97 | - { |
|
| 94 | + protected function initStorageObjects() { |
|
| 98 | 95 | $this->storedSearches = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
| 99 | 96 | } |
| 100 | 97 | |
@@ -104,8 +101,7 @@ discard block |
||
| 104 | 101 | * |
| 105 | 102 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\StoredSearch> |
| 106 | 103 | */ |
| 107 | - public function getStoredSearches() |
|
| 108 | - { |
|
| 104 | + public function getStoredSearches() { |
|
| 109 | 105 | return $this->storedSearches; |
| 110 | 106 | } |
| 111 | 107 | |
@@ -115,16 +111,14 @@ discard block |
||
| 115 | 111 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\StoredSearch> $storedSearches |
| 116 | 112 | * @return void |
| 117 | 113 | */ |
| 118 | - public function setStoredSearches(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $storedSearches) |
|
| 119 | - { |
|
| 114 | + public function setStoredSearches(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $storedSearches) { |
|
| 120 | 115 | $this->storedSearches = $storedSearches; |
| 121 | 116 | } |
| 122 | 117 | |
| 123 | 118 | /** |
| 124 | 119 | * @param \EWW\Dpf\Domain\Model\StoredSearch $storedSearch |
| 125 | 120 | */ |
| 126 | - public function addStoredSearch(\EWW\Dpf\Domain\Model\StoredSearch $storedSearch) |
|
| 127 | - { |
|
| 121 | + public function addStoredSearch(\EWW\Dpf\Domain\Model\StoredSearch $storedSearch) { |
|
| 128 | 122 | $this->storedSearches->attach($storedSearch); |
| 129 | 123 | } |
| 130 | 124 | |
@@ -133,8 +127,7 @@ discard block |
||
| 133 | 127 | * |
| 134 | 128 | * @return string |
| 135 | 129 | */ |
| 136 | - public function getUserRole() |
|
| 137 | - { |
|
| 130 | + public function getUserRole() { |
|
| 138 | 131 | // Get frontend user groups of the client. |
| 139 | 132 | $clientFrontendGroups = array(); |
| 140 | 133 | foreach ($this->frontendUserGroupRepository->findAll() as $clientGroup) { |
@@ -182,8 +175,7 @@ discard block |
||
| 182 | 175 | /** |
| 183 | 176 | * @param bool $notifyPersonalLink |
| 184 | 177 | */ |
| 185 | - public function setNotifyPersonalLink(bool $notifyPersonalLink) |
|
| 186 | - { |
|
| 178 | + public function setNotifyPersonalLink(bool $notifyPersonalLink) { |
|
| 187 | 179 | $this->notifyPersonalLink = boolval($notifyPersonalLink); |
| 188 | 180 | } |
| 189 | 181 | |
@@ -198,8 +190,7 @@ discard block |
||
| 198 | 190 | /** |
| 199 | 191 | * @param bool $notifyStatusChange |
| 200 | 192 | */ |
| 201 | - public function setNotifyStatusChange(bool $notifyStatusChange) |
|
| 202 | - { |
|
| 193 | + public function setNotifyStatusChange(bool $notifyStatusChange) { |
|
| 203 | 194 | $this->notifyStatusChange = boolval($notifyStatusChange); |
| 204 | 195 | } |
| 205 | 196 | |
@@ -230,8 +221,7 @@ discard block |
||
| 230 | 221 | /** |
| 231 | 222 | * @param bool $notifyFulltextPublished |
| 232 | 223 | */ |
| 233 | - public function setNotifyFulltextPublished(bool $notifyFulltextPublished) |
|
| 234 | - { |
|
| 224 | + public function setNotifyFulltextPublished(bool $notifyFulltextPublished) { |
|
| 235 | 225 | $this->notifyFulltextPublished = boolval($notifyFulltextPublished); |
| 236 | 226 | } |
| 237 | 227 | |
@@ -246,8 +236,7 @@ discard block |
||
| 246 | 236 | /** |
| 247 | 237 | * @param bool $notifyNewPublicationMypublication |
| 248 | 238 | */ |
| 249 | - public function setNotifyNewPublicationMypublication(bool $notifyNewPublicationMypublication) |
|
| 250 | - { |
|
| 239 | + public function setNotifyNewPublicationMypublication(bool $notifyNewPublicationMypublication) { |
|
| 251 | 240 | $this->notifyNewPublicationMypublication = boolval($notifyNewPublicationMypublication); |
| 252 | 241 | } |
| 253 | 242 | |
@@ -262,8 +251,7 @@ discard block |
||
| 262 | 251 | /** |
| 263 | 252 | * @param string $fisPersId |
| 264 | 253 | */ |
| 265 | - public function setFisPersId(string $fisPersId) |
|
| 266 | - { |
|
| 254 | + public function setFisPersId(string $fisPersId) { |
|
| 267 | 255 | $this->fisPersId = $fisPersId; |
| 268 | 256 | } |
| 269 | 257 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\StoredSearch> |
| 28 | 28 | * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") |
| 29 | 29 | */ |
| 30 | - protected $storedSearches = null; |
|
| 30 | + protected $storedSearches = NULL; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * frontendUserGroupRepository |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @var \EWW\Dpf\Domain\Repository\FrontendUserGroupRepository |
| 36 | 36 | * @TYPO3\CMS\Extbase\Annotation\Inject |
| 37 | 37 | */ |
| 38 | - protected $frontendUserGroupRepository = null; |
|
| 38 | + protected $frontendUserGroupRepository = NULL; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @var boolean |
@@ -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 |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | // don't return query if searchString is empty |
| 51 | 51 | if (empty($searchString)) { |
| 52 | - return null; |
|
| 52 | + return NULL; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $searchString = $this->escapeQuery(trim($searchString)); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // child_type is invalid in elasticsearch 7.5 |
| 62 | 62 | //$query['body']['query']['bool']['should'][1]['has_child']['type'] = "datastream"; // 1 |
| 63 | 63 | |
| 64 | - $query = $this->resultsFilter($query, false); |
|
| 64 | + $query = $this->resultsFilter($query, FALSE); |
|
| 65 | 65 | |
| 66 | 66 | return $query; |
| 67 | 67 | |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | } elseif (!empty($qry) && $key == 'from') { |
| 91 | 91 | |
| 92 | - if ($dateTime = $this->convertFormDate($qry, false)) { |
|
| 92 | + if ($dateTime = $this->convertFormDate($qry, FALSE)) { |
|
| 93 | 93 | $filter['gte'] = $dateTime->format('Y-m-d'); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | } elseif (!empty($qry) && $key == 'till') { |
| 97 | 97 | |
| 98 | - if ($dateTime = $this->convertFormDate($qry, true)) { |
|
| 98 | + if ($dateTime = $this->convertFormDate($qry, TRUE)) { |
|
| 99 | 99 | $filter['lte'] = $dateTime->format('Y-m-d'); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $showDeleted = ($searchArray['showDeleted'] == 'true') ? true : false; |
|
| 111 | + $showDeleted = ($searchArray['showDeleted'] == 'true') ? TRUE : FALSE; |
|
| 112 | 112 | $query = $this->resultsFilter($query, $showDeleted); |
| 113 | 113 | return $query; |
| 114 | 114 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param array Elasticsearch query array |
| 120 | 120 | * @return array Elasticsearch queryFilter array |
| 121 | 121 | */ |
| 122 | - public function resultsFilter($query, $showDeleted = false) |
|
| 122 | + public function resultsFilter($query, $showDeleted = FALSE) |
|
| 123 | 123 | { |
| 124 | 124 | |
| 125 | 125 | $queryFilter = array(); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if ($searchResultsFilter['from']) { |
| 147 | 147 | |
| 148 | 148 | $from = date('d.m.Y', $searchResultsFilter['from']); |
| 149 | - $dateTime = $this->convertFormDate($from, false); |
|
| 149 | + $dateTime = $this->convertFormDate($from, FALSE); |
|
| 150 | 150 | $dateFilter['gte'] = $dateTime->format('Y-m-d'); |
| 151 | 151 | unset($searchResultsFilter['from']); |
| 152 | 152 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | if ($searchResultsFilter['till']) { |
| 156 | 156 | |
| 157 | 157 | $till = date('d.m.Y', $searchResultsFilter['till']); |
| 158 | - $dateTime = $this->convertFormDate($till, true); |
|
| 158 | + $dateTime = $this->convertFormDate($till, TRUE); |
|
| 159 | 159 | $dateFilter['lte'] = $dateTime->format('Y-m-d'); |
| 160 | 160 | unset($searchResultsFilter['till']); |
| 161 | 161 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // document must be active |
| 181 | - if($showDeleted == false) { |
|
| 181 | + if($showDeleted == FALSE) { |
|
| 182 | 182 | |
| 183 | 183 | // $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
| 184 | 184 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param bool $intervalEnd Fills missing values with the maximum possible date if true |
| 210 | 210 | * @return DateTime Determined date |
| 211 | 211 | */ |
| 212 | - public function convertFormDate($dateString, $intervalEnd = false) |
|
| 212 | + public function convertFormDate($dateString, $intervalEnd = FALSE) |
|
| 213 | 213 | { |
| 214 | 214 | try { |
| 215 | 215 | if (strlen($dateString) == 4) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | return new \DateTime($dateString); |
| 223 | 223 | } |
| 224 | 224 | } catch (\Exception $_) { |
| 225 | - return false; |
|
| 225 | + return FALSE; |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * @package EWW\Dpf\Controller |
| 23 | 23 | * @deprecated since version 4.0 |
| 24 | 24 | */ |
| 25 | -abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController |
|
| 26 | -{ |
|
| 25 | +abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController { |
|
| 27 | 26 | // search terms |
| 28 | 27 | private static $terms = ['_id', 'OWNER_ID', 'submitter', 'project']; |
| 29 | 28 | |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * @param array $query elasticsearch search query |
| 37 | 36 | * @return array results |
| 38 | 37 | */ |
| 39 | - public function getResultList($query, $type) |
|
| 40 | - { |
|
| 38 | + public function getResultList($query, $type) { |
|
| 41 | 39 | |
| 42 | 40 | $elasticSearch = $this->objectManager->get(ElasticSearch::class); |
| 43 | 41 | $results = $elasticSearch->search($query, $type); |
@@ -50,8 +48,7 @@ discard block |
||
| 50 | 48 | * @param string $searchString |
| 51 | 49 | * @return array query |
| 52 | 50 | */ |
| 53 | - public function searchFulltext($searchString) |
|
| 54 | - { |
|
| 51 | + public function searchFulltext($searchString) { |
|
| 55 | 52 | // don't return query if searchString is empty |
| 56 | 53 | if (empty($searchString)) { |
| 57 | 54 | return null; |
@@ -76,8 +73,7 @@ discard block |
||
| 76 | 73 | * build array for elasticsearch |
| 77 | 74 | * @return array Elasticsearch query array |
| 78 | 75 | */ |
| 79 | - public function extendedSearch($searchArray = array()) |
|
| 80 | - { |
|
| 76 | + public function extendedSearch($searchArray = array()) { |
|
| 81 | 77 | |
| 82 | 78 | $query = array(); |
| 83 | 79 | $filter = array(); |
@@ -124,8 +120,7 @@ discard block |
||
| 124 | 120 | * @param array Elasticsearch query array |
| 125 | 121 | * @return array Elasticsearch queryFilter array |
| 126 | 122 | */ |
| 127 | - public function resultsFilter($query, $showDeleted = false) |
|
| 128 | - { |
|
| 123 | + public function resultsFilter($query, $showDeleted = false) { |
|
| 129 | 124 | |
| 130 | 125 | $queryFilter = array(); |
| 131 | 126 | |
@@ -214,8 +209,7 @@ discard block |
||
| 214 | 209 | * @param bool $intervalEnd Fills missing values with the maximum possible date if true |
| 215 | 210 | * @return DateTime Determined date |
| 216 | 211 | */ |
| 217 | - public function convertFormDate($dateString, $intervalEnd = false) |
|
| 218 | - { |
|
| 212 | + public function convertFormDate($dateString, $intervalEnd = false) { |
|
| 219 | 213 | try { |
| 220 | 214 | if (strlen($dateString) == 4) { |
| 221 | 215 | // assuming year |
@@ -236,8 +230,7 @@ discard block |
||
| 236 | 230 | * @param $string |
| 237 | 231 | * @return mixed |
| 238 | 232 | */ |
| 239 | - private function escapeQuery($string) |
|
| 240 | - { |
|
| 233 | + private function escapeQuery($string) { |
|
| 241 | 234 | $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\'); |
| 242 | 235 | $string = preg_replace_callback( |
| 243 | 236 | '/([' . $luceneReservedCharacters . '])/', |
@@ -257,8 +250,7 @@ discard block |
||
| 257 | 250 | * @param $date |
| 258 | 251 | * @return string |
| 259 | 252 | */ |
| 260 | - public function formatDate($date) |
|
| 261 | - { |
|
| 253 | + public function formatDate($date) { |
|
| 262 | 254 | // convert date from dd.mm.yyy to yyyy-dd-mm |
| 263 | 255 | $date = explode(".", $date); |
| 264 | 256 | return $date[2] . '-' . $date[1] . '-' . $date[0]; |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | use EWW\Dpf\Domain\Workflow\DocumentWorkflow; |
| 18 | 18 | |
| 19 | -class SearchSessionData |
|
| 20 | -{ |
|
| 19 | +class SearchSessionData { |
|
| 21 | 20 | /** |
| 22 | 21 | * @var array |
| 23 | 22 | */ |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | * |
| 55 | 54 | * @return array |
| 56 | 55 | */ |
| 57 | - public function getExcludeFilters() |
|
| 58 | - { |
|
| 56 | + public function getExcludeFilters() { |
|
| 59 | 57 | return $this->excludeFilters; |
| 60 | 58 | } |
| 61 | 59 | |
@@ -64,8 +62,7 @@ discard block |
||
| 64 | 62 | * Toggles the discarded documents filter. |
| 65 | 63 | * |
| 66 | 64 | */ |
| 67 | - public function toggleExcludeDiscardedFilter() |
|
| 68 | - { |
|
| 65 | + public function toggleExcludeDiscardedFilter() { |
|
| 69 | 66 | if (array_key_exists('aliasState', $this->excludeFilters)) { |
| 70 | 67 | unset($this->excludeFilters['aliasState']); |
| 71 | 68 | } else { |
@@ -78,8 +75,7 @@ discard block |
||
| 78 | 75 | * Toggles the hide bookmarks filter. |
| 79 | 76 | * |
| 80 | 77 | */ |
| 81 | - public function toggleBookmarksOnlyFilter() |
|
| 82 | - { |
|
| 78 | + public function toggleBookmarksOnlyFilter() { |
|
| 83 | 79 | if (array_key_exists('bookmarks', $this->excludeFilters)) { |
| 84 | 80 | unset($this->excludeFilters['bookmarks']); |
| 85 | 81 | } else { |
@@ -93,8 +89,7 @@ discard block |
||
| 93 | 89 | * @param $name |
| 94 | 90 | * @param array $values |
| 95 | 91 | */ |
| 96 | - public function setFilter($name, $values = []) |
|
| 97 | - { |
|
| 92 | + public function setFilter($name, $values = []) { |
|
| 98 | 93 | if ($name && $values && is_array($values)) { |
| 99 | 94 | $this->filters[$name] = $values; |
| 100 | 95 | } elseif ($name) { |
@@ -108,8 +103,7 @@ discard block |
||
| 108 | 103 | * |
| 109 | 104 | * @return array |
| 110 | 105 | */ |
| 111 | - public function clearFilters() |
|
| 112 | - { |
|
| 106 | + public function clearFilters() { |
|
| 113 | 107 | $this->filters = []; |
| 114 | 108 | } |
| 115 | 109 | |
@@ -119,8 +113,7 @@ discard block |
||
| 119 | 113 | * |
| 120 | 114 | * @return array |
| 121 | 115 | */ |
| 122 | - public function getFilters() |
|
| 123 | - { |
|
| 116 | + public function getFilters() { |
|
| 124 | 117 | return $this->filters; |
| 125 | 118 | } |
| 126 | 119 | |
@@ -129,8 +122,7 @@ discard block |
||
| 129 | 122 | * Removes the sort information |
| 130 | 123 | * |
| 131 | 124 | */ |
| 132 | - public function clearSort() |
|
| 133 | - { |
|
| 125 | + public function clearSort() { |
|
| 134 | 126 | $this->sortField = ''; |
| 135 | 127 | $this->sortOrder = ''; |
| 136 | 128 | } |
@@ -140,8 +132,7 @@ discard block |
||
| 140 | 132 | * |
| 141 | 133 | * @return string |
| 142 | 134 | */ |
| 143 | - public function getSortField() |
|
| 144 | - { |
|
| 135 | + public function getSortField() { |
|
| 145 | 136 | return $this->sortField; |
| 146 | 137 | } |
| 147 | 138 | |
@@ -150,8 +141,7 @@ discard block |
||
| 150 | 141 | * |
| 151 | 142 | * @param string $fieldName |
| 152 | 143 | */ |
| 153 | - public function setSortField($fieldName) |
|
| 154 | - { |
|
| 144 | + public function setSortField($fieldName) { |
|
| 155 | 145 | $this->sortField = $fieldName; |
| 156 | 146 | } |
| 157 | 147 | |
@@ -160,8 +150,7 @@ discard block |
||
| 160 | 150 | * |
| 161 | 151 | * @return string |
| 162 | 152 | */ |
| 163 | - public function getSortOrder() |
|
| 164 | - { |
|
| 153 | + public function getSortOrder() { |
|
| 165 | 154 | return $this->sortOrder; |
| 166 | 155 | } |
| 167 | 156 | |
@@ -170,8 +159,7 @@ discard block |
||
| 170 | 159 | * |
| 171 | 160 | * @param string $order |
| 172 | 161 | */ |
| 173 | - public function setSortOrder($order) |
|
| 174 | - { |
|
| 162 | + public function setSortOrder($order) { |
|
| 175 | 163 | $this->sortOrder = $order; |
| 176 | 164 | } |
| 177 | 165 | |
@@ -180,8 +168,7 @@ discard block |
||
| 180 | 168 | * |
| 181 | 169 | * @return string |
| 182 | 170 | */ |
| 183 | - public function getSimpleQuery() |
|
| 184 | - { |
|
| 171 | + public function getSimpleQuery() { |
|
| 185 | 172 | return $this->simpleQuery; |
| 186 | 173 | } |
| 187 | 174 | |
@@ -190,8 +177,7 @@ discard block |
||
| 190 | 177 | * |
| 191 | 178 | * @param string $query |
| 192 | 179 | */ |
| 193 | - public function setSimpleQuery($query) |
|
| 194 | - { |
|
| 180 | + public function setSimpleQuery($query) { |
|
| 195 | 181 | $this->simpleQuery = $query; |
| 196 | 182 | } |
| 197 | 183 | |
@@ -200,8 +186,7 @@ discard block |
||
| 200 | 186 | * |
| 201 | 187 | * @return int |
| 202 | 188 | */ |
| 203 | - public function getItemsPerPage() |
|
| 204 | - { |
|
| 189 | + public function getItemsPerPage() { |
|
| 205 | 190 | return $this->itemsPerPage; |
| 206 | 191 | } |
| 207 | 192 | |
@@ -210,8 +195,7 @@ discard block |
||
| 210 | 195 | * |
| 211 | 196 | * @param int $itemsPerPage |
| 212 | 197 | */ |
| 213 | - public function setItemsPerPage($itemsPerPage) |
|
| 214 | - { |
|
| 198 | + public function setItemsPerPage($itemsPerPage) { |
|
| 215 | 199 | $this->itemsPerPage = $itemsPerPage; |
| 216 | 200 | } |
| 217 | 201 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * @var string |
| 43 | 43 | */ |
| 44 | - protected $simpleQuery = null; |
|
| 44 | + protected $simpleQuery = NULL; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * @var int |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (array_key_exists('bookmarks', $this->excludeFilters)) { |
| 84 | 84 | unset($this->excludeFilters['bookmarks']); |
| 85 | 85 | } else { |
| 86 | - $this->excludeFilters['bookmarks'] = true; |
|
| 86 | + $this->excludeFilters['bookmarks'] = TRUE; |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |