Passed
Branch master (95796a)
by Andreas
38:22
created
lib/org/openpsa/helpers/handler/chooser.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -214,8 +214,7 @@
 block discarded – undo
214 214
 
215 215
     private function object_to_jsdata()
216 216
     {
217
-        $jsdata = array
218
-        (
217
+        $jsdata = array(
219 218
             'id' => @$this->_object->id,
220 219
             'guid' => @$this->_object->guid,
221 220
             'pre_selected' => true
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
             {
82 82
                 throw new midcom_error(midcom_connection::get_error_string());
83 83
             }
84
-        }
85
-        else
84
+        } else
86 85
         {
87 86
             $nodes = $object_qb->execute();
88 87
             $node = $nodes[0];
Please login to merge, or discard this patch.
lib/org/openpsa/httplib/main.php 2 patches
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class org_openpsa_httplib extends midcom_baseclasses_components_purecode
22 22
 {
23
-    private $_params = array
24
-    (
23
+    private $_params = array(
25 24
         'timeout' => 30,
26 25
         'ssl_verify_peer' => false,
27 26
         'follow_redirects' => true
@@ -29,8 +28,7 @@  discard block
 block discarded – undo
29 28
 
30 29
     public $error = '';
31 30
 
32
-    public $basicauth = array
33
-    (
31
+    public $basicauth = array(
34 32
         'user' => false,
35 33
         'password' => false,
36 34
     );
@@ -93,7 +91,7 @@  discard block
 block discarded – undo
93 91
         $request->addHeader('User-Agent: ' . $this->_user_agent());
94 92
 
95 93
         // Handle basic auth
96
-        if (   !empty($username)
94
+        if (!empty($username)
97 95
             && !empty($password))
98 96
         {
99 97
             // Set basic auth
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
                     if ($value)
64 64
                     {
65 65
                         $value = 10;
66
-                    }
67
-                    else
66
+                    } else
68 67
                     {
69 68
                         $value = 0;
70 69
                     }
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
         if ($method == RequestInterface::METHOD_POST)
83 82
         {
84 83
             $request = new FormRequest;
85
-        }
86
-        else
84
+        } else
87 85
         {
88 86
             $request = new Request($method);
89 87
         }
@@ -125,8 +123,7 @@  discard block
 block discarded – undo
125 123
         try
126 124
         {
127 125
             $response = $browser->send($request);
128
-        }
129
-        catch (Exception $e)
126
+        } catch (Exception $e)
130 127
         {
131 128
             $this->error = $e->getMessage();
132 129
             debug_add("Got error '{$this->error}' from HTTP request", MIDCOM_LOG_INFO);
@@ -166,8 +163,7 @@  discard block
 block discarded – undo
166 163
         try
167 164
         {
168 165
             $response = $browser->send($request);
169
-        }
170
-        catch (Exception $e)
166
+        } catch (Exception $e)
171 167
         {
172 168
             $this->error = $e->getMessage();
173 169
             debug_add("Got error '{$this->error}' from HTTP request", MIDCOM_LOG_INFO);
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/plugin.php 2 patches
Spacing   +15 added lines, -28 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function create($from_obj, $from_component, $to_obj, $to_component, $status = false, $extra = false)
33 33
     {
34
-        if (   !is_object($from_obj)
34
+        if (!is_object($from_obj)
35 35
             || !is_object($to_obj))
36 36
         {
37 37
             return false;
@@ -155,8 +155,7 @@  discard block
 block discarded – undo
155 155
                 //Wrong type of object found in array, cruelly abort the whole procedure
156 156
                 return false;
157 157
             }
158
-            $entry = array
159
-            (
158
+            $entry = array(
160 159
                 'toGuid' => $rel->toGuid,
161 160
                 'toComponent' => $rel->toComponent,
162 161
                 'toClass' => $rel->toClass
@@ -195,10 +194,8 @@  discard block
 block discarded – undo
195 194
 
196 195
     static function add_button(midcom_helper_toolbar $toolbar, $guid, $mode = 'both')
197 196
     {
198
-        $toolbar->add_item
199
-        (
200
-            array
201
-            (
197
+        $toolbar->add_item(
198
+            array(
202 199
                 MIDCOM_TOOLBAR_URL => "__mfa/org.openpsa.relatedto/render/{$guid}/{$mode}/",
203 200
                 MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('view related information', 'org.openpsa.relatedto'),
204 201
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png',
@@ -247,26 +244,21 @@  discard block
 block discarded – undo
247 244
 
248 245
     static function common_toolbar_buttons_defaults()
249 246
     {
250
-        return array
251
-        (
252
-            'event' => array
253
-            (
247
+        return array(
248
+            'event' => array(
254 249
                 'node' => false,
255 250
                 'component' => 'org.openpsa.calendar'
256 251
             ),
257
-            'task'  => array
258
-            (
252
+            'task'  => array(
259 253
                 'node' => false,
260 254
                 'component' => 'org.openpsa.projects'
261 255
             ),
262
-            'wikinote' => array
263
-            (
256
+            'wikinote' => array(
264 257
                 'node' => false,
265 258
                 'component' => 'net.nemein.wiki',
266 259
                 'wikiword'  => false, //Calling component MUST define this key to get a wikinote button
267 260
             ),
268
-            'document' => array
269
-            (
261
+            'document' => array(
270 262
                 'node' => false,
271 263
                 'component' => 'org.openpsa.documents'
272 264
             ),
@@ -293,7 +285,7 @@  discard block
 block discarded – undo
293 285
             if ($data === false)
294 286
             {
295 287
                 //In case somebody didn't unset() a button from the defaults, just marked it as false
296
-                debug_add('data marked as false, skipping (the correct way is to unset() the key)',  MIDCOM_LOG_WARN);
288
+                debug_add('data marked as false, skipping (the correct way is to unset() the key)', MIDCOM_LOG_WARN);
297 289
                 continue;
298 290
             }
299 291
 
@@ -312,8 +304,7 @@  discard block
 block discarded – undo
312 304
                 case 'task':
313 305
                     if (midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_projects_task_dba'))
314 306
                     {
315
-                        $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}task/new/?" . self::relatedto2get(array($related_to)), array
316
-                        (
307
+                        $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}task/new/?" . self::relatedto2get(array($related_to)), array(
317 308
                             MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('create task', $data['component']),
318 309
                             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new_task.png',
319 310
                             MIDCOM_TOOLBAR_OPTIONS  => array('data-refresh-opener' => 'true'),
@@ -337,8 +328,7 @@  discard block
 block discarded – undo
337 328
                     }
338 329
 
339 330
                     $data['wikiword_encoded'] = rawurlencode($data['wikiword']);
340
-                    $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$data['wikiword_encoded']}&" . self::relatedto2get(array($related_to)), array
341
-                    (
331
+                    $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$data['wikiword_encoded']}&" . self::relatedto2get(array($related_to)), array(
342 332
                         MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('create note', $data['component']),
343 333
                         //TODO: Different icon from new document ?
344 334
                         MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new-text.png',
@@ -349,8 +339,7 @@  discard block
 block discarded – undo
349 339
                 case 'document':
350 340
                     if ($data['node'][MIDCOM_NAV_OBJECT]->can_do('midgard:create'))
351 341
                     {
352
-                        $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}document/create/choosefolder/?" . self::relatedto2get(array($related_to)), array
353
-                        (
342
+                        $toolbar_buttons[] = $workflow->get_button("{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}document/create/choosefolder/?" . self::relatedto2get(array($related_to)), array(
354 343
                             MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('create document', $data['component']),
355 344
                             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new-text.png',
356 345
                             MIDCOM_TOOLBAR_OPTIONS  => array('data-refresh-opener' => 'true'),
@@ -370,10 +359,8 @@  discard block
 block discarded – undo
370 359
      */
371 360
     static function add_journal_entry_button(midcom_helper_toolbar $toolbar, $guid)
372 361
     {
373
-        $toolbar->add_item
374
-        (
375
-            array
376
-            (
362
+        $toolbar->add_item(
363
+            array(
377 364
                 MIDCOM_TOOLBAR_URL => "__mfa/org.openpsa.relatedto/journalentry/{$guid}/html/",
378 365
                 MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('view journal entries', 'org.openpsa.relatedto'),
379 366
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png',
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,11 +150,13 @@
 block discarded – undo
150 150
         $ret = array('org_openpsa_relatedto' => array());
151 151
         foreach ($array as $rel)
152 152
         {
153
-            if (!midcom::get()->dbfactory->is_a($rel, 'org_openpsa_relatedto_dba')) //Matches also 'org_openpsa_relatedto'
153
+            if (!midcom::get()->dbfactory->is_a($rel, 'org_openpsa_relatedto_dba')) {
154
+                //Matches also 'org_openpsa_relatedto'
154 155
             {
155 156
                 //Wrong type of object found in array, cruelly abort the whole procedure
156 157
                 return false;
157 158
             }
159
+            }
158 160
             $entry = array
159 161
             (
160 162
                 'toGuid' => $rel->toGuid,
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/collector.php 2 patches
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function add_object_constraint($field, $operator, $value)
123 123
     {
124
-        $this->_object_constraints[] = array
125
-        (
124
+        $this->_object_constraints[] = array(
126 125
             'field' => $field,
127 126
             'operator' => $operator,
128 127
             'value' => $value
@@ -137,8 +136,7 @@  discard block
 block discarded – undo
137 136
      */
138 137
     public function add_object_order($field, $direction)
139 138
     {
140
-        $this->_object_orders[] = array
141
-        (
139
+        $this->_object_orders[] = array(
142 140
             'field' => $field,
143 141
             'direction' => $direction
144 142
         );
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,13 +79,11 @@  discard block
 block discarded – undo
79 79
         {
80 80
             parent::__construct('org_openpsa_relatedto_dba', $this->_object_prefix . 'Guid', $guids);
81 81
             $this->add_constraint($this->_other_prefix . 'Class', 'IN', (array) $classes);
82
-        }
83
-        else if (is_string($classes))
82
+        } else if (is_string($classes))
84 83
         {
85 84
             parent::__construct('org_openpsa_relatedto_dba', $this->_other_prefix . 'Class', $classes);
86 85
             $this->add_constraint($this->_object_prefix . 'Guid', 'IN', (array) $guids);
87
-        }
88
-        else
86
+        } else
89 87
         {
90 88
             throw new midcom_error('None of the arguments was passed as a string');
91 89
         }
@@ -104,8 +102,7 @@  discard block
 block discarded – undo
104 102
         {
105 103
             $this->_object_prefix = 'to';
106 104
             $this->_other_prefix = 'from';
107
-        }
108
-        else
105
+        } else
109 106
         {
110 107
             $this->_object_prefix = 'from';
111 108
             $this->_other_prefix = 'to';
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/dba.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     const SUSPECTED = 100;
22 22
     const CONFIRMED = 120;
23
-    const NOTRELATED =130;
23
+    const NOTRELATED = 130;
24 24
 
25 25
     public function _on_creating()
26 26
     {
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/handler/journalentry.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
         $this->_relocate_url = midcom::get()->permalinks->create_permalink($this->_current_object->guid);
57 57
         $data['url_prefix'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/journalentry/";
58 58
 
59
-         //add needed constraints etc. to the query-builder
59
+            //add needed constraints etc. to the query-builder
60 60
         $this->qb_journal_entries = org_openpsa_relatedto_journal_entry_dba::new_query_builder();
61 61
         $this->qb_journal_entries->add_constraint('linkGuid', '=', $args[0]);
62 62
         $this->qb_journal_entries->add_order('followUp', 'DESC');
Please login to merge, or discard this patch.
Spacing   +10 added lines, -13 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $this->_prepare_output();
76 76
             org_openpsa_widgets_grid::add_head_elements();
77 77
             //pass url where to get the data for js-plugin
78
-            $this->_request_data['data_url'] = $data['url_prefix'] . $this->_current_object->guid ."/xml/";
78
+            $this->_request_data['data_url'] = $data['url_prefix'] . $this->_current_object->guid . "/xml/";
79 79
 
80 80
             //prepare breadcrumb
81 81
             $ref = midcom_helper_reflector::get($this->_current_object);
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
             {
86 86
                 $this->add_breadcrumb($object_url, $object_label);
87 87
             }
88
-            $this->add_breadcrumb
89
-            (
88
+            $this->add_breadcrumb(
90 89
                 midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/render/" . $this->_current_object->guid . "/both/",
91 90
                 $this->_l10n->get('view related information')
92 91
             );
@@ -101,15 +100,13 @@  discard block
 block discarded – undo
101 100
     private function _prepare_output()
102 101
     {
103 102
         $buttons = array();
104
-        $buttons[] = array
105
-        (
103
+        $buttons[] = array(
106 104
             MIDCOM_TOOLBAR_URL => $this->_relocate_url,
107 105
             MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('back'),
108 106
             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png',
109 107
         );
110 108
         $workflow = $this->get_workflow('datamanager2');
111
-        $buttons[] = $workflow->get_button($this->_request_data['url_prefix'] . "create/" . $this->_current_object->guid . "/", array
112
-        (
109
+        $buttons[] = $workflow->get_button($this->_request_data['url_prefix'] . "create/" . $this->_current_object->guid . "/", array(
113 110
             MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('add journal entry'),
114 111
             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new-text.png'
115 112
         ));
@@ -147,7 +144,7 @@  discard block
 block discarded – undo
147 144
     {
148 145
         $reminder = new org_openpsa_relatedto_journal_entry_dba();
149 146
         $reminder->linkGuid = $this->_current_object->guid;
150
-        if (! $reminder->create())
147
+        if (!$reminder->create())
151 148
         {
152 149
             debug_print_r('We operated on this object:', $reminder);
153 150
             throw new midcom_error("Failed to create a new reminder. Error: " . midcom_connection::get_error_string());
@@ -233,7 +230,7 @@  discard block
 block discarded – undo
233 230
             $this->_request_data['entries'] = $this->qb_journal_entries->execute();
234 231
 
235 232
             //get the corresponding objects
236
-            if (   $this->_request_data['show_object'] == true
233
+            if ($this->_request_data['show_object'] == true
237 234
                 && !empty($this->_request_data['entries']))
238 235
             {
239 236
                 $this->_request_data['linked_objects'] = array();
@@ -258,7 +255,7 @@  discard block
 block discarded – undo
258 255
                     }
259 256
 
260 257
                     $reflector = new midcom_helper_reflector($linked_object);
261
-                    $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) ."</a>";
258
+                    $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) . "</a>";
262 259
                     $this->_request_data['linked_objects'][$entry->linkGuid] = $link_html;
263 260
                     $this->_request_data['linked_raw_objects'][$entry->linkGuid] = $reflector->get_object_label($linked_object);
264 261
                 }
@@ -269,7 +266,7 @@  discard block
 block discarded – undo
269 266
         else
270 267
         {
271 268
             //url where the xml-data can be loaded
272
-            $this->_request_data['data_url'] =midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/journalentry/list/xml/" ;
269
+            $this->_request_data['data_url'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/journalentry/list/xml/";
273 270
             //enable jqgrid for html-output
274 271
             org_openpsa_widgets_grid::add_head_elements();
275 272
         }
@@ -308,8 +305,8 @@  discard block
 block discarded – undo
308 305
         if (array_key_exists('page', $_POST) && array_key_exists('rows', $_POST))
309 306
         {
310 307
             $this->_request_data['page'] = $_POST['page'];
311
-            $this->qb_journal_entries->set_limit((int)$_POST['rows']);
312
-            $offset = ((int)$_POST['page'] - 1) * (int)$_POST['rows'];
308
+            $this->qb_journal_entries->set_limit((int) $_POST['rows']);
309
+            $offset = ((int) $_POST['page'] - 1) * (int) $_POST['rows'];
313 310
             $this->qb_journal_entries->set_offset($offset);
314 311
         }
315 312
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -123,8 +123,7 @@  discard block
 block discarded – undo
123 123
         if ($this->_output_mode == 'xml')
124 124
         {
125 125
             midcom_show_style('show_entries_xml');
126
-        }
127
-        else
126
+        } else
128 127
         {
129 128
             midcom_show_style('show_entries_html');
130 129
         }
@@ -249,8 +248,7 @@  discard block
 block discarded – undo
249 248
                     try
250 249
                     {
251 250
                         $linked_object = midcom::get()->dbfactory->get_object_by_guid($entry->linkGuid);
252
-                    }
253
-                    catch (midcom_error $e)
251
+                    } catch (midcom_error $e)
254 252
                     {
255 253
                         unset($this->_request_data['entries'][$i]);
256 254
                         $e->log();
@@ -265,8 +263,7 @@  discard block
 block discarded – undo
265 263
             }
266 264
             //url_prefix to build the links to the entries
267 265
             $this->_request_data['url_prefix'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/journalentry/";
268
-        }
269
-        else
266
+        } else
270 267
         {
271 268
             //url where the xml-data can be loaded
272 269
             $this->_request_data['data_url'] =midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "__mfa/org.openpsa.relatedto/journalentry/list/xml/" ;
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/handler/relatedto.php 2 patches
Spacing   +13 added lines, -18 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @var array
39 39
      */
40
-    private $_links = array
41
-    (
40
+    private $_links = array(
42 41
         'incoming' => array(),
43 42
         'outgoing' => array()
44 43
     );
@@ -97,10 +96,8 @@  discard block
 block discarded – undo
97 96
 
98 97
         if ($object_url)
99 98
         {
100
-            $this->_view_toolbar->add_item
101
-            (
102
-                array
103
-                (
99
+            $this->_view_toolbar->add_item(
100
+                array(
104 101
                     MIDCOM_TOOLBAR_URL => $object_url,
105 102
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('back'),
106 103
                     MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png',
@@ -123,7 +120,7 @@  discard block
 block discarded – undo
123 120
         $this->_request_data['object'] = $this->_object;
124 121
 
125 122
         $this->_request_data['show_title'] = false;
126
-        if (   $this->_mode == 'both'
123
+        if ($this->_mode == 'both'
127 124
             || $this->_mode == 'both-paged')
128 125
         {
129 126
             $this->_request_data['show_title'] = true;
@@ -167,10 +164,8 @@  discard block
 block discarded – undo
167 164
         foreach (array_keys($links) as $guid)
168 165
         {
169 166
             //TODO: check for duplicates ?
170
-            $to_arr = array
171
-            (
172
-                'link' => array
173
-                (
167
+            $to_arr = array(
168
+                'link' => array(
174 169
                     'guid' => $guid,
175 170
                     'component' => $mc->get_subkey($guid, $object_prefix . 'Component'),
176 171
                     'class' => $mc->get_subkey($guid, $object_prefix . 'Class'),
@@ -196,7 +191,7 @@  discard block
 block discarded – undo
196 191
      */
197 192
     private function _get_object_links_sort_time($obj)
198 193
     {
199
-        switch(true)
194
+        switch (true)
200 195
         {
201 196
             case midcom::get()->dbfactory->is_a($obj, 'midcom_db_event'):
202 197
             case midcom::get()->dbfactory->is_a($obj, 'org_openpsa_projects_task_dba'):
@@ -266,7 +261,7 @@  discard block
 block discarded – undo
266 261
     private function _render_line(array $link, &$other_obj)
267 262
     {
268 263
         $this->_request_data['link'] = $link;
269
-        $this->_request_data['other_obj'] =& $other_obj;
264
+        $this->_request_data['other_obj'] = & $other_obj;
270 265
 
271 266
         $ref = midcom_helper_reflector::get($link['class']);
272 267
 
@@ -369,7 +364,7 @@  discard block
 block discarded – undo
369 364
             //Calendar node found, render a better view
370 365
             $this->_request_data['raw_url'] = $calendar_url . 'event/raw/' . $other_obj->guid . '/';
371 366
             $workflow = $this->get_workflow('viewer');
372
-            $title = '<a href="' . $calendar_url . 'event/' . $other_obj->guid .  '/" ' . $workflow->render_attributes() . '>' . $title . "</a>\n";
367
+            $title = '<a href="' . $calendar_url . 'event/' . $other_obj->guid . '/" ' . $workflow->render_attributes() . '>' . $title . "</a>\n";
373 368
         }
374 369
 
375 370
         $this->_request_data['title'] = $title;
@@ -400,7 +395,7 @@  discard block
 block discarded – undo
400 395
 
401 396
         if ($projects_url)
402 397
         {
403
-            $title = '<a href="' . $projects_url . $type . '/' . $other_obj->guid  . '/" target="task_' . $other_obj->guid . '">' . $other_obj->title . "</a>\n";
398
+            $title = '<a href="' . $projects_url . $type . '/' . $other_obj->guid . '/" target="task_' . $other_obj->guid . '">' . $other_obj->title . "</a>\n";
404 399
         }
405 400
         $this->_request_data['title'] = $title;
406 401
 
@@ -423,7 +418,7 @@  discard block
 block discarded – undo
423 418
 
424 419
         if ($sales_url)
425 420
         {
426
-            $title = '<a href="' . $sales_url . 'salesproject/' . $other_obj->guid  . '/" target="salesproject_' . $other_obj->guid . '">' . $title . "</a>\n";
421
+            $title = '<a href="' . $sales_url . 'salesproject/' . $other_obj->guid . '/" target="salesproject_' . $other_obj->guid . '">' . $title . "</a>\n";
427 422
         }
428 423
 
429 424
         $this->_request_data['title'] = $title;
@@ -445,7 +440,7 @@  discard block
 block discarded – undo
445 440
 
446 441
         if ($invoices_url)
447 442
         {
448
-            $title = '<a href="' . $invoices_url . 'invoice/' . $other_obj->guid  . '/" target="invoice_' . $other_obj->guid . '">' . $title . "</a>\n";
443
+            $title = '<a href="' . $invoices_url . 'invoice/' . $other_obj->guid . '/" target="invoice_' . $other_obj->guid . '">' . $title . "</a>\n";
449 444
         }
450 445
         $this->_request_data['title'] = $title;
451 446
 
@@ -495,7 +490,7 @@  discard block
 block discarded – undo
495 490
     {
496 491
         echo "<ul class=\"relatedto_toolbar\" data-link-guid=\"{$link['guid']}\" data-other-guid=\"{$other_obj->guid}\">\n";
497 492
 
498
-        if (   $link['component'] == 'net.nemein.wiki'
493
+        if ($link['component'] == 'net.nemein.wiki'
499 494
             || $link['component'] == 'org.openpsa.calendar')
500 495
         {
501 496
             echo "<li><input type=\"button\" class=\"button info\" value=\"" . midcom::get()->i18n->get_string('details', 'org.openpsa.relatedto') . "\" /></li>\n";
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -149,8 +149,7 @@  discard block
 block discarded – undo
149 149
         {
150 150
             $object_prefix = 'from';
151 151
             $mc = org_openpsa_relatedto_dba::new_collector('toGuid', $obj->guid);
152
-        }
153
-        else
152
+        } else
154 153
         {
155 154
             $object_prefix = 'to';
156 155
             $mc = org_openpsa_relatedto_dba::new_collector('fromGuid', $obj->guid);
@@ -180,8 +179,7 @@  discard block
 block discarded – undo
180 179
             try
181 180
             {
182 181
                 $to_arr['other_obj'] = midcom::get()->dbfactory->get_object_by_guid($mc->get_subkey($guid, $object_prefix . 'Guid'));
183
-            }
184
-            catch (midcom_error $e)
182
+            } catch (midcom_error $e)
185 183
             {
186 184
                 continue;
187 185
             }
@@ -387,8 +385,7 @@  discard block
 block discarded – undo
387 385
         if ($other_obj->orgOpenpsaObtype == org_openpsa_projects_task_dba::OBTYPE)
388 386
         {
389 387
             $type = 'task';
390
-        }
391
-        else
388
+        } else
392 389
         {
393 390
             $type = 'project';
394 391
         }
@@ -535,8 +532,7 @@  discard block
 block discarded – undo
535 532
                 {
536 533
                     $response->status = "method '{$this->_mode}' requires guid of a link object as an argument";
537 534
                 }
538
-            }
539
-            catch (midcom_error $e)
535
+            } catch (midcom_error $e)
540 536
             {
541 537
                 $response->status = "method '{$this->_mode}' requires guid of a link object as an argument";
542 538
             }
@@ -576,8 +572,7 @@  discard block
 block discarded – undo
576 572
             $relation = new org_openpsa_relatedto_dba($args[0]);
577 573
             $response->result = $relation->delete();
578 574
             $response->status = 'Last message: ' . midcom_connection::get_error_string();
579
-        }
580
-        catch (midcom_error $e)
575
+        } catch (midcom_error $e)
581 576
         {
582 577
             $response->result = false;
583 578
             $response->status = "Object '{$args[0]}' could not be loaded, error:" . $e->getMessage();
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/midcom/interfaces.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
         {
24 24
             $relatedto_arr = $session->get('relatedto2get_array');
25 25
             $session->remove('relatedto2get_array');
26
-        }
27
-        else
26
+        } else
28 27
         {
29 28
             $relatedto_arr = org_openpsa_relatedto_plugin::get2relatedto();
30 29
         }
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
             if (!$rel->id)
36 35
             {
37 36
                 $rel->create();
38
-            }
39
-            else
37
+            } else
40 38
             {
41 39
                 //In theory we should not ever hit this, but better to be sure.
42 40
                 $rel->update();
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/suspect.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $properties = array('fromClass', 'toClass', 'fromGuid', 'toGuid', 'fromComponent', 'toComponent', 'status', 'toExtra', 'toExtra');
104 104
         foreach ($properties as $property)
105 105
         {
106
-            if (   !empty($defaults->$property)
106
+            if (!empty($defaults->$property)
107 107
                 && empty($link->$property))
108 108
             {
109 109
                 debug_add("Copying property '{$property}' ('{$defaults->$property}') from defaults");
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         if ($component)
114 114
         {
115 115
             debug_add('$component given, guessing direction');
116
-            if (   empty($link->toComponent)
116
+            if (empty($link->toComponent)
117 117
                 && !empty($link->fromComponent))
118 118
             {
119 119
                 debug_add("Setting property 'toComponent' to '{$component}'");
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         if (is_object($obj))
129 129
         {
130 130
             debug_add('$obj given, guessing direction');
131
-            if (   empty($link->toGuid)
131
+            if (empty($link->toGuid)
132 132
                 && !empty($link->fromGuid))
133 133
             {
134 134
                 $link->toClass = get_class($obj);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,8 +118,7 @@  discard block
 block discarded – undo
118 118
             {
119 119
                 debug_add("Setting property 'toComponent' to '{$component}'");
120 120
                 $link->toComponent = $component;
121
-            }
122
-            else
121
+            } else
123 122
             {
124 123
                 debug_add("Setting property 'fromComponent' to '{$component}'");
125 124
                 $link->fromComponent = $component;
@@ -135,8 +134,7 @@  discard block
 block discarded – undo
135 134
                 $link->toGuid = $obj->guid;
136 135
                 debug_add("Setting property 'toGuid' to '{$link->toGuid}'");
137 136
                 debug_add("Setting property 'toClass' to '{$link->toClass}'");
138
-            }
139
-            else
137
+            } else
140 138
             {
141 139
                 $link->fromClass = get_class($obj);
142 140
                 $link->fromGuid = $obj->guid;
Please login to merge, or discard this patch.