Completed
Push — master ( 309357...7ad46f )
by Andreas
18:00
created
lib/net/nehmer/comments/comment.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         }
182 182
 
183 183
         // Set the status
184
-        if (   $this->can_do('net.nehmer.comments:moderation')
184
+        if ($this->can_do('net.nehmer.comments:moderation')
185 185
             && !$this->_sudo_requested) {
186 186
             $this->status = net_nehmer_comments_comment::ABUSE;
187 187
         } else {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             return false;
206 206
         }
207 207
         // Set the status
208
-        if (   !$this->can_do('net.nehmer.comments:moderation')
208
+        if (!$this->can_do('net.nehmer.comments:moderation')
209 209
             || $this->_sudo_requested) {
210 210
             return false;
211 211
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         }
230 230
 
231 231
         // Set the status
232
-        if (   !$this->can_do('net.nehmer.comments:moderation')
232
+        if (!$this->can_do('net.nehmer.comments:moderation')
233 233
             || $this->_sudo_requested) {
234 234
             return false;
235 235
         }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public function report_not_abuse()
250 250
     {
251
-        if (   !$this->can_do('net.nehmer.comments:moderation')
251
+        if (!$this->can_do('net.nehmer.comments:moderation')
252 252
             || $this->_sudo_requested) {
253 253
             return false;
254 254
         }
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
     {
352 352
         $config = midcom_baseclasses_components_configuration::get('net.nehmer.comments', 'config');
353 353
 
354
-        if (   $config->get('ratings_enable')
355
-            && (    $config->get('ratings_cache_to_object')
354
+        if ($config->get('ratings_enable')
355
+            && ($config->get('ratings_cache_to_object')
356 356
                  || $config->get('comment_count_cache_to_object'))) {
357 357
             // Handle ratings
358 358
             $comments = net_nehmer_comments_comment::list_by_objectguid($this->objectguid);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             return false;
414 414
         }
415 415
 
416
-        if (   empty($this->title)
416
+        if (empty($this->title)
417 417
             && empty($this->content)) {
418 418
             // No need to send notifications about empty rating entries
419 419
             return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -408,7 +408,8 @@
 block discarded – undo
408 408
         //Get the parent object
409 409
         try {
410 410
             $parent = midcom::get()->dbfactory->get_object_by_guid($this->objectguid);
411
-        } catch (midcom_error $e) {
411
+        }
412
+        catch (midcom_error $e) {
412 413
             $e->log();
413 414
             return false;
414 415
         }
Please login to merge, or discard this patch.
lib/net/nemein/tag/handler.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $tagstring = self::resolve_tagname($tagname);
69 69
         $tag = net_nemein_tag_tag_dba::get_by_tag($tagstring);
70 70
         if (!$tag) {
71
-            $tag =  new net_nemein_tag_tag_dba();
71
+            $tag = new net_nemein_tag_tag_dba();
72 72
             $tag->tag = $tagstring;
73 73
             $tag->url = $url;
74 74
             if (!$tag->create()) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 return;
78 78
             }
79 79
         }
80
-        $link =  new net_nemein_tag_link_dba();
80
+        $link = new net_nemein_tag_link_dba();
81 81
         $link->tag = $tag->id;
82 82
         $link->context = self::resolve_context($tagname);
83 83
         $link->value = self::resolve_value($tagname);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function copy_tags($from, $to, $component = null)
191 191
     {
192
-        if (   !is_object($from)
192
+        if (!is_object($from)
193 193
             || !is_object($to)) {
194 194
             return false;
195 195
         }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         $quote_open = false;
494 494
         for ($i = 0; $i < (strlen($tags_string) + 1); $i++) {
495 495
             $char = substr($tags_string, $i, 1);
496
-            if (   (   $char == ' '
496
+            if (($char == ' '
497 497
                     && !$quote_open)
498 498
                 || $i == strlen($tags_string)) {
499 499
                 $tags[] = $current_tag;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                 $quote_open = false;
505 505
                 continue;
506 506
             }
507
-            if (   $char === '"'
507
+            if ($char === '"'
508 508
                 || $char === "'") {
509 509
                 $quote_open = $char;
510 510
                 continue;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -384,7 +384,8 @@  discard block
 block discarded – undo
384 384
                 $value = $link->value;
385 385
 
386 386
                 $tags[$key] = $value;
387
-            } catch (midcom_error $e) {
387
+            }
388
+            catch (midcom_error $e) {
388 389
                 $e->log();
389 390
             }
390 391
         }
@@ -443,7 +444,8 @@  discard block
 block discarded – undo
443 444
             try {
444 445
                 $tag = net_nemein_tag_tag_dba::get_cached($link->tag);
445 446
                 $link_object_map[$link->fromGuid][$tag->tag] = $link;
446
-            } catch (midcom_error $e) {
447
+            }
448
+            catch (midcom_error $e) {
447 449
                 $e->log();
448 450
             }
449 451
         }
@@ -472,7 +474,8 @@  discard block
 block discarded – undo
472 474
                     $tmpobject = midcom::get()->dbfactory->convert_midgard_to_midcom($tmpobject);
473 475
                 }
474 476
                 $return[] = $tmpobject;
475
-            } catch (midcom_error $e) {
477
+            }
478
+            catch (midcom_error $e) {
476 479
                 $e->log();
477 480
             }
478 481
         }
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/event/member.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $event = new org_openpsa_calendar_event_dba($this->eid);
67 67
         }
68 68
 
69
-        if (    $recipient->id == midcom_connection::get_user()
69
+        if ($recipient->id == midcom_connection::get_user()
70 70
              && !$event->send_notify_me) {
71 71
             //Do not send notification to current user
72 72
             debug_add('event->send_notify_me is false and recipient is current user, aborting notify');
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 return false;
112 112
         }
113 113
 
114
-        if (   $type == 'cancel'
114
+        if ($type == 'cancel'
115 115
             || $type == 'remove') {
116 116
             // TODO: Create iCal export with correct delete commands
117 117
         } else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         while ($stamp <= $end) {
186 186
             $ymd = date('Ymd', $stamp);
187 187
             debug_add("making sure date {$ymd} has at least one event");
188
-            $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp)+1, date('Y', $stamp));
188
+            $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp) + 1, date('Y', $stamp));
189 189
             if (array_key_exists($ymd, $events_by_date)) {
190 190
                 continue;
191 191
             }
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
             $workday_starts = 8;
203 203
             $workday_ends = 16;
204 204
 
205
-            $workday_starts_ts = mktime($workday_starts, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
206
-            $workday_ends_ts = mktime($workday_ends, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
205
+            $workday_starts_ts = mktime($workday_starts, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
206
+            $workday_ends_ts = mktime($workday_ends, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
207 207
             $last_end_time = false;
208 208
             $last_event = false;
209 209
             foreach ($events as $event) {
210
-                if (   $event->end <= $workday_starts_ts
210
+                if ($event->end <= $workday_starts_ts
211 211
                     || $event->start >= $workday_ends_ts) {
212 212
                     // We need not to consider this event, it is outside the defined workday
213 213
                     continue;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             if ($last_end_time === false) {
239 239
                 $last_end_time = $workday_starts_ts;
240 240
             }
241
-            if (   $last_end_time < $workday_ends_ts
241
+            if ($last_end_time < $workday_ends_ts
242 242
                 && (($workday_ends_ts - $last_end_time) >= $amount)) {
243 243
                 $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event);
244 244
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,8 @@
 block discarded – undo
152 152
                 debug_add('person #' . $person->id . 'has no email address, aborting');
153 153
                 return false;
154 154
             }
155
-        } catch (midcom_error $e) {
155
+        }
156
+        catch (midcom_error $e) {
156 157
             return false;
157 158
         }
158 159
 
Please login to merge, or discard this patch.
lib/org/openpsa/documents/midcom/interfaces.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
     public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object)
41 41
     {
42
-        if (   $object instanceof org_openpsa_documents_document_dba
42
+        if ($object instanceof org_openpsa_documents_document_dba
43 43
             && $object->topic == $topic->id) {
44 44
             return "document/{$object->guid}/";
45 45
         }
Please login to merge, or discard this patch.
lib/org/openpsa/products/product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
             $qb->add_constraint('id', '<>', $this->id);
108 108
         }
109 109
         // Make sure the product is in the same product group
110
-        $qb->add_constraint('productGroup', '=', (int)$this->productGroup);
110
+        $qb->add_constraint('productGroup', '=', (int) $this->productGroup);
111 111
 
112 112
         return ($qb->count() == 0);
113 113
     }
Please login to merge, or discard this patch.
lib/org/openpsa/projects/workflow.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         debug_add("task->start() called with user #" . midcom_connection::get_user());
172 172
         //PONDER: Check actual status objects for more accurate logic ?
173
-        if (   $task->status >= org_openpsa_projects_task_status_dba::STARTED
173
+        if ($task->status >= org_openpsa_projects_task_status_dba::STARTED
174 174
             && $task->status <= org_openpsa_projects_task_status_dba::APPROVED) {
175 175
             //We already have started status
176 176
             debug_add('Task has already been started');
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 
383 383
     private static function is_manager($task)
384 384
     {
385
-        return (   $task->manager == 0
385
+        return ($task->manager == 0
386 386
                 || midcom_connection::get_user() == $task->manager);
387 387
     }
388 388
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -356,7 +356,8 @@
 block discarded – undo
356 356
                 // The agreement allows invoicing only approved hours, therefore don't mark unapproved
357 357
                 $qb->add_constraint('metadata.isapproved', '=', true);
358 358
             }
359
-        } catch (midcom_error $e) {
359
+        }
360
+        catch (midcom_error $e) {
360 361
             $e->log();
361 362
         }
362 363
 
Please login to merge, or discard this patch.
lib/org/openpsa/projects/task.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     public function _on_updated()
94 94
     {
95 95
         // Sync the object's ACL properties into MidCOM ACL system
96
-        if (   !$this->_skip_acl_refresh) {
96
+        if (!$this->_skip_acl_refresh) {
97 97
             if ($this->orgOpenpsaAccesstype && $this->orgOpenpsaOwnerWg) {
98 98
                 debug_add("Synchronizing task ACLs to MidCOM");
99 99
                 $sync = new org_openpsa_core_acl_synchronizer();
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 
327 327
             if ($report_data['invoice']) {
328 328
                 $hours['invoiced'] += $report_hours;
329
-            } elseif (   $report_data['invoiceable']
329
+            } elseif ($report_data['invoiceable']
330 330
                       && ($report_data['isapproved'] || !$invoice_approved_only)) {
331 331
                 $hours['invoiceable'] += $report_hours;
332 332
             }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -240,7 +240,8 @@  discard block
 block discarded – undo
240 240
                     $salesproject = org_openpsa_sales_salesproject_dba::get_cached($agreement->salesproject);
241 241
                     $this->customer = $salesproject->customer;
242 242
                 }
243
-            } catch (midcom_error $e) {
243
+            }
244
+            catch (midcom_error $e) {
244 245
             }
245 246
         } else {
246 247
             // No agreement, we can't be invoiceable
@@ -286,7 +287,8 @@  discard block
 block discarded – undo
286 287
         try {
287 288
             $agreement = new org_openpsa_sales_salesproject_deliverable_dba($this->get_agreement());
288 289
             $agreement->update_units($this->id, $hours);
289
-        } catch (midcom_error $e) {
290
+        }
291
+        catch (midcom_error $e) {
290 292
         }
291 293
 
292 294
         if ($update) {
@@ -313,7 +315,8 @@  discard block
 block discarded – undo
313 315
         try {
314 316
             $agreement = new org_openpsa_sales_salesproject_deliverable_dba($this->get_agreement());
315 317
             $invoice_approved_only = $agreement->invoiceApprovedOnly;
316
-        } catch (midcom_error $e) {
318
+        }
319
+        catch (midcom_error $e) {
317 320
             $invoice_approved_only = false;
318 321
         }
319 322
 
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/handler/relatedto.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     private function _render_line(array $link, &$other_obj)
229 229
     {
230 230
         $this->_request_data['link'] = $link;
231
-        $this->_request_data['other_obj'] =& $other_obj;
231
+        $this->_request_data['other_obj'] = & $other_obj;
232 232
 
233 233
         $ref = midcom_helper_reflector::get($link['class']);
234 234
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             //Calendar node found, render a better view
317 317
             $this->_request_data['raw_url'] = $url . 'event/raw/' . $other_obj->guid . '/';
318 318
             $workflow = $this->get_workflow('viewer');
319
-            $title = '<a href="' . $url . 'event/' . $other_obj->guid .  '/" ' . $workflow->render_attributes() . '>' . $title . "</a>\n";
319
+            $title = '<a href="' . $url . 'event/' . $other_obj->guid . '/" ' . $workflow->render_attributes() . '>' . $title . "</a>\n";
320 320
         }
321 321
 
322 322
         $this->_request_data['title'] = $title;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         $title = $other_obj->title;
341 341
 
342 342
         if ($url = $this->get_node_url('org.openpsa.projects')) {
343
-            $title = '<a href="' . $url . $type . '/' . $other_obj->guid  . '/" target="task_' . $other_obj->guid . '">' . $title . "</a>\n";
343
+            $title = '<a href="' . $url . $type . '/' . $other_obj->guid . '/" target="task_' . $other_obj->guid . '">' . $title . "</a>\n";
344 344
         }
345 345
         $this->_request_data['title'] = $title;
346 346
         $this->_request_data['type'] = $type;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $title = $other_obj->title;
359 359
 
360 360
         if ($url = $this->get_node_url('org.openpsa.sales')) {
361
-            $title = '<a href="' . $url . 'salesproject/' . $other_obj->guid  . '/" target="salesproject_' . $other_obj->guid . '">' . $title . "</a>\n";
361
+            $title = '<a href="' . $url . 'salesproject/' . $other_obj->guid . '/" target="salesproject_' . $other_obj->guid . '">' . $title . "</a>\n";
362 362
         }
363 363
 
364 364
         $this->_request_data['title'] = $title;
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         $title = $this->_i18n->get_string('invoice', 'org.openpsa.invoices') . ' ' . $other_obj->get_label();
377 377
 
378 378
         if ($url = $this->get_node_url('org.openpsa.invoices')) {
379
-            $title = '<a href="' . $url . 'invoice/' . $other_obj->guid  . '/" target="invoice_' . $other_obj->guid . '">' . $title . "</a>\n";
379
+            $title = '<a href="' . $url . 'invoice/' . $other_obj->guid . '/" target="invoice_' . $other_obj->guid . '">' . $title . "</a>\n";
380 380
         }
381 381
         $this->_request_data['title'] = $title;
382 382
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     {
423 423
         echo "<ul class=\"relatedto_toolbar\" data-link-guid=\"{$link['guid']}\" data-other-guid=\"{$other_obj->guid}\">\n";
424 424
 
425
-        if (   $link['component'] == 'net.nemein.wiki'
425
+        if ($link['component'] == 'net.nemein.wiki'
426 426
             || $link['component'] == 'org.openpsa.calendar') {
427 427
             echo "<li><input type=\"button\" class=\"button info\" value=\"" . midcom::get()->i18n->get_string('details', 'org.openpsa.relatedto') . "\" /></li>\n";
428 428
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,7 +148,8 @@  discard block
 block discarded – undo
148 148
             ];
149 149
             try {
150 150
                 $to_arr['other_obj'] = midcom::get()->dbfactory->get_object_by_guid($mc->get_subkey($guid, $object_prefix . 'Guid'));
151
-            } catch (midcom_error $e) {
151
+            }
152
+            catch (midcom_error $e) {
152 153
                 continue;
153 154
             }
154 155
 
@@ -455,7 +456,8 @@  discard block
 block discarded – undo
455 456
                 if (!($this->_object instanceof org_openpsa_relatedto_dba)) {
456 457
                     $response->status = "method '{$this->_mode}' requires guid of a link object as an argument";
457 458
                 }
458
-            } catch (midcom_error $e) {
459
+            }
460
+            catch (midcom_error $e) {
459 461
                 $response->status = "method '{$this->_mode}' requires guid of a link object as an argument";
460 462
             }
461 463
         }
@@ -492,7 +494,8 @@  discard block
 block discarded – undo
492 494
             $relation = new org_openpsa_relatedto_dba($args[0]);
493 495
             $response->result = $relation->delete();
494 496
             $response->status = 'Last message: ' . midcom_connection::get_error_string();
495
-        } catch (midcom_error $e) {
497
+        }
498
+        catch (midcom_error $e) {
496 499
             $response->result = false;
497 500
             $response->status = "Object '{$args[0]}' could not be loaded, error:" . $e->getMessage();
498 501
         }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/invoice/pdf.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $filename = $generator->from_string($this->invoice->get_label()) . '.pdf';
88 88
 
89 89
         // tmp filename
90
-        $tmp_file = midcom::get()->config->get('midcom_tempdir') . "/". $filename;
90
+        $tmp_file = midcom::get()->config->get('midcom_tempdir') . "/" . $filename;
91 91
 
92 92
         // render pdf to tmp filename
93 93
         $pdf_builder->render($tmp_file);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $attachment->update();
101 101
         } else {
102 102
             $attachment = $this->invoice->create_attachment($filename, $this->invoice->get_label(), "application/pdf");
103
-            if (   !$attachment
103
+            if (!$attachment
104 104
                 || !$this->invoice->set_parameter("midcom.helper.datamanager2.type.blobs", "guids_pdf_file", $attachment->guid . ":" . $attachment->guid)) {
105 105
                 throw new midcom_error("Failed to create invoice attachment for pdf");
106 106
             }
Please login to merge, or discard this patch.