diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index f28a1f6e7a7..d2149f611ff 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1825,75 +1825,112 @@ if ($action == 'create' || $action == 'adduserldap') {
/*
* Buttons actions
*/
-
print '
';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
if (empty($user->socid)) {
+ $canSendMail = false;
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
if (!empty($object->email)) {
$langs->load("mails");
- print '
';
+ $canSendMail = true;
} else {
$langs->load("mails");
- print '
';
+ $params['attr']['title'] = $langs->trans('NoEMail');
}
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params);
}
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
- print '
';
+ $params['attr']['title'] = $langs->trans('DisabledInMonoUserMode');
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
} else {
- print '
';
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken(), '', true, $params);
}
} elseif ($caneditpassword && !$object->ldap_sid &&
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
- print '
';
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit', '', true, $params);
}
// Si on a un gestionnaire de generation de mot de passe actif
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
if ($conf->global->USER_PASSWORD_GENERATED != 'none') {
if ($object->statut == 0) {
- print '
';
- } elseif ($caneditpassword && $object->login && !$object->ldap_sid &&
+ $params['attr']['title'] = $langs->trans('UserDisabled');
+ print dolGetButtonAction($langs->trans('ReinitPassword'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
+ } elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
- print '
';
+ print dolGetButtonAction($langs->trans('ReinitPassword'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password&token='.newToken(), '', true, $params);
}
if ($object->statut == 0) {
- print '
';
- } elseif ($caneditpassword && $object->login && !$object->ldap_sid &&
+ $params['attr']['title'] = $langs->trans('UserDisabled');
+ print dolGetButtonAction($langs->trans('SendNewPassword'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
+ } elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
if ($object->email) {
- print '
';
+ print dolGetButtonAction($langs->trans('SendNewPassword'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend&token='.newToken(), '', true, $params);
} else {
- print '
';
+ $params['attr']['title'] = $langs->trans('NoEMail');
+ print dolGetButtonAction($langs->trans('SendNewPassword'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
}
}
}
// Enable user
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
- print '
';
+ print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken().$langs->trans("Reactivate"), '', true, $params);
}
// Disable user
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
- print '
';
+ print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken().$langs->trans("DisableUser"), '', true, $params);
} else {
if ($user->id == $id) {
- print '
';
+ $params['attr']['title'] = $langs->trans('CantDisableYourself');
+ print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
}
}
// Delete
if ($user->id <> $id && $candisableuser &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin
- print '
';
+ print dolGetButtonAction($langs->trans('DeleteUser'), '', 'default', $_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id, '', true, $params);
} else {
- print '
';
+ $params['attr']['title'] = $langs->trans('MustBeAdminToDeleteOtherAdmin');
+ print dolGetButtonAction($langs->trans('DeleteUser'), '', 'default', $_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id, '', false, $params);
}
}
}
@@ -1902,7 +1939,7 @@ if ($action == 'create' || $action == 'adduserldap') {
- //Select mail models is same action as presend
+ // Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}