mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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))
|
||||
{
|
||||
$nummytasks++; $cssclass='family_mytasks';
|
||||
// TODO Set a color using user color
|
||||
|
||||
// Must defined rule to choose color of who to use.
|
||||
// event->ownerid will still contains user id of owner
|
||||
// event->userassigned will be an array in future.
|
||||
// $color=$user->color;
|
||||
$color=$user->color;
|
||||
}
|
||||
else if ($event->type_code == 'ICALEVENT')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,4 +119,5 @@ HierarchicView=Hierarchical view
|
|||
UseTypeFieldToChange=Use field Type to change
|
||||
OpenIDURL=OpenID URL
|
||||
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;
|
||||
$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');
|
||||
|
||||
// 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/usergroups.lib.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->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');
|
||||
|
|
@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
|
|||
}
|
||||
}
|
||||
|
||||
// Action ajout user
|
||||
// Action Add user
|
||||
if ($action == 'add' && $canadduser)
|
||||
{
|
||||
$error = 0;
|
||||
|
|
@ -205,6 +206,8 @@ if ($action == 'add' && $canadduser)
|
|||
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
|
||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||
|
||||
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$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 ($group)
|
||||
|
|
@ -350,6 +353,8 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
|
||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||
|
||||
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
|
|
@ -589,6 +594,7 @@ if ($action == 'adduserldap')
|
|||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
|
||||
llxHeader('',$langs->trans("UserCard"));
|
||||
|
||||
|
|
@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
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 '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
|
@ -767,7 +773,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
}
|
||||
$password=$generated_password;
|
||||
|
||||
// Mot de passe
|
||||
// Password
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>';
|
||||
print '<td>';
|
||||
if (! empty($ldap_sid))
|
||||
|
|
@ -789,7 +795,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Administrateur
|
||||
// Administrator
|
||||
if (! empty($user->admin))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
|
||||
|
|
@ -974,6 +980,15 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print '<input size="8" type="text" name="weeklyhours" value="'.GETPOST('weeklyhours').'">';
|
||||
print '</td>';
|
||||
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
|
||||
print '<tr><td valign="top">';
|
||||
|
|
@ -1002,7 +1017,7 @@ else
|
|||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Visu et edition */
|
||||
/* View and edition */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -1032,7 +1047,7 @@ else
|
|||
$userDisabled = 0;
|
||||
$statutUACF = '';
|
||||
|
||||
//On verifie les options du compte
|
||||
// Check options of user account
|
||||
if (count($ldap->uacf) > 0)
|
||||
{
|
||||
foreach ($ldap->uacf as $key => $statut)
|
||||
|
|
@ -1080,7 +1095,7 @@ else
|
|||
}
|
||||
|
||||
/*
|
||||
* Confirmation desactivation
|
||||
* Confirm deactivation
|
||||
*/
|
||||
if ($action == 'disable')
|
||||
{
|
||||
|
|
@ -1088,7 +1103,7 @@ else
|
|||
}
|
||||
|
||||
/*
|
||||
* Confirmation activation
|
||||
* Confirm activation
|
||||
*/
|
||||
if ($action == 'enable')
|
||||
{
|
||||
|
|
@ -1108,13 +1123,13 @@ else
|
|||
*/
|
||||
if ($action != 'edit')
|
||||
{
|
||||
$rowspan=16;
|
||||
|
||||
$rowspan=17;
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
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 '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
|
@ -1123,10 +1138,12 @@ else
|
|||
if (! empty($conf->societe->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++;
|
||||
|
||||
// Lastname
|
||||
print '<tr><td valign="top">'.$langs->trans("Lastname").'</td>';
|
||||
print '<td>'.$object->lastname.'</td>';
|
||||
print '<td colspan="2">'.$object->lastname.'</td>';
|
||||
|
||||
// Photo
|
||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
|
|
@ -1137,23 +1154,23 @@ else
|
|||
|
||||
// Firstname
|
||||
print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>';
|
||||
print '<td>'.$object->firstname.'</td>';
|
||||
print '<td colspan="2">'.$object->firstname.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Position/Job
|
||||
print '<tr><td valign="top">'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<td>'.$object->job.'</td>';
|
||||
print '<td colspan="2">'.$object->job.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Login
|
||||
print '<tr><td valign="top">'.$langs->trans("Login").'</td>';
|
||||
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
|
||||
{
|
||||
print '<td>'.$object->login.'</td>';
|
||||
print '<td colspan="2">'.$object->login.'</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
|
@ -1163,24 +1180,24 @@ else
|
|||
{
|
||||
if ($passDoNotExpire)
|
||||
{
|
||||
print '<td>'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
|
||||
}
|
||||
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)
|
||||
{
|
||||
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
|
||||
{
|
||||
print '<td>'.$langs->trans("DomainPassword").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("DomainPassword").'</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
if ($object->pass) print preg_replace('/./i','*',$object->pass);
|
||||
else
|
||||
{
|
||||
|
|
@ -1192,7 +1209,7 @@ else
|
|||
print '</tr>'."\n";
|
||||
|
||||
// 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)
|
||||
{
|
||||
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
|
||||
|
|
@ -1208,7 +1225,7 @@ else
|
|||
print '</td></tr>'."\n";
|
||||
|
||||
// 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");
|
||||
if ($object->societe_id) $type=$langs->trans("External");
|
||||
print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
|
||||
|
|
@ -1218,47 +1235,47 @@ else
|
|||
// 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 '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
// Tel pro
|
||||
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";
|
||||
|
||||
// Tel mobile
|
||||
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";
|
||||
|
||||
// Fax
|
||||
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";
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Skype").'</td>';
|
||||
print '<td>'.dol_print_skype($object->skype,0,0,1).'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Skype").'</td>';
|
||||
print '<td colspan="2">'.dol_print_skype($object->skype,0,0,1).'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// EMail
|
||||
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";
|
||||
|
||||
// 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 "</td></tr>\n";
|
||||
|
||||
// Hierarchy
|
||||
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
if (empty($object->fk_user)) print $langs->trans("None");
|
||||
else {
|
||||
$huser=new User($db);
|
||||
|
|
@ -1268,27 +1285,27 @@ else
|
|||
print '</td>';
|
||||
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");
|
||||
|
||||
// THM
|
||||
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 '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// TJM
|
||||
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 '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Salary
|
||||
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 '</td>';
|
||||
print "</tr>\n";
|
||||
|
|
@ -1296,7 +1313,7 @@ else
|
|||
|
||||
// Weeklyhours
|
||||
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
print price2num($object->weeklyhours);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
|
@ -1306,28 +1323,39 @@ else
|
|||
{
|
||||
$rowspan++;
|
||||
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
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
print $object->getLibStatut(4);
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
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><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";
|
||||
|
||||
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 '<td>'.$object->openid.'</td>';
|
||||
print '<td colspan="2">'.$object->openid.'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
|
@ -1335,7 +1363,7 @@ else
|
|||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("LinkToCompanyContact").'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
if (isset($object->societe_id) && $object->societe_id > 0)
|
||||
{
|
||||
$societe = new Societe($db);
|
||||
|
|
@ -1363,7 +1391,7 @@ else
|
|||
{
|
||||
$langs->load("members");
|
||||
print '<tr><td valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
if ($object->fk_member)
|
||||
{
|
||||
$adh=new Adherent($db);
|
||||
|
|
@ -1631,7 +1659,10 @@ else
|
|||
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->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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
|
@ -1696,7 +1727,7 @@ else
|
|||
print '<input size="30" type="text" name="job" value="'.$object->job.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
print '<input type="hidden" name="job" value="'.$object->job.'">';
|
||||
print $object->job;
|
||||
}
|
||||
|
|
@ -1918,7 +1949,7 @@ else
|
|||
print $doleditor->Create(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
print dol_htmlentitiesbr($object->signature);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -1957,7 +1988,7 @@ else
|
|||
print '</td>';
|
||||
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");
|
||||
|
||||
|
|
@ -2008,6 +2039,15 @@ else
|
|||
print '</td>';
|
||||
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
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class User extends CommonObject
|
|||
var $firstname;
|
||||
var $note;
|
||||
var $email;
|
||||
var $skype;
|
||||
var $skype;
|
||||
var $job;
|
||||
var $signature;
|
||||
var $office_phone;
|
||||
|
|
@ -101,13 +101,14 @@ class User extends CommonObject
|
|||
var $users; // To store all tree of users hierarchy
|
||||
var $parentof; // To store an array of all parents for all ids.
|
||||
|
||||
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
|
||||
var $thm; // Average cost of employee
|
||||
var $tjm; // Average cost of employee
|
||||
var $salary; // Monthly salary
|
||||
var $salaryextra; // Monthly salary extra
|
||||
var $weeklyhours; // Weekly hours
|
||||
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
|
||||
var $thm; // Average cost of employee
|
||||
var $tjm; // Average cost of employee
|
||||
var $salary; // Monthly salary
|
||||
var $salaryextra; // Monthly salary extra
|
||||
var $weeklyhours; // Weekly hours
|
||||
|
||||
var $color; // Define background color for user in agenda
|
||||
|
||||
/**
|
||||
* Constructor de la classe
|
||||
|
|
@ -166,6 +167,7 @@ class User extends CommonObject
|
|||
$sql.= " u.salary,";
|
||||
$sql.= " u.salaryextra,";
|
||||
$sql.= " u.weeklyhours,";
|
||||
$sql.= " u.color,";
|
||||
$sql.= " u.ref_int, u.ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
|
|
@ -233,6 +235,7 @@ class User extends CommonObject
|
|||
$this->salary = $obj->salary;
|
||||
$this->salaryextra = $obj->salaryextra;
|
||||
$this->weeklyhours = $obj->weeklyhours;
|
||||
$this->color = $obj->color;
|
||||
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
|
|
@ -270,7 +273,7 @@ class User extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
|
||||
// Recupere parametrage global propre a l'utilisateur
|
||||
// To get back the global configuration unique to the user
|
||||
if ($loadpersonalconf)
|
||||
{
|
||||
$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 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 string $allmodule Retirer tous les droits du module allmodule
|
||||
|
|
@ -672,7 +675,7 @@ class User extends CommonObject
|
|||
|
||||
$this->db->begin();
|
||||
|
||||
// Desactive utilisateur
|
||||
// Deactivate user
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " SET statut = ".$this->statut;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
|
@ -717,7 +720,7 @@ class User extends CommonObject
|
|||
|
||||
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;
|
||||
|
||||
if (! $error && ! $this->db->query($sql))
|
||||
|
|
@ -734,7 +737,7 @@ class User extends CommonObject
|
|||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// Si contact, supprime lien
|
||||
// If contact, remove link
|
||||
if ($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
|
||||
*/
|
||||
|
|
@ -1142,6 +1145,7 @@ class User extends CommonObject
|
|||
$this->zip = empty($this->zip)?'':$this->zip;
|
||||
$this->town = empty($this->town)?'':$this->town;
|
||||
$this->accountancy_code = trim($this->accountancy_code);
|
||||
$this->color = empty($this->color)?'':$this->color;
|
||||
|
||||
// Check parameters
|
||||
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
||||
|
|
@ -1150,6 +1154,13 @@ class User extends CommonObject
|
|||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (empty($this->color))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorColor",$this->color);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
|
@ -1172,6 +1183,7 @@ class User extends CommonObject
|
|||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||
$sql.= ", color = '".$this->db->escape($this->color)."'";
|
||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user