@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | //Substyle handling |
61 | - if ( !empty($data['message_array']['substyle']) |
|
61 | + if (!empty($data['message_array']['substyle']) |
|
62 | 62 | && !preg_match('/^builtin:/', $data['message_array']['substyle'])) { |
63 | 63 | debug_add("Appending substyle {$data['message_array']['substyle']}"); |
64 | 64 | midcom::get()->style->append_substyle($data['message_array']['substyle']); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | private function _real_show_compose($handler_id, array &$data) |
118 | 118 | { |
119 | 119 | $prefix = ''; |
120 | - if ( !empty($data['message_array']['substyle']) |
|
120 | + if (!empty($data['message_array']['substyle']) |
|
121 | 121 | && preg_match('/^builtin:(.*)/', $data['message_array']['substyle'], $matches_style)) { |
122 | 122 | $prefix = $matches_style[1] . '-'; |
123 | 123 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | if (!$this->timestamp) { |
25 | 25 | $this->timestamp = time(); |
26 | 26 | } |
27 | - if ( !$this->referrer |
|
27 | + if (!$this->referrer |
|
28 | 28 | && !empty($_SERVER['HTTP_REFERER'])) { |
29 | 29 | $this->referrer = $_SERVER['HTTP_REFERER']; |
30 | 30 | } |
@@ -300,7 +300,8 @@ |
||
300 | 300 | $organization = $this->_import_subscribers_organization($subscriber); |
301 | 301 | $this->_import_subscribers_organization_member($subscriber, $person, $organization); |
302 | 302 | } |
303 | - } catch (midcom_error $e) { |
|
303 | + } |
|
304 | + catch (midcom_error $e) { |
|
304 | 305 | $e->log(); |
305 | 306 | // Clean up possibly created data |
306 | 307 | $this->_clean_new_objects(); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | - if ( !$person |
|
124 | + if (!$person |
|
125 | 125 | && !empty($subscriber['person']['handphone'])) { |
126 | 126 | // Perform a simple cell phone test. More complicated duplicate checking is best left to the o.o.contacts duplicate checker |
127 | 127 | $qb = org_openpsa_contacts_person_dba::new_query_builder(); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // User is or has been subscriber earlier, update status |
168 | 168 | $member = $members[0]; |
169 | 169 | |
170 | - if ( $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
170 | + if ($member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
171 | 171 | || $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::NORMAL) { |
172 | 172 | $this->_import_status['already_subscribed']++; |
173 | 173 | return; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | $qb = org_openpsa_contacts_group_dba::new_query_builder(); |
209 | 209 | $schema = $this->_schemadbs['organization']->get('default'); |
210 | - if ( $schema->has_field('company_id') |
|
210 | + if ($schema->has_field('company_id') |
|
211 | 211 | && !empty($subscriber['organization']['company_id'])) { |
212 | 212 | // Imported data has a company id, we use that instead of name |
213 | 213 | $qb->add_constraint($schema->get_field('company_id')['storage']['location'], '=', $subscriber['organization']['company_id']); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | // Seek by official name |
216 | 216 | $qb->add_constraint('official', '=', $subscriber['organization']['official']); |
217 | 217 | |
218 | - if ( $schema->has_field('city') |
|
218 | + if ($schema->has_field('city') |
|
219 | 219 | && !empty($subscriber['organization']['city'])) { |
220 | 220 | // Imported data has a city, we use also that for matching |
221 | 221 | $qb->add_constraint($schema->get_field('city')['storage']['location'], '=', $subscriber['organization']['city']); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | echo " <th>{$type}</th>\n"; |
35 | 35 | echo " <td style=\"text-align: right;\">" . number_format($count) . "</td>\n"; |
36 | 36 | if (isset($cleanups_kept[$type])) { |
37 | - echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) ."</td>\n"; |
|
37 | + echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) . "</td>\n"; |
|
38 | 38 | } |
39 | 39 | echo " </tr>\n"; |
40 | 40 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $button_config[MIDCOM_TOOLBAR_URL] = $url; |
74 | 74 | //The constants are numeric, so array_merge won't work... |
75 | 75 | foreach ($options as $key => $value) { |
76 | - if ( is_array($value) |
|
76 | + if (is_array($value) |
|
77 | 77 | && !empty($button_config[$key])) { |
78 | 78 | $value = array_merge($button_config[$key], $value); |
79 | 79 | } |
@@ -37,7 +37,8 @@ |
||
37 | 37 | foreach ($items as $identifier => $guid) { |
38 | 38 | try { |
39 | 39 | $results[$identifier] = new midcom_db_attachment($guid); |
40 | - } catch (midcom_error $e) { |
|
40 | + } |
|
41 | + catch (midcom_error $e) { |
|
41 | 42 | $e->log(); |
42 | 43 | } |
43 | 44 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | protected function save_attachment_list() : bool |
144 | 144 | { |
145 | 145 | if (!empty($this->config['widget_config']['sortable'])) { |
146 | - uasort($this->map, function ($a, $b) { |
|
146 | + uasort($this->map, function($a, $b) { |
|
147 | 147 | if ($a->metadata->score == $b->metadata->score) { |
148 | 148 | return strnatcasecmp($a->name, $b->name); |
149 | 149 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | midcom::get()->auth->require_admin_user(); |
3 | 3 | |
4 | -if ( empty($_POST['to']) |
|
4 | +if (empty($_POST['to']) |
|
5 | 5 | || empty($_POST['from'])) { |
6 | 6 | ?> |
7 | 7 | <h2>Send test email</h2> |
@@ -23,7 +23,7 @@ |
||
23 | 23 | include dirname(__DIR__) . '/config-default.inc.php'; |
24 | 24 | } |
25 | 25 | |
26 | -if (! defined('MIDCOM_STATIC_URL')) { |
|
26 | +if (!defined('MIDCOM_STATIC_URL')) { |
|
27 | 27 | define('MIDCOM_STATIC_URL', '/midcom-static'); |
28 | 28 | } |
29 | 29 |
@@ -77,7 +77,8 @@ discard block |
||
77 | 77 | // if the property useContactAddress is set |
78 | 78 | $billing_data[0]->set_address(); |
79 | 79 | return $billing_data[0]; |
80 | - } catch (midcom_error $e) { |
|
80 | + } |
|
81 | + catch (midcom_error $e) { |
|
81 | 82 | $e->log(); |
82 | 83 | return false; |
83 | 84 | } |
@@ -122,10 +123,12 @@ discard block |
||
122 | 123 | { |
123 | 124 | try { |
124 | 125 | return new org_openpsa_contacts_person_dba($this->linkGuid); |
125 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
126 | 128 | try { |
127 | 129 | return new org_openpsa_contacts_group_dba($this->linkGuid); |
128 | - } catch (midcom_error $e) { |
|
130 | + } |
|
131 | + catch (midcom_error $e) { |
|
129 | 132 | debug_add("Failed to load contact with GUID: " . $this->linkGuid . " - last error:" . $e->getMessage(), MIDCOM_LOG_ERROR); |
130 | 133 | return false; |
131 | 134 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | public static function get_by_object(org_openpsa_invoices_interfaces_customer $object) : self |
62 | 62 | { |
63 | 63 | if ( !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
64 | - // check if the customerContact is set and has invoice_data |
|
64 | + // check if the customerContact is set and has invoice_data |
|
65 | 65 | && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) { |
66 | 66 | $bd = new self(); |
67 | 67 | $due = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('default_due_days'); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | */ |
61 | 61 | public static function get_by_object(org_openpsa_invoices_interfaces_customer $object) : self |
62 | 62 | { |
63 | - if ( !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
|
63 | + if (!($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
|
64 | 64 | // check if the customerContact is set and has invoice_data |
65 | 65 | && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) { |
66 | 66 | $bd = new self(); |