|
@@ -72,7 +72,7 @@ $mode = GETPOST('mode', 'alpha');
|
|
|
$confirm = GETPOST('confirm', 'alpha');
|
|
|
$group = GETPOST("group", "int", 3);
|
|
|
$cancel = GETPOST('cancel', 'alpha');
|
|
|
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'useracard'; // To manage different context of search
|
|
|
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'useracard'; // To manage different context of search
|
|
|
|
|
|
if (empty($id) && $action != 'create') {
|
|
|
$id = $user->id;
|
|
@@ -959,7 +959,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
if (empty($ldap_sid)) { // ldap_sid is for activedirectory
|
|
|
$generated_password = getRandomPassword(false);
|
|
|
}
|
|
|
- $password = (GETPOSTISSET('password') ?GETPOST('password') : $generated_password);
|
|
|
+ $password = (GETPOSTISSET('password') ? GETPOST('password') : $generated_password);
|
|
|
|
|
|
// Administrator
|
|
|
if (!empty($user->admin)) {
|
|
@@ -1143,7 +1143,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
// Country
|
|
|
print '<tr><td>'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).'</td><td class="maxwidthonsmartphone">';
|
|
|
print img_picto('', 'country', 'class="pictofixedwidth"');
|
|
|
- print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id), 'country_id');
|
|
|
+ print $form->select_country((GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id), 'country_id');
|
|
|
if ($user->admin) {
|
|
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
|
|
}
|
|
@@ -1244,7 +1244,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
if (isModEnabled('agenda')) {
|
|
|
print '<tr><td>'.$langs->trans("ColorUser").'</td>';
|
|
|
print '<td>';
|
|
|
- print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
|
|
|
+ print $formother->selectColor(GETPOSTISSET('color') ? GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
|
|
@@ -1260,7 +1260,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
|
|
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).'</td>';
|
|
|
print '<td class="maxwidthonsmartphone">'."\n";
|
|
|
- print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth300 widthcentpercentminusx');
|
|
|
+ print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth300 widthcentpercentminusx');
|
|
|
print '</td>';
|
|
|
print '</tr>';
|
|
|
}
|
|
@@ -1271,10 +1271,10 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
if (!method_exists($mc, 'formObjectOptions')) {
|
|
|
if (!getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && $user->admin && !$user->entity) { // condition must be same for create and edit mode
|
|
|
print "<tr>".'<td>'.$langs->trans("Entity").'</td>';
|
|
|
- print "<td>".$mc->select_entities($conf->entity);
|
|
|
- print "</td></tr>\n";
|
|
|
+ print "<td>".$mc->select_entities($conf->entity);
|
|
|
+ print "</td></tr>\n";
|
|
|
} else {
|
|
|
- print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
|
|
|
+ print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1641,7 +1641,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
// Salary
|
|
|
print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
print '<td>';
|
|
|
- print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<span class="amount">'.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').'</span>';
|
|
|
+ print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<span class="amount">'.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').'</span>';
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
@@ -1651,7 +1651,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
|
|
|
print '</td>';
|
|
|
print '<td>';
|
|
|
- print ($object->thm != '' ?price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
+ print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
@@ -1661,7 +1661,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm');
|
|
|
print '</td>';
|
|
|
print '<td>';
|
|
|
- print ($object->tjm != '' ?price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
+ print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
}
|
|
@@ -2235,7 +2235,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
&& (
|
|
|
(!isModEnabled('multicompany') && $nbAdmin >= 1)
|
|
|
|| (isModEnabled('multicompany') && (($object->entity > 0 || ($user->entity == 0 && $object->entity == 0)) || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
|
|
|
- )
|
|
|
+ )
|
|
|
) {
|
|
|
print $form->selectyesno('admin', $object->admin, 1, false, 0, 1);
|
|
|
|
|
@@ -2299,7 +2299,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '<td>';
|
|
|
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother"));
|
|
|
if ($caneditfield) {
|
|
|
- print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ?GETPOST('gender') : $object->gender, 1);
|
|
|
+ print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ? GETPOST('gender') : $object->gender, 1);
|
|
|
} else {
|
|
|
print $arraygender[$object->gender];
|
|
|
}
|
|
@@ -2538,7 +2538,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '<tr><td>'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).'</td><td>';
|
|
|
print img_picto('', 'country', 'class="pictofixedwidth"');
|
|
|
if ($caneditfield) {
|
|
|
- print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id), 'country_id');
|
|
|
+ print $form->select_country((GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id), 'country_id');
|
|
|
if ($user->admin) {
|
|
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
|
|
}
|
|
@@ -2617,7 +2617,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '<span class="fa '.$value['icon'].' pictofixedwidth"></span>';
|
|
|
}
|
|
|
if ($caneditfield && empty($object->ldap_sid)) {
|
|
|
- print '<input type="text" name="'.$key.'" class="flat maxwidth200" value="'.(isset($object->socialnetworks[$key])?$object->socialnetworks[$key]:'').'">';
|
|
|
+ print '<input type="text" name="'.$key.'" class="flat maxwidth200" value="'.(isset($object->socialnetworks[$key]) ? $object->socialnetworks[$key] : '').'">';
|
|
|
} else {
|
|
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
|
|
print $object->socialnetworks[$key];
|
|
@@ -2625,7 +2625,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '</td></tr>';
|
|
|
} else {
|
|
|
// if social network is not active but value exist we do not want to loose it
|
|
|
- print '<input type="hidden" name="'.$key.'" value="'.(isset($object->socialnetworks[$key])?$object->socialnetworks[$key]:'').'">';
|
|
|
+ print '<input type="hidden" name="'.$key.'" value="'.(isset($object->socialnetworks[$key]) ? $object->socialnetworks[$key] : '').'">';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2660,7 +2660,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ColorUser").'</td>';
|
|
|
print '<td>';
|
|
|
if ($caneditfield) {
|
|
|
- print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
|
|
|
+ print $formother->selectColor(GETPOSTISSET('color') ? GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
|
|
|
} else {
|
|
|
print $formother->showColor($object->color, '');
|
|
|
}
|
|
@@ -2814,7 +2814,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
|
|
|
print '<td>';
|
|
|
if ($caneditfield) {
|
|
|
- print '<input size="8" type="text" name="weeklyhours" value="'.price2num(GETPOST('weeklyhours') ?GETPOST('weeklyhours') : $object->weeklyhours).'">';
|
|
|
+ print '<input size="8" type="text" name="weeklyhours" value="'.price2num(GETPOST('weeklyhours') ? GETPOST('weeklyhours') : $object->weeklyhours).'">';
|
|
|
} else {
|
|
|
print price2num($object->weeklyhours);
|
|
|
}
|
|
@@ -2825,12 +2825,12 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|
|
|
|| (isModEnabled('salaries') && $user->hasRight("salaries", "readall"))
|
|
|
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
|
|
|
- $langs->load("salaries");
|
|
|
+ $langs->load("salaries");
|
|
|
|
|
|
// Salary
|
|
|
print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
print '<td>';
|
|
|
- print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<input size="8" type="text" name="salary" value="'.price2num(GETPOST('salary') ?GETPOST('salary') : $object->salary).'">';
|
|
|
+ print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<input size="8" type="text" name="salary" value="'.price2num(GETPOST('salary') ? GETPOST('salary') : $object->salary).'">';
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
@@ -2841,9 +2841,9 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '</td>';
|
|
|
print '<td>';
|
|
|
if ($caneditfield) {
|
|
|
- print '<input size="8" type="text" name="thm" value="'.price2num(GETPOST('thm') ?GETPOST('thm') : $object->thm).'">';
|
|
|
+ print '<input size="8" type="text" name="thm" value="'.price2num(GETPOST('thm') ? GETPOST('thm') : $object->thm).'">';
|
|
|
} else {
|
|
|
- print ($object->thm != '' ?price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
+ print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
}
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
@@ -2855,9 +2855,9 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '</td>';
|
|
|
print '<td>';
|
|
|
if ($caneditfield) {
|
|
|
- print '<input size="8" type="text" name="tjm" value="'.price2num(GETPOST('tjm') ?GETPOST('tjm') : $object->tjm).'">';
|
|
|
+ print '<input size="8" type="text" name="tjm" value="'.price2num(GETPOST('tjm') ? GETPOST('tjm') : $object->tjm).'">';
|
|
|
} else {
|
|
|
- print ($object->tjm != '' ?price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
+ print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
}
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|