Passed
Branch master (95796a)
by Andreas
38:22
created
lib/org/openpsa/contacts/handler/person/view.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,8 +156,7 @@  discard block
 block discarded – undo
156 156
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('remove from my contacts'),
157 157
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png',
158 158
             );
159
-        }
160
-        else
159
+        } else
161 160
         {
162 161
             // We're not buddies, show add button
163 162
             $buttons[] = array
@@ -220,8 +219,7 @@  discard block
 block discarded – undo
220 219
         {
221 220
             midcom_show_style('show-person-groups-empty');
222 221
 
223
-        }
224
-        else
222
+        } else
225 223
         {
226 224
             $this->_show_memberships('organizations');
227 225
             $this->_show_memberships('groups');
@@ -241,8 +239,7 @@  discard block
 block discarded – undo
241 239
             try
242 240
             {
243 241
                 $this->_request_data['group'] = org_openpsa_contacts_group_dba::get_cached($member->gid);
244
-            }
245
-            catch (midcom_error $e)
242
+            } catch (midcom_error $e)
246 243
             {
247 244
                 $e->log();
248 245
                 continue;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/person/create.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
             if ($this->_group->orgOpenpsaObtype >= org_openpsa_contacts_group_dba::ORGANIZATION)
42 42
             {
43 43
                 $defaults['organizations'] = array($this->_group->id);
44
-            }
45
-            else if ($this->_group->orgOpenpsaObtype < org_openpsa_contacts_group_dba::MYCONTACTS)
44
+            } else if ($this->_group->orgOpenpsaObtype < org_openpsa_contacts_group_dba::MYCONTACTS)
46 45
             {
47 46
                 $defaults['groups'] = array($this->_group->id);
48 47
             }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/duplicates/person.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
             {
73 73
                 $person1 = new org_openpsa_contacts_person_dba($param->parentguid);
74 74
                 $person2 = new org_openpsa_contacts_person_dba($param->name);
75
-            }
76
-            catch (midcom_error $e)
75
+            } catch (midcom_error $e)
77 76
             {
78 77
                 $i++;
79 78
                 continue;
@@ -126,8 +125,7 @@  discard block
 block discarded – undo
126 125
 
127 126
                     // TODO: Localize
128 127
                     midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), "Keeping both \"{$option1->name}\" and \"{$option2->name}\", they will not be marked as duplicates in the future", 'ok');
129
-                }
130
-                else
128
+                } else
131 129
                 {
132 130
                     $errstr = midcom_connection::get_error_string();
133 131
                     // Failed to set as not duplicate, clear parameter that might have been set (could have only been the first)
@@ -136,20 +134,17 @@  discard block
 block discarded – undo
136 134
                     // TODO: Localize
137 135
                     midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), "Failed to mark #{$option1->id} and # {$option2->id} as not duplicates, errstr: {$errstr}", 'error');
138 136
                 }
139
-            }
140
-            else
137
+            } else
141 138
             {
142 139
                 if ($keep == $option1->guid)
143 140
                 {
144 141
                     $person1 =& $option1;
145 142
                     $person2 =& $option2;
146
-                }
147
-                else if ($keep == $option2->guid)
143
+                } else if ($keep == $option2->guid)
148 144
                 {
149 145
                     $person1 =& $option2;
150 146
                     $person2 =& $option1;
151
-                }
152
-                else
147
+                } else
153 148
                 {
154 149
                     throw new midcom_error('Something weird happened (basically we got bogus data)');
155 150
                 }
@@ -160,8 +155,7 @@  discard block
 block discarded – undo
160 155
                 {
161 156
                     $merger = new org_openpsa_contacts_duplicates_merge('person', $this->_config);
162 157
                     $merger->merge_delete($person1, $person2);
163
-                }
164
-                catch (midcom_error $e)
158
+                } catch (midcom_error $e)
165 159
                 {
166 160
                     // TODO: Localize
167 161
                     midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), 'Merge failed, errstr: ' . $e->getMessage(), 'error');
@@ -182,8 +176,7 @@  discard block
 block discarded – undo
182 176
         if (!$this->_request_data['notfound'])
183 177
         {
184 178
             midcom_show_style('show-duplicate-persons');
185
-        }
186
-        else
179
+        } else
187 180
         {
188 181
             midcom_show_style('show-duplicate-persons-notfound');
189 182
         }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/midcom/interfaces.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
             {
60 60
                 $root_groups[$name] = $group;
61 61
             }
