@@ -145,12 +145,12 @@ |
||
145 | 145 | $messagewarning .= '</div>'; |
146 | 146 | |
147 | 147 | if ($result <= 0 && $edituser->error == 'USERNOTFOUND') { |
148 | - usleep(20000); // add delay to simulate setPassword() and send_password() actions delay (0.02s) |
|
148 | + usleep(20000); // add delay to simulate setPassword() and send_password() actions delay (0.02s) |
|
149 | 149 | $message .= $messagewarning; |
150 | 150 | $username = ''; |
151 | 151 | } else { |
152 | 152 | if (empty($edituser->email)) { |
153 | - usleep(20000); // add delay to simulate setPassword() and send_password() actions delay (0.02s) |
|
153 | + usleep(20000); // add delay to simulate setPassword() and send_password() actions delay (0.02s) |
|
154 | 154 | $message .= $messagewarning; |
155 | 155 | } else { |
156 | 156 | $newpassword = $edituser->setPassword($user, '', 1); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $dateendvalidity = dol_mktime(0, 0, 0, GETPOSTINT('dateendvaliditymonth'), GETPOSTINT('dateendvalidityday'), GETPOSTINT('dateendvalidityyear')); |
86 | 86 | $dateofbirth = dol_mktime(0, 0, 0, GETPOSTINT('dateofbirthmonth'), GETPOSTINT('dateofbirthday'), GETPOSTINT('dateofbirthyear')); |
87 | 87 | |
88 | -$childids = $user->getAllChildIds(1); // For later, test on salary visibility |
|
88 | +$childids = $user->getAllChildIds(1); // For later, test on salary visibility |
|
89 | 89 | |
90 | 90 | $object = new User($db); |
91 | 91 | $extrafields = new ExtraFields($db); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // Define value to know what current user can do on users |
118 | 118 | $canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); |
119 | 119 | $canreaduser = (!empty($user->admin) || $user->hasRight("user", "user", "read")); |
120 | -$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); // edit other user |
|
120 | +$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); // edit other user |
|
121 | 121 | $candisableuser = (!empty($user->admin) || $user->hasRight("user", "user", "delete")); |
122 | 122 | $canreadgroup = $canreaduser; |
123 | 123 | $caneditgroup = $canedituser; |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | $object->gender = GETPOST("gender", 'aZ09'); |
440 | 440 | if ($caneditpasswordandsee) { |
441 | - $object->pass = GETPOST("password", 'none'); // We can keep 'none' for password fields |
|
441 | + $object->pass = GETPOST("password", 'none'); // We can keep 'none' for password fields |
|
442 | 442 | } |
443 | 443 | if ($caneditpasswordandsee || $user->hasRight("api", "apikey", "generate")) { |
444 | 444 | $object->api_key = (GETPOST("api_key", 'alphanohtml')) ? GETPOST("api_key", 'alphanohtml') : $object->api_key; |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | } |
547 | 547 | } |
548 | 548 | |
549 | - $ret = $object->update($user); // This may include call to setPassword if password has changed |
|
549 | + $ret = $object->update($user); // This may include call to setPassword if password has changed |
|
550 | 550 | if ($ret < 0) { |
551 | 551 | $error++; |
552 | 552 | if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { |
@@ -1944,7 +1944,7 @@ discard block |
||
1944 | 1944 | print '<td>'; |
1945 | 1945 | if (!empty($object->api_key)) { |
1946 | 1946 | print '<span class="opacitymedium">'; |
1947 | - print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste |
|
1947 | + print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste |
|
1948 | 1948 | print '</span>'; |
1949 | 1949 | } |
1950 | 1950 | print '</td></tr>'; |
@@ -224,9 +224,9 @@ discard block |
||
224 | 224 | // Read the permissions of a user inherited by its groups |
225 | 225 | $permsgroupbyentity = array(); |
226 | 226 | |
227 | -$sql = "SELECT DISTINCT gr.fk_id, gu.entity"; // fk_id are permission id and entity is entity of the group |
|
227 | +$sql = "SELECT DISTINCT gr.fk_id, gu.entity"; // fk_id are permission id and entity is entity of the group |
|
228 | 228 | $sql .= " FROM " . MAIN_DB_PREFIX . "usergroup_rights as gr,"; |
229 | -$sql .= " " . MAIN_DB_PREFIX . "usergroup_user as gu"; // all groups of a user |
|
229 | +$sql .= " " . MAIN_DB_PREFIX . "usergroup_user as gu"; // all groups of a user |
|
230 | 230 | $sql .= " WHERE gr.entity = " . ((int) $entity); |
231 | 231 | // The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r. |
232 | 232 | // but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } else { |
508 | 508 | $ishidden = 0; |
509 | 509 | } |
510 | - $isexpanded = ! $ishidden; |
|
510 | + $isexpanded = !$ishidden; |
|
511 | 511 | //var_dump("isexpanded=".$isexpanded); |
512 | 512 | |
513 | 513 | $permsgroupbyentitypluszero = array(); |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } else { |
532 | 532 | $ishidden = 0; |
533 | 533 | } |
534 | - $isexpanded = ! $ishidden; |
|
534 | + $isexpanded = !$ishidden; |
|
535 | 535 | //var_dump('$obj->module='.$obj->module.' isexpanded='.$isexpanded); |
536 | 536 | |
537 | 537 | // Break detected, we get objMod |
@@ -450,7 +450,7 @@ |
||
450 | 450 | print '<td class="liste_titre right" width="5"> </td>'; |
451 | 451 | print "</tr>\n"; |
452 | 452 | |
453 | - $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
453 | + $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
454 | 454 | |
455 | 455 | if (!empty($object->members)) { |
456 | 456 | foreach ($object->members as $useringroup) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $object = new UserGroup($db); |
67 | 67 | $extrafields = new ExtraFields($db); |
68 | 68 | //$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; |
69 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
69 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
70 | 70 | |
71 | 71 | // Fetch optionals attributes and labels |
72 | 72 | $extrafields->fetch_name_optionals_label($object->table_element); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
331 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
331 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
332 | 332 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
333 | 333 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
334 | 334 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | $object->fields = dol_sort_array($object->fields, 'position'); |
156 | 156 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
157 | -'@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 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
158 | 158 | |
159 | 159 | // Init search fields |
160 | 160 | $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | } |
995 | 995 | |
996 | 996 | if (empty($obj->country_code)) { |
997 | - $obj->country_code = ''; // TODO Add join in select with country table to get country_code |
|
997 | + $obj->country_code = ''; // TODO Add join in select with country table to get country_code |
|
998 | 998 | } |
999 | 999 | |
1000 | 1000 | // Store properties in $object |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | if ($api_key) { |
1203 | 1203 | if ($canreadsecretapi) { |
1204 | 1204 | print '<span class="opacitymedium">'; |
1205 | - print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste |
|
1205 | + print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste |
|
1206 | 1206 | print '</span>'; |
1207 | 1207 | } else { |
1208 | 1208 | print '<span class="opacitymedium">' . $langs->trans("Hidden") . '</span>'; |
@@ -89,8 +89,8 @@ |
||
89 | 89 | |
90 | 90 | // Define value to know what current user can do on users |
91 | 91 | $selfpermission = ($user->id == $id && $user->hasRight('user', 'self', 'creer')); |
92 | -$canadduser = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write') ); |
|
93 | -$canreaduser = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read') ); |
|
92 | +$canadduser = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')); |
|
93 | +$canreaduser = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read')); |
|
94 | 94 | $permissiontoaddbankaccount = ($user->hasRight('salaries', 'write') || $user->hasRight('hrm', 'employee', 'write') || $user->hasRight('user', 'user', 'creer') || $selfpermission); |
95 | 95 | $permissiontoreadhr = $user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write'); |
96 | 96 | $permissiontowritehr = $user->hasRight('hrm', 'write_personal_information', 'write'); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | || (($user->id != $id) && $user->hasRight("user", "user", "password"))); |
67 | 67 | } |
68 | 68 | |
69 | -$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
69 | +$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
70 | 70 | $permtoedit = $caneditfield; |
71 | 71 | |
72 | 72 | // Security check |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | |
120 | 120 | if (!$error) { |
121 | 121 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
122 | - $action = ''; // To avoid to execute next actions |
|
122 | + $action = ''; // To avoid to execute next actions |
|
123 | 123 | } else { |
124 | 124 | setEventMessages($langs->trans("Error"), null, 'errors'); |
125 | - $action = ''; // To avoid to execute next actions |
|
125 | + $action = ''; // To avoid to execute next actions |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | |
138 | 138 | if (!$error) { |
139 | 139 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
140 | - $action = ''; // To avoid to execute next actions |
|
140 | + $action = ''; // To avoid to execute next actions |
|
141 | 141 | } else { |
142 | 142 | setEventMessages($langs->trans("Error"), null, 'errors'); |
143 | - $action = ''; // To avoid to execute next actions |
|
143 | + $action = ''; // To avoid to execute next actions |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 |