';
@@ -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 '';
// Ref
print '| '.$langs->trans("Ref").' | ';
- print '';
+ print ' | ';
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
print ' | ';
print ' '."\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 '| '.$langs->trans("Lastname").' | ';
- print ''.$object->lastname.' | ';
+ print ''.$object->lastname.' | ';
// Photo
print '';
@@ -1137,23 +1154,23 @@ else
// Firstname
print ' | | '.$langs->trans("Firstname").' | ';
- print ''.$object->firstname.' | ';
+ print ''.$object->firstname.' | ';
print ' '."\n";
// Position/Job
print '| '.$langs->trans("PostOrFunction").' | ';
- print ''.$object->job.' | ';
+ print ''.$object->job.' | ';
print ' '."\n";
// Login
print '| '.$langs->trans("Login").' | ';
if (! empty($object->ldap_sid) && $object->statut==0)
{
- print ''.$langs->trans("LoginAccountDisableInDolibarr").' | ';
+ print ''.$langs->trans("LoginAccountDisableInDolibarr").' | ';
}
else
{
- print ''.$object->login.' | ';
+ print ''.$object->login.' | ';
}
print ' '."\n";
@@ -1163,24 +1180,24 @@ else
{
if ($passDoNotExpire)
{
- print ''.$langs->trans("LdapUacf_".$statutUACF).' | ';
+ print ''.$langs->trans("LdapUacf_".$statutUACF).' | ';
}
else if($userChangePassNextLogon)
{
- print ''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).' | ';
+ print ''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).' | ';
}
else if($userDisabled)
{
- print ''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).' | ';
+ print ''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).' | ';
}
else
{
- print ''.$langs->trans("DomainPassword").' | ';
+ print ''.$langs->trans("DomainPassword").' | ';
}
}
else
{
- print '';
+ print ' | ';
if ($object->pass) print preg_replace('/./i','*',$object->pass);
else
{
@@ -1192,7 +1209,7 @@ else
print ''."\n";
// Administrator
- print ' | | '.$langs->trans("Administrator").' | ';
+ print ' | | '.$langs->trans("Administrator").' | ';
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 ' | '."\n";
// Type
- print '| '.$langs->trans("Type").' | ';
+ print ' | | '.$langs->trans("Type").' | ';
$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 ' | | '.$langs->trans("Type").' | ';
+ print ' | | '.$langs->trans("Type").' | ';
print $langs->trans("DomainUser",$ldap->domainFQDN);
print ' | '."\n";
}
// Tel pro
print '| '.$langs->trans("PhonePro").' | ';
- print ''.dol_print_phone($object->office_phone,'',0,0,1).' | ';
+ print ''.dol_print_phone($object->office_phone,'',0,0,1).' | ';
print ' '."\n";
// Tel mobile
print '| '.$langs->trans("PhoneMobile").' | ';
- print ''.dol_print_phone($object->user_mobile,'',0,0,1).' | ';
+ print ''.dol_print_phone($object->user_mobile,'',0,0,1).' | ';
print ' '."\n";
// Fax
print '| '.$langs->trans("Fax").' | ';
- print ''.dol_print_phone($object->office_fax,'',0,0,1).' | ';
+ print ''.dol_print_phone($object->office_fax,'',0,0,1).' | ';
print ' '."\n";
// Skype
if (! empty($conf->skype->enabled))
{
- print '| '.$langs->trans("Skype").' | ';
- print ''.dol_print_skype($object->skype,0,0,1).' | ';
+ print ' | '.$langs->trans("Skype").' | ';
+ print ''.dol_print_skype($object->skype,0,0,1).' | ';
print " \n";
}
// EMail
print '| '.$langs->trans("EMail").' | ';
- print ''.dol_print_email($object->email,0,0,1).' | ';
+ print ''.dol_print_email($object->email,0,0,1).' | ';
print " \n";
// Signature
- print '| '.$langs->trans('Signature').' | ';
+ print ' | | '.$langs->trans('Signature').' | ';
print dol_htmlentitiesbr($object->signature);
print " | \n";
// Hierarchy
print '| '.$langs->trans("HierarchicalResponsible").' | ';
- print '';
+ print ' | ';
if (empty($object->fk_user)) print $langs->trans("None");
else {
$huser=new User($db);
@@ -1268,27 +1285,27 @@ else
print ' | ';
print " \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 '| '.$langs->trans("THM").' | ';
- print '';
+ print ' | ';
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
print ' | ';
print " \n";
// TJM
print '| '.$langs->trans("TJM").' | ';
- print '';
+ print ' | ';
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
print ' | ';
print " \n";
// Salary
print '| '.$langs->trans("Salary").' | ';
- print '';
+ print ' | ';
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
print ' | ';
print " \n";
@@ -1296,7 +1313,7 @@ else
// Weeklyhours
print '| '.$langs->trans("WeeklyHours").' | ';
- print '';
+ print ' | ';
print price2num($object->weeklyhours);
print ' | ';
print " \n";
@@ -1306,28 +1323,39 @@ else
{
$rowspan++;
print '| '.$langs->trans("AccountancyCode").' | ';
- print ''.$object->accountancy_code.' | ';
+ print ''.$object->accountancy_code.' | ';
+ }
+
+ // Color user
+ if (! empty($conf->agenda->enabled))
+ {
+ print ' | '.$langs->trans("ColorUser").' | ';
+ print '';
+ print $object->color;
+ print ' | ';
+ print ' | ';
+ print " \n";
}
// Status
print '| '.$langs->trans("Status").' | ';
- print '';
+ print ' | ';
print $object->getLibStatut(4);
print ' | ';
print ' '."\n";
print '| '.$langs->trans("LastConnexion").' | ';
- print ''.dol_print_date($object->datelastlogin,"dayhour").' | ';
+ print ''.dol_print_date($object->datelastlogin,"dayhour").' | ';
print " \n";
print '| '.$langs->trans("PreviousConnexion").' | ';
- print ''.dol_print_date($object->datepreviouslogin,"dayhour").' | ';
+ print ''.dol_print_date($object->datepreviouslogin,"dayhour").' | ';
print " \n";
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
{
print '| '.$langs->trans("OpenIDURL").' | ';
- print ''.$object->openid.' | ';
+ print ''.$object->openid.' | ';
print " \n";
}
@@ -1335,7 +1363,7 @@ else
if (! empty($conf->societe->enabled))
{
print '| '.$langs->trans("LinkToCompanyContact").' | ';
- print '';
+ print ' | ';
if (isset($object->societe_id) && $object->societe_id > 0)
{
$societe = new Societe($db);
@@ -1363,7 +1391,7 @@ else
{
$langs->load("members");
print ' | | '.$langs->trans("LinkedToDolibarrMember").' | ';
- print '';
+ print ' | ';
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 ' | ';
@@ -1957,7 +1988,7 @@ else
print '';
print "\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 '';
print "";
}
+
+ // User color
+ if (! empty($conf->agenda->enabled))
+ {
+ print '| '.$langs->trans("ColorUser").' | ';
+ print '';
+ print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset');
+ print ' | ';
+ }
// Status
print '| '.$langs->trans("Status").' | ';
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 4afd650f4ae..91f85d4cb0b 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -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,7 +1154,7 @@ class User extends CommonObject
$this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1;
}
-
+
$this->db->begin();
// Mise a jour autres infos
@@ -1172,6 +1176,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");
|