';
+
+ // Ref/ID
+ if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
+ {
+ print '| '.$langs->trans("Ref").' | ';
+ print '';
+ print $object->id;
+ print ' | ';
+ print '
';
+ }
+
+ // Lastname
+ print "";
+ print '| '.$langs->trans("Lastname").' | ';
+ print '';
+ if ($caneditfield && !$object->ldap_sid)
{
- $text=$form->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning');
+ print '';
}
- }
- else
- {
- $text=preg_replace('/./i','*',$object->pass);
- }
- print $text;
- print " |
\n";
-
- // API key
- if(! empty($conf->api->enabled) && $user->admin) {
- print '| '.$langs->trans("ApiKey").' | ';
- print '';
- print '';
- if (! empty($conf->use_javascript_ajax))
- print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"');
- print ' |
';
- }
-
- // Administrator
- print '| '.$langs->trans("Administrator").' | ';
- if ($object->societe_id > 0)
- {
- $langs->load("admin");
- print '';
- print ''.yn($object->admin);
- print ' ('.$langs->trans("ExternalUser").')';
- print ' |
';
- }
- else
- {
- print '';
- $nbAdmin = $user->getNbOfUsers('active','',1);
- $nbSuperAdmin = $user->getNbOfUsers('active','superadmin',1);
- //var_dump($nbAdmin);
- //var_dump($nbSuperAdmin);
- if ($user->admin // Need to be admin to allow downgrade of an admin
- && ($user->id != $object->id) // Don't downgrade ourself
- && (
- (empty($conf->multicompany->enabled) && $nbAdmin >= 1)
- || (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
- )
- )
+ else
{
- print $form->selectyesno('admin',$object->admin,1);
-
- if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
+ print '';
+ print $object->lastname;
+ }
+ print ' | ';
+ print '';
+
+ // Firstname
+ print "".'| '.$langs->trans("Firstname").' | ';
+ print '';
+ if ($caneditfield && !$object->ldap_sid)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->firstname;
+ }
+ print ' |
';
+
+ // Employee
+ print '';
+ print '| '.fieldLabel('Employee','employee',0).' | ';
+ print $form->selectyesno("employee",$object->employee,1);
+ print ' |
';
+
+ // Position/Job
+ print '| '.$langs->trans("PostOrFunction").' | ';
+ print '';
+ if ($caneditfield)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->job;
+ }
+ print ' |
';
+
+ // Gender
+ print '| '.$langs->trans("Gender").' | ';
+ print '';
+ $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
+ print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1);
+ print ' |
';
+
+ // Login
+ print "".'| '.$langs->trans("Login").' | ';
+ print '';
+ if ($user->admin && !$object->ldap_sid)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->login;
+ }
+ print ' | ';
+ print '
';
+
+ // Pass
+ print '| '.$langs->trans("Password").' | ';
+ print '';
+ if ($object->ldap_sid)
+ {
+ $text=$langs->trans("DomainPassword");
+ }
+ else if ($caneditpassword)
+ {
+ $text='';
+ if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http')
{
- if ($conf->use_javascript_ajax)
- {
- print '';
- }
-
- $checked=(($object->admin && ! $object->entity) ? ' checked' : '');
- print ' '.$langs->trans("SuperAdministrator");
+ $text=$form->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning');
}
}
else
{
- $yn = yn($object->admin);
- print '';
- print '';
- if (! empty($conf->multicompany->enabled) && empty($object->entity)) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning');
- else print $yn;
+ $text=preg_replace('/./i','*',$object->pass);
}
+ print $text;
+ print " |
\n";
+
+ // API key
+ if(! empty($conf->api->enabled) && $user->admin) {
+ print '| '.$langs->trans("ApiKey").' | ';
+ print '';
+ print '';
+ if (! empty($conf->use_javascript_ajax))
+ print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"');
+ print ' |
';
+ }
+
+ // Administrator
+ print '| '.$langs->trans("Administrator").' | ';
+ if ($object->societe_id > 0)
+ {
+ $langs->load("admin");
+ print '';
+ print ''.yn($object->admin);
+ print ' ('.$langs->trans("ExternalUser").')';
+ print ' |
';
+ }
+ else
+ {
+ print '';
+ $nbAdmin = $user->getNbOfUsers('active','',1);
+ $nbSuperAdmin = $user->getNbOfUsers('active','superadmin',1);
+ //var_dump($nbAdmin);
+ //var_dump($nbSuperAdmin);
+ if ($user->admin // Need to be admin to allow downgrade of an admin
+ && ($user->id != $object->id) // Don't downgrade ourself
+ && (
+ (empty($conf->multicompany->enabled) && $nbAdmin >= 1)
+ || (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
+ )
+ )
+ {
+ print $form->selectyesno('admin',$object->admin,1);
+
+ if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
+ {
+ if ($conf->use_javascript_ajax)
+ {
+ print '';
+ }
+
+ $checked=(($object->admin && ! $object->entity) ? ' checked' : '');
+ print ' '.$langs->trans("SuperAdministrator");
+ }
+ }
+ else
+ {
+ $yn = yn($object->admin);
+ print '';
+ print '';
+ if (! empty($conf->multicompany->enabled) && empty($object->entity)) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning');
+ else print $yn;
+ }
+ print ' | ';
+ }
+
+ // Type
+ print '| '.$langs->trans("Type").' | ';
+ print '';
+ if ($user->id == $object->id || ! $user->admin)
+ {
+ $type=$langs->trans("Internal");
+ if ($object->societe_id) $type=$langs->trans("External");
+ print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
+ if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
+ }
+ else
+ {
+ $type=0;
+ if ($object->contact_id) $type=$object->contact_id;
+ print $form->selectcontacts(0,$type,'contactid',2,'','',1,'',false,1);
+ if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
+ }
+ print ' |
';
+
+ // Address
+ print '| '.fieldLabel('Address','address').' | ';
+ print ' |
';
+
+ // Zip
+ print '| '.fieldLabel('Zip','zipcode').' | ';
+ print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
print ' |
';
- }
-
- // Type
- print '| '.$langs->trans("Type").' | ';
- print '';
- if ($user->id == $object->id || ! $user->admin)
- {
- $type=$langs->trans("Internal");
- if ($object->societe_id) $type=$langs->trans("External");
- print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
- if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
- }
- else
- {
- $type=0;
- if ($object->contact_id) $type=$object->contact_id;
- print $form->selectcontacts(0,$type,'contactid',2,'','',1,'',false,1);
- if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
- }
- print ' |
';
-
- // Address
- print '| '.fieldLabel('Address','address').' | ';
- print ' |
';
-
- // Zip
- print '| '.fieldLabel('Zip','zipcode').' | ';
- print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
- print ' |
';
-
- // Town
- print '| '.fieldLabel('Town','town').' | ';
- print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
- print ' |
';
-
- // Country
- print '| '.fieldLabel('Country','selectcounty_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);
- print ' |
';
-
- // State
- if (empty($conf->global->USER_DISABLE_STATE))
- {
- print '| '.fieldLabel('State','state_id').' | ';
- print $formcompany->select_state($object->state_id,$object->country_code, 'state_id');
+
+ // Town
+ print ' |
| '.fieldLabel('Town','town').' | ';
+ print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print ' |
';
- }
-
- // Tel pro
- print "".'| '.$langs->trans("PhonePro").' | ';
- print '';
- if ($caneditfield && empty($object->ldap_sid))
- {
- print '';
- }
- else
- {
- print '';
- print $object->office_phone;
- }
- print ' |
';
-
- // Tel mobile
- print "".'| '.$langs->trans("PhoneMobile").' | ';
- print '';
- if ($caneditfield && empty($object->ldap_sid))
- {
- print '';
- }
- else
- {
- print '';
- print $object->user_mobile;
- }
- print ' |
';
-
- // Fax
- print "".'| '.$langs->trans("Fax").' | ';
- print '';
- if ($caneditfield && empty($object->ldap_sid))
- {
- print '';
- }
- else
- {
- print '';
- print $object->office_fax;
- }
- print ' |
';
-
- // Skype
- if (! empty($conf->skype->enabled))
- {
- print '| '.$langs->trans("Skype").' | ';
+
+ // Country
+ print '
| '.fieldLabel('Country','selectcounty_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);
+ print ' |
';
+
+ // State
+ if (empty($conf->global->USER_DISABLE_STATE))
+ {
+ print '| '.fieldLabel('State','state_id').' | ';
+ print $formcompany->select_state($object->state_id,$object->country_code, 'state_id');
+ print ' |
';
+ }
+
+ // Tel pro
+ print "".'| '.$langs->trans("PhonePro").' | ';
print '';
if ($caneditfield && empty($object->ldap_sid))
{
- print '';
+ print '';
}
else
{
- print '';
- print $object->skype;
+ print '';
+ print $object->office_phone;
}
print ' |
';
- }
-
- // EMail
- print "".'| global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").' | ';
- print '';
- if ($caneditfield && empty($object->ldap_sid))
- {
- print '';
- }
- else
- {
- print '';
- print $object->email;
- }
- print ' |
';
-
- // Signature
- print "".'| '.$langs->trans("Signature").' | ';
- print '';
- if ($caneditfield)
- {
- require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor('signature',$object->signature,'',138,'dolibarr_mailings','In',false,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,'90%');
- print $doleditor->Create(1);
- }
- else
- {
- print dol_htmlentitiesbr($object->signature);
- }
- print ' |
';
-
- // OpenID url
- if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
- {
- print "".'| '.$langs->trans("OpenIDURL").' | ';
+
+ // Tel mobile
+ print "
".'| '.$langs->trans("PhoneMobile").' | ';
+ print '';
+ if ($caneditfield && empty($object->ldap_sid))
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->user_mobile;
+ }
+ print ' |
';
+
+ // Fax
+ print "".'| '.$langs->trans("Fax").' | ';
+ print '';
+ if ($caneditfield && empty($object->ldap_sid))
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->office_fax;
+ }
+ print ' |
';
+
+ // Skype
+ if (! empty($conf->skype->enabled))
+ {
+ print '| '.$langs->trans("Skype").' | ';
+ print '';
+ if ($caneditfield && empty($object->ldap_sid))
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->skype;
+ }
+ print ' |
';
+ }
+
+ // EMail
+ print "".'| global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").' | ';
+ print '';
+ if ($caneditfield && empty($object->ldap_sid))
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->email;
+ }
+ print ' |
';
+
+ // Signature
+ print "".'| '.$langs->trans("Signature").' | ';
print '';
if ($caneditfield)
{
- print '';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor('signature',$object->signature,'',138,'dolibarr_mailings','In',false,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,'90%');
+ print $doleditor->Create(1);
}
else
- {
- print '';
- print $object->openid;
+ {
+ print dol_htmlentitiesbr($object->signature);
}
print ' |
';
- }
-
- // Hierarchy
- print '| '.$langs->trans("HierarchicalResponsible").' | ';
- print '';
- if ($caneditfield)
- {
- print $form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300');
- }
- else
- {
- print '';
- $huser=new User($db);
- $huser->fetch($object->fk_user);
- print $huser->getNomUrl(1);
- }
- print ' | ';
- print "
\n";
-
- if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
- {
- $langs->load("salaries");
-
- // THM
- print '| ';
- $text=$langs->trans("THM");
- print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
- print ' | ';
- print '';
- print '';
- print ' | ';
- print "
\n";
-
- // TJM
- print '| ';
- $text=$langs->trans("TJM");
- print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classthm');
- print ' | ';
- print '';
- print '';
- print ' | ';
- print "
\n";
-
- // Salary
- print '| '.$langs->trans("Salary").' | ';
- print '';
- print '';
- print ' | ';
- print "
\n";
- }
-
- // Weeklyhours
- print '| '.$langs->trans("WeeklyHours").' | ';
- print '';
- print '';
- print ' | ';
- print "
\n";
-
- // Date employment
- print '| '.$langs->trans("DateEmployment").' | ';
- print '';
- echo $form->select_date(GETPOST('dateemployment')?GETPOST('dateemployment'):$object->dateemployment,'dateemployment',0,0,1,'form'.'dateemployment',1,0,1);
- print ' | ';
- print "
\n";
-
- // Accountancy code
- if ($conf->accounting->enabled)
+
+ // OpenID url
+ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
+ {
+ print "".'| '.$langs->trans("OpenIDURL").' | ';
+ print '';
+ if ($caneditfield)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->openid;
+ }
+ print ' |
';
+ }
+
+ // Hierarchy
+ print '| '.$langs->trans("HierarchicalResponsible").' | ';
+ print '';
+ if ($caneditfield)
+ {
+ print $form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300');
+ }
+ else
+ {
+ print '';
+ $huser=new User($db);
+ $huser->fetch($object->fk_user);
+ print $huser->getNomUrl(1);
+ }
+ print ' | ';
+ print "
\n";
+
+ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
+ {
+ $langs->load("salaries");
+
+ // THM
+ print '| ';
+ $text=$langs->trans("THM");
+ print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
+ print ' | ';
+ print '';
+ print '';
+ print ' | ';
+ print "
\n";
+
+ // TJM
+ print '| ';
+ $text=$langs->trans("TJM");
+ print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classthm');
+ print ' | ';
+ print '';
+ print '';
+ print ' | ';
+ print "
\n";
+
+ // Salary
+ print '| '.$langs->trans("Salary").' | ';
+ print '';
+ print '';
+ print ' | ';
+ print "
\n";
+ }
+
+ // Weeklyhours
+ print '| '.$langs->trans("WeeklyHours").' | ';
+ print '';
+ print '';
+ print ' | ';
+ print "
\n";
+
+ // Date employment
+ print '| '.$langs->trans("DateEmployment").' | ';
+ print '';
+ echo $form->select_date(GETPOST('dateemployment')?GETPOST('dateemployment'):$object->dateemployment,'dateemployment',0,0,1,'form'.'dateemployment',1,0,1);
+ print ' | ';
+ print "
\n";
+
+ // Accountancy code
+ if ($conf->accounting->enabled)
+ {
+ print "";
+ print '| '.$langs->trans("AccountancyCode").' | ';
+ print '';
+ if ($caneditfield)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ print $object->accountancy_code;
+ }
+ print ' | ';
+ print "
";
+ }
+
+ // User color
+ if (! empty($conf->agenda->enabled))
+ {
+ print '| '.$langs->trans("ColorUser").' | ';
+ print '';
+ print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset');
+ print ' |
';
+ }
+
+ // Photo
+ print '';
+ print '| '.$langs->trans("Photo").' | ';
+ print '';
+ print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small');
+ print ' | ';
+ print '
';
+
+ // Categories
+ if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
{
- print "";
- print '| '.$langs->trans("AccountancyCode").' | ';
- print '';
- if ($caneditfield)
- {
- print '';
- }
- else
- {
- print '';
- print $object->accountancy_code;
- }
- print ' | ';
- print "
";
- }
-
- // User color
- if (! empty($conf->agenda->enabled))
- {
- print '| '.$langs->trans("ColorUser").' | ';
- print '';
- print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset');
- print ' |
';
- }
-
- // Photo
- print '';
- print '| '.$langs->trans("Photo").' | ';
- print '';
- print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small');
- print ' | ';
- print '
';
-
- // Categories
- if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
- {
- print '| ' . fieldLabel( 'Categories', 'usercats' ) . ' | ';
- print '';
- $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, null, null, null, 1 );
- $c = new Categorie( $db );
- $cats = $c->containing($object->id, Categorie::TYPE_USER);
- foreach ($cats as $cat) {
- $arrayselected[] = $cat->id;
- }
- print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' );
- print " |
";
- }
+ print '| ' . fieldLabel( 'Categories', 'usercats' ) . ' | ';
+ print '';
+ $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, null, null, null, 1 );
+ $c = new Categorie( $db );
+ $cats = $c->containing($object->id, Categorie::TYPE_USER);
+ foreach ($cats as $cat) {
+ $arrayselected[] = $cat->id;
+ }
+ print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' );
+ print " |
";
+ }
// Status
print '| '.$langs->trans("Status").' | ';
@@ -2373,6 +2501,8 @@ else
print '';
+ }
+
}
if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close();