Passed
Pull Request — master (#193)
by
unknown
20:53
created
lib/org/openpsa/calendar/event/member.php 1 patch
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.
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 1 patch
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.
lib/org/openpsa/projects/task.php 1 patch
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.
lib/org/openpsa/relatedto/handler/relatedto.php 1 patch
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.
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.
lib/org/openpsa/relatedto/handler/journal/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 }
122 122
 
123 123
                 $reflector = midcom_helper_reflector::get($linked_object);
124
-                $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) ."</a>";
124
+                $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) . "</a>";
125 125
                 $data['linked_objects'][$entry->linkGuid] = $link_html;
126 126
                 $data['linked_raw_objects'][$entry->linkGuid] = $reflector->get_object_label($linked_object);
127 127
             }
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         //check if there is a page & rows - parameter passed - if add them to qb
152 152
         if (array_key_exists('page', $_POST) && array_key_exists('rows', $_POST)) {
153 153
             $this->_request_data['page'] = $_POST['page'];
154
-            $this->qb->set_limit((int)$_POST['rows']);
155
-            $offset = ((int)$_POST['page'] - 1) * (int)$_POST['rows'];
154
+            $this->qb->set_limit((int) $_POST['rows']);
155
+            $offset = ((int) $_POST['page'] - 1) * (int) $_POST['rows'];
156 156
             $this->qb->set_offset($offset);
157 157
         }
158 158
     }
Please login to merge, or discard this patch.
lib/org/openpsa/notifications/main.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 
94 94
         // If user has preference for this message, we use that
95 95
         $personal_preferences = $recipient->list_parameters('org.openpsa.notifications');
96
-        if (   count($personal_preferences) > 0
96
+        if (count($personal_preferences) > 0
97 97
             && array_key_exists("{$component}:{$action}", $personal_preferences)) {
98 98
             return $personal_preferences[$action];
99 99
         }
Please login to merge, or discard this patch.