@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | if (in_array($key, $this->field_config['timebased'])) { |
| 264 | 264 | // This is ugly, but seems the only possible way... |
| 265 | - if ( isset($this->__metadata->$key) |
|
| 265 | + if (isset($this->__metadata->$key) |
|
| 266 | 266 | && (string) $this->__metadata->$key !== "0001-01-01T00:00:00+00:00") { |
| 267 | 267 | return (int) $this->__metadata->$key->format('U'); |
| 268 | 268 | } |
@@ -323,11 +323,11 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | $now = time(); |
| 326 | - if ( $this->get('schedulestart') |
|
| 326 | + if ($this->get('schedulestart') |
|
| 327 | 327 | && $this->get('schedulestart') > $now) { |
| 328 | 328 | return false; |
| 329 | 329 | } |
| 330 | - if ( $this->get('scheduleend') |
|
| 330 | + if ($this->get('scheduleend') |
|
| 331 | 331 | && $this->get('scheduleend') < $now) { |
| 332 | 332 | return false; |
| 333 | 333 | } |
@@ -343,9 +343,9 @@ discard block |
||
| 343 | 343 | public function is_object_visible_onsite() : bool |
| 344 | 344 | { |
| 345 | 345 | return |
| 346 | - ( ( midcom::get()->config->get('show_hidden_objects') |
|
| 346 | + ((midcom::get()->config->get('show_hidden_objects') |
|
| 347 | 347 | || $this->is_visible()) |
| 348 | - && ( midcom::get()->config->get('show_unapproved_objects') |
|
| 348 | + && (midcom::get()->config->get('show_unapproved_objects') |
|
| 349 | 349 | || $this->is_approved()) |
| 350 | 350 | ); |
| 351 | 351 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | $guid = $source; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | - if ( $object === null |
|
| 405 | + if ($object === null |
|
| 406 | 406 | && mgd_is_guid($guid)) { |
| 407 | 407 | try { |
| 408 | 408 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | // Lock was created by the user, return "not locked" |
| 438 | - if ( !empty(midcom::get()->auth->user->guid) |
|
| 438 | + if (!empty(midcom::get()->auth->user->guid) |
|
| 439 | 439 | && $this->get('locker') === midcom::get()->auth->user->guid) { |
| 440 | 440 | return false; |
| 441 | 441 | } |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | public function can_unlock() : bool |
| 464 | 464 | { |
| 465 | - return ( $this->__object->can_do('midcom:unlock') |
|
| 465 | + return ($this->__object->can_do('midcom:unlock') |
|
| 466 | 466 | || midcom::get()->auth->can_user_do('midcom:unlock', null, midcom_services_auth::class)); |
| 467 | 467 | } |
| 468 | 468 | |