Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created
public/htdocs/comm/action/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 $mode = GETPOST('mode', 'aZ09');
63 63
 if (empty($mode) && str_contains($action, 'show_')) {
64
-    $mode = $action;    // For backward compatibility
64
+    $mode = $action; // For backward compatibility
65 65
 }
66 66
 $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid");
67 67
 $pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 $object->fields = dol_sort_array($object->fields, 'position');
185 185
 $arrayfields = dol_sort_array($arrayfields, 'position');
186
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
186
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
187 187
 
188 188
 $result = restrictedArea($user, 'agenda', 0, '', 'myactions');
189 189
 if ($user->socid && $socid) {
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 if (isModEnabled('category') && $user->hasRight('agenda', 'myactions', 'create')) {
419 419
     $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"') . $langs->trans("AffectTag");
420 420
 }
421
-if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
421
+if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
422 422
     $arrayofmassactions = array();
423 423
 }
424 424
 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
Please login to merge, or discard this patch.
public/htdocs/comm/action/pertype.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
58 58
 
59 59
 // $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
60
-$showbirthday = 0;    // will be hidden here
60
+$showbirthday = 0; // will be hidden here
61 61
 
62 62
 // If not choice done on calendar owner, we filter on user.
63 63
 if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 $week = $prev['week'];
259 259
 
260
-$day = (int)$day;
260
+$day = (int) $day;
261 261
 $next = dol_get_next_day($day, $month, $year);
262 262
 $next_year = $year + 1;
263 263
 $next_month = $month;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     }
289 289
 }
290 290
 if ($resourceid > 0) {
291
-    $param .= "&search_resourceid=" . urlencode((string)($resourceid));
291
+    $param .= "&search_resourceid=" . urlencode((string) ($resourceid));
292 292
 }
293 293
 if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) {
294 294
     $param .= "&search_status=" . urlencode($status);
@@ -300,16 +300,16 @@  discard block
 block discarded – undo
300 300
     $param .= "&search_filtert=" . urlencode($filtert);
301 301
 }
302 302
 if ($usergroup > 0) {
303
-    $param .= "&search_usergroup=" . urlencode((string)($usergroup));
303
+    $param .= "&search_usergroup=" . urlencode((string) ($usergroup));
304 304
 }
305 305
 if ($socid > 0) {
306
-    $param .= "&search_socid=" . urlencode((string)($socid));
306
+    $param .= "&search_socid=" . urlencode((string) ($socid));
307 307
 }
308 308
 if ($showbirthday) {
309 309
     $param .= "&search_showbirthday=1";
310 310
 }
311 311
 if ($pid) {
312
-    $param .= "&search_projectid=" . urlencode((string)($pid));
312
+    $param .= "&search_projectid=" . urlencode((string) ($pid));
313 313
 }
314 314
 if ($type) {
315 315
     $param .= "&search_type=" . urlencode($type);
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
     $param .= '&end_h=' . urlencode($end_h);
325 325
 }
326 326
 if ($begin_d != '') {
327
-    $param .= '&begin_d=' . urlencode((string)($begin_d));
327
+    $param .= '&begin_d=' . urlencode((string) ($begin_d));
328 328
 }
329 329
 if ($end_d != '') {
330
-    $param .= '&end_d=' . urlencode((string)($end_d));
330
+    $param .= '&end_d=' . urlencode((string) ($end_d));
331 331
 }
332
-$param .= "&maxprint=" . urlencode((string)($maxprint));
332
+$param .= "&maxprint=" . urlencode((string) ($maxprint));
333 333
 
334 334
 $paramnoactionodate = $param;
335 335
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
 $week = $prev['week'];
345 345
 
346
-$day = (int)$day;
346
+$day = (int) $day;
347 347
 $next = dol_get_next_day(31, 12, $year);
348 348
 $next_year = $year + 1;
349 349
 $next_month = $month;
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 $nav .= ' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
377 377
 
378 378
 // Must be after the nav definition
379
-$param .= '&year=' . urlencode((string)($year)) . '&month=' . urlencode((string)($month)) . ($day ? '&day=' . urlencode((string)($day)) : '');
379
+$param .= '&year=' . urlencode((string) ($year)) . '&month=' . urlencode((string) ($month)) . ($day ? '&day=' . urlencode((string) ($day)) : '');
380 380
 //print 'x'.$param;
381 381
 
382 382
 
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
     }
576 576
 }
577 577
 if ($resourceid > 0) {
578
-    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . ((int)$resourceid);
578
+    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . ((int) $resourceid);
579 579
 }
580 580
 if ($pid) {
581
-    $sql .= " AND a.fk_project = " . ((int)$pid);
581
+    $sql .= " AND a.fk_project = " . ((int) $pid);
582 582
 }
583 583
 // If the internal user must only see his customers, force searching by him
584 584
 $search_sale = 0;
@@ -590,12 +590,12 @@  discard block
 block discarded – undo
590 590
     if ($search_sale == -2) {
591 591
         $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
592 592
     } elseif ($search_sale > 0) {
593
-        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")";
593
+        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
594 594
     }
595 595
 }
596 596
 // Search on socid
597 597
 if ($socid) {
598
-    $sql .= " AND a.fk_soc = " . ((int)$socid);
598
+    $sql .= " AND a.fk_soc = " . ((int) $socid);
599 599
 }
600 600
 // We must filter on assignment table
601 601
 if ($filtert > 0 || $usergroup > 0) {
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
     $sql .= ')';
627 627
 }
628 628
 if ($type) {
629
-    $sql .= " AND ca.id = " . ((int)$type);
629
+    $sql .= " AND ca.id = " . ((int) $type);
630 630
 }
631 631
 if ($status == '0') {
632 632
     $sql .= " AND a.percent = 0";
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
         $sql .= "ar.fk_element = " . $filtert;
653 653
     }
654 654
     if ($usergroup > 0) {
655
-        $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . ((int)$usergroup);
655
+        $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . ((int) $usergroup);
656 656
     }
657 657
     $sql .= ")";
658 658
 }
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
         $mois = dol_print_date($daykey, '%m', 'tzuserrel');
1004 1004
         $jour = dol_print_date($daykey, '%d', 'tzuserrel');
1005 1005
 
1006
-        if ($day == $jour && (int)$month == (int)$mois && $year == $annee) {  // Is it the day we are looking for when calling function ?
1006
+        if ($day == $jour && (int) $month == (int) $mois && $year == $annee) {  // Is it the day we are looking for when calling function ?
1007 1007
             // Scan all event for this date
1008 1008
             foreach ($eventarray[$daykey] as $index => $event) {
1009 1009
                 //print 'daykey='.$daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."<br>\n";
@@ -1079,9 +1079,9 @@  discard block
 block discarded – undo
1079 1079
                     //if ($username->id == 1 && $day==1) print 'h='.$h;
1080 1080
                     $newcolor = ''; //init
1081 1081
                     if (empty($event->fulldayevent)) {
1082
-                        $a = dol_mktime((int)$h, 0, 0, $month, $day, $year, 'tzuserrel', 0);
1083
-                        $b = dol_mktime((int)$h, 30, 0, $month, $day, $year, 'tzuserrel', 0);
1084
-                        $c = dol_mktime((int)$h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0);
1082
+                        $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0);
1083
+                        $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0);
1084
+                        $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0);
1085 1085
 
1086 1086
                         $dateendtouse = $event->date_end_in_calendar;
1087 1087
                         if ($dateendtouse == $event->date_start_in_calendar) {
Please login to merge, or discard this patch.