62
-        }
63
-        else
62
+        } else
64 63
         {
65 64
             debug_add("OpenPSA Contacts root group could not be found", MIDCOM_LOG_WARN);
66 65
 
@@ -168,8 +167,7 @@  discard block
 block discarded – undo
168 167
             try
169 168
             {
170 169
                 $person = new org_openpsa_contacts_person_dba($args['person']);
171
-            }
172
-            catch (midcom_error $e)
170
+            } catch (midcom_error $e)
173 171
             {
174 172
                 $handler->print_error("Person {$args['person']} not found, error " . $e->getMessage());
175 173
                 return false;
@@ -180,15 +178,13 @@  discard block
 block discarded – undo
180 178
                 return false;
181 179
             }
182 180
             return $this->_check_person_url($person);
183
-        }
184
-        else if (array_key_exists('group', $args))
181
+        } else if (array_key_exists('group', $args))
185 182
         {
186 183
             // Handling for groups
187 184
             try
188 185
             {
189 186
                 $group = new org_openpsa_contacts_group_dba($args['group']);
190
-            }
191
-            catch (midcom_error $e)
187
+            } catch (midcom_error $e)
192 188
             {
193 189
                 $handler->print_error("Group {$args['group']} not found, error " . $e->getMessage());
194 190
                 return false;
@@ -255,8 +251,7 @@  discard block
 block discarded – undo
255 251
         {
256 252
             // GeoRSS subscription is a good way to keep track of person's location
257 253
             $person->set_parameter('org.routamc.positioning:georss', 'georss_url', $data['georss_url']);
258
-        }
259
-        else if (array_key_exists('icbm', $data))
254
+        } else if (array_key_exists('icbm', $data))
260 255
         {
261 256
             // Instead of using the ICBM position data directly we can subscribe to it so we get modifications too
262 257
             $person->set_parameter('org.routamc.positioning:html', 'icbm_url', $person->homepage);
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/duplicates/check.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -138,8 +138,7 @@  discard block
 block discarded – undo
138 138
         {
139 139
             $ret['email_match'] = true;
140 140
             $ret['p'] += 1;
141
-        }
142
-        else if (!empty($person1['lastname']))
141
+        } else if (!empty($person1['lastname']))
143 142
         {
144 143
             // if user's lastname is part of the email address, check to see if the difference is only in the domain part
145 144
             $email1 = preg_replace('/@.+/', '', $person1['email']);
@@ -435,8 +434,7 @@  discard block
 block discarded – undo
435 434
             {
436 435
                 $obj1 = $class::get_cached($arr1['guid']);
437 436
                 $obj2 = $class::get_cached($arr2['guid']);
438
-            }
439
-            catch (midcom_error $e)
437
+            } catch (midcom_error $e)
440 438
             {
441 439
                 $e->log();
442 440
                 continue;
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/event.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -310,8 +310,7 @@  discard block
 block discarded – undo
310 310
             if ($linkdata['link']->create())
311 311
             {
312 312
                 debug_add("saved link to task #{$linkdata['other_obj']->id} (link id #{$linkdata['link']->id})", MIDCOM_LOG_INFO);
313
-            }
314
-            else
313
+            } else
315 314
             {
316 315
                 debug_add("could not save link to task #{$linkdata['other_obj']->id}, errstr" . midcom_connection::get_error_string(), MIDCOM_LOG_WARN);
317 316
             }
@@ -360,8 +359,7 @@  discard block
 block discarded – undo
360 359
             if ($linkdata['link']->create())
361 360
             {
362 361
                 debug_add("saved sales link to {$linkdata['other_obj']->guid} (link id #{$linkdata['link']->id})", MIDCOM_LOG_INFO);
363
-            }
364
-            else
362
+            } else
365 363
             {
366 364
                 debug_add("could not save sales link to {$linkdata['other_obj']->guid}, errstr" . midcom_connection::get_error_string(), MIDCOM_LOG_WARN);
367 365
             }
@@ -420,8 +418,7 @@  discard block
 block discarded – undo
420 418
         if ($this->orgOpenpsaAccesstype == org_openpsa_core_acl::ACCESS_PRIVATE)
