@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function __construct(array &$data) |
24 | 24 | { |
25 | - $this->_data =& $data; |
|
25 | + $this->_data = & $data; |
|
26 | 26 | midcom::get()->head->enable_jquery_ui(['accordion']); |
27 | 27 | } |
28 | 28 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - if ( midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style') |
|
36 | - && ( $this->_data['handler_id'] !== 'object_create' |
|
35 | + if (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style') |
|
36 | + && ($this->_data['handler_id'] !== 'object_create' |
|
37 | 37 | || $this->_data['current_type'] == 'midgard_element')) { |
38 | 38 | // Suggest element names to create under a style |
39 | 39 | $this->_data['help_style_elementnames'] = $this->_get_style_elements_and_nodes($this->_data['object']->id); |
40 | 40 | midcom_show_style('midgard_admin_asgard_stylehelper_elementnames'); |
41 | 41 | |
42 | - } elseif ( midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element') |
|
42 | + } elseif (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element') |
|
43 | 43 | && $this->_get_help_element()) { |
44 | 44 | midcom_show_style('midgard_admin_asgard_stylehelper_element'); |
45 | 45 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | private function _get_help_element() : bool |
49 | 49 | { |
50 | - if ( empty($this->_data['object']->name) |
|
50 | + if (empty($this->_data['object']->name) |
|
51 | 51 | || empty($this->_data['object']->style)) { |
52 | 52 | // We cannot help with empty elements |
53 | 53 | return false; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ]); |
49 | 49 | } |
50 | 50 | |
51 | - if ( $this->_article->topic === $this->_topic->id |
|
51 | + if ($this->_article->topic === $this->_topic->id |
|
52 | 52 | && $this->_article->can_do('midgard:delete')) { |
53 | 53 | $delete = $this->get_workflow('delete', ['object' => $this->_article]); |
54 | 54 | $buttons[] = $delete->get_button("delete/{$this->_article->guid}/"); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if ($this->_config->get('comments_enable')) { |
84 | 84 | if ($node = net_nehmer_comments_interface::get_node($this->_topic, $this->_config->get('comments_topic'))) { |
85 | 85 | $data['comments_url'] = $node[MIDCOM_NAV_RELATIVEURL] . "comment/{$this->_article->guid}"; |
86 | - if ( $this->_topic->can_do('midgard:update') |
|
86 | + if ($this->_topic->can_do('midgard:update') |
|
87 | 87 | && $this->_topic->can_do('net.nehmer.comments:moderation')) { |
88 | 88 | net_nehmer_comments_viewer::add_head_elements(); |
89 | 89 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function _on_watched_dba_delete(midcom_core_dbaobject $object) |
18 | 18 | { |
19 | 19 | $qb = org_openpsa_directmarketing_campaign_member_dba::new_query_builder(); |
20 | - if ( $object instanceof midcom_db_person |
|
20 | + if ($object instanceof midcom_db_person |
|
21 | 21 | || $object instanceof org_openpsa_contacts_person_dba) { |
22 | 22 | $qb->add_constraint('person', '=', $object->id); |
23 | 23 | } elseif ($object instanceof org_openpsa_directmarketing_campaign_dba) { |
@@ -140,7 +140,7 @@ |
||
140 | 140 | return; |
141 | 141 | } |
142 | 142 | |
143 | - if ( !is_writable($config['filename']) |
|
143 | + if (!is_writable($config['filename']) |
|
144 | 144 | && !is_writable(dirname($config['filename']))) { |
145 | 145 | debug_add("Error logging file {$config['filename']} is not writable", MIDCOM_LOG_WARN); |
146 | 146 | return; |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $year_data = []; |
132 | 132 | $first_post = $this->_compute_welcome_first_post(); |
133 | 133 | $this->_request_data['first_post'] = $first_post; |
134 | - $this->_request_data['total_count'] =& $total_count; |
|
135 | - $this->_request_data['year_data'] =& $year_data; |
|
134 | + $this->_request_data['total_count'] = & $total_count; |
|
135 | + $this->_request_data['year_data'] = & $year_data; |
|
136 | 136 | if (!$first_post) { |
137 | 137 | return; |
138 | 138 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | switch ($handler_id) { |
262 | 262 | case 'archive-year-category': |
263 | 263 | $category = trim(strip_tags($args[1])); |
264 | - if ( $data['datamanager']->get_schema('default')->has_field('categories') |
|
264 | + if ($data['datamanager']->get_schema('default')->has_field('categories') |
|
265 | 265 | && !$data['datamanager']->get_schema('default')->get_field('categories')['type_config']['allow_multiple']) { |
266 | 266 | $qb->add_constraint('extra1', '=', $category); |
267 | 267 | } else { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | throw new midcom_error_notfound("The year '{$year}' is not valid."); |
346 | 346 | } |
347 | 347 | |
348 | - if ( $month < 1 |
|
348 | + if ($month < 1 |
|
349 | 349 | || $month > 12) { |
350 | 350 | throw new midcom_error_notfound("The month {$month} is not valid."); |
351 | 351 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $result = $this->is_username_available($fields); |
48 | 48 | |
49 | 49 | $accounthelper = new org_openpsa_user_accounthelper(); |
50 | - if ($fields['password']['switch'] && !$accounthelper->check_password_strength($fields['password']['password'])){ |
|
50 | + if ($fields['password']['switch'] && !$accounthelper->check_password_strength($fields['password']['password'])) { |
|
51 | 51 | $result = ['password' => midcom::get()->i18n->get_string('password weak', 'org.openpsa.user')]; |
52 | 52 | } |
53 | 53 | |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | $user = new midcom_db_person($fields["person"]); |
150 | 150 | |
151 | 151 | $accounthelper = new org_openpsa_user_accounthelper($user); |
152 | - if (!$accounthelper->check_password_reuse($fields['new_password'])){ |
|
152 | + if (!$accounthelper->check_password_reuse($fields['new_password'])) { |
|
153 | 153 | $result['password'] = midcom::get()->i18n->get_string('password was already used', 'org.openpsa.user'); |
154 | 154 | } |
155 | - if (!$accounthelper->check_password_strength($fields['new_password'])){ |
|
155 | + if (!$accounthelper->check_password_strength($fields['new_password'])) { |
|
156 | 156 | $result['password'] = midcom::get()->i18n->get_string('password weak', 'org.openpsa.user'); |
157 | 157 | } |
158 | 158 | return $result ?: true; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | $result_cache[$cache_key] = []; |
77 | - $ret =& $result_cache[$cache_key]; |
|
77 | + $ret = & $result_cache[$cache_key]; |
|
78 | 78 | |
79 | 79 | if (empty($up)) { |
80 | 80 | // TODO: use reflection to see what kind of property this is ? |
@@ -149,7 +149,7 @@ |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | $reflector = midcom_helper_reflector::get($linked_object); |
152 | - $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) ."</a>"; |
|
152 | + $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) . "</a>"; |
|
153 | 153 | $data['linked_objects'][$entry->linkGuid] = $link_html; |
154 | 154 | $data['linked_raw_objects'][$entry->linkGuid] = $reflector->get_object_label($linked_object); |
155 | 155 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $qb_receipts->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT); |
38 | 38 | $qb_receipts->add_order('metadata.created'); |
39 | 39 | $receipts = $qb_receipts->execute_unchecked(); |
40 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
40 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
41 | 41 | $receipt_data['first_send'] = $receipts[0]->metadata->created ?? 0; |
42 | 42 | $receipt_data['last_send'] = end($receipts)->metadata->created ?? 0; |
43 | 43 | $receipt_data['sent'] = count($receipts); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | private function _get_campaign_data(int $first_send) |
66 | 66 | { |
67 | - $campaign_data =& $this->_request_data['report']['campaign_data']; |
|
67 | + $campaign_data = & $this->_request_data['report']['campaign_data']; |
|
68 | 68 | $qb_unsub = org_openpsa_directmarketing_campaign_member_dba::new_query_builder(); |
69 | 69 | $qb_unsub->add_constraint('campaign', '=', $this->_message->campaign); |
70 | 70 | $qb_unsub->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | private function _get_link_data($segmentation_param) |
89 | 89 | { |
90 | 90 | $this->_request_data['report']['link_data'] = []; |
91 | - $link_data =& $this->_request_data['report']['link_data']; |
|
91 | + $link_data = & $this->_request_data['report']['link_data']; |
|
92 | 92 | |
93 | 93 | $link_data['counts'] = []; |
94 | 94 | $link_data['percentages'] = ['of_links' => [], 'of_recipients' => []]; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | foreach ($links as $link) { |
115 | 115 | $segment = ''; |
116 | 116 | $segment_notfound = false; |
117 | - if ( $segmentation_param |
|
117 | + if ($segmentation_param |
|
118 | 118 | && !empty($link->person)) { |
119 | 119 | try { |
120 | 120 | $person = org_openpsa_contacts_person_dba::get_cached($link->person); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (!isset($link_data['segments'][$segment])) { |
129 | 129 | $link_data['segments'][$segment] = $segment_prototype; |
130 | 130 | } |
131 | - $segment_data =& $link_data['segments'][$segment]; |
|
131 | + $segment_data = & $link_data['segments'][$segment]; |
|
132 | 132 | } else { |
133 | 133 | $segment_data = $segment_prototype; |
134 | 134 | } |
@@ -238,15 +238,15 @@ discard block |
||
238 | 238 | $this->_initialize_field($array['percentages']['of_links'], $link); |
239 | 239 | $this->_initialize_field($array['percentages']['of_recipients'], $link); |
240 | 240 | |
241 | - $link_data =& $this->_request_data['report']['link_data']; |
|
242 | - $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total']/$link_data['total'])*100; |
|
243 | - $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/$link_data['total'])*100; |
|
241 | + $link_data = & $this->_request_data['report']['link_data']; |
|
242 | + $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total'] / $link_data['total']) * 100; |
|
243 | + $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / $link_data['total']) * 100; |
|
244 | 244 | |
245 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
246 | - $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target])-1)/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
247 | - $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
245 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
246 | + $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target]) - 1) / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
247 | + $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
248 | 248 | |
249 | - if ( !isset($array['percentages']['of_recipients']['total']) |
|
249 | + if (!isset($array['percentages']['of_recipients']['total']) |
|
250 | 250 | || $array['percentages']['of_recipients'][$link->target]['total'] > $array['percentages']['of_recipients']['total']) { |
251 | 251 | $array['percentages']['of_recipients']['total'] = $array['percentages']['of_recipients'][$link->target]['total']; |
252 | 252 | } |