@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $properties = ['fromClass', 'toClass', 'fromGuid', 'toGuid', 'fromComponent', 'toComponent', 'status', 'toExtra', 'toExtra']; |
93 | 93 | foreach ($properties as $property) { |
94 | - if ( !empty($defaults->$property) |
|
94 | + if (!empty($defaults->$property) |
|
95 | 95 | && empty($link->$property)) { |
96 | 96 | debug_add("Copying property '{$property}' ('{$defaults->$property}') from defaults"); |
97 | 97 | $link->$property = $defaults->$property; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | if ($component) { |
101 | 101 | debug_add('$component given, guessing direction'); |
102 | - if ( empty($link->toComponent) |
|
102 | + if (empty($link->toComponent) |
|
103 | 103 | && !empty($link->fromComponent)) { |
104 | 104 | debug_add("Setting property 'toComponent' to '{$component}'"); |
105 | 105 | $link->toComponent = $component; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | if (is_object($obj)) { |
112 | 112 | debug_add('$obj given, guessing direction'); |
113 | - if ( empty($link->toGuid) |
|
113 | + if (empty($link->toGuid) |
|
114 | 114 | && !empty($link->fromGuid)) { |
115 | 115 | $link->toClass = get_class($obj); |
116 | 116 | $link->toGuid = $obj->guid; |
@@ -123,7 +123,8 @@ |
||
123 | 123 | $row = []; |
124 | 124 | try { |
125 | 125 | $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person); |
126 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
127 | 128 | $e->log(); |
128 | 129 | continue; |
129 | 130 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $qb_hr = org_openpsa_expenses_hour_report_dba::new_query_builder(); |
44 | 44 | $qb_hr->add_constraint('date', '<=', (int) $this->_request_data['query_data']['end']); |
45 | 45 | $qb_hr->add_constraint('date', '>=', (int) $this->_request_data['query_data']['start']); |
46 | - if ( array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
46 | + if (array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
47 | 47 | && $this->_request_data['query_data']['invoiceable_filter'] != -1) { |
48 | 48 | $qb_hr->add_constraint('invoiceable', '=', (bool) $this->_request_data['query_data']['invoiceable_filter']); |
49 | 49 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $tasks = $this->_expand_task($this->_request_data['query_data']['task']); |
60 | 60 | $qb_hr->add_constraint('task', 'IN', $tasks); |
61 | 61 | } |
62 | - if ( array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
62 | + if (array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
63 | 63 | && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') { |
64 | 64 | $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']); |
65 | 65 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | private function add_to_group($new_row, $matching, $sort, $title) |
152 | 152 | { |
153 | - $rows =& $this->_request_data['report']['rows']; |
|
153 | + $rows = & $this->_request_data['report']['rows']; |
|
154 | 154 | if (array_key_exists($matching, $rows)) { |
155 | 155 | $rows[$matching]['rows'][] = $new_row; |
156 | 156 | $rows[$matching]['total_hours'] += $new_row['hour']->hours; |
@@ -102,12 +102,12 @@ |
||
102 | 102 | if (null !== $guid) { |
103 | 103 | //pass the urls & titles for the tabs |
104 | 104 | $tabdata[] = [ |
105 | - 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
106 | - 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
105 | + 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
106 | + 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
107 | 107 | ]; |
108 | 108 | $tabdata[] = [ |
109 | - 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
110 | - 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
109 | + 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
110 | + 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
111 | 111 | ]; |
112 | 112 | } |
113 | 113 |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | $config = array_merge($defaults, $config); |
40 | 40 | |
41 | 41 | $node_url = $siteconfig->get_node_full_url($component); |
42 | - if ( $node_url |
|
43 | - && ( !$user_id |
|
42 | + if ($node_url |
|
43 | + && (!$user_id |
|
44 | 44 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $siteconfig->get_node_guid($component), midcom_db_topic::class, $user_id))) { |
45 | 45 | $providers[] = [ |
46 | 46 | 'placeholder' => midcom::get()->i18n->get_string('search title', $component), |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | echo '<div id="tabs">'; |
116 | 116 | echo "\n<ul>\n"; |
117 | 117 | foreach ($tabdata as $key => $tab) { |
118 | - echo "<li><a id='key_" . $key ."' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
118 | + echo "<li><a id='key_" . $key . "' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
119 | 119 | } |
120 | 120 | echo "\n</ul>\n"; |
121 | 121 | echo "</div>\n"; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | private function _convert_to_localdata() |
234 | 234 | { |
235 | - return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
235 | + return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | private function _render_json() |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $this->_sort_field = $query['sidx']; |
267 | 267 | $this->_sort_direction = strtoupper($query['sord']); |
268 | 268 | } |
269 | - if ( !empty($query['_search']) |
|
269 | + if (!empty($query['_search']) |
|
270 | 270 | && $query['_search'] === 'true') { |
271 | 271 | foreach ($query as $field => $value) { |
272 | 272 | if (in_array($field, ['_search', 'nd', 'page', 'rows', 'sidx', 'sord'])) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | $this->_total_rows = $qb->count(); |
293 | 293 | |
294 | - if ( $this->_datatype == 'json' |
|
294 | + if ($this->_datatype == 'json' |
|
295 | 295 | && !empty($this->_results_per_page)) { |
296 | 296 | $qb->set_limit($this->_results_per_page); |
297 | 297 | if (!empty($this->_offset)) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | $recipient = $_ENV["RECIPIENT"]; |
47 | 47 | $token_length = strlen($recipient) - strlen($prefix) - strlen($suffix); |
48 | -if ( $token_length <= 0 |
|
48 | +if ($token_length <= 0 |
|
49 | 49 | || substr($recipient, 0, strlen($prefix)) != $prefix |
50 | 50 | || substr($recipient, strlen($prefix) + $token_length) != $suffix) { |
51 | 51 | error_log("Recipient address does not match address template: $recipient"); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | fclose($fh); |
62 | 62 | exit(0); |
63 | 63 | } |
64 | -} elseif ( substr($BOUNCE_LOGGER, 0, strlen("http://")) == "http://" |
|
64 | +} elseif (substr($BOUNCE_LOGGER, 0, strlen("http://")) == "http://" |
|
65 | 65 | || substr($BOUNCE_LOGGER, 0, strlen("https://")) == "https://") { |
66 | 66 | $client = new org_openpsa_httplib(); |
67 | 67 | $client->post($BOUNCE_LOGGER, ["token" => $token]); |
@@ -222,7 +222,8 @@ discard block |
||
222 | 222 | $this->_backend->send($person, $member, $token, $subject, $content, $from); |
223 | 223 | self::$_messages_sent++; |
224 | 224 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT; |
225 | - } catch (midcom_error $e) { |
|
225 | + } |
|
226 | + catch (midcom_error $e) { |
|
226 | 227 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::FAILURE; |
227 | 228 | if (!$this->test_mode) { |
228 | 229 | $params[] = [ |
@@ -279,7 +280,8 @@ discard block |
||
279 | 280 | { |
280 | 281 | try { |
281 | 282 | $person = org_openpsa_contacts_person_dba::get_cached($member->person); |
282 | - } catch (midcom_error $e) { |
|
283 | + } |
|
284 | + catch (midcom_error $e) { |
|
283 | 285 | debug_add("Person #{$member->person} deleted or missing, removing member (member #{$member->id})"); |
284 | 286 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
285 | 287 | $member->delete(); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $token .= midcom_helper_misc::random_string($this->token_size - 1, 'abcdefghijklmnopqrstuvwxyz0123456789'); |
261 | 261 | |
262 | 262 | //If token is not free or (very, very unlikely) matches our dummy token, recurse. |
263 | - if ( $token === 'dummy' |
|
263 | + if ($token === 'dummy' |
|
264 | 264 | || !org_openpsa_directmarketing_campaign_messagereceipt_dba::token_is_free($token)) { |
265 | 265 | return $this->_create_token(); |
266 | 266 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | return false; |
285 | 285 | } |
286 | 286 | $type = $this->_backend->get_type(); |
287 | - if ( $person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
287 | + if ($person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
288 | 288 | || $person->get_parameter('org.openpsa.directmarketing', "send_{$type}_denied")) { |
289 | 289 | debug_add("Sending {$type} messages to person {$person->rname} is denied, unsubscribing member (member #{$member->id})"); |
290 | 290 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | debug_add("Recursion level is {$level}, limit is {$this->_chunk_max_recurse}"); |
332 | 332 | /* Make sure we still have results left, if not just recurse... |
333 | 333 | (basically this is to avoid returning an empty array when everything is otherwise ok) */ |
334 | - if ( count($results) == 0 |
|
334 | + if (count($results) == 0 |
|
335 | 335 | && ($level < $this->_chunk_max_recurse)) { |
336 | 336 | debug_add('All our results got filtered, recursing for another round'); |
337 | 337 | //Trivial rate limiting. |
@@ -54,7 +54,7 @@ |
||
54 | 54 | } |
55 | 55 | $this->_view_toolbar->add_items($buttons); |
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 | $this->_node_toolbar->add_item($workflow->get_button('config/', [ |
60 | 60 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function configureOptions(OptionsResolver $resolver) |
26 | 26 | { |
27 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
27 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
28 | 28 | $widget_defaults = [ |
29 | 29 | 'map_action_elements' => false, |
30 | 30 | 'show_title' => true, |
@@ -88,7 +88,7 @@ |
||
88 | 88 | ]) |
89 | 89 | ->setRequired('object') |
90 | 90 | ->setAllowedTypes('object', 'midcom_core_dbaobject') |
91 | - ->setNormalizer('label', function ($options, $value) { |
|
91 | + ->setNormalizer('label', function($options, $value) { |
|
92 | 92 | if ($value === null) { |
93 | 93 | return midcom_helper_reflector::get_object_title($options['object']); |
94 | 94 | } |