Add field to select color of the user in user's card
This commit is contained in:
parent
2f4822e73b
commit
c1d016a531
@ -1146,11 +1146,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
if (in_array($user->id, $keysofuserassigned))
|
if (in_array($user->id, $keysofuserassigned))
|
||||||
{
|
{
|
||||||
$nummytasks++; $cssclass='family_mytasks';
|
$nummytasks++; $cssclass='family_mytasks';
|
||||||
// TODO Set a color using user color
|
|
||||||
// Must defined rule to choose color of who to use.
|
// Must defined rule to choose color of who to use.
|
||||||
// event->ownerid will still contains user id of owner
|
// event->ownerid will still contains user id of owner
|
||||||
// event->userassigned will be an array in future.
|
// event->userassigned will be an array in future.
|
||||||
// $color=$user->color;
|
$color=$user->color;
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'ICALEVENT')
|
else if ($event->type_code == 'ICALEVENT')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -120,3 +120,4 @@ UseTypeFieldToChange=Use field Type to change
|
|||||||
OpenIDURL=OpenID URL
|
OpenIDURL=OpenID URL
|
||||||
LoginUsingOpenID=Use OpenID to login
|
LoginUsingOpenID=Use OpenID to login
|
||||||
WeeklyHours=Weekly hours
|
WeeklyHours=Weekly hours
|
||||||
|
ColorUser=Color of the user
|
||||||
@ -46,7 +46,7 @@ $actionsave=GETPOST('save','alpha');
|
|||||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||||
|
|
||||||
// List of aviable colors
|
// List of available colors
|
||||||
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
|||||||
@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||||
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
||||||
@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action ajout user
|
// Action Add user
|
||||||
if ($action == 'add' && $canadduser)
|
if ($action == 'add' && $canadduser)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -206,6 +207,8 @@ if ($action == 'add' && $canadduser)
|
|||||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||||
|
|
||||||
|
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
|
||||||
@ -258,7 +261,7 @@ if ($action == 'add' && $canadduser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action ajout groupe utilisateur
|
// Action add usergroup
|
||||||
if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
|
if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
|
||||||
{
|
{
|
||||||
if ($group)
|
if ($group)
|
||||||
@ -351,6 +354,8 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||||
|
|
||||||
|
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
|
||||||
@ -589,6 +594,7 @@ if ($action == 'adduserldap')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
$formother=new FormOther($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("UserCard"));
|
llxHeader('',$langs->trans("UserCard"));
|
||||||
|
|
||||||
@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
setEventMessage($ldap->error, 'errors');
|
setEventMessage($ldap->error, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si la liste des users est rempli, on affiche la liste deroulante
|
// If user list is full, we show drop-down list
|
||||||
print "\n\n<!-- Form liste LDAP debut -->\n";
|
print "\n\n<!-- Form liste LDAP debut -->\n";
|
||||||
|
|
||||||
print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
@ -767,7 +773,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
}
|
}
|
||||||
$password=$generated_password;
|
$password=$generated_password;
|
||||||
|
|
||||||
// Mot de passe
|
// Password
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (! empty($ldap_sid))
|
if (! empty($ldap_sid))
|
||||||
@ -789,7 +795,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Administrateur
|
// Administrator
|
||||||
if (! empty($user->admin))
|
if (! empty($user->admin))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
|
||||||
@ -975,6 +981,15 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// User color
|
||||||
|
if (! empty($conf->agenda->enabled))
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top">';
|
||||||
print $langs->trans("Note");
|
print $langs->trans("Note");
|
||||||
@ -1002,7 +1017,7 @@ else
|
|||||||
{
|
{
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Visu et edition */
|
/* View and edition */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -1032,7 +1047,7 @@ else
|
|||||||
$userDisabled = 0;
|
$userDisabled = 0;
|
||||||
$statutUACF = '';
|
$statutUACF = '';
|
||||||
|
|
||||||
//On verifie les options du compte
|
// Check options of user account
|
||||||
if (count($ldap->uacf) > 0)
|
if (count($ldap->uacf) > 0)
|
||||||
{
|
{
|
||||||
foreach ($ldap->uacf as $key => $statut)
|
foreach ($ldap->uacf as $key => $statut)
|
||||||
@ -1080,7 +1095,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation desactivation
|
* Confirm deactivation
|
||||||
*/
|
*/
|
||||||
if ($action == 'disable')
|
if ($action == 'disable')
|
||||||
{
|
{
|
||||||
@ -1088,7 +1103,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation activation
|
* Confirm activation
|
||||||
*/
|
*/
|
||||||
if ($action == 'enable')
|
if ($action == 'enable')
|
||||||
{
|
{
|
||||||
@ -1108,13 +1123,13 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($action != 'edit')
|
if ($action != 'edit')
|
||||||
{
|
{
|
||||||
$rowspan=16;
|
$rowspan=17;
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="3">';
|
||||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
@ -1123,10 +1138,12 @@ else
|
|||||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||||
if (! empty($conf->adherent->enabled)) $rowspan++;
|
if (! empty($conf->adherent->enabled)) $rowspan++;
|
||||||
if (! empty($conf->skype->enabled)) $rowspan++;
|
if (! empty($conf->skype->enabled)) $rowspan++;
|
||||||
|
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
|
||||||
|
if (! empty($conf->agenda->enabled)) $rowspan++;
|
||||||
|
|
||||||
// Lastname
|
// Lastname
|
||||||
print '<tr><td valign="top">'.$langs->trans("Lastname").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Lastname").'</td>';
|
||||||
print '<td>'.$object->lastname.'</td>';
|
print '<td colspan="2">'.$object->lastname.'</td>';
|
||||||
|
|
||||||
// Photo
|
// Photo
|
||||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||||
@ -1137,23 +1154,23 @@ else
|
|||||||
|
|
||||||
// Firstname
|
// Firstname
|
||||||
print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>';
|
||||||
print '<td>'.$object->firstname.'</td>';
|
print '<td colspan="2">'.$object->firstname.'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Position/Job
|
// Position/Job
|
||||||
print '<tr><td valign="top">'.$langs->trans("PostOrFunction").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("PostOrFunction").'</td>';
|
||||||
print '<td>'.$object->job.'</td>';
|
print '<td colspan="2">'.$object->job.'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
print '<tr><td valign="top">'.$langs->trans("Login").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Login").'</td>';
|
||||||
if (! empty($object->ldap_sid) && $object->statut==0)
|
if (! empty($object->ldap_sid) && $object->statut==0)
|
||||||
{
|
{
|
||||||
print '<td class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
print '<td colspan="2" class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td>'.$object->login.'</td>';
|
print '<td colspan="2">'.$object->login.'</td>';
|
||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
@ -1163,24 +1180,24 @@ else
|
|||||||
{
|
{
|
||||||
if ($passDoNotExpire)
|
if ($passDoNotExpire)
|
||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
|
print '<td colspan="2">'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
|
||||||
}
|
}
|
||||||
else if($userChangePassNextLogon)
|
else if($userChangePassNextLogon)
|
||||||
{
|
{
|
||||||
print '<td class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>';
|
print '<td colspan="2" class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>';
|
||||||
}
|
}
|
||||||
else if($userDisabled)
|
else if($userDisabled)
|
||||||
{
|
{
|
||||||
print '<td class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>';
|
print '<td colspan="2" class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("DomainPassword").'</td>';
|
print '<td colspan="2">'.$langs->trans("DomainPassword").'</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
if ($object->pass) print preg_replace('/./i','*',$object->pass);
|
if ($object->pass) print preg_replace('/./i','*',$object->pass);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1192,7 +1209,7 @@ else
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Administrator
|
// Administrator
|
||||||
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td><td colspan="2">';
|
||||||
if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity)
|
if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity)
|
||||||
{
|
{
|
||||||
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
|
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
|
||||||
@ -1208,7 +1225,7 @@ else
|
|||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td colspan="2">';
|
||||||
$type=$langs->trans("Internal");
|
$type=$langs->trans("Internal");
|
||||||
if ($object->societe_id) $type=$langs->trans("External");
|
if ($object->societe_id) $type=$langs->trans("External");
|
||||||
print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
|
print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
|
||||||
@ -1218,47 +1235,47 @@ else
|
|||||||
// Ldap sid
|
// Ldap sid
|
||||||
if ($object->ldap_sid)
|
if ($object->ldap_sid)
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td colspan="2">';
|
||||||
print $langs->trans("DomainUser",$ldap->domainFQDN);
|
print $langs->trans("DomainUser",$ldap->domainFQDN);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tel pro
|
// Tel pro
|
||||||
print '<tr><td valign="top">'.$langs->trans("PhonePro").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("PhonePro").'</td>';
|
||||||
print '<td>'.dol_print_phone($object->office_phone,'',0,0,1).'</td>';
|
print '<td colspan="2">'.dol_print_phone($object->office_phone,'',0,0,1).'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Tel mobile
|
// Tel mobile
|
||||||
print '<tr><td valign="top">'.$langs->trans("PhoneMobile").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("PhoneMobile").'</td>';
|
||||||
print '<td>'.dol_print_phone($object->user_mobile,'',0,0,1).'</td>';
|
print '<td colspan="2">'.dol_print_phone($object->user_mobile,'',0,0,1).'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Fax
|
// Fax
|
||||||
print '<tr><td valign="top">'.$langs->trans("Fax").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Fax").'</td>';
|
||||||
print '<td>'.dol_print_phone($object->office_fax,'',0,0,1).'</td>';
|
print '<td colspan="2">'.dol_print_phone($object->office_fax,'',0,0,1).'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->skype->enabled))
|
if (! empty($conf->skype->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Skype").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Skype").'</td>';
|
||||||
print '<td>'.dol_print_skype($object->skype,0,0,1).'</td>';
|
print '<td colspan="2">'.dol_print_skype($object->skype,0,0,1).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td valign="top">'.$langs->trans("EMail").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("EMail").'</td>';
|
||||||
print '<td>'.dol_print_email($object->email,0,0,1).'</td>';
|
print '<td colspan="2">'.dol_print_email($object->email,0,0,1).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Signature
|
// Signature
|
||||||
print '<tr><td valign="top">'.$langs->trans('Signature').'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans('Signature').'</td><td colspan="2">';
|
||||||
print dol_htmlentitiesbr($object->signature);
|
print dol_htmlentitiesbr($object->signature);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Hierarchy
|
// Hierarchy
|
||||||
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
if (empty($object->fk_user)) print $langs->trans("None");
|
if (empty($object->fk_user)) print $langs->trans("None");
|
||||||
else {
|
else {
|
||||||
$huser=new User($db);
|
$huser=new User($db);
|
||||||
@ -1268,27 +1285,27 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if ($conf->salaries->enabled && ! empty($user->rights->salaries->read))
|
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|
||||||
{
|
{
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
|
||||||
// THM
|
// THM
|
||||||
print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
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 '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// TJM
|
// TJM
|
||||||
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
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 '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Salary
|
// Salary
|
||||||
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
|
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -1296,7 +1313,7 @@ else
|
|||||||
|
|
||||||
// Weeklyhours
|
// Weeklyhours
|
||||||
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
print price2num($object->weeklyhours);
|
print price2num($object->weeklyhours);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -1306,28 +1323,39 @@ else
|
|||||||
{
|
{
|
||||||
$rowspan++;
|
$rowspan++;
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
print '<td>'.$object->accountancy_code.'</td>';
|
print '<td colspan="2">'.$object->accountancy_code.'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Color user
|
||||||
|
if (! empty($conf->agenda->enabled))
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
|
||||||
|
print '<td width="50px" bgcolor="'.$object->color.'">';
|
||||||
|
print $object->color;
|
||||||
|
print '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
print $object->getLibStatut(4);
|
print $object->getLibStatut(4);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("LastConnexion").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("LastConnexion").'</td>';
|
||||||
print '<td>'.dol_print_date($object->datelastlogin,"dayhour").'</td>';
|
print '<td colspan="2">'.dol_print_date($object->datelastlogin,"dayhour").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("PreviousConnexion").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("PreviousConnexion").'</td>';
|
||||||
print '<td>'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
|
print '<td colspan="2">'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
|
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("OpenIDURL").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("OpenIDURL").'</td>';
|
||||||
print '<td>'.$object->openid.'</td>';
|
print '<td colspan="2">'.$object->openid.'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1335,7 +1363,7 @@ else
|
|||||||
if (! empty($conf->societe->enabled))
|
if (! empty($conf->societe->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("LinkToCompanyContact").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("LinkToCompanyContact").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
if (isset($object->societe_id) && $object->societe_id > 0)
|
if (isset($object->societe_id) && $object->societe_id > 0)
|
||||||
{
|
{
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
@ -1363,7 +1391,7 @@ else
|
|||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
print '<tr><td valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
if ($object->fk_member)
|
if ($object->fk_member)
|
||||||
{
|
{
|
||||||
$adh=new Adherent($db);
|
$adh=new Adherent($db);
|
||||||
@ -1631,6 +1659,9 @@ else
|
|||||||
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
|
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
|
||||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||||
if (! empty($conf->adherent->enabled)) $rowspan++;
|
if (! empty($conf->adherent->enabled)) $rowspan++;
|
||||||
|
if (! empty($conf->skype->enabled)) $rowspan++;
|
||||||
|
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
|
||||||
|
if (! empty($conf->agenda->enabled)) $rowspan++;
|
||||||
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -1957,7 +1988,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
if ($conf->salaries->enabled && ! empty($user->rights->salaries->read))
|
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|
||||||
{
|
{
|
||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
|
||||||
@ -2009,6 +2040,15 @@ else
|
|||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// User color
|
||||||
|
if (! empty($conf->agenda->enabled))
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -108,6 +108,7 @@ class User extends CommonObject
|
|||||||
var $salaryextra; // Monthly salary extra
|
var $salaryextra; // Monthly salary extra
|
||||||
var $weeklyhours; // Weekly hours
|
var $weeklyhours; // Weekly hours
|
||||||
|
|
||||||
|
var $color; // Define background color for user in agenda
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor de la classe
|
* Constructor de la classe
|
||||||
@ -166,6 +167,7 @@ class User extends CommonObject
|
|||||||
$sql.= " u.salary,";
|
$sql.= " u.salary,";
|
||||||
$sql.= " u.salaryextra,";
|
$sql.= " u.salaryextra,";
|
||||||
$sql.= " u.weeklyhours,";
|
$sql.= " u.weeklyhours,";
|
||||||
|
$sql.= " u.color,";
|
||||||
$sql.= " u.ref_int, u.ref_ext";
|
$sql.= " u.ref_int, u.ref_ext";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
|
|
||||||
@ -233,6 +235,7 @@ class User extends CommonObject
|
|||||||
$this->salary = $obj->salary;
|
$this->salary = $obj->salary;
|
||||||
$this->salaryextra = $obj->salaryextra;
|
$this->salaryextra = $obj->salaryextra;
|
||||||
$this->weeklyhours = $obj->weeklyhours;
|
$this->weeklyhours = $obj->weeklyhours;
|
||||||
|
$this->color = $obj->color;
|
||||||
|
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
$this->datem = $this->db->jdate($obj->datem);
|
$this->datem = $this->db->jdate($obj->datem);
|
||||||
@ -270,7 +273,7 @@ class User extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recupere parametrage global propre a l'utilisateur
|
// To get back the global configuration unique to the user
|
||||||
if ($loadpersonalconf)
|
if ($loadpersonalconf)
|
||||||
{
|
{
|
||||||
$sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
|
$sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
|
||||||
@ -302,7 +305,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajoute un droit a l'utilisateur
|
* Add a right to the user
|
||||||
*
|
*
|
||||||
* @param int $rid id du droit a ajouter
|
* @param int $rid id du droit a ajouter
|
||||||
* @param string $allmodule Ajouter tous les droits du module allmodule
|
* @param string $allmodule Ajouter tous les droits du module allmodule
|
||||||
@ -404,7 +407,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retire un droit a l'utilisateur
|
* Remove a right to the user
|
||||||
*
|
*
|
||||||
* @param int $rid Id du droit a retirer
|
* @param int $rid Id du droit a retirer
|
||||||
* @param string $allmodule Retirer tous les droits du module allmodule
|
* @param string $allmodule Retirer tous les droits du module allmodule
|
||||||
@ -672,7 +675,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Desactive utilisateur
|
// Deactivate user
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||||
$sql.= " SET statut = ".$this->statut;
|
$sql.= " SET statut = ".$this->statut;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
@ -717,7 +720,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
|
|
||||||
// Supprime droits
|
// Remove rights
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id;
|
||||||
|
|
||||||
if (! $error && ! $this->db->query($sql))
|
if (! $error && ! $this->db->query($sql))
|
||||||
@ -734,7 +737,7 @@ class User extends CommonObject
|
|||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si contact, supprime lien
|
// If contact, remove link
|
||||||
if ($this->contact_id)
|
if ($this->contact_id)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id;
|
||||||
@ -1063,7 +1066,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Affectation des permissions par defaut
|
* Assign rights by default
|
||||||
*
|
*
|
||||||
* @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes
|
* @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes
|
||||||
*/
|
*/
|
||||||
@ -1142,6 +1145,7 @@ class User extends CommonObject
|
|||||||
$this->zip = empty($this->zip)?'':$this->zip;
|
$this->zip = empty($this->zip)?'':$this->zip;
|
||||||
$this->town = empty($this->town)?'':$this->town;
|
$this->town = empty($this->town)?'':$this->town;
|
||||||
$this->accountancy_code = trim($this->accountancy_code);
|
$this->accountancy_code = trim($this->accountancy_code);
|
||||||
|
$this->color = empty($this->color)?'':$this->color;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
||||||
@ -1151,6 +1155,13 @@ class User extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($this->color))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorColor",$this->color);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Mise a jour autres infos
|
// Mise a jour autres infos
|
||||||
@ -1172,6 +1183,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||||
|
$sql.= ", color = '".$this->db->escape($this->color)."'";
|
||||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user