@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function _on_creating() : bool |
| 27 | 27 | { |
| 28 | - if ( $this->invoice |
|
| 28 | + if ($this->invoice |
|
| 29 | 29 | && $this->position == 0) { |
| 30 | 30 | $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice); |
| 31 | 31 | $this->position = count($invoice->get_invoice_items()) + 1; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } catch (midcom_error) { |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - if ( $url == '' |
|
| 78 | + if ($url == '' |
|
| 79 | 79 | && $sales_url) { |
| 80 | 80 | try { |
| 81 | 81 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $invoice = new org_openpsa_invoices_invoice_dba($this->invoice); |
| 98 | 98 | $old_sum = $invoice->sum; |
| 99 | 99 | self::update_invoice($invoice); |
| 100 | - if ( $old_sum != $invoice->sum |
|
| 100 | + if ($old_sum != $invoice->sum |
|
| 101 | 101 | && !empty($this->deliverable)) { |
| 102 | 102 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
| 103 | 103 | self::update_deliverable($deliverable); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if ($invoiced != $deliverable->invoiced) { |
| 137 | 137 | $deliverable->invoiced = $invoiced; |
| 138 | - if ( $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 138 | + if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 139 | 139 | && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) { |
| 140 | 140 | $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED; |
| 141 | 141 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | { |
| 255 | 255 | if (in_array($key, $this->field_config['timebased'])) { |
| 256 | 256 | // This is ugly, but seems the only possible way... |
| 257 | - if ( isset($this->__metadata->$key) |
|
| 257 | + if (isset($this->__metadata->$key) |
|
| 258 | 258 | && (string) $this->__metadata->$key !== "0001-01-01T00:00:00+00:00") { |
| 259 | 259 | return (int) $this->__metadata->$key->format('U'); |
| 260 | 260 | } |
@@ -315,11 +315,11 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | $now = time(); |
| 318 | - if ( $this->get('schedulestart') |
|
| 318 | + if ($this->get('schedulestart') |
|
| 319 | 319 | && $this->get('schedulestart') > $now) { |
| 320 | 320 | return false; |
| 321 | 321 | } |
| 322 | - if ( $this->get('scheduleend') |
|
| 322 | + if ($this->get('scheduleend') |
|
| 323 | 323 | && $this->get('scheduleend') < $now) { |
| 324 | 324 | return false; |
| 325 | 325 | } |
@@ -335,9 +335,9 @@ discard block |
||
| 335 | 335 | public function is_object_visible_onsite() : bool |
| 336 | 336 | { |
| 337 | 337 | return |
| 338 | - ( ( midcom::get()->config->get('show_hidden_objects') |
|
| 338 | + ((midcom::get()->config->get('show_hidden_objects') |
|
| 339 | 339 | || $this->is_visible()) |
| 340 | - && ( midcom::get()->config->get('show_unapproved_objects') |
|
| 340 | + && (midcom::get()->config->get('show_unapproved_objects') |
|
| 341 | 341 | || $this->is_approved()) |
| 342 | 342 | ); |
| 343 | 343 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $guid = $source; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - if ( $object === null |
|
| 397 | + if ($object === null |
|
| 398 | 398 | && mgd_is_guid($guid)) { |
| 399 | 399 | try { |
| 400 | 400 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | public function can_unlock() : bool |
| 455 | 455 | { |
| 456 | - return ( midcom::get()->auth->user?->guid == $this->__object->metadata->locker |
|
| 456 | + return (midcom::get()->auth->user?->guid == $this->__object->metadata->locker |
|
| 457 | 457 | || $this->__object->can_do('midcom:unlock') |
| 458 | 458 | || midcom::get()->auth->can_user_do('midcom:unlock', class: midcom_services_auth::class)); |
| 459 | 459 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $parent = $object->get_parent(); |
| 144 | 144 | |
| 145 | - if ( $object instanceof midcom_db_parameter |
|
| 145 | + if ($object instanceof midcom_db_parameter |
|
| 146 | 146 | && !empty($parent->guid)) { |
| 147 | 147 | // Add "parameters" list to breadcrumb if we're in a param |
| 148 | 148 | $breadcrumb[] = [ |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $i = 0; |
| 155 | - while ( !empty($parent->guid) |
|
| 155 | + while (!empty($parent->guid) |
|
| 156 | 156 | && $i < 10) { |
| 157 | 157 | $i++; |
| 158 | 158 | $parent_reflector = midcom_helper_reflector::get($parent); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | static $preferences = []; |
| 261 | 261 | |
| 262 | - if ( !array_key_exists($preference, $preferences) |
|
| 262 | + if (!array_key_exists($preference, $preferences) |
|
| 263 | 263 | && $person = midcom::get()->auth->user?->get_storage()) { |
| 264 | 264 | $preferences[$preference] = $person->get_parameter('midgard.admin.asgard:preferences', $preference); |
| 265 | 265 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | if ($category) { |
| 50 | 50 | // This is not a predefined category from configuration, check if site maintainer allows us to show it |
| 51 | - if ( !in_array($category, $data['categories']) |
|
| 51 | + if (!in_array($category, $data['categories']) |
|
| 52 | 52 | && !$this->_config->get('categories_custom_enable')) { |
| 53 | 53 | throw new midcom_error('Custom category support is disabled'); |
| 54 | 54 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $this->_topic->require_do('midgard:create'); |
| 30 | 30 | |
| 31 | 31 | $schemadb = $data['schemadb']; |
| 32 | - if ( $this->_config->get('simple_name_handling') |
|
| 32 | + if ($this->_config->get('simple_name_handling') |
|
| 33 | 33 | && !midcom::get()->auth->can_user_do('midcom:urlname')) { |
| 34 | 34 | foreach ($schemadb->all() as $schema) { |
| 35 | 35 | $schema->get_field('name')['readonly'] = true; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $item->title = $data['article']->title; |
| 19 | 19 | |
| 20 | -if ( $data['config']->get('link_to_external_url') |
|
| 20 | +if ($data['config']->get('link_to_external_url') |
|
| 21 | 21 | && !empty($data['article']->url)) { |
| 22 | 22 | $item->link = $data['article']->url; |
| 23 | 23 | } else { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $item->description .= '<div class="abstract">' . $view['abstract'] . '</div>'; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -if ( array_key_exists('image', $view) |
|
| 36 | +if (array_key_exists('image', $view) |
|
| 37 | 37 | && $data['config']->get('rss_use_image')) { |
| 38 | 38 | $item->description .= "\n<div class=\"image\">" . $view['image'] . '</div>'; |
| 39 | 39 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $data['query'] = new org_openpsa_reports_query_dba($guid); |
| 76 | 76 | $data['query']->require_do('midgard:update'); |
| 77 | 77 | } else { |
| 78 | - $data['query']= new org_openpsa_reports_query_dba(); |
|
| 78 | + $data['query'] = new org_openpsa_reports_query_dba(); |
|
| 79 | 79 | $data['query']->component = $this->_component; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // Catch first the configuration option for showing editing interface instead |
| 36 | 36 | // of redirecting administrators |
| 37 | - if ( $this->_topic->can_do('net.nemein.redirector:noredirect') |
|
| 37 | + if ($this->_topic->can_do('net.nemein.redirector:noredirect') |
|
| 38 | 38 | && !$this->_config->get('admin_redirection')) { |
| 39 | 39 | return new midcom_response_relocate($this->router->generate('edit', ['tinyurl' => $tinyurl])); |
| 40 | 40 | } |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $data['url'] = net_nemein_redirector_viewer::topic_links_to($this->_config); |
| 70 | 70 | |
| 71 | - if ( $this->_config->get('redirection_type') !== null |
|
| 72 | - && ( !$this->_topic->can_do('net.nemein.redirector:noredirect') |
|
| 71 | + if ($this->_config->get('redirection_type') !== null |
|
| 72 | + && (!$this->_topic->can_do('net.nemein.redirector:noredirect') |
|
| 73 | 73 | || $this->_config->get('admin_redirection'))) { |
| 74 | 74 | return $this->redirect($data['url']); |
| 75 | 75 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if ( $this->_topic->can_do('midgard:update') |
|
| 57 | + if ($this->_topic->can_do('midgard:update') |
|
| 58 | 58 | && $this->_topic->can_do('midcom:component_config')) { |
| 59 | 59 | $buttons[] = $workflow->get_button($this->router->generate('config'), [ |
| 60 | 60 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |