@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // User is or has been subscriber earlier, update status |
134 | 134 | $member = $members[0]; |
135 | 135 | |
136 | - if ( $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
136 | + if ($member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
137 | 137 | || $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::NORMAL) { |
138 | 138 | $this->_import_status['already_subscribed']++; |
139 | 139 | return; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | $qb = org_openpsa_contacts_group_dba::new_query_builder(); |
175 | 175 | $schema = $this->_schemadbs['organization']->get('default'); |
176 | - if ( $schema->has_field('company_id') |
|
176 | + if ($schema->has_field('company_id') |
|
177 | 177 | && !empty($subscriber['organization']['company_id'])) { |
178 | 178 | // Imported data has a company id, we use that instead of name |
179 | 179 | $qb->add_constraint($schema->get_field('company_id')['storage']['location'], '=', $subscriber['organization']['company_id']); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | // Seek by official name |
182 | 182 | $qb->add_constraint('official', '=', $subscriber['organization']['official']); |
183 | 183 | |
184 | - if ( $schema->has_field('city') |
|
184 | + if ($schema->has_field('city') |
|
185 | 185 | && !empty($subscriber['organization']['city'])) { |
186 | 186 | // Imported data has a city, we use also that for matching |
187 | 187 | $qb->add_constraint($schema->get_field('city')['storage']['location'], '=', $subscriber['organization']['city']); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | protected function match(string $property, array $data1, array $data2) : bool |
115 | 115 | { |
116 | - if ( !empty($data1[$property]) |
|
116 | + if (!empty($data1[$property]) |
|
117 | 117 | && $data1[$property] == $data2[$property]) { |
118 | 118 | return true; |
119 | 119 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | continue; |
196 | 196 | } |
197 | 197 | |
198 | - if ( $obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
198 | + if ($obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
199 | 199 | || $obj2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj1->guid)) { |
200 | 200 | // Not-duplicate parameter found, returning zero probability |
201 | 201 | continue; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | // if user's lastname is part of the email address, check to see if the difference is only in the domain part |
43 | 43 | $email1 = preg_replace('/@.+/', '', $person1['email']); |
44 | 44 | $email2 = preg_replace('/@.+/', '', $person2['email']); |
45 | - if ( str_contains($email1, $person1['lastname']) |
|
45 | + if (str_contains($email1, $person1['lastname']) |
|
46 | 46 | && $email1 == $email2) { |
47 | 47 | $p += 0.5; |
48 | 48 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function load_next() |
61 | 61 | { |
62 | - $i =& $this->_request_data['loop_i']; |
|
62 | + $i = & $this->_request_data['loop_i']; |
|
63 | 63 | while ($i < 100) { |
64 | 64 | debug_add("Loop iteration {$i}"); |
65 | 65 | $qb = new midgard_query_builder('midgard_parameter'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | // Make sure we actually have enough rights to do this |
90 | - if ( !$object1->can_do('midgard:update') |
|
90 | + if (!$object1->can_do('midgard:update') |
|
91 | 91 | || !$object1->can_do('midgard:delete') |
92 | 92 | || !$object2->can_do('midgard:update') |
93 | 93 | || !$object2->can_do('midgard:delete')) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | // Extra sanity check (in case of semi-successful not-duplicate mark) |
99 | - if ( $object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
99 | + if ($object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
100 | 100 | || $object2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object1->guid)) { |
101 | 101 | debug_add("It seems these two (#{$object1->id} and #{$object2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN); |
102 | 102 | $i++; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if ($keep == 'both') { |
129 | 129 | $option1->require_do('midgard:update'); |
130 | 130 | $option2->require_do('midgard:update'); |
131 | - if ( $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
131 | + if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
132 | 132 | && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) { |
133 | 133 | // Clear the possible duplicate parameters |
134 | 134 | $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | } else { |
148 | 148 | if ($keep == $option1->guid) { |
149 | - $object1 =& $option1; |
|
150 | - $object2 =& $option2; |
|
149 | + $object1 = & $option1; |
|
150 | + $object2 = & $option2; |
|
151 | 151 | } elseif ($keep == $option2->guid) { |
152 | - $object1 =& $option2; |
|
153 | - $object2 =& $option1; |
|
152 | + $object1 = & $option2; |
|
153 | + $object2 = & $option1; |
|
154 | 154 | } else { |
155 | 155 | throw new midcom_error('Something weird happened (basically we got bogus data)'); |
156 | 156 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | if ($path === '') { |
66 | 66 | // Infinite loop, set an UI message and stop executing |
67 | - if ( !isset($schema['extends']['name']) |
|
67 | + if (!isset($schema['extends']['name']) |
|
68 | 68 | || $schema['extends']['name'] === $schema_name) { |
69 | 69 | throw new midcom_error('schema ' . $schema_name . ' extends itself'); |
70 | 70 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | private function _process_category_constraint(org_openpsa_qbpager $qb) |
77 | 77 | { |
78 | - if ( !in_array($this->category, $this->_request_data['categories']) |
|
78 | + if (!in_array($this->category, $this->_request_data['categories']) |
|
79 | 79 | && !$this->_config->get('categories_custom_enable')) { |
80 | 80 | throw new midcom_error('Custom categories are not allowed'); |
81 | 81 | // TODO: Check here if there are actually items in this cat? |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
89 | 89 | |
90 | 90 | // Activate correct leaf |
91 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
91 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
92 | 92 | && in_array($this->category, $this->_request_data['categories'])) { |
93 | 93 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->category); |
94 | 94 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function _on_creating() : bool |
27 | 27 | { |
28 | - if ( !$this->referrer |
|
28 | + if (!$this->referrer |
|
29 | 29 | && !empty($_SERVER['HTTP_REFERER'])) { |
30 | 30 | $this->referrer = $_SERVER['HTTP_REFERER']; |
31 | 31 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | $profit = $value - $cost; |
122 | - if ( $this->value != $value |
|
122 | + if ($this->value != $value |
|
123 | 123 | || $this->profit != $profit) { |
124 | 124 | $this->value = $value; |
125 | 125 | $this->profit = $value - $cost; |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | |
185 | 185 | public function _on_updating() : bool |
186 | 186 | { |
187 | - if ( $this->state != self::STATE_ACTIVE |
|
187 | + if ($this->state != self::STATE_ACTIVE |
|
188 | 188 | && !$this->end) { |
189 | 189 | //Not active anymore and end not set, set it to now |
190 | 190 | $this->end = time(); |
191 | 191 | } |
192 | - if ( $this->end |
|
192 | + if ($this->end |
|
193 | 193 | && $this->state == self::STATE_ACTIVE) { |
194 | 194 | //Returned to active state, clear the end marker. |
195 | 195 | $this->end = 0; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function _on_creating() : bool |
42 | 42 | { |
43 | - return ( $this->validate_tag($this->tag) |
|
43 | + return ($this->validate_tag($this->tag) |
|
44 | 44 | && $this->_check_duplicates() == 0); |
45 | 45 | } |
46 | 46 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | public function _on_updating() : bool |
71 | 71 | { |
72 | - return ( $this->validate_tag($this->tag) |
|
72 | + return ($this->validate_tag($this->tag) |
|
73 | 73 | && $this->_check_duplicates() == 0); |
74 | 74 | } |
75 | 75 |