@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function _handler_create(Request $request, ?string $guid = null) |
23 | 23 | { |
24 | - midcom::get()->auth->require_user_do('midgard:create', class: org_openpsa_contacts_person_dba::class); |
|
24 | + midcom::get()->auth->require_user_do('midgard:create', class : org_openpsa_contacts_person_dba::class); |
|
25 | 25 | |
26 | 26 | $defaults = []; |
27 | 27 | if (!empty($guid)) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public function _handler_new(Request $request, ?string $guid = null) |
39 | 39 | { |
40 | - midcom::get()->auth->require_user_do('midgard:create', class: org_openpsa_sales_salesproject_dba::class); |
|
40 | + midcom::get()->auth->require_user_do('midgard:create', class : org_openpsa_sales_salesproject_dba::class); |
|
41 | 41 | |
42 | 42 | $this->_salesproject = new org_openpsa_sales_salesproject_dba; |
43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $schemadb = schemadb::from_path($this->_config->get('schemadb_salesproject')); |
49 | 49 | |
50 | 50 | if ($guid) { |
51 | - $field =& $schemadb->get('default')->get_field('customer'); |
|
51 | + $field = & $schemadb->get('default')->get_field('customer'); |
|
52 | 52 | try { |
53 | 53 | $customer = new org_openpsa_contacts_group_dba($guid); |
54 | 54 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
@@ -133,7 +133,7 @@ |
||
133 | 133 | return new midcom_response_relocate($relocate); |
134 | 134 | } |
135 | 135 | |
136 | - private function parse_input(ParameterBag $input, string $action) : int|bool |
|
136 | + private function parse_input(ParameterBag $input, string $action) : int | bool |
|
137 | 137 | { |
138 | 138 | if (!in_array($action, ['invoiceable', 'invoice', 'task'])) { |
139 | 139 | throw new midcom_error('passed action ' . $action . ' is unknown'); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | if ($contacts = $importer->parse($input)) { |
140 | 140 | $this->_request_data['import_status'] = $importer->import_subscribers($contacts, $this->_request_data['campaign']); |
141 | - if ( $this->_request_data['import_status']['subscribed_new'] > 0 |
|
141 | + if ($this->_request_data['import_status']['subscribed_new'] > 0 |
|
142 | 142 | || $this->_request_data['import_status']['already_subscribed'] > 0) { |
143 | 143 | $this->_import_success = true; |
144 | 144 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $read_rows = 0; |
196 | 196 | $handle = fopen($data['tmp_file'], 'r'); |
197 | 197 | $total_columns = 0; |
198 | - while ( $read_rows < 2 |
|
198 | + while ($read_rows < 2 |
|
199 | 199 | && $csv_line = fgetcsv($handle, 1000, $data['separator'])) { |
200 | 200 | if ($total_columns == 0) { |
201 | 201 | $total_columns = count($csv_line); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | $result = $this->validate_units($fields); |
19 | 19 | |
20 | - if ( empty($fields['end']) |
|
20 | + if (empty($fields['end']) |
|
21 | 21 | && empty($fields['continuous'])) { |
22 | 22 | if ($result === true) { |
23 | 23 | $result = []; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function validate_units(array $fields) |
31 | 31 | { |
32 | - if ( empty($fields['invoiceByActualUnits']) |
|
32 | + if (empty($fields['invoiceByActualUnits']) |
|
33 | 33 | && empty($fields['plannedUnits'])) { |
34 | 34 | return [ |
35 | 35 | 'plannedUnits' => midcom::get()->i18n->get_string('select either planned units or invoice by actual units', 'org.openpsa.sales') |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $schema->get_field('next_cycle')['hidden'] = false; |
38 | 38 | $schema->get_field('next_cycle')['default'] = $entry->start; |
39 | 39 | $schema->get_field('at_entry')['default'] = $entry->id; |
40 | - } elseif ( ($this->_deliverable->continuous || $this->_deliverable->end > time()) |
|
40 | + } elseif (($this->_deliverable->continuous || $this->_deliverable->end > time()) |
|
41 | 41 | && $this->_deliverable->state == org_openpsa_sales_salesproject_deliverable_dba::STATE_STARTED) { |
42 | 42 | $schema->get_field('next_cycle')['hidden'] = false; |
43 | 43 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $message['title'] = sprintf($this->_l10n->get('comment %s reported as abuse'), $comment->title); |
54 | 54 | $message['content'] = ''; |
55 | 55 | if ($logs = $comment->get_logs()) { |
56 | - $message['content'] .= $this->_l10n->get('moderation history').":\n\n"; |
|
56 | + $message['content'] .= $this->_l10n->get('moderation history') . ":\n\n"; |
|
57 | 57 | foreach ($logs as $time => $log) { |
58 | 58 | $reported = $this->_l10n->get_formatter()->datetime(strtotime("{$time}Z")); |
59 | 59 | $message['content'] .= $this->_l10n->get(sprintf('%s: %s by %s (from %s)', "$reported:\n", $this->_l10n->get($log['action']), $log['reporter'], $log['ip'])) . "\n\n"; |
@@ -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 | } |