421 419
         {
422 420
             $this->set_privilege('org.openpsa.calendar:read', 'EVERYONE', MIDCOM_PRIVILEGE_DENY);
423
-        }
424
-        else
421
+        } else
425 422
         {
426 423
             $this->set_privilege('org.openpsa.calendar:read', 'EVERYONE', MIDCOM_PRIVILEGE_ALLOW);
427 424
         }
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/event/member.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -123,8 +123,7 @@  discard block
 block discarded – undo
123 123
             || $type == 'remove')
124 124
         {
125 125
             // TODO: Create iCal export with correct delete commands
126
-        }
127
-        else
126
+        } else
128 127
         {
129 128
             $generator = midcom::get()->serviceloader->load('midcom_core_service_urlgenerator');
130 129
             $encoder = new org_openpsa_calendar_vcal;
@@ -158,8 +157,7 @@  discard block
 block discarded – undo
158 157
                 debug_add('person #' . $person->id . 'has no email address, aborting');
159 158
                 return false;
160 159
             }
161
-        }
162
-        catch (midcom_error $e)
160
+        } catch (midcom_error $e)
163 161
         {
164 162
             return false;
165 163
         }
@@ -190,8 +188,7 @@  discard block
 block discarded – undo
190 188
             try
191 189
             {
192 190
                 $event = org_openpsa_calendar_event_dba::get_cached($eid);
193
-            }
194
-            catch (midcom_error $e)
191
+            } catch (midcom_error $e)
195 192
             {
196 193
                 continue;
197 194
             }
@@ -247,8 +244,7 @@  discard block
 block discarded – undo
247 244
                     {
248 245
                         // First event of the day starts after we have started working, use work start time as last end time.
249 246
                         $last_end_time = $workday_starts_ts;
250
-                    }
251
-                    else
247
+                    } else
252 248
                     {
253 249
                         // Make the first event of the day the last end time and skip rest of the checks
254 250
                         $last_end_time = $event->end;
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/handler/create.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
         {
45 45
             $person = $person->get_storage();
46 46
             $defaults['participants'][$person->id] = $person;
47
-        }
48
-        else if ($group = midcom::get()->auth->get_group($this->resource))
47
+        } else if ($group = midcom::get()->auth->get_group($this->resource))
49 48
         {
50 49
             foreach ($group->list_members() as $member)
51 50
             {
@@ -98,8 +97,7 @@  discard block
 block discarded – undo
98 97
             if (!empty($_GET['end']))
99 98
             {
100 99
                 $this->_requested_end = strtotime($_GET['end']);
101
-            }
102
-            else
100
+            } else
103 101
             {
104 102
                 $this->_requested_end = $this->_requested_start + 3600;
105 103
             }
@@ -120,8 +118,7 @@  discard block
 block discarded – undo
120 118
             $indexer = new org_openpsa_calendar_midcom_indexer($this->_topic);
121 119
             $indexer->index($data['controller']->datamanager);
122 120
             midcom::get()->head->add_jsonload('openpsa_calendar_widget.refresh_parent();');
123
-        }
124
-        else if (!empty($conflictmanager->busy_members))
121
+        } else if (!empty($conflictmanager->busy_members))
125 122
         {
126 123
             midcom::get()->uimessages->add($this->_l10n->get('event conflict'), $conflictmanager->get_message($this->_l10n->get_formatter()), 'warning');
127 124
         }
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/handler/admin.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@  discard block
 block discarded – undo
65 65
             $indexer = new org_openpsa_calendar_midcom_indexer($this->_topic);
66 66
             $indexer->index($data['controller']->datamanager);
67 67
             midcom::get()->head->add_jsonload('openpsa_calendar_widget.refresh_parent();');
68
-        }
69
-        else if (!empty($conflictmanager->busy_members))
68
+        } else if (!empty($conflictmanager->busy_members))
70 69
         {
71 70
             midcom::get()->uimessages->add($this->_l10n->get('event conflict'), $conflictmanager->get_message($this->_l10n->get_formatter()), 'warning');
72 71
         }
@@ -93,8 +92,7 @@  discard block
 block discarded – undo
93 92
         if (empty($_POST['end']))
94 93
         {
95 94
             $end = $event->end + ($start - $event->start);
96
-        }
97
-        else
95
+        } else
98 96
         {
99 97
             $end = strtotime($_POST['end']);
100 98
         }
Please login to merge, or discard this patch.