Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created
public/htdocs/comm/action/index.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $conf->global->AGENDA_EXT_NB = 5;
54 54
 }
55 55
 $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
56
-$DELAYFORCACHE = 300;   // 300 seconds
56
+$DELAYFORCACHE = 300; // 300 seconds
57 57
 
58 58
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
59 59
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 $mode = GETPOST('mode', 'aZ09');
112 112
 if (empty($mode) && str_contains($action, 'show_')) {
113
-    $mode = $action;    // For backward compatibility
113
+    $mode = $action; // For backward compatibility
114 114
 }
115 115
 $resourceid = GETPOST("search_resourceid", 'int');
116 116
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 }
146 146
 
147 147
 $defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app
148
-$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview);   // default for user
148
+$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user
149 149
 if (empty($mode) && !GETPOSTISSET('mode')) {
150 150
     $mode = $defaultview;
151 151
 }
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 
541 541
 $viewmode .= '</div>';
542 542
 
543
-$viewmode .= '<span class="marginrightonly"></span>';   // To add a space before the navigation tools
543
+$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
544 544
 
545 545
 
546 546
 $newparam = '';
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
     $newparam .= '&month=' . ((int) $month) . '&year=' . ((int) $tmpforcreatebutton['year']) . '&mode=' . urlencode($mode);
552 552
 
553 553
     //$param='month='.$monthshown.'&year='.$year;
554
-    $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt') . '0000';  // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
554
+    $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt') . '0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
555 555
 
556 556
     $urltocreateaction = constant('BASE_URL') . '/comm/action/card.php?action=create';
557 557
     $urltocreateaction .= '&apyear=' . $tmpforcreatebutton['year'] . '&apmonth=' . $tmpforcreatebutton['mon'] . '&apday=' . $tmpforcreatebutton['mday'] . '&aphour=' . $tmpforcreatebutton['hours'] . '&apmin=' . $tmpforcreatebutton['minutes'];
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
     $sql .= " WHERE bc.status = 1";
578 578
     $sql .= " AND ba.status = 1";
579 579
     if (!empty($filtert) && $filtert != -1) {
580
-        $sql .= " AND bc.visibility = " . (int) $filtert ;
580
+        $sql .= " AND bc.visibility = " . (int) $filtert;
581 581
     }
582 582
     $resql = $db->query($sql);
583 583
     if ($resql) {
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
         $s .= '</script>' . "\n";
660 660
 
661 661
         foreach ($showextcals as $val) {
662
-            $htmlname = md5($val['name']);  // not used for security purpose, only to get a string with no special char
662
+            $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char
663 663
 
664 664
             if (!empty($val['default']) || GETPOSTINT('check_ext' . $htmlname)) {
665 665
                 $default = "checked";
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
     if ($mode == 'show_day') {
1112 1112
         // Request only leaves for the current selected day
1113
-        $sql .= " AND '" . $db->escape($year) . "-" . $db->escape($month) . "-" . $db->escape($day) . "' BETWEEN x.date_debut AND x.date_fin";  // date_debut and date_fin are date without time
1113
+        $sql .= " AND '" . $db->escape($year) . "-" . $db->escape($month) . "-" . $db->escape($day) . "' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
1114 1114
     } elseif ($mode == 'show_week') {
1115 1115
         // Restrict on current month (we get more, but we will filter later)
1116 1116
         $sql .= " AND date_debut < '" . $db->idate(dol_get_last_day($year, $month)) . "'";
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
 
1657 1657
     for ($iter_day = 0; $iter_day < 7; $iter_day++) {
1658 1658
         // Show days of the current week
1659
-        $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');        // $firstdaytoshow is in timezone of server
1659
+        $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
1660 1660
         $tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
1661 1661
         $tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
1662 1662
         $tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
@@ -1885,9 +1885,9 @@  discard block
 block discarded – undo
1885 1885
     $tmpholiday = new Holiday($db);
1886 1886
 
1887 1887
     foreach ($eventarray as $daykey => $notused) {      // daykey is the 'YYYYMMDD' to show according to user
1888
-        $annee = dol_print_date($daykey, '%Y', 'gmt');  // We use gmt because we want the value represented by string 'YYYYMMDD'
1889
-        $mois =  dol_print_date($daykey, '%m', 'gmt');  // We use gmt because we want the value represented by string 'YYYYMMDD'
1890
-        $jour =  dol_print_date($daykey, '%d', 'gmt');  // We use gmt because we want the value represented by string 'YYYYMMDD'
1888
+        $annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1889
+        $mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1890
+        $jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1891 1891
 
1892 1892
         //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
1893 1893
         //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n";
Please login to merge, or discard this patch.
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.
public/htdocs/core/modules/export/export_tsv.modules.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         return $this->version_lib;
152 152
     }
153 153
 
154
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
154
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
155 155
     /**
156 156
      *   Open output file
157 157
      *
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      */
162 162
     public function open_file($file, $outputlangs)
163 163
     {
164
-		// phpcs:enable
164
+        // phpcs:enable
165 165
         global $langs;
166 166
 
167 167
         dol_syslog("ExportTsv::open_file file=" . $file);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         return $ret;
180 180
     }
181 181
 
182
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
182
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
183 183
     /**
184 184
      *  Output header into file
185 185
      *
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function write_header($outputlangs)
190 190
     {
191
-		// phpcs:enable
191
+        // phpcs:enable
192 192
         return 0;
193 193
     }
194 194
 
195 195
 
196
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
196
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
197 197
     /**
198 198
      *  Output title line into file
199 199
      *
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     public function write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types)
207 207
     {
208
-		// phpcs:enable
208
+        // phpcs:enable
209 209
         $selectlabel = array();
210 210
         foreach ($array_selected_sorted as $code => $value) {
211 211
             $newvalue = $outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     }
227 227
 
228 228
 
229
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
229
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
230 230
     /**
231 231
      *  Output record line into file
232 232
      *
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
240 240
     {
241
-		// phpcs:enable
241
+        // phpcs:enable
242 242
         global $conf;
243 243
 
244 244
         $this->col = 0;
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         return 0;
285 285
     }
286 286
 
287
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
287
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
288 288
     /**
289 289
      *  Output footer into file
290 290
      *
@@ -293,11 +293,11 @@  discard block
 block discarded – undo
293 293
      */
294 294
     public function write_footer($outputlangs)
295 295
     {
296
-		// phpcs:enable
296
+        // phpcs:enable
297 297
         return 0;
298 298
     }
299 299
 
300
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
300
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
301 301
     /**
302 302
      *  Close file handle
303 303
      *
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public function close_file()
307 307
     {
308
-		// phpcs:enable
308
+        // phpcs:enable
309 309
         fclose($this->handle);
310 310
         return 0;
311 311
     }
312 312
 
313
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
313
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
314 314
     /**
315 315
      * Clean a cell to respect rules of TSV file cells
316 316
      *
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
      */
321 321
     public function tsv_clean($newvalue, $charset)
322 322
     {
323
-		// phpcs:enable
323
+        // phpcs:enable
324 324
         // Rule Dolibarr: No HTML
325 325
         $newvalue = dol_string_nohtmltag($newvalue, 1, $charset);
326 326
 
Please login to merge, or discard this patch.