Test Failed
Branch master (8d1702)
by Andreas
11:03
created
lib/org/openpsa/directmarketing/handler/message/report.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $qb_receipts->add_constraint('message', '=', $this->_message->id);
55 55
         $qb_receipts->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT);
56 56
         $receipts = $qb_receipts->execute_unchecked();
57
-        $receipt_data =& $this->_request_data['report']['receipt_data'];
57
+        $receipt_data = & $this->_request_data['report']['receipt_data'];
58 58
         $receipt_data['first_send'] = time();
59 59
         $receipt_data['last_send'] = 0;
60 60
         $receipt_data['sent'] = count($receipts);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
     private function _get_campaign_data($first_send)
89 89
     {
90
-        $campaign_data =& $this->_request_data['report']['campaign_data'];
90
+        $campaign_data = & $this->_request_data['report']['campaign_data'];
91 91
         $qb_unsub = org_openpsa_directmarketing_campaign_member_dba::new_query_builder();
92 92
         $qb_unsub->add_constraint('campaign', '=', $this->_message->campaign);
93 93
         $qb_unsub->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED);
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
         $campaign_data['next_message'] = false;
96 96
         // Find "next message" and if present use its sendStarted as constraint for this query
97 97
         $qb_messages = org_openpsa_directmarketing_campaign_message_dba::new_query_builder();
98
-        $qb_messages->add_constraint('campaign', '=',  $this->_message->campaign);
99
-        $qb_messages->add_constraint('id', '<>',  $this->_message->id);
98
+        $qb_messages->add_constraint('campaign', '=', $this->_message->campaign);
99
+        $qb_messages->add_constraint('id', '<>', $this->_message->id);
100 100
         $qb_messages->add_constraint('sendStarted', '>', $first_send);
101 101
         $qb_messages->add_order('sendStarted', 'DESC');
102 102
         $qb_messages->set_limit(1);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     private function _get_link_data($segmentation_param)
112 112
     {
113 113
         $this->_request_data['report']['link_data'] = array();
114
-        $link_data =& $this->_request_data['report']['link_data'];
114
+        $link_data = & $this->_request_data['report']['link_data'];
115 115
 
116 116
         $link_data['counts'] = array();
117 117
         $link_data['percentages'] = array('of_links' => array(), 'of_recipients' => array());
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         foreach ($links as $link) {
138 138
             $segment = '';
139 139
             $segment_notfound = false;
140
-            if (   $segmentation_param
140
+            if ($segmentation_param
141 141
                 && !empty($link->person)) {
142 142
                 try {
143 143
                     $person = org_openpsa_contacts_person_dba::get_cached($link->person);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 if (!isset($link_data['segments'][$segment])) {
152 152
                     $link_data['segments'][$segment] = $segment_prototype;
153 153
                 }
154
-                $segment_data =& $link_data['segments'][$segment];
154
+                $segment_data = & $link_data['segments'][$segment];
155 155
             } else {
156 156
                 $segment_data = $segment_prototype;
157 157
             }
@@ -261,15 +261,15 @@  discard block
 block discarded – undo
261 261
         $this->_initialize_field($array['percentages']['of_links'], $link);
262 262
         $this->_initialize_field($array['percentages']['of_recipients'], $link);
263 263
 
264
-        $link_data =& $this->_request_data['report']['link_data'];
265
-        $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total']/$link_data['total'])*100;
266
-        $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/$link_data['total'])*100;
264
+        $link_data = & $this->_request_data['report']['link_data'];
265
+        $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total'] / $link_data['total']) * 100;
266
+        $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / $link_data['total']) * 100;
267 267
 
268
-        $receipt_data =& $this->_request_data['report']['receipt_data'];
269
-        $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target])-1)/($receipt_data['sent']-$receipt_data['bounced']))*100;
270
-        $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/($receipt_data['sent']-$receipt_data['bounced']))*100;
268
+        $receipt_data = & $this->_request_data['report']['receipt_data'];
269
+        $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target]) - 1) / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100;
270
+        $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100;
271 271
 
