@@ -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]; |
@@ -54,7 +54,8 @@ discard block |
||
54 | 54 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
55 | 55 | |
56 | 56 | $defaults['customer'] = $customer->id; |
57 | - } catch (midcom_error) { |
|
57 | + } |
|
58 | + catch (midcom_error) { |
|
58 | 59 | $customer = new org_openpsa_contacts_person_dba($guid); |
59 | 60 | $defaults['customerContact'] = $customer->id; |
60 | 61 | $field['type_config']['options'] = $this->list_groups([$customer->id => true]); |
@@ -126,7 +127,8 @@ discard block |
||
126 | 127 | try { |
127 | 128 | $company = new org_openpsa_contacts_group_dba($company_id); |
128 | 129 | $ret[$company->id] = $company->get_label(); |
129 | - } catch (midcom_error $e) { |
|
130 | + } |
|
131 | + catch (midcom_error $e) { |
|
130 | 132 | $e->log(); |
131 | 133 | } |
132 | 134 | } |
@@ -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"; |
@@ -27,7 +27,8 @@ |
||
27 | 27 | } |
28 | 28 | $contact = new org_openpsa_widgets_contact($editor); |
29 | 29 | echo "<li class=\"updated-{$class}\"><a href=\"{$url}\"{$onclick}>{$document->title}</a> <div class=\"metadata\">" . $formatter->datetime($document->edited) . " (" . $contact->show_inline() . ")</div></li>\n"; |
30 | - } catch (midcom_error) { |
|
30 | + } |
|
31 | + catch (midcom_error) { |
|
31 | 32 | } |
32 | 33 | } |
33 | 34 | echo "</ul></div>\n"; |
@@ -94,7 +94,8 @@ |
||
94 | 94 | $customer = new org_openpsa_contacts_group_dba($customer_id); |
95 | 95 | $customer_label = $customer->official; |
96 | 96 | $customer = $customer_id; |
97 | - } catch (midcom_error) { |
|
97 | + } |
|
98 | + catch (midcom_error) { |
|
98 | 99 | } |
99 | 100 | } |
100 | 101 | } |
@@ -103,7 +103,8 @@ discard block |
||
103 | 103 | foreach ($hours as $guid => $row) { |
104 | 104 | try { |
105 | 105 | $task = org_openpsa_projects_task_dba::get_cached($row['task']); |
106 | - } catch (midcom_error) { |
|
106 | + } |
|
107 | + catch (midcom_error) { |
|
107 | 108 | // Task couldn't be loaded, probably because of ACL |
108 | 109 | continue; |
109 | 110 | } |
@@ -116,7 +117,8 @@ discard block |
||
116 | 117 | $person_object = midcom_db_person::get_cached($row['person']); |
117 | 118 | $person_label = $this->_get_list_link($person_object->name, person_id: $row['person']); |
118 | 119 | $person_name = $person_object->name; |
119 | - } catch (midcom_error) { |
|
120 | + } |
|
121 | + catch (midcom_error) { |
|
120 | 122 | $person_label = $this->_l10n->get('no person'); |
121 | 123 | $person_name = ''; |
122 | 124 | } |
@@ -31,7 +31,8 @@ discard block |
||
31 | 31 | if ($data['contacts_url']) { |
32 | 32 | $row['customer'] = "<a href=\"{$data['contacts_url']}group/{$customer->guid}/\">{$label}</a>"; |
33 | 33 | } |
34 | - } catch (midcom_error $e) { |
|
34 | + } |
|
35 | + catch (midcom_error $e) { |
|
35 | 36 | $e->log(); |
36 | 37 | } |
37 | 38 | } |
@@ -44,7 +45,8 @@ discard block |
||
44 | 45 | $contact_widget = org_openpsa_widgets_contact::get($salesproject->customerContact); |
45 | 46 | $row['index_customerContact'] = $customer->get_label(); |
46 | 47 | $row['customerContact'] = $contact_widget->show_inline(); |
47 | - } catch (midcom_error $e) { |
|
48 | + } |
|
49 | + catch (midcom_error $e) { |
|
48 | 50 | $e->log(); |
49 | 51 | } |
50 | 52 | } |
@@ -56,7 +58,8 @@ discard block |
||
56 | 58 | $owner_widget = org_openpsa_widgets_contact::get($salesproject->owner); |
57 | 59 | $row['index_owner'] = $owner->rname; |
58 | 60 | $row['owner'] = $owner_widget->show_inline(); |
59 | - } catch (midcom_error) { |
|
61 | + } |
|
62 | + catch (midcom_error) { |
|
60 | 63 | $row['index_owner'] = ''; |
61 | 64 | $row['owner'] = ''; |
62 | 65 | } |