Passed
Push — FUNCTIONS_LIB_REVIEW_240920 ( 00d68f...dbb741 )
by Rafael
51:44
created
public/htdocs/expedition/card.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
                                         $tooltipClass = ' classfortooltip';
1450 1450
                                         $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1451 1451
                                     } else {
1452
-                                        $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1452
+                                        $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1453 1453
                                     }
1454 1454
                                     $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1455 1455
 
@@ -1688,7 +1688,7 @@  discard block
 block discarded – undo
1688 1688
                                             $tooltipClass = ' classfortooltip';
1689 1689
                                             $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1690 1690
                                         } else {
1691
-                                            $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1691
+                                            $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1692 1692
                                         }
1693 1693
                                         $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1694 1694
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1437,7 +1437,9 @@
 block discarded – undo
1437 1437
                                         $deliverableQty = min($quantityToBeDelivered, $batchStock);
1438 1438
                                     }
1439 1439
 
1440
-                                    if ($deliverableQty < 0) $deliverableQty = 0;
1440
+                                    if ($deliverableQty < 0) {
1441
+                                        $deliverableQty = 0;
1442
+                                    }
1441 1443
 
1442 1444
                                     $inputName = 'qtyl' . $indiceAsked . '_' . $subj;
1443 1445
                                     if (GETPOSTISSET($inputName)) {
Please login to merge, or discard this patch.
public/htdocs/expedition/list.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
 
154 154
 $object->fields = dol_sort_array($object->fields, 'position');
155 155
 $arrayfields = dol_sort_array($arrayfields, 'position');
156
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
156
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
157 157
 
158 158
 // Security check
159 159
 $expeditionid = GETPOSTINT('id');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -444,8 +444,10 @@
 block discarded – undo
444 444
                             );
445 445
                             if ($result > 0) {
446 446
                                 $lineid = $result;
447
-                                if (!empty($createbills_onebythird)) //increment rang to keep sending
447
+                                if (!empty($createbills_onebythird)) {
448
+                                    //increment rang to keep sending
448 449
                                     $TFactThirdNbLines[$expd->socid]++;
450
+                                }
449 451
                             } else {
450 452
                                 $lineid = 0;
451 453
                                 $error++;
Please login to merge, or discard this patch.
public/htdocs/expedition/document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
 }
97 97
 $result = restrictedArea($user, 'expedition', $object->id, '');
98 98
 
99
-$permissiontoadd = $user->hasRight('expedition', 'creer');  // Used by the include of actions_dellink.inc.php
99
+$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php
100 100
 
101 101
 