272
-        if (   !isset($array['percentages']['of_recipients']['total'])
272
+        if (!isset($array['percentages']['of_recipients']['total'])
273 273
             || $array['percentages']['of_recipients'][$link->target]['total'] > $array['percentages']['of_recipients']['total']) {
274 274
             $array['percentages']['of_recipients']['total'] = $array['percentages']['of_recipients'][$link->target]['total'];
275 275
         }
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         $this->_campaign = $this->_master->load_campaign($this->_message->campaign);
336 336
         $data['campaign'] = $this->_campaign;
337 337
 
338
-        if (   isset($_POST['oo_dirmar_userule'])
338
+        if (isset($_POST['oo_dirmar_userule'])
339 339
             && !empty($_POST['oo_dirmar_rule_' . $_POST['oo_dirmar_userule']])) {
340 340
             return $this->_create_campaign_from_link($_POST['oo_dirmar_userule']);
341 341
         }
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/documents/handler/document/admin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $this->_controller = $this->get_controller('simple', $this->_document);
116 116
 
117
-        if (   $data['enable_versioning']
117
+        if ($data['enable_versioning']
118 118
             && !empty($_POST)) {
119 119
             $this->_backup_attachment();
120 120
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $prefix = $node[MIDCOM_NAV_ABSOLUTEURL];
145 145
         }
146 146
 
147
-        return $prefix  . "document/" . $this->_document->guid . "/";
147
+        return $prefix . "document/" . $this->_document->guid . "/";
148 148
     }
149 149
 
150 150
     /**
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
         // First, look at post data (from in-form replace/delete buttons)
158 158
         if (!empty($_POST['document'])) {
159 159
             foreach (array_keys($_POST['document']) as $key) {
160
-                if (    strpos($key, '_delete')
161
-                    || (    strpos($key, '_upload')
160
+                if (strpos($key, '_delete')
161
+                    || (strpos($key, '_upload')
162 162
                         && !strpos($key, 'new_upload'))) {
163 163
                     $this->_document->backup_version();
164 164
                     return;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         // If nothing is found, try looking in quickform (regular form submission)
170 170
         $group = $this->_controller->formmanager->form->getElement('document');
171 171
         foreach ($group->getElements() as $element) {
172
-            if (   preg_match('/e_exist_.+?_file$/', $element->getName())
172
+            if (preg_match('/e_exist_.+?_file$/', $element->getName())
173 173
                 && $element->isUploadedFile()) {
174 174
                 $this->_document->backup_version();
175 175
                 return;
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/viewer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function _on_handle($handler, array $args)
41 41
     {
42
-        if (   strpos($handler, 'index') !== false
42
+        if (strpos($handler, 'index') !== false
43 43
             || strpos($handler, 'list') !== false) {
44 44
             $task = false;
45
-            if (   $handler == 'list_hours_task'
45
+            if ($handler == 'list_hours_task'
46 46
                 || $handler == 'list_hours_task_all') {
47 47
                 $task = $args[0];
48 48
             }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $person_filter->set_label($this->_l10n->get("choose user"));
65 65
         $qf->add_filter($person_filter);
66 66
 
67
-        if (   $this->_request_data['handler_id'] != 'index_timestamp'
67
+        if ($this->_request_data['handler_id'] != 'index_timestamp'
68 68
             && $this->_request_data['handler_id'] != 'index') {
69 69
             $date_filter = new org_openpsa_core_filter_timeframe('date');
70 70
             $date_filter->set_label($this->_l10n->get("timeframe"));
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/reports/handler/projects/report.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $qb_hr = org_openpsa_projects_hour_report_dba::new_query_builder();
45 45
         $qb_hr->add_constraint('date', '<=', (int) $this->_request_data['query_data']['end']);
46 46
         $qb_hr->add_constraint('date', '>=', (int) $this->_request_data['query_data']['start']);
47
-        if (   array_key_exists('invoiceable_filter', $this->_request_data['query_data'])
47
+        if (array_key_exists('invoiceable_filter', $this->_request_data['query_data'])
48 48
             && $this->_request_data['query_data']['invoiceable_filter'] != -1) {
49 49
             $qb_hr->add_constraint('invoiceable', '=', (bool) $this->_request_data['query_data']['invoiceable_filter']);
50 50
         }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             $tasks = $this->_expand_task($this->_request_data['query_data']['task']);
61 61
             $qb_hr->add_constraint('task', 'IN', $tasks);
62 62
         }
63
-        if (   array_key_exists('hour_type_filter', $this->_request_data['query_data'])
63
+        if (array_key_exists('hour_type_filter', $this->_request_data['query_data'])
64 64
             && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') {
65 65
             $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']);
66 66
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function add_to_group($new_row, $matching, $sort, $title)
153 153
     {
154
-        $rows =& $this->_request_data['report']['rows'];
154
+        $rows = & $this->_request_data['report']['rows'];
155 155
         if (array_key_exists($matching, $rows)) {
156 156
             $rows[$matching]['rows'][] = $new_row;
157 157
             $rows[$matching]['total_hours'] += $new_row['hour']->hours;
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.