@@ -90,10 +90,10 @@ discard block |
||
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 |
||
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 |
||
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'; |
@@ -99,7 +99,7 @@ |
||
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 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $object = new Dolresource($db); |
46 | 46 | |
47 | 47 | // Load object |
48 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once |
|
48 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once |
|
49 | 49 | |
50 | 50 | // Security check |
51 | 51 | if ($user->socid) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | $object->fields = dol_sort_array($object->fields, 'position'); |
161 | 161 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
162 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
162 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
163 | 163 | |
164 | 164 | include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
165 | 165 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | // Output page |
361 | 361 | |
362 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-resource page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
362 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-resource page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
363 | 363 | |
364 | 364 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
365 | 365 |
@@ -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 |