@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | $classes = []; |
339 | 339 | |
340 | 340 | if ($child[MIDCOM_NAV_TYPE] === 'node') { |
341 | - if ( $item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
342 | - && ( !$this->_nap->get_current_leaf() |
|
341 | + if ($item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
342 | + && (!$this->_nap->get_current_leaf() |
|
343 | 343 | || !$this->_nap->get_leaf($this->_nap->get_current_leaf()))) { |
344 | 344 | $classes[] = $this->css_active; |
345 | 345 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | } |
387 | 387 | |
388 | 388 | // Add information about the object's status |
389 | - if ( $this->object_status_to_class |
|
389 | + if ($this->object_status_to_class |
|
390 | 390 | && isset($item[MIDCOM_NAV_OBJECT]) |
391 | 391 | && $css_status_class = midcom::get()->metadata->get_object_classes($item[MIDCOM_NAV_OBJECT])) { |
392 | 392 | $classes[] = $css_status_class; |
@@ -405,12 +405,12 @@ discard block |
||
405 | 405 | echo "<a href=\"{$item[MIDCOM_NAV_ABSOLUTEURL]}\"{$link_class}>{$item[MIDCOM_NAV_NAME]}</a>"; |
406 | 406 | // If either of the follow nodes switches is on, follow all the nodes |
407 | 407 | |
408 | - if ( $item[MIDCOM_NAV_TYPE] === 'node' |
|
408 | + if ($item[MIDCOM_NAV_TYPE] === 'node' |
|
409 | 409 | && !$this->show_only_current |
410 | - && ( $this->list_levels === 0 |
|
410 | + && ($this->list_levels === 0 |
|
411 | 411 | || $this->_level < $this->list_levels)) { |
412 | - if ( $this->follow_all |
|
413 | - || ( $this->follow_selected |
|
412 | + if ($this->follow_all |
|
413 | + || ($this->follow_selected |
|
414 | 414 | && in_array($item[MIDCOM_NAV_ID], $this->node_path, true))) { |
415 | 415 | $this->_level++; |
416 | 416 | $this->_list_child_elements($item[MIDCOM_NAV_ID]); |
@@ -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 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $tasks = $this->_expand_task($this->_request_data['query_data']['task']); |
59 | 59 | $qb_hr->add_constraint('task', 'IN', $tasks); |
60 | 60 | } |
61 | - if ( array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
61 | + if (array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
62 | 62 | && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') { |
63 | 63 | $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']); |
64 | 64 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | private function add_to_group(array $new_row, string $matching, string $sort, string $title) |
148 | 148 | { |
149 | - $rows =& $this->_request_data['report']['rows']; |
|
149 | + $rows = & $this->_request_data['report']['rows']; |
|
150 | 150 | if (array_key_exists($matching, $rows)) { |
151 | 151 | $rows[$matching]['rows'][] = $new_row; |
152 | 152 | $rows[$matching]['total_hours'] += $new_row['hour']->hours; |
@@ -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(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $this->from = $from; |
80 | 80 | $this->subject = $subject; |
81 | 81 | |
82 | - if ( $this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
82 | + if ($this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
83 | 83 | && $this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_HTML) { |
84 | 84 | throw new midcom_error('unsupported message type'); |
85 | 85 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $token .= midcom_helper_misc::random_string($this->token_size - 1, 'abcdefghijklmnopqrstuvwxyz0123456789'); |
226 | 226 | |
227 | 227 | //If token is not free or (very, very unlikely) matches our dummy token, recurse. |
228 | - if ( $token === 'dummy' |
|
228 | + if ($token === 'dummy' |
|
229 | 229 | || !org_openpsa_directmarketing_campaign_messagereceipt_dba::token_is_free($token)) { |
230 | 230 | return $this->_create_token(); |
231 | 231 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | return false; |
250 | 250 | } |
251 | 251 | $type = $this->_backend->get_type(); |
252 | - if ( $person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
252 | + if ($person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
253 | 253 | || $person->get_parameter('org.openpsa.directmarketing', "send_{$type}_denied")) { |
254 | 254 | debug_add("Sending {$type} messages to person {$person->rname} is denied, unsubscribing member (member #{$member->id})"); |
255 | 255 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // OPML subscription list import support |
85 | - if ( array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
85 | + if (array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
86 | 86 | && is_uploaded_file($_FILES['net_nemein_rss_manage_opml']['tmp_name'])) { |
87 | 87 | $opml_file = $_FILES['net_nemein_rss_manage_opml']['tmp_name']; |
88 | 88 |
@@ -210,8 +210,7 @@ |
||
210 | 210 | { |
211 | 211 | $ret = []; |
212 | 212 | |
213 | - foreach ($this->storage as $field => $value) |
|
214 | - { |
|
213 | + foreach ($this->storage as $field => $value) { |
|
215 | 214 | $ret[$field] = $value->get_value(); |
216 | 215 | $config = $this->schema->get_field($field); |
217 | 216 | if (!empty($config['type_config']['allow_multiple'])) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function set_storage(midcom_core_dbaobject $storage = null, $schemaname = null) : self |
141 | 141 | { |
142 | - if ( $schemaname === null |
|
142 | + if ($schemaname === null |
|
143 | 143 | && !empty($storage->id)) { |
144 | 144 | $schemaname = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
145 | 145 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $name = 'midcom_helper_datamanager2'; |
262 | 262 | } |
263 | 263 | |
264 | - if ( $this->form === null |
|
264 | + if ($this->form === null |
|
265 | 265 | || $this->form->getName() != $name) { |
266 | 266 | $config = [ |
267 | 267 | 'schema' => $this->get_schema() |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | { |
337 | 337 | $ret = true; |
338 | 338 | foreach ($this->storage as $field) { |
339 | - if ( $field instanceof recreateable |
|
339 | + if ($field instanceof recreateable |
|
340 | 340 | && !$field->recreate()) { |
341 | 341 | $ret = false; |
342 | 342 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | $this->_group = new org_openpsa_contacts_group_dba(); |
74 | 74 | |
75 | - if ( $this->_type == 'organization' |
|
75 | + if ($this->_type == 'organization' |
|
76 | 76 | && $this->_parent_group) { |
77 | 77 | $this->_group->owner = $this->_parent_group->id; |
78 | 78 | } else { |
@@ -50,6 +50,6 @@ |
||
50 | 50 | $indexer = new org_openpsa_documents_midcom_indexer($this->_topic); |
51 | 51 | $indexer->index($controller->get_datamanager()); |
52 | 52 | |
53 | - return $controller->get_datamanager()->get_storage()->get_value()->name. "/"; |
|
53 | + return $controller->get_datamanager()->get_storage()->get_value()->name . "/"; |
|
54 | 54 | } |
55 | 55 | } |
@@ -9,11 +9,11 @@ |
||
9 | 9 | use midcom\datamanager\indexer\client; |
10 | 10 | use midcom\datamanager\datamanager; |
11 | 11 | |
12 | - /** |
|
13 | - * Indexer client class |
|
14 | - * |
|
15 | - * @package org.openpsa.invoices |
|
16 | - */ |
|
12 | + /** |
|
13 | + * Indexer client class |
|
14 | + * |
|
15 | + * @package org.openpsa.invoices |
|
16 | + */ |
|
17 | 17 | class org_openpsa_invoices_midcom_indexer extends client |
18 | 18 | { |
19 | 19 | public function prepare_document(midcom_services_indexer_document &$document, datamanager $dm) |
@@ -30,7 +30,8 @@ |
||
30 | 30 | $this->config = $config; |
31 | 31 | } |
32 | 32 | |
33 | - protected function cast($value) { |
|
33 | + protected function cast($value) |
|
34 | + { |
|
34 | 35 | if ($this->config['type'] == 'number' && !is_numeric($value)) { |
35 | 36 | $value = (float) $value; |
36 | 37 | } |