31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33if (isModEnabled(
'category')) {
34 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38$langs->loadLangs(array(
'users',
'companies',
'hrm',
'salaries'));
40$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
41$massaction =
GETPOST(
'massaction',
'alpha');
43$confirm =
GETPOST(
'confirm',
'alpha');
44$cancel =
GETPOST(
'cancel',
'alpha');
45$toselect =
GETPOST(
'toselect',
'array');
46$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
47$backtopage =
GETPOST(
'backtopage',
'alpha');
48$optioncss =
GETPOST(
'optioncss',
'aZ');
53if ($user->socid > 0) {
54 $socid = $user->socid;
59$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
60$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
62if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
66$offset = $limit * $page;
73$diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
74$hookmanager->initHooks(array(
'userlist'));
77$extrafields->fetch_name_optionals_label(
$object->table_element);
79$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
82 $sortfield =
"u.login";
89$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
91foreach (
$object->fields as $key => $val) {
92 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
93 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
95 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
101$userstatic =
new User($db);
102$companystatic =
new Societe($db);
103$form =
new Form($db);
106$fieldstosearchall = array(
107 'u.login' =>
"Login",
108 'u.lastname' =>
"Lastname",
109 'u.firstname' =>
"Firstname",
110 'u.accountancy_code' =>
"AccountancyCode",
111 'u.office_phone' =>
"PhonePro",
112 'u.user_mobile' =>
"PhoneMobile",
113 'u.email' =>
"EMail",
114 'u.note_public' =>
"NotePublic",
115 'u.note_private' =>
"NotePrivate"
117if (isModEnabled(
'api')) {
118 $fieldstosearchall[
'u.api_key'] =
"ApiKey";
121$permissiontoreadhr = $user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write');
122$permissiontowritehr = $user->hasRight(
'hrm',
'write_personal_information',
'write');
126 'u.rowid' => array(
'label' =>
"TechnicalID",
'checked' => -1,
'position' => 5),
127 'u.login' => array(
'label' =>
"Login",
'checked' => 1,
'position' => 10),
128 'u.lastname' => array(
'label' =>
"Lastname",
'checked' => 1,
'position' => 15),
129 'u.firstname' => array(
'label' =>
"Firstname",
'checked' => 1,
'position' => 20),
130 'u.entity' => array(
'label' =>
"Entity",
'checked' => 1,
'position' => 50,
'enabled' => (isModEnabled(
'multicompany') && !
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE'))),
131 'u.gender' => array(
'label' =>
"Gender",
'checked' => 0,
'position' => 22),
132 'u.employee' => array(
'label' =>
"Employee",
'checked' => ($contextpage ==
'employeelist' ? 1 : 0),
'position' => 25),
133 'u.fk_user' => array(
'label' =>
"HierarchicalResponsible",
'checked' => 1,
'position' => 27,
'csslist' =>
'maxwidth150'),
134 'u.accountancy_code' => array(
'label' =>
"AccountancyCode",
'checked' => 0,
'position' => 30),
135 'u.office_phone' => array(
'label' =>
"PhonePro",
'checked' => 1,
'position' => 31),
136 'u.user_mobile' => array(
'label' =>
"PhoneMobile",
'checked' => 1,
'position' => 32),
137 'u.email' => array(
'label' =>
"EMail",
'checked' => 1,
'position' => 35),
138 'u.api_key' => array(
'label' =>
"ApiKey",
'checked' => 0,
'position' => 40,
"enabled" => (isModEnabled(
'api') && $user->admin)),
139 'u.fk_soc' => array(
'label' =>
"Company",
'checked' => ($contextpage ==
'employeelist' ? 0 : 1),
'position' => 45),
140 'u.ref_employee' => array(
'label' =>
"RefEmployee",
'checked' => -1,
'position' => 50,
'enabled' => (isModEnabled(
'hrm') && $permissiontoreadhr)),
141 'u.national_registration_number' => array(
'label' =>
"NationalRegistrationNumber",
'checked' => -1,
'position' => 51,
'enabled' => (isModEnabled(
'hrm') && $permissiontoreadhr)),
142 'u.job' => array(
'label' =>
"PostOrFunction",
'checked' => -1,
'position' => 60),
143 'u.salary' => array(
'label' =>
"Salary",
'checked' => -1,
'position' => 80,
'enabled' => (isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"readall")),
'isameasure' => 1),
144 'u.datelastlogin' => array(
'label' =>
"LastConnexion",
'checked' => 1,
'position' => 100),
145 'u.datepreviouslogin' => array(
'label' =>
"PreviousConnexion",
'checked' => 0,
'position' => 110),
146 'u.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
147 'u.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
148 'u.statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000),
151include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_list_array_fields.tpl.php';
155'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
158$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
159$search_user =
GETPOST(
'search_user',
'alpha');
160$search_rowid =
GETPOST(
'search_rowid',
'alpha');
161$search_login =
GETPOST(
'search_login',
'alpha');
162$search_lastname =
GETPOST(
'search_lastname',
'alpha');
163$search_firstname =
GETPOST(
'search_firstname',
'alpha');
164$search_gender =
GETPOST(
'search_gender',
'alpha');
165$search_employee =
GETPOST(
'search_employee',
'alpha');
166$search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha');
167$search_phonepro =
GETPOST(
'search_phonepro',
'alpha');
168$search_phonemobile =
GETPOST(
'search_phonemobile',
'alpha');
169$search_email =
GETPOST(
'search_email',
'alpha');
170$search_api_key =
GETPOST(
'search_api_key',
'alphanohtml');
171$search_status =
GETPOST(
'search_status',
'intcomma');
172$search_thirdparty =
GETPOST(
'search_thirdparty',
'alpha');
173$search_job =
GETPOST(
'search_job',
'alpha');
174$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
175$search_supervisor =
GETPOST(
'search_supervisor',
'intcomma');
176$search_categ =
GETPOST(
"search_categ",
'intcomma');
177$searchCategoryUserOperator = 0;
178if (GETPOSTISSET(
'formfilteraction')) {
179 $searchCategoryUserOperator =
GETPOSTINT(
'search_category_user_operator');
183$searchCategoryUserList =
GETPOST(
'search_category_user_list',
'array');
185if (!empty($catid) && empty($searchCategoryUserList)) {
186 $searchCategoryUserList = array($catid);
189if (!empty($catid) && empty($search_categ)) {
190 $search_categ = $catid;
194if ($search_status ==
'' && empty($search_all)) {
195 $search_status =
'1';
197if ($contextpage ==
'employeelist' && !GETPOSTISSET(
'search_employee')) {
198 $search_employee = 1;
202$permissiontoadd = (isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE') ? false : (!empty($user->admin) || $user->hasRight(
"user",
"user",
"write")));
203$canreaduser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"read"));
204$canedituser = $permissiontoadd;
205$candisableuser = (isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE') ? false : (!empty($user->admin) || $user->hasRight(
"user",
"user",
"delete")));
206$canreadgroup = $canreaduser;
207$caneditgroup = $canedituser;
209 $canreadgroup = (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"read"));
210 $caneditgroup = (isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE') ? false : (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"write")));
216if (isModEnabled(
'salaries') && $contextpage ==
'employeelist' && $search_employee == 1) {
217 if (!$user->hasRight(
"salaries",
"read")) {
221 if (!$user->hasRight(
"user",
"user",
"read") && empty($user->admin)) {
226$childids = $user->getAllChildIds(1);
233if (
GETPOST(
'cancel',
'alpha')) {
237if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
241$parameters = array(
'arrayfields' => &$arrayfields);
242$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
247if (empty($reshook)) {
249 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
252 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
256 $search_lastname =
"";
257 $search_firstname =
"";
259 $search_employee =
"";
260 $search_accountancy_code =
"";
261 $search_phonepro =
"";
262 $search_phonemobile =
"";
265 $search_thirdparty =
"";
267 $search_warehouse =
"";
268 $search_supervisor =
"";
269 $search_api_key =
"";
270 $search_datelastlogin =
"";
271 $search_datepreviouslogin =
"";
272 $search_date_creation =
"";
273 $search_date_modification =
"";
276 $search_array_options = array();
278 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
279 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
284 $objectclass =
'User';
285 $objectlabel =
'User';
286 $uploaddir = $conf->user->dir_output;
287 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
290 if (!$error && ($massaction ==
'disable' || $massaction ==
'reactivate') && $permissiontoadd) {
291 $objecttmp =
new User($db);
297 foreach ($toselect as $toselectid) {
298 if ($toselectid == $user->id) {
299 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableYourself' :
'CanEnableYourself'), null,
'errors');
304 $result = $objecttmp->fetch($toselectid);
306 if ($objecttmp->admin) {
307 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableAnAdminUserWithMassActions' :
'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null,
'errors');
312 $result = $objecttmp->setstatus($massaction ==
'disable' ? 0 : 1);
315 } elseif ($result < 0) {
329 if (!$error && !empty($conf->file->main_limit_users)) {
330 $nb =
$object->getNbOfUsers(
"active");
331 if ($nb >= $conf->file->main_limit_users) {
333 setEventMessages($langs->trans(
"YourQuotaOfUsersIsReached"),
null,
'errors');
353$user2 =
new User($db);
357$help_url =
'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer';
358if ($contextpage ==
'employeelist' && $search_employee == 1) {
359 $title = $langs->trans(
"Employees");
361 $title = $langs->trans(
"Users");
369$sql =
"SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.office_phone, u.user_mobile, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,";
370$sql .=
" u.fk_user,";
371$sql .=
" u.ref_employee, u.national_registration_number, u.job, u.salary, u.datelastlogin, u.datepreviouslogin,";
372$sql .=
" u.datestartvalidity, u.dateendvalidity,";
373$sql .=
" u.ldap_sid, u.statut as status, u.entity,";
374$sql .=
" u.tms as date_modification, u.datec as date_creation,";
375$sql .=
" u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.office_phone as ofice_phone2, u2.user_mobile as user_mobile2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as status2,";
376$sql .=
" s.nom as name, s.canvas";
378if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
379 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
380 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
384$parameters = array();
385$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
386$sql .= $hookmanager->resPrint;
387$sql = preg_replace(
'/,\s*$/',
'', $sql);
391$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as u";
392if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
393 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (u.rowid = ef.fk_object)";
395$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON u.fk_soc = s.rowid";
396$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u2 ON u.fk_user = u2.rowid";
398$parameters = array();
399$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
400$sql .= $hookmanager->resPrint;
402 $sql .= $hookmanager->resPrint;
404$sql .=
" WHERE u.entity IN (".getEntity(
$object->element).
")";
406 $sql .=
" AND u.fk_soc = ".((int) $socid);
409if ($search_supervisor > 0) {
410 $sql .=
" AND u.fk_user IN (".$db->sanitize($search_supervisor).
")";
412if ($search_thirdparty !=
'') {
415if ($search_warehouse > 0) {
416 $sql .=
natural_search(array(
'u.fk_warehouse'), $search_warehouse);
418if ($search_rowid !=
'') {
421if ($search_login !=
'') {
424if ($search_lastname !=
'') {
427if ($search_firstname !=
'') {
430if ($search_gender !=
'' && $search_gender !=
'-1') {
431 $sql .=
" AND u.gender = '".$db->escape($search_gender).
"'";
433if (is_numeric($search_employee) && $search_employee >= 0) {
434 $sql .=
' AND u.employee = '.(int) $search_employee;
436if ($search_accountancy_code !=
'') {
437 $sql .=
natural_search(
"u.accountancy_code", $search_accountancy_code);
439if ($search_phonepro !=
'') {
442if ($search_phonemobile !=
'') {
445if ($search_email !=
'') {
448if ($search_api_key !=
'') {
451if ($search_job !=
'') {
454if ($search_status !=
'' && $search_status >= 0) {
455 $sql .=
" AND u.statut IN (".$db->sanitize($search_status).
")";
458 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
461$searchCategoryUserList = array($search_categ);
462if (!empty($searchCategoryUserList)) {
463 $searchCategoryUserSqlList = array();
464 $listofcategoryid =
'';
465 foreach ($searchCategoryUserList as $searchCategoryUser) {
466 if (intval($searchCategoryUser) == -2) {
467 $searchCategoryUserSqlList[] =
"NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user)";
468 } elseif (intval($searchCategoryUser) > 0) {
469 if ($searchCategoryUserOperator == 0) {
470 $searchCategoryUserSqlList[] =
" EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).
")";
472 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryUser);
476 if ($listofcategoryid) {
477 $searchCategoryUserSqlList[] =
" EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
479 if ($searchCategoryUserOperator == 1) {
480 if (!empty($searchCategoryUserSqlList)) {
481 $sql .=
" AND (".implode(
' OR ', $searchCategoryUserSqlList).
")";
484 if (!empty($searchCategoryUserSqlList)) {
485 $sql .=
" AND (".implode(
' AND ', $searchCategoryUserSqlList).
")";
489if ($search_warehouse > 0) {
490 $sql .=
" AND u.fk_warehouse = ".((int) $search_warehouse);
492if (isModEnabled(
'salaries') && $contextpage ==
'employeelist' && !$user->hasRight(
"salaries",
"readall")) {
493 $sql .=
" AND u.rowid IN (".$db->sanitize(implode(
',', $childids)).
")";
496include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
498$parameters = array();
499$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
500$sql .= $hookmanager->resPrint;
503$nbtotalofrecords =
'';
506 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
507 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
508 $resql = $db->query($sqlforcount);
510 $objforcount = $db->fetch_object($resql);
511 $nbtotalofrecords = $objforcount->nbtotalofrecords;
516 if (($page * $limit) > $nbtotalofrecords) {
524$sql .= $db->order($sortfield, $sortorder);
526 $sql .= $db->plimit($limit + 1, $offset);
529$resql = $db->query($sql);
535$num = $db->num_rows($resql);
538if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
539 $obj = $db->fetch_object($resql);
541 header(
"Location: ".DOL_URL_ROOT.
'/user/card.php?id='.$id);
548llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist mod-product page-list');
550$arrayofselected = is_array($toselect) ? $toselect : array();
554 $param .=
'&mode='.urlencode($mode);
556if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
557 $param .=
'&contextpage='.urlencode($contextpage);
559if ($limit > 0 && $limit != $conf->liste_limit) {
560 $param .=
'&limit='.((int) $limit);
562if ($optioncss !=
'') {
563 $param .=
'&optioncss='.urlencode($optioncss);
565if ($search_all !=
'') {
566 $param .=
'&search_all='.urlencode($search_all);
568if ($search_user !=
'') {
569 $param .=
"&search_user=".urlencode($search_user);
571if ($search_rowid !=
'') {
572 $param .=
"&search_rowid=".urlencode($search_rowid);
574if ($search_login !=
'') {
575 $param .=
"&search_login=".urlencode($search_login);
577if ($search_lastname !=
'') {
578 $param .=
"&search_lastname=".urlencode($search_lastname);
580if ($search_firstname !=
'') {
581 $param .=
"&search_firstname=".urlencode($search_firstname);
583if ($search_gender !=
'' && $search_gender !=
'-1') {
584 $param .=
"&search_gender=".urlencode($search_gender);
586if ($search_employee !=
'' && $search_employee !=
'-1') {
587 $param .=
"&search_employee=".urlencode($search_employee);
589if ($search_accountancy_code !=
'') {
590 $param .=
"&search_accountancy_code=".urlencode($search_accountancy_code);
592if ($search_phonepro !=
'') {
593 $param .=
"&search_phonepro=".urlencode($search_phonepro);
595if ($search_phonemobile !=
'') {
596 $param .=
"&search_phonemobile=".urlencode($search_phonemobile);
598if ($search_email !=
'') {
599 $param .=
"&search_email=".urlencode($search_email);
601if ($search_api_key !=
'') {
602 $param .=
"&search_api_key=".urlencode($search_api_key);
604if ($search_supervisor > 0) {
605 $param .=
"&search_supervisor=".urlencode($search_supervisor);
607if ($search_status !=
'') {
608 $param .=
"&search_status=".urlencode($search_status);
610if ($search_categ > 0) {
611 $param .=
'&search_categ='.urlencode((
string) ($search_categ));
613if ($search_warehouse > 0) {
614 $param .=
'&search_warehouse='.urlencode($search_warehouse);
617include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
620$arrayofmassactions = array();
621if ($permissiontoadd) {
622 $arrayofmassactions[
'disable'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"DisableUser");
624if ($permissiontoadd) {
625 $arrayofmassactions[
'reactivate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Reactivate");
627if (isModEnabled(
'category') && $permissiontoadd) {
628 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
630if ($permissiontoadd) {
631 $arrayofmassactions[
'presetsupervisor'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"SetSupervisor");
635if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'presetsupervisor'))) {
636 $arrayofmassactions = array();
638$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
640print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
641if ($optioncss !=
'') {
642 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
644print
'<input type="hidden" name="token" value="'.newToken().
'">';
645print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
646print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
647print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
648print
'<input type="hidden" name="page" value="'.$page.
'">';
649print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
650print
'<input type="hidden" name="page_y" value="">';
651print
'<input type="hidden" name="mode" value="'.$mode.
'">';
653$url = DOL_URL_ROOT.
'/user/card.php?action=create'.($contextpage ==
'employeelist' ?
'&search_employee=1' :
'').
'&leftmenu=';
655 $url .=
'&socid='.urlencode((
string) ($socid));
659$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.
'/user/list.php?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
660$newcardbutton .=
dolGetButtonTitle($langs->trans(
'HierarchicView'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.
'/user/hierarchy.php?mode=hierarchy'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', (($mode ==
'hierarchy') ? 2 : 1), array(
'morecss' =>
'reposition'));
661$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
663$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewUser'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
670print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0, $morehtmlright.
' '.$newcardbutton,
'', $limit, 0, 0, 1);
675$topicmail =
"SendUserRef";
677$objecttmp =
new User($db);
678$trackid =
'use'.$object->id;
679include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
682 print
"<div id='ways'>";
684 $ways = $c->print_all_ways(
' > ',
'user/list.php');
685 print
" > ".$ways[0].
"<br>\n";
691 foreach ($fieldstosearchall as $key => $val) {
692 $fieldstosearchall[$key] = $langs->trans($val);
693 $setupstring .= $key.
"=".$val.
";";
695 print
'<!-- Search done like if USER_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
696 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
705if (isModEnabled(
'category') && $user->hasRight(
"categorie",
"read")) {
706 $moreforfilter .=
'<div class="divsearchfield">';
707 $tmptitle = $langs->trans(
'Category');
708 $moreforfilter .=
img_picto($langs->trans(
"Category"),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ,
'search_categ', 1, $tmptitle);
709 $moreforfilter .=
'</div>';
713 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
715 $moreforfilter .=
'<div class="divsearchfield">';
716 $tmptitle = $langs->trans(
'Warehouse');
717 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
718 $moreforfilter .=
'</div>';
721$parameters = array();
722$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
723if (empty($reshook)) {
724 $moreforfilter .= $hookmanager->resPrint;
726 $moreforfilter = $hookmanager->resPrint;
729if (!empty($moreforfilter)) {
730 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
731 print $moreforfilter;
735$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
736$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
737$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
738$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
740print
'<div class="div-table-responsive">';
741print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
745print
'<tr class="liste_titre_filter">';
748 print
'<td class="liste_titre center maxwidthsearch">';
749 $searchpicto = $form->showFilterButtons(
'left');
753if (!empty($arrayfields[
'u.rowid'][
'checked'])) {
754 print
'<td class="liste_titre"><input type="text" name="search_rowid" class="maxwidth50" value="'.$search_rowid.
'"></td>';
756if (!empty($arrayfields[
'u.login'][
'checked'])) {
757 print
'<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.
'"></td>';
759if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
760 print
'<td class="liste_titre"><input type="text" name="search_lastname" class="maxwidth50" value="'.$search_lastname.
'"></td>';
762if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
763 print
'<td class="liste_titre"><input type="text" name="search_firstname" class="maxwidth50" value="'.$search_firstname.
'"></td>';
765if (!empty($arrayfields[
'u.gender'][
'checked'])) {
766 print
'<td class="liste_titre center">';
767 $arraygender = array(
'man' => $langs->trans(
"Genderman"),
'woman' => $langs->trans(
"Genderwoman"),
'other' => $langs->trans(
"Genderother"));
768 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
771if (!empty($arrayfields[
'u.employee'][
'checked'])) {
772 print
'<td class="liste_titre">';
773 print $form->selectyesno(
'search_employee', $search_employee, 1,
false, 1);
777if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
778 print
'<td class="liste_titre">';
779 print $form->select_dolusers($search_supervisor,
'search_supervisor', 1, array(), 0,
'', 0, 0, 0, 0,
'', 0,
'',
'maxwidth125');
782if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
783 print
'<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.
'"></td>';
785if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
786 print
'<td class="liste_titre"><input type="text" name="search_phonepro" class="maxwidth50" value="'.$search_phonepro.
'"></td>';
788if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
789 print
'<td class="liste_titre"><input type="text" name="search_phonemobile" class="maxwidth50" value="'.$search_phonemobile.
'"></td>';
791if (!empty($arrayfields[
'u.email'][
'checked'])) {
792 print
'<td class="liste_titre"><input type="text" name="search_email" class="maxwidth75" value="'.$search_email.
'"></td>';
794if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
795 print
'<td class="liste_titre"><input type="text" name="search_api_key" class="maxwidth50" value="'.$search_api_key.
'"></td>';
797if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
798 print
'<td class="liste_titre"><input type="text" name="search_thirdparty" class="maxwidth75" value="'.$search_thirdparty.
'"></td>';
800if (!empty($arrayfields[
'u.entity'][
'checked'])) {
801 print
'<td class="liste_titre"></td>';
803if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
804 print
'<td class="liste_titre"></td>';
806if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
807 print
'<td class="liste_titre"></td>';
809if (!empty($arrayfields[
'u.job'][
'checked'])) {
810 print
'<td class="liste_titre"><input type="text" name="search_job" class="maxwidth75" value="'.$search_job.
'"></td>';
812if (!empty($arrayfields[
'u.salary'][
'checked'])) {
813 print
'<td class="liste_titre"></td>';
815if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
816 print
'<td class="liste_titre"></td>';
818if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
819 print
'<td class="liste_titre"></td>';
822include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
824$parameters = array(
'arrayfields' => $arrayfields);
825$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
826print $hookmanager->resPrint;
827if (!empty($arrayfields[
'u.datec'][
'checked'])) {
829 print
'<td class="liste_titre">';
832if (!empty($arrayfields[
'u.tms'][
'checked'])) {
834 print
'<td class="liste_titre">';
837if (!empty($arrayfields[
'u.statut'][
'checked'])) {
839 print
'<td class="liste_titre center parentonrightofpage">';
840 print $form->selectarray(
'search_status', array(
'-1' =>
'',
'0' => $langs->trans(
'Disabled'),
'1' => $langs->trans(
'Enabled')), $search_status, 0, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
845 print
'<td class="liste_titre maxwidthsearch">';
846 $searchpicto = $form->showFilterButtons();
852$totalarray = array();
853$totalarray[
'nbfield'] = 0;
857print
'<tr class="liste_titre">';
859 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
860 $totalarray[
'nbfield']++;
862if (!empty($arrayfields[
'u.rowid'][
'checked'])) {
863 print_liste_field_titre($arrayfields[
'u.rowid'][
'label'], $_SERVER[
'PHP_SELF'],
"u.rowid", $param,
"",
"", $sortfield, $sortorder);
864 $totalarray[
'nbfield']++;
866if (!empty($arrayfields[
'u.login'][
'checked'])) {
867 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
'PHP_SELF'],
"u.login", $param,
"",
"", $sortfield, $sortorder);
868 $totalarray[
'nbfield']++;
870if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
871 print_liste_field_titre(
"Lastname", $_SERVER[
'PHP_SELF'],
"u.lastname", $param,
"",
"", $sortfield, $sortorder);
872 $totalarray[
'nbfield']++;
874if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
875 print_liste_field_titre(
"FirstName", $_SERVER[
'PHP_SELF'],
"u.firstname", $param,
"",
"", $sortfield, $sortorder);
876 $totalarray[
'nbfield']++;
878if (!empty($arrayfields[
'u.gender'][
'checked'])) {
879 print_liste_field_titre(
"Gender", $_SERVER[
'PHP_SELF'],
"u.gender", $param,
"",
"", $sortfield, $sortorder,
'center ');
880 $totalarray[
'nbfield']++;
882if (!empty($arrayfields[
'u.employee'][
'checked'])) {
883 print_liste_field_titre(
"Employee", $_SERVER[
'PHP_SELF'],
"u.employee", $param,
"",
"", $sortfield, $sortorder,
'center ');
884 $totalarray[
'nbfield']++;
886if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
887 print_liste_field_titre(
"HierarchicalResponsible", $_SERVER[
'PHP_SELF'],
"u.fk_user", $param,
"",
"", $sortfield, $sortorder);
888 $totalarray[
'nbfield']++;
890if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
891 print_liste_field_titre(
"AccountancyCode", $_SERVER[
'PHP_SELF'],
"u.accountancy_code", $param,
"",
"", $sortfield, $sortorder);
892 $totalarray[
'nbfield']++;
894if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
895 print_liste_field_titre(
"PhonePro", $_SERVER[
'PHP_SELF'],
"u.office_phone", $param,
"",
"", $sortfield, $sortorder);
896 $totalarray[
'nbfield']++;
898if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
899 print_liste_field_titre(
"PhoneMobile", $_SERVER[
'PHP_SELF'],
"u.user_mobile", $param,
"",
"", $sortfield, $sortorder);
900 $totalarray[
'nbfield']++;
902if (!empty($arrayfields[
'u.email'][
'checked'])) {
904 $totalarray[
'nbfield']++;
906if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
908 $totalarray[
'nbfield']++;
910if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
912 $totalarray[
'nbfield']++;
914if (!empty($arrayfields[
'u.entity'][
'checked'])) {
915 print_liste_field_titre($arrayfields[
'u.entity'][
'label'], $_SERVER[
'PHP_SELF'],
"u.entity", $param,
"",
"", $sortfield, $sortorder);
916 $totalarray[
'nbfield']++;
918if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
919 print_liste_field_titre(
"RefEmployee", $_SERVER[
'PHP_SELF'],
"u.ref_employee", $param,
"",
"", $sortfield, $sortorder);
920 $totalarray[
'nbfield']++;
922if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
923 print_liste_field_titre(
"NationalRegistrationNumber", $_SERVER[
'PHP_SELF'],
"u.national_registration_number", $param,
"",
"", $sortfield, $sortorder);
924 $totalarray[
'nbfield']++;
926if (!empty($arrayfields[
'u.job'][
'checked'])) {
927 print_liste_field_titre($arrayfields[
'u.job'][
'label'], $_SERVER[
'PHP_SELF'],
"u.job", $param,
"",
"", $sortfield, $sortorder);
928 $totalarray[
'nbfield']++;
930if (!empty($arrayfields[
'u.salary'][
'checked'])) {
931 print_liste_field_titre(
"Salary", $_SERVER[
'PHP_SELF'],
"u.salary", $param,
"",
"", $sortfield, $sortorder,
'right ');
932 $totalarray[
'nbfield']++;
934if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
935 print_liste_field_titre(
"LastConnexion", $_SERVER[
'PHP_SELF'],
"u.datelastlogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
936 $totalarray[
'nbfield']++;
938if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
939 print_liste_field_titre(
"PreviousConnexion", $_SERVER[
'PHP_SELF'],
"u.datepreviouslogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
940 $totalarray[
'nbfield']++;
943include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
945$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
946$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
947print $hookmanager->resPrint;
948if (!empty($arrayfields[
'u.datec'][
'checked'])) {
949 print_liste_field_titre(
"DateCreationShort", $_SERVER[
"PHP_SELF"],
"u.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
950 $totalarray[
'nbfield']++;
952if (!empty($arrayfields[
'u.tms'][
'checked'])) {
953 print_liste_field_titre(
"DateModificationShort", $_SERVER[
"PHP_SELF"],
"u.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
954 $totalarray[
'nbfield']++;
956if (!empty($arrayfields[
'u.statut'][
'checked'])) {
957 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"u.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
958 $totalarray[
'nbfield']++;
962 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
963 $totalarray[
'nbfield']++;
969$needToFetchEachLine = 0;
970if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
971 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
972 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
973 $needToFetchEachLine++;
982$savnbfield = $totalarray[
'nbfield'];
983$totalarray = array(
'val' => array(
'u.salary' => 0));
984$totalarray[
'nbfield'] = 0;
985$imaxinloop = ($limit ? min($num, $limit) : $num);
986while ($i < $imaxinloop) {
987 $obj = $db->fetch_object($resql);
992 if (empty($obj->country_code)) {
993 $obj->country_code =
'';
997 $object->setVarsFromFetchObj($obj);
1003 $object->statut = $obj->status;
1004 $object->status = $obj->status;
1005 $object->office_phone = $obj->office_phone;
1006 $object->user_mobile = $obj->user_mobile;
1009 $object->gender = $obj->gender;
1010 $object->socid = $obj->fk_soc;
1011 $object->firstname = $obj->firstname;
1012 $object->lastname = $obj->lastname;
1013 $object->employee = $obj->employee;
1015 $object->datestartvalidity = $db->jdate($obj->datestartvalidity);
1016 $object->dateendvalidity = $db->jdate($obj->dateendvalidity);
1018 $li =
$object->getNomUrl(-1,
'', 0, 0, 24, 1,
'login',
'', 1);
1020 $canreadhrmdata = 0;
1021 if ((isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"read") && in_array($obj->rowid, $childids))
1022 || (isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"readall"))
1023 || (isModEnabled(
'hrm') && $user->hasRight(
"hrm",
"employee",
"read"))) {
1024 $canreadhrmdata = 1;
1026 $canreadsecretapi = 0;
1027 if ($user->id == $obj->rowid || !empty($user->admin)) {
1028 $canreadsecretapi = 1;
1031 if ($mode ==
'kanban') {
1033 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1034 print
'<div class="box-flex-container kanban">';
1039 if ($massactionbutton || $massaction) {
1041 if (in_array(
$object->id, $arrayofselected)) {
1045 print
$object->getKanbanView(
'', array(
'selected' => $selected));
1046 if ($i == ($imaxinloop - 1)) {
1053 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1056 print
'<td class="nowrap center">';
1057 if ($massactionbutton || $massaction) {
1059 if (in_array(
$object->id, $arrayofselected)) {
1062 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1066 $totalarray[
'nbfield']++;
1070 if (!empty($arrayfields[
'u.rowid'][
'checked'])) {
1071 print
'<td class="nowraponall">'.dol_escape_htmltag($obj->rowid).
'</td>';
1073 $totalarray[
'nbfield']++;
1077 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1078 print
'<td class="nowraponall tdoverflowmax150">';
1080 if (isModEnabled(
'multicompany') && $obj->admin && !$obj->entity) {
1081 print
img_picto($langs->trans(
"SuperAdministratorDesc"),
'redstar',
'class="valignmiddle paddingright paddingleft"');
1082 } elseif ($obj->admin) {
1083 print
img_picto($langs->trans(
"AdministratorDesc"),
'star',
'class="valignmiddle paddingright paddingleft"');
1087 $totalarray[
'nbfield']++;
1090 if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
1091 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->lastname).
'</td>';
1093 $totalarray[
'nbfield']++;
1096 if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
1097 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->firstname).
'</td>';
1099 $totalarray[
'nbfield']++;
1102 if (!empty($arrayfields[
'u.gender'][
'checked'])) {
1103 print
'<td class="center">';
1107 switch ($obj->gender) {
1109 $addgendertxt .=
'<i class="fas fa-mars" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1112 $addgendertxt .=
'<i class="fas fa-venus" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1115 $addgendertxt .=
'<i class="fas fa-transgender" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1118 print $addgendertxt;
1123 $totalarray[
'nbfield']++;
1127 if (!empty($arrayfields[
'u.employee'][
'checked'])) {
1128 print
'<td class="center">'.yn($obj->employee).
'</td>';
1130 $totalarray[
'nbfield']++;
1135 if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
1136 print
'<td class="tdoverflowmax125">';
1138 $user2->id = $obj->id2;
1139 $user2->login = $obj->login2;
1140 $user2->lastname = $obj->lastname2;
1141 $user2->firstname = $obj->firstname2;
1142 $user2->gender = $obj->gender2;
1143 $user2->photo = $obj->photo2;
1144 $user2->admin = $obj->admin2;
1145 $user2->office_phone = $obj->office_phone;
1146 $user2->user_mobile = $obj->user_mobile;
1147 $user2->email = $obj->email2;
1148 $user2->socid = $obj->fk_soc2;
1149 $user2->statut = $obj->status2;
1150 $user2->status = $obj->status2;
1151 if (isModEnabled(
'multicompany') && $obj->admin2 && !$obj->entity2) {
1152 print
img_picto($langs->trans(
"SuperAdministratorDesc"),
'redstar',
'class="valignmiddle paddingright"');
1153 } elseif ($obj->admin2) {
1154 print
img_picto($langs->trans(
"AdministratorDesc"),
'star',
'class="valignmiddle paddingright"');
1156 print $user2->getNomUrl(-1,
'', 0, 0, 24, 0,
'',
'', 1);
1160 $totalarray[
'nbfield']++;
1164 if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
1165 print
'<td>'.$obj->accountancy_code.
'</td>';
1167 $totalarray[
'nbfield']++;
1172 if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
1173 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'phone').
"</td>\n";
1175 $totalarray[
'nbfield']++;
1179 if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
1180 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'mobile').
"</td>\n";
1182 $totalarray[
'nbfield']++;
1186 if (!empty($arrayfields[
'u.email'][
'checked'])) {
1187 print
'<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc, 1, 0, 0, 1).
"</td>\n";
1189 $totalarray[
'nbfield']++;
1193 if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
1195 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($api_key).
'">';
1197 if ($canreadsecretapi) {
1198 print
'<span class="opacitymedium">';
1202 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1207 $totalarray[
'nbfield']++;
1211 if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
1212 print
'<td class="tdoverflowmax150">';
1213 if ($obj->fk_soc > 0) {
1214 $companystatic->id = $obj->fk_soc;
1215 $companystatic->name = $obj->name;
1216 $companystatic->canvas = $obj->canvas;
1217 print $companystatic->getNomUrl(1);
1218 } elseif ($obj->ldap_sid) {
1219 print
'<span class="opacitymedium">'.$langs->trans(
"DomainUser").
'</span>';
1221 print
'<span class="opacitymedium">'.$langs->trans(
"InternalUser").
'</span>';
1225 $totalarray[
'nbfield']++;
1229 if (isModEnabled(
'multicompany') && is_object($mc) && !
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE')) {
1230 if (!empty($arrayfields[
'u.entity'][
'checked'])) {
1231 if (!$obj->entity) {
1232 $labeltouse = $langs->trans(
"AllEntities");
1234 $mc->getInfo($obj->entity);
1235 $labeltouse = $mc->label;
1237 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labeltouse).
'">';
1241 $totalarray[
'nbfield']++;
1247 if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
1248 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_employee).
'">';
1252 $totalarray[
'nbfield']++;
1256 if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
1257 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->national_registration_number).
'">';
1261 $totalarray[
'nbfield']++;
1265 if (!empty($arrayfields[
'u.job'][
'checked'])) {
1266 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->job).
'">';
1270 $totalarray[
'nbfield']++;
1275 if (!empty($arrayfields[
'u.salary'][
'checked'])) {
1276 print
'<td class="nowraponall right amount">';
1278 if ($canreadhrmdata) {
1279 print
price($obj->salary);
1281 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1286 $totalarray[
'nbfield']++;
1289 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'u.salary';
1291 if (!isset($totalarray[
'val'])) {
1292 $totalarray[
'val'] = array();
1294 if (!isset($totalarray[
'val'][
'u.salary'])) {
1295 $totalarray[
'val'][
'u.salary'] = 0;
1297 $totalarray[
'val'][
'u.salary'] += $obj->salary;
1301 if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
1302 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($obj->datelastlogin),
"dayhour").
'</td>';
1304 $totalarray[
'nbfield']++;
1308 if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
1309 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($obj->datepreviouslogin),
"dayhour").
'</td>';
1311 $totalarray[
'nbfield']++;
1316 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1318 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1319 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
1320 print $hookmanager->resPrint;
1322 if (!empty($arrayfields[
'u.datec'][
'checked'])) {
1323 print
'<td class="center nowraponall">';
1324 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1327 $totalarray[
'nbfield']++;
1331 if (!empty($arrayfields[
'u.tms'][
'checked'])) {
1332 print
'<td class="center nowraponall">';
1333 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1336 $totalarray[
'nbfield']++;
1340 if (!empty($arrayfields[
'u.statut'][
'checked'])) {
1341 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
1343 $totalarray[
'nbfield']++;
1348 print
'<td class="nowrap center">';
1349 if ($massactionbutton || $massaction) {
1351 if (in_array(
$object->id, $arrayofselected)) {
1354 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1358 $totalarray[
'nbfield']++;
1369include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1374 foreach ($arrayfields as $key => $val) {
1375 if (!empty($val[
'checked'])) {
1379 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1385$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
1386$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1387print $hookmanager->resPrint;
1389print
'</table>'.
"\n";
1392print
'</form>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage categories.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
dolDecrypt($chain, $key='')
Decode a string with a symmetric encryption.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.