102 102
 /*
Please login to merge, or discard this patch.
public/htdocs/expedition/shipment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
     $socid = $user->socid;
82 82
 }
83 83
 
84
-$result = restrictedArea($user, 'expedition', 0, '');   // We use 0 for id, because there is no particular shipment on this tab, only id of order is known
84
+$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known
85 85
 
86 86
 
87 87
 
Please login to merge, or discard this patch.
public/htdocs/societe/ajax/company.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
     $match = preg_grep('/(' . preg_quote($htmlname, '/') . '[0-9]+)/', array_keys($_GET));
106 106
     sort($match);
107 107
 
108
-    $id = (!empty($match[0]) ? $match[0] : '');     // Take first key found into GET array with matching $htmlname123
108
+    $id = (!empty($match[0]) ? $match[0] : ''); // Take first key found into GET array with matching $htmlname123
109 109
 
110 110
     // When used from jQuery, the search term is added as GET param $htmlname.
111 111
     $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : ''));
Please login to merge, or discard this patch.
public/htdocs/workstation/workstation_list.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -39,15 +39,15 @@  discard block
 block discarded – undo
39 39
 $langs->loadLangs(array('mrp', 'other'));
40 40
 
41 41
 $action      = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
42
-$massaction  = GETPOST('massaction', 'alpha');                                   // The bulk action (combo box choice into lists)
43
-$show_files  = GETPOSTINT('show_files');                                    // Show files area generated by bulk actions ?
44
-$confirm     = GETPOST('confirm', 'alpha');                                    // Result of a confirmation
45
-$cancel      = GETPOST('cancel', 'alpha');                                    // We click on a Cancel button
46
-$toselect    = GETPOST('toselect', 'array');                                 // Array of ids of elements selected into a list
42
+$massaction  = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
43
+$show_files  = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
44
+$confirm     = GETPOST('confirm', 'alpha'); // Result of a confirmation
45
+$cancel      = GETPOST('cancel', 'alpha'); // We click on a Cancel button
46
+$toselect    = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
47 47
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)) . basename(__FILE__, '.php')); // To manage different context of search
48
-$backtopage  = GETPOST('backtopage', 'alpha');                                                   // Go back to a dedicated page
49
-$optioncss   = GETPOST('optioncss', 'aZ');                                                      // Option for the css output (always '' except when 'print')
50
-$mode       = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
48
+$backtopage  = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
49
+$optioncss   = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
50
+$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
51 51
 
52 52
 $id = GETPOSTINT('id');
53 53
 $ref = GETPOST('ref', 'alpha');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 $object = new Workstation($db);
70 70
 $extrafields = new ExtraFields($db);
71 71
 $diroutputmassaction = $conf->workstation->dir_output . '/temp/massgeneration/' . $user->id;
72
-$hookmanager->initHooks(array('workstationlist'));         // Note that conf->hooks_modules contains array
72
+$hookmanager->initHooks(array('workstationlist')); // Note that conf->hooks_modules contains array
73 73
 
74 74
 // Fetch optionals attributes and labels
75 75
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 // Default sort order (if not yet defined by previous GETPOST)
81 81
 if (!$sortfield) {
82
-    reset($object->fields);                 // Reset is required to avoid key() to return null.
82
+    reset($object->fields); // Reset is required to avoid key() to return null.
83 83
     $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition.
84 84
 }
85 85
 if (!$sortorder) {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 $object->fields = dol_sort_array($object->fields, 'position');
153 153
 $arrayfields = dol_sort_array($arrayfields, 'position');
154
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
154
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
155 155
 
156 156
 $permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
157 157
 $permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     $sql .= "t." . $db->escape($key) . ", ";
322 322
 }
323 323
 // Add fields from extrafields
324
-if (! empty($extrafields->attributes[$object->table_element]['label'])) {
324
+if (!empty($extrafields->attributes[$object->table_element]['label'])) {
325 325
     foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
326 326
         // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
327 327
         $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef." . $key . ', ' : '');
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 }
330 330
 // Add groupby from hooks
331 331
 $parameters = array();
332
-$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object);    // Note that $action and $object may have been modified by hook
332
+$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
333 333
 $sql .= $hookmanager->resPrint;
334 334
 $sql = preg_replace('/,\s*$/', '', $sql);
335 335
 
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 }
499 499
 
500 500
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
501
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
501
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
502 502
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
503 503
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
504 504
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
606 606
         $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
607 607
     }
608
-    $cssforfield = preg_replace('/small\s*/', '', $cssforfield);    // the 'small' css must not be used for the title label
608
+    $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
609 609
     if (!empty($arrayfields['t.' . $key]['checked'])) {
610 610
         print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n";
611 611
         $totalarray['nbfield']++;
Please login to merge, or discard this patch.
public/htdocs/workstation/workstation_note.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 $object = new Workstation($db);
48 48
 $extrafields = new ExtraFields($db);
49 49
 $diroutputmassaction = $conf->workstation->dir_output . '/temp/massgeneration/' . $user->id;
50
-$hookmanager->initHooks(array('workstationnote', 'globalcard'));       // Note that conf->hooks_modules contains array
50
+$hookmanager->initHooks(array('workstationnote', 'globalcard')); // Note that conf->hooks_modules contains array
51 51
 
52 52
 // Fetch optionals attributes and labels
53 53
 $extrafields->fetch_name_optionals_label($object->table_element);
54 54
 
55 55
 // Load object
56
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';     // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
56
+include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
57 57
 if ($id > 0 || !empty($ref)) {
58 58
     $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/');
59 59
 }
60 60
 
61
-$permissionnote = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_setnotes.inc.php
62
-$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');     // Used by the include of actions_addupdatedelete.inc.php
61
+$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
62
+$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php
63 63
 
64 64
 // Security check
65 65
 $isdraft = 0;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
  * Actions
71 71
  */
72 72
 $parameters = array();
73
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);     // Note that $action and $object may have been modified by some hooks
73
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
74 74
 if ($reshook < 0) {
75 75
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
76 76
 }
Please login to merge, or discard this patch.
public/htdocs/workstation/workstation_card.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 
91 91
 // Permissions
92 92
 $permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
93
-$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
93
+$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
94 94
 $permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DISABLED);
95
-$permissionnote = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_setnotes.inc.php
96
-$permissiondellink = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_dellink.inc.php
95
+$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
96
+$permissiondellink = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_dellink.inc.php
97 97
 
98 98
 $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/');
99 99
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  */
108 108
 
109 109
 $parameters = array();
110
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);   // Note that $action and $object may have been modified by some hooks
110
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
111 111
 if ($reshook < 0) {
112 112
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
113 113
 }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         }
128 128
     }
129 129
 
130
-    $triggermodname = 'WORKSTATION_WORKSTATION_MODIFY';    // Name of trigger action code to execute when we modify record
130
+    $triggermodname = 'WORKSTATION_WORKSTATION_MODIFY'; // Name of trigger action code to execute when we modify record
131 131
 
132 132
     // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
133 133
     include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
Please login to merge, or discard this patch.
public/htdocs/resource/agenda.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
  */
100 100
 
101 101
 $parameters = array('id' => $id);
102
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);    // Note that $action and $object may have been modified by some hooks
102
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
103 103
 if ($reshook < 0) {
104 104
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
105 105
 }
Please login to merge, or discard this patch.