@@ -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 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | foreach ($parameters as $key => $value) { |
104 | 104 | $this->_patterns[] = "/__({$key})__/"; |
105 | 105 | |
106 | - if ( is_array($value) |
|
106 | + if (is_array($value) |
|
107 | 107 | || is_object($value)) { |
108 | 108 | $this->_patterns[] = "/__({$key})_([^ \.>\"-]*?)__/"; |
109 | 109 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $this->from = $from; |
76 | 76 | $this->subject = $subject; |
77 | 77 | |
78 | - if ( $message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
78 | + if ($message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
79 | 79 | && $message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_HTML) { |
80 | 80 | throw new midcom_error('unsupported message type'); |
81 | 81 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $token .= midcom_helper_misc::random_string($this->token_size - 1, 'abcdefghijklmnopqrstuvwxyz0123456789'); |
220 | 220 | |
221 | 221 | //If token is not free or (very, very unlikely) matches our dummy token, recurse. |
222 | - if ( $token === 'dummy' |
|
222 | + if ($token === 'dummy' |
|
223 | 223 | || !org_openpsa_directmarketing_campaign_messagereceipt_dba::token_is_free($token)) { |
224 | 224 | return $this->_create_token(); |
225 | 225 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | return null; |
241 | 241 | } |
242 | 242 | $type = $this->_backend->get_type(); |
243 | - if ( $person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
243 | + if ($person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
244 | 244 | || $person->get_parameter('org.openpsa.directmarketing', "send_{$type}_denied")) { |
245 | 245 | debug_add("Sending {$type} messages to person {$person->rname} is denied, unsubscribing member (member #{$member->id})"); |
246 | 246 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $tmpfile = null; |
342 | 342 | $imagesize = getimagesize($this->_filename); |
343 | 343 | |
344 | - if ( $imagesize[2] == IMAGETYPE_JPEG |
|
344 | + if ($imagesize[2] == IMAGETYPE_JPEG |
|
345 | 345 | && $this->_jpegtran_available()) { |
346 | 346 | /* jpegtran */ |
347 | 347 | $operations = [ |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $imagesize = getimagesize($this->_filename); |
410 | 410 | |
411 | 411 | // Try lossless jpegtran rotation if possible |
412 | - if ( $imagesize[2] == IMAGETYPE_JPEG |
|
412 | + if ($imagesize[2] == IMAGETYPE_JPEG |
|
413 | 413 | && ($rotate % 90 == 0) |
414 | 414 | && $this->_jpegtran_available()) { |
415 | 415 | $tmpfile = $this->_get_tempfile(); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function fill($x = null, $y = null, $color = null, string $gravity = 'center') |
541 | 541 | { |
542 | - if ( empty($x) |
|
542 | + if (empty($x) |
|
543 | 543 | || empty($y) |
544 | 544 | || empty($color)) { |
545 | 545 | //This is a bit silly, but here for backwards compatibility... |
@@ -97,7 +97,7 @@ |
||
97 | 97 | $attachment->update(); |
98 | 98 | } else { |
99 | 99 | $attachment = $this->invoice->create_attachment($filename, $this->invoice->get_label(), "application/pdf"); |
100 | - if ( !$attachment |
|
100 | + if (!$attachment |
|
101 | 101 | || !$this->invoice->set_parameter("midcom.helper.datamanager2.type.blobs", "guids_pdf_file", $attachment->guid . ":" . $attachment->guid)) { |
102 | 102 | throw new midcom_error("Failed to create invoice attachment for pdf: " . midcom_connection::get_error_string()); |
103 | 103 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | return null; |
101 | 101 | } |
102 | 102 | |
103 | - if ( midcom::get()->config->get('auth_check_client_ip') |
|
103 | + if (midcom::get()->config->get('auth_check_client_ip') |
|
104 | 104 | && $data['clientip'] != $request->getClientIp()) { |
105 | 105 | debug_add("The session had mismatching client IP.", MIDCOM_LOG_INFO); |
106 | 106 | debug_add("Expected {$data['clientip']}, got {$request->getClientIp()}."); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return null; |
115 | 115 | } |
116 | 116 | |
117 | - if ( !$this->check_timestamp($data['timestamp'], $user) |
|
117 | + if (!$this->check_timestamp($data['timestamp'], $user) |
|
118 | 118 | || !$this->authenticate($user->username, '', true)) { |
119 | 119 | $this->logout($user); |
120 | 120 | return null; |
@@ -149,7 +149,7 @@ |
||
149 | 149 | $child_indent = $indent + 20; |
150 | 150 | echo "{$prefix}<tbody class=\"children\">\n"; |
151 | 151 | foreach ($child_types as $type => $children) { |
152 | - if ( count($children) < 10 |
|
152 | + if (count($children) < 10 |
|
153 | 153 | || isset($_GET['show_children'][$object->guid][$type])) { |
154 | 154 | foreach ($children as $child) { |
155 | 155 | $this->show_type($child, $child_indent, "{$prefix} ", false); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | &(published:h); |
29 | 29 | <?php |
30 | 30 | if ($data['linked']) { |
31 | - echo $data['l10n']->get('to') ." <a href=\"{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}\">{$data['node'][MIDCOM_NAV_NAME]}</a>\n"; |
|
31 | + echo $data['l10n']->get('to') . " <a href=\"{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}\">{$data['node'][MIDCOM_NAV_NAME]}</a>\n"; |
|
32 | 32 | } |
33 | 33 | ?> |
34 | 34 | </p> |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function search_nodes(array $node, midcom_helper_nav $nap, string $prefix) |
52 | 52 | { |
53 | - if ( !array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
53 | + if (!array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
54 | 54 | && $node[MIDCOM_NAV_COMPONENT] != 'midcom.helper.search') { |
55 | 55 | $l10n = $this->_i18n->get_l10n($node[MIDCOM_NAV_COMPONENT]); |
56 | 56 | $this->_request_data['components'][$node[MIDCOM_NAV_COMPONENT]] = $l10n->get($node[MIDCOM_NAV_COMPONENT]); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | $this->prepare_formdata($_REQUEST['type']); |
100 | 100 | |
101 | - if ( count(explode(' ', $data['query'])) == 1 |
|
101 | + if (count(explode(' ', $data['query'])) == 1 |
|
102 | 102 | && !str_contains($data['query'], '*') |
103 | 103 | && $this->_config->get('single_term_auto_wildcard')) { |
104 | 104 | //If there is only one search term append * to the query if auto_wildcard is enabled |