29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
31if (isModEnabled(
'categorie')) {
32 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
36$langs->loadLangs(array(
'users',
'companies',
'hrm',
'salaries'));
38$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
39$massaction =
GETPOST(
'massaction',
'alpha');
40$show_files =
GETPOST(
'show_files',
'int');
41$confirm =
GETPOST(
'confirm',
'alpha');
42$cancel =
GETPOST(
'cancel',
'alpha');
43$toselect =
GETPOST(
'toselect',
'array');
44$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'userlist';
45$backtopage =
GETPOST(
'backtopage',
'alpha');
46$optioncss =
GETPOST(
'optioncss',
'aZ');
51if ($user->socid > 0) {
52 $socid = $user->socid;
56$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
57$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
59$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
60if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
64$offset = $limit * $page;
69$object =
new User($db);
71$diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
72$hookmanager->initHooks(array(
'userlist'));
75$extrafields->fetch_name_optionals_label($object->table_element);
77$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
80 $sortfield =
"u.login";
87$search_all =
GETPOST(
'search_all',
'alphanohtml');
89foreach ($object->fields as $key => $val) {
90 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
91 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
93 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
94 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
95 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
99$userstatic =
new User($db);
100$companystatic =
new Societe($db);
101$form =
new Form($db);
104$fieldstosearchall = array(
106 'u.lastname'=>
"Lastname",
107 'u.firstname'=>
"Firstname",
108 'u.accountancy_code'=>
"AccountancyCode",
109 'u.office_phone'=>
"PhonePro",
110 'u.user_mobile'=>
"PhoneMobile",
112 'u.note_public'=>
"NotePublic",
113 'u.note_private'=>
"NotePrivate"
115if (isModEnabled(
'api')) {
116 $fieldstosearchall[
'u.api_key'] =
"ApiKey";
119$permissiontoreadhr = $user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write');
120$permissiontowritehr = $user->hasRight(
'hrm',
'write_personal_information',
'write');
124 'u.login'=>array(
'label'=>
"Login",
'checked'=>1,
'position'=>10),
125 'u.lastname'=>array(
'label'=>
"Lastname",
'checked'=>1,
'position'=>15),
126 'u.firstname'=>array(
'label'=>
"Firstname",
'checked'=>1,
'position'=>20),
127 'u.entity'=>array(
'label'=>
"Entity",
'checked'=>1,
'position'=>50,
'enabled'=>(isModEnabled(
'multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
128 'u.gender'=>array(
'label'=>
"Gender",
'checked'=>0,
'position'=>22),
129 'u.employee'=>array(
'label'=>
"Employee",
'checked'=>($contextpage ==
'employeelist' ? 1 : 0),
'position'=>25),
130 'u.fk_user'=>array(
'label'=>
"HierarchicalResponsible",
'checked'=>1,
'position'=>27,
'csslist'=>
'maxwidth150'),
131 'u.accountancy_code'=>array(
'label'=>
"AccountancyCode",
'checked'=>0,
'position'=>30),
132 'u.office_phone'=>array(
'label'=>
"PhonePro",
'checked'=>1,
'position'=>31),
133 'u.user_mobile'=>array(
'label'=>
"PhoneMobile",
'checked'=>1,
'position'=>32),
134 'u.email'=>array(
'label'=>
"EMail",
'checked'=>1,
'position'=>35),
135 'u.api_key'=>array(
'label'=>
"ApiKey",
'checked'=>0,
'position'=>40,
"enabled"=>(isModEnabled(
'api') && $user->admin)),
136 'u.fk_soc'=>array(
'label'=>
"Company",
'checked'=>($contextpage ==
'employeelist' ? 0 : 1),
'position'=>45),
137 'u.ref_employee'=>array(
'label'=>
"RefEmployee",
'checked'=>-1,
'position'=>50,
'enabled'=>(isModEnabled(
'hrm') && $permissiontoreadhr)),
138 'u.national_registration_number'=>array(
'label'=>
"NationalRegistrationNumber",
'checked'=>-1,
'position'=>51,
'enabled'=>(isModEnabled(
'hrm') && $permissiontoreadhr)),
139 'u.job'=>array(
'label'=>
"PostOrFunction",
'checked'=>-1,
'position'=>60),
140 'u.salary'=>array(
'label'=>
"Salary",
'checked'=>-1,
'position'=>80,
'enabled'=>(isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"readall")),
'isameasure'=>1),
141 'u.datelastlogin'=>array(
'label'=>
"LastConnexion",
'checked'=>1,
'position'=>100),
142 'u.datepreviouslogin'=>array(
'label'=>
"PreviousConnexion",
'checked'=>0,
'position'=>110),
143 'u.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>500),
144 'u.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>500),
145 'u.statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
148include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_list_array_fields.tpl.php';
154$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
155$search_user =
GETPOST(
'search_user',
'alpha');
156$search_login =
GETPOST(
'search_login',
'alpha');
157$search_lastname =
GETPOST(
'search_lastname',
'alpha');
158$search_firstname =
GETPOST(
'search_firstname',
'alpha');
159$search_gender =
GETPOST(
'search_gender',
'alpha');
160$search_employee =
GETPOST(
'search_employee',
'alpha');
161$search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha');
162$search_phonepro =
GETPOST(
'search_phonepro',
'alpha');
163$search_phonemobile =
GETPOST(
'search_phonemobile',
'alpha');
164$search_email =
GETPOST(
'search_email',
'alpha');
165$search_api_key =
GETPOST(
'search_api_key',
'alphanohtml');
166$search_statut =
GETPOST(
'search_statut',
'intcomma');
167$search_thirdparty =
GETPOST(
'search_thirdparty',
'alpha');
168$search_job =
GETPOST(
'search_job',
'alpha');
169$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
170$search_supervisor =
GETPOST(
'search_supervisor',
'intcomma');
171$search_categ =
GETPOST(
"search_categ",
'int');
172$searchCategoryUserOperator = 0;
173if (GETPOSTISSET(
'formfilteraction')) {
174 $searchCategoryUserOperator =
GETPOSTINT(
'search_category_user_operator');
175} elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
176 $searchCategoryUserOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
178$searchCategoryUserList =
GETPOST(
'search_category_user_list',
'array');
179$catid =
GETPOST(
'catid',
'int');
180if (!empty($catid) && empty($searchCategoryUserList)) {
181 $searchCategoryUserList = array($catid);
183$catid =
GETPOST(
'catid',
'int');
184if (!empty($catid) && empty($search_categ)) {
185 $search_categ = $catid;
189if ($search_statut ==
'') {
190 $search_statut =
'1';
192if ($contextpage ==
'employeelist' && !GETPOSTISSET(
'search_employee')) {
193 $search_employee = 1;
197$permissiontoadd = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"write"));
198$canreaduser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"read"));
199$canedituser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"write"));
200$candisableuser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"delete"));
201$canreadgroup = $canreaduser;
202$caneditgroup = $canedituser;
203if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
204 $canreadgroup = (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"read"));
205 $caneditgroup = (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"write"));
211if (isModEnabled(
'salaries') && $contextpage ==
'employeelist' && $search_employee == 1) {
212 if (!$user->hasRight(
"salaries",
"read")) {
216 if (!$user->hasRight(
"user",
"user",
"read") && empty($user->admin)) {
221$childids = $user->getAllChildIds(1);
228if (
GETPOST(
'cancel',
'alpha')) {
232if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
236$parameters = array();
237$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
242if (empty($reshook)) {
244 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
247 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
250 $search_lastname =
"";
251 $search_firstname =
"";
253 $search_employee =
"";
254 $search_accountancy_code =
"";
255 $search_phonepro =
"";
256 $search_phonemobile =
"";
259 $search_thirdparty =
"";
261 $search_warehouse =
"";
262 $search_supervisor =
"";
263 $search_api_key =
"";
264 $search_datelastlogin =
"";
265 $search_datepreviouslogin =
"";
266 $search_date_creation =
"";
267 $search_date_update =
"";
270 $search_array_options = array();
272 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
273 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
278 $objectclass =
'User';
279 $objectlabel =
'User';
280 $uploaddir = $conf->user->dir_output;
281 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
284 if (!$error && ($massaction ==
'disable' || $massaction ==
'reactivate') && $permissiontoadd) {
285 $objecttmp =
new User($db);
291 foreach ($toselect as $toselectid) {
292 if ($toselectid == $user->id) {
293 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableYourself' :
'CanEnableYourself'), null,
'errors');
298 $result = $objecttmp->fetch($toselectid);
300 if ($objecttmp->admin) {
301 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableAnAdminUserWithMassActions' :
'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null,
'errors');
306 $result = $objecttmp->setstatus($massaction ==
'disable' ? 0 : 1);
309 } elseif ($result < 0) {
323 if (!$error && !empty($conf->file->main_limit_users)) {
324 $nb = $object->getNbOfUsers(
"active");
325 if ($nb >= $conf->file->main_limit_users) {
327 setEventMessages($langs->trans(
"YourQuotaOfUsersIsReached"),
null,
'errors');
351$user2 =
new User($db);
355$help_url =
'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer';
356if ($contextpage ==
'employeelist' && $search_employee == 1) {
357 $title = $langs->trans(
"Employees");
359 $title = $langs->trans(
"Users");
367$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,";
368$sql .=
" u.fk_user,";
369$sql .=
" u.ref_employee, u.national_registration_number, u.job, u.salary, u.datelastlogin, u.datepreviouslogin,";
370$sql .=
" u.datestartvalidity, u.dateendvalidity,";
371$sql .=
" u.ldap_sid, u.statut as status, u.entity,";
372$sql .=
" u.tms as date_update, u.datec as date_creation,";
373$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,";
374$sql .=
" s.nom as name, s.canvas";
376if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
377 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
378 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
382$parameters = array();
383$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
384$sql .= $hookmanager->resPrint;
385$sql = preg_replace(
'/,\s*$/',
'', $sql);
389$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as u";
390if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
391 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (u.rowid = ef.fk_object)";
393$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON u.fk_soc = s.rowid";
394$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u2 ON u.fk_user = u2.rowid";
396$parameters = array();
397$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
398$sql .= $hookmanager->resPrint;
400 $sql .= $hookmanager->resPrint;
402$sql .=
" WHERE u.entity IN (".getEntity($object->element).
")";
404 $sql .=
" AND u.fk_soc = ".((int) $socid);
407if ($search_supervisor > 0) {
408 $sql .=
" AND u.fk_user IN (".$db->sanitize($search_supervisor).
")";
410if ($search_thirdparty !=
'') {
413if ($search_warehouse > 0) {
414 $sql .=
natural_search(array(
'u.fk_warehouse'), $search_warehouse);
416if ($search_login !=
'') {
419if ($search_lastname !=
'') {
422if ($search_firstname !=
'') {
425if ($search_gender !=
'' && $search_gender !=
'-1') {
426 $sql .=
" AND u.gender = '".$db->escape($search_gender).
"'";
428if (is_numeric($search_employee) && $search_employee >= 0) {
429 $sql .=
' AND u.employee = '.(int) $search_employee;
431if ($search_accountancy_code !=
'') {
432 $sql .=
natural_search(
"u.accountancy_code", $search_accountancy_code);
434if ($search_phonepro !=
'') {
437if ($search_phonemobile !=
'') {
440if ($search_email !=
'') {
443if ($search_api_key !=
'') {
446if ($search_job !=
'') {
449if ($search_statut !=
'' && $search_statut >= 0) {
450 $sql .=
" AND u.statut IN (".$db->sanitize($search_statut).
")";
453 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
456$searchCategoryUserList = array($search_categ);
457if (!empty($searchCategoryUserList)) {
458 $searchCategoryUserSqlList = array();
459 $listofcategoryid =
'';
460 foreach ($searchCategoryUserList as $searchCategoryUser) {
461 if (intval($searchCategoryUser) == -2) {
462 $searchCategoryUserSqlList[] =
"NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user)";
463 } elseif (intval($searchCategoryUser) > 0) {
464 if ($searchCategoryUserOperator == 0) {
465 $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).
")";
467 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryUser);
471 if ($listofcategoryid) {
472 $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).
"))";
474 if ($searchCategoryUserOperator == 1) {
475 if (!empty($searchCategoryUserSqlList)) {
476 $sql .=
" AND (".implode(
' OR ', $searchCategoryUserSqlList).
")";
479 if (!empty($searchCategoryUserSqlList)) {
480 $sql .=
" AND (".implode(
' AND ', $searchCategoryUserSqlList).
")";
484if ($search_warehouse > 0) {
485 $sql .=
" AND u.fk_warehouse = ".((int) $search_warehouse);
487if (isModEnabled(
'salaries') && $contextpage ==
'employeelist' && !$user->hasRight(
"salaries",
"readall")) {
488 $sql .=
" AND u.rowid IN (".$db->sanitize(join(
',', $childids)).
")";
491include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
493$parameters = array();
494$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
495$sql .= $hookmanager->resPrint;
498$nbtotalofrecords =
'';
501 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
502 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
503 $resql = $db->query($sqlforcount);
505 $objforcount = $db->fetch_object($resql);
506 $nbtotalofrecords = $objforcount->nbtotalofrecords;
511 if (($page * $limit) > $nbtotalofrecords) {
519$sql .= $db->order($sortfield, $sortorder);
521 $sql .= $db->plimit($limit + 1, $offset);
524$resql = $db->query($sql);
530$num = $db->num_rows($resql);
533if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
534 $obj = $db->fetch_object($resql);
536 header(
"Location: ".DOL_URL_ROOT.
'/user/card.php?id='.$id);
543llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
545$arrayofselected = is_array($toselect) ? $toselect : array();
549 $param .=
'&mode='.urlencode($mode);
551if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
552 $param .=
'&contextpage='.urlencode($contextpage);
554if ($limit > 0 && $limit != $conf->liste_limit) {
555 $param .=
'&limit='.((int) $limit);
557if ($search_all !=
'') {
558 $param .=
'&search_all='.urlencode($search_all);
560if ($search_user !=
'') {
561 $param .=
"&search_user=".urlencode($search_user);
563if ($search_login !=
'') {
564 $param .=
"&search_login=".urlencode($search_login);
566if ($search_lastname !=
'') {
567 $param .=
"&search_lastname=".urlencode($search_lastname);
569if ($search_firstname !=
'') {
570 $param .=
"&search_firstname=".urlencode($search_firstname);
572if ($search_gender !=
'' && $search_gender !=
'-1') {
573 $param .=
"&search_gender=".urlencode($search_gender);
575if ($search_employee !=
'' && $search_employee !=
'-1') {
576 $param .=
"&search_employee=".urlencode($search_employee);
578if ($search_accountancy_code !=
'') {
579 $param .=
"&search_accountancy_code=".urlencode($search_accountancy_code);
581if ($search_phonepro !=
'') {
582 $param .=
"&search_phonepro=".urlencode($search_phonepro);
584if ($search_phonemobile !=
'') {
585 $param .=
"&search_phonemobile=".urlencode($search_phonemobile);
587if ($search_email !=
'') {
588 $param .=
"&search_email=".urlencode($search_email);
590if ($search_api_key !=
'') {
591 $param .=
"&search_api_key=".urlencode($search_api_key);
593if ($search_supervisor > 0) {
594 $param .=
"&search_supervisor=".urlencode($search_supervisor);
596if ($search_statut !=
'') {
597 $param .=
"&search_statut=".urlencode($search_statut);
599if ($optioncss !=
'') {
600 $param .=
'&optioncss='.urlencode($optioncss);
602if ($search_categ > 0) {
603 $param .=
'&search_categ='.urlencode($search_categ);
605if ($search_warehouse > 0) {
606 $param .=
'&search_warehouse='.urlencode($search_warehouse);
609include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
612$arrayofmassactions = array();
613if ($permissiontoadd) {
614 $arrayofmassactions[
'disable'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"DisableUser");
616if ($permissiontoadd) {
617 $arrayofmassactions[
'reactivate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Reactivate");
619if (isModEnabled(
'category') && $permissiontoadd) {
620 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
622if ($permissiontoadd) {
623 $arrayofmassactions[
'presetsupervisor'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"SetSupervisor");
627if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'presetsupervisor'))) {
628 $arrayofmassactions = array();
630$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
632print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
633if ($optioncss !=
'') {
634 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
636print
'<input type="hidden" name="token" value="'.newToken().
'">';
637print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
638print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
639print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
640print
'<input type="hidden" name="page" value="'.$page.
'">';
641print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
642print
'<input type="hidden" name="page_y" value="">';
643print
'<input type="hidden" name="mode" value="'.$mode.
'">';
645$url = DOL_URL_ROOT.
'/user/card.php?action=create'.($contextpage ==
'employeelist' ?
'&search_employee=1' :
'').
'&leftmenu=';
647 $url .=
'&socid='.urlencode($socid);
651$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'));
652$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'));
653$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'));
655$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewUser'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
662print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0, $morehtmlright.
' '.$newcardbutton,
'', $limit, 0, 0, 1);
667$topicmail =
"SendUserRef";
669$objecttmp =
new User($db);
670$trackid =
'use'.$object->id;
671include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
674 print
"<div id='ways'>";
676 $ways = $c->print_all_ways(
' > ',
'user/list.php');
677 print
" > ".$ways[0].
"<br>\n";
682 foreach ($fieldstosearchall as $key => $val) {
683 $fieldstosearchall[$key] = $langs->trans($val);
685 print
'<!-- Search done like if USER_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
686 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
695if (isModEnabled(
'categorie') && $user->hasRight(
"categorie",
"read")) {
696 $moreforfilter .=
'<div class="divsearchfield">';
697 $tmptitle = $langs->trans(
'Category');
698 $moreforfilter .=
img_picto($langs->trans(
"Category"),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ,
'search_categ', 1, $tmptitle);
699 $moreforfilter .=
'</div>';
702if (isModEnabled(
'stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
703 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
705 $moreforfilter .=
'<div class="divsearchfield">';
706 $tmptitle = $langs->trans(
'Warehouse');
707 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
708 $moreforfilter .=
'</div>';
711$parameters = array();
712$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
713if (empty($reshook)) {
714 $moreforfilter .= $hookmanager->resPrint;
716 $moreforfilter = $hookmanager->resPrint;
719if (!empty($moreforfilter)) {
720 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
721 print $moreforfilter;
725$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
726$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
727$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
729print
'<div class="div-table-responsive">';
730print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
734print
'<tr class="liste_titre_filter">';
737 print
'<td class="liste_titre center maxwidthsearch">';
738 $searchpicto = $form->showFilterButtons(
'left');
742if (!empty($arrayfields[
'u.login'][
'checked'])) {
743 print
'<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.
'"></td>';
745if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
746 print
'<td class="liste_titre"><input type="text" name="search_lastname" class="maxwidth50" value="'.$search_lastname.
'"></td>';
748if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
749 print
'<td class="liste_titre"><input type="text" name="search_firstname" class="maxwidth50" value="'.$search_firstname.
'"></td>';
751if (!empty($arrayfields[
'u.gender'][
'checked'])) {
752 print
'<td class="liste_titre center">';
753 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
754 print $form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
757if (!empty($arrayfields[
'u.employee'][
'checked'])) {
758 print
'<td class="liste_titre">';
759 print $form->selectyesno(
'search_employee', $search_employee, 1,
false, 1);
763if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
764 print
'<td class="liste_titre">';
765 print $form->select_dolusers($search_supervisor,
'search_supervisor', 1, array(), 0,
'', 0, 0, 0, 0,
'', 0,
'',
'maxwidth125');
768if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
769 print
'<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.
'"></td>';
771if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
772 print
'<td class="liste_titre"><input type="text" name="search_phonepro" class="maxwidth50" value="'.$search_phonepro.
'"></td>';
774if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
775 print
'<td class="liste_titre"><input type="text" name="search_phonemobile" class="maxwidth50" value="'.$search_phonemobile.
'"></td>';
777if (!empty($arrayfields[
'u.email'][
'checked'])) {
778 print
'<td class="liste_titre"><input type="text" name="search_email" class="maxwidth75" value="'.$search_email.
'"></td>';
780if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
781 print
'<td class="liste_titre"><input type="text" name="search_api_key" class="maxwidth50" value="'.$search_api_key.
'"></td>';
783if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
784 print
'<td class="liste_titre"><input type="text" name="search_thirdparty" class="maxwidth75" value="'.$search_thirdparty.
'"></td>';
786if (!empty($arrayfields[
'u.entity'][
'checked'])) {
787 print
'<td class="liste_titre"></td>';
789if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
790 print
'<td class="liste_titre"></td>';
792if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
793 print
'<td class="liste_titre"></td>';
795if (!empty($arrayfields[
'u.job'][
'checked'])) {
796 print
'<td class="liste_titre"><input type="text" name="search_job" class="maxwidth75" value="'.$search_job.
'"></td>';
798if (!empty($arrayfields[
'u.salary'][
'checked'])) {
799 print
'<td class="liste_titre"></td>';
801if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
802 print
'<td class="liste_titre"></td>';
804if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
805 print
'<td class="liste_titre"></td>';
808include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
810$parameters = array(
'arrayfields'=>$arrayfields);
811$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
812print $hookmanager->resPrint;
813if (!empty($arrayfields[
'u.datec'][
'checked'])) {
815 print
'<td class="liste_titre">';
818if (!empty($arrayfields[
'u.tms'][
'checked'])) {
820 print
'<td class="liste_titre">';
823if (!empty($arrayfields[
'u.statut'][
'checked'])) {
825 print
'<td class="liste_titre center parentonrightofpage">';
826 print $form->selectarray(
'search_statut', array(
'-1'=>
'',
'0'=>$langs->trans(
'Disabled'),
'1'=>$langs->trans(
'Enabled')), $search_statut, 0, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
831 print
'<td class="liste_titre maxwidthsearch">';
832 $searchpicto = $form->showFilterButtons();
838$totalarray = array();
839$totalarray[
'nbfield'] = 0;
843print
'<tr class="liste_titre">';
845 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
846 $totalarray[
'nbfield']++;
848if (!empty($arrayfields[
'u.login'][
'checked'])) {
849 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
'PHP_SELF'],
"u.login", $param,
"",
"", $sortfield, $sortorder);
850 $totalarray[
'nbfield']++;
852if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
853 print_liste_field_titre(
"Lastname", $_SERVER[
'PHP_SELF'],
"u.lastname", $param,
"",
"", $sortfield, $sortorder);
854 $totalarray[
'nbfield']++;
856if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
857 print_liste_field_titre(
"FirstName", $_SERVER[
'PHP_SELF'],
"u.firstname", $param,
"",
"", $sortfield, $sortorder);
858 $totalarray[
'nbfield']++;
860if (!empty($arrayfields[
'u.gender'][
'checked'])) {
861 print_liste_field_titre(
"Gender", $_SERVER[
'PHP_SELF'],
"u.gender", $param,
"",
"", $sortfield, $sortorder,
'center ');
862 $totalarray[
'nbfield']++;
864if (!empty($arrayfields[
'u.employee'][
'checked'])) {
865 print_liste_field_titre(
"Employee", $_SERVER[
'PHP_SELF'],
"u.employee", $param,
"",
"", $sortfield, $sortorder,
'center ');
866 $totalarray[
'nbfield']++;
868if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
869 print_liste_field_titre(
"HierarchicalResponsible", $_SERVER[
'PHP_SELF'],
"u.fk_user", $param,
"",
"", $sortfield, $sortorder);
870 $totalarray[
'nbfield']++;
872if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
873 print_liste_field_titre(
"AccountancyCode", $_SERVER[
'PHP_SELF'],
"u.accountancy_code", $param,
"",
"", $sortfield, $sortorder);
874 $totalarray[
'nbfield']++;
876if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
877 print_liste_field_titre(
"PhonePro", $_SERVER[
'PHP_SELF'],
"u.office_phone", $param,
"",
"", $sortfield, $sortorder);
878 $totalarray[
'nbfield']++;
880if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
881 print_liste_field_titre(
"PhoneMobile", $_SERVER[
'PHP_SELF'],
"u.user_mobile", $param,
"",
"", $sortfield, $sortorder);
882 $totalarray[
'nbfield']++;
884if (!empty($arrayfields[
'u.email'][
'checked'])) {
886 $totalarray[
'nbfield']++;
888if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
890 $totalarray[
'nbfield']++;
892if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
894 $totalarray[
'nbfield']++;
896if (!empty($arrayfields[
'u.entity'][
'checked'])) {
897 print_liste_field_titre($arrayfields[
'u.entity'][
'label'], $_SERVER[
'PHP_SELF'],
"u.entity", $param,
"",
"", $sortfield, $sortorder);
898 $totalarray[
'nbfield']++;
900if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
901 print_liste_field_titre(
"RefEmployee", $_SERVER[
'PHP_SELF'],
"u.ref_employee", $param,
"",
"", $sortfield, $sortorder);
902 $totalarray[
'nbfield']++;
904if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
905 print_liste_field_titre(
"NationalRegistrationNumber", $_SERVER[
'PHP_SELF'],
"u.national_registration_number", $param,
"",
"", $sortfield, $sortorder);
906 $totalarray[
'nbfield']++;
908if (!empty($arrayfields[
'u.job'][
'checked'])) {
909 print_liste_field_titre($arrayfields[
'u.job'][
'label'], $_SERVER[
'PHP_SELF'],
"u.job", $param,
"",
"", $sortfield, $sortorder);
910 $totalarray[
'nbfield']++;
912if (!empty($arrayfields[
'u.salary'][
'checked'])) {
913 print_liste_field_titre(
"Salary", $_SERVER[
'PHP_SELF'],
"u.salary", $param,
"",
"", $sortfield, $sortorder,
'right ');
914 $totalarray[
'nbfield']++;
916if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
917 print_liste_field_titre(
"LastConnexion", $_SERVER[
'PHP_SELF'],
"u.datelastlogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
918 $totalarray[
'nbfield']++;
920if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
921 print_liste_field_titre(
"PreviousConnexion", $_SERVER[
'PHP_SELF'],
"u.datepreviouslogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
922 $totalarray[
'nbfield']++;
925include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
927$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
928$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
929print $hookmanager->resPrint;
930if (!empty($arrayfields[
'u.datec'][
'checked'])) {
931 print_liste_field_titre(
"DateCreationShort", $_SERVER[
"PHP_SELF"],
"u.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
932 $totalarray[
'nbfield']++;
934if (!empty($arrayfields[
'u.tms'][
'checked'])) {
935 print_liste_field_titre(
"DateModificationShort", $_SERVER[
"PHP_SELF"],
"u.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
936 $totalarray[
'nbfield']++;
938if (!empty($arrayfields[
'u.statut'][
'checked'])) {
939 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"u.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
940 $totalarray[
'nbfield']++;
944 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
945 $totalarray[
'nbfield']++;
951$needToFetchEachLine = 0;
952if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
953 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
954 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
955 $needToFetchEachLine++;
964$savnbfield = $totalarray[
'nbfield'];
965$totalarray = array(
'val'=>array(
'u.salary'=>0));
966$totalarray[
'nbfield'] = 0;
967$imaxinloop = ($limit ? min($num, $limit) : $num);
968while ($i < $imaxinloop) {
969 $obj = $db->fetch_object($resql);
974 if (empty($obj->country_code)) {
975 $obj->country_code =
'';
979 $object->setVarsFromFetchObj($obj);
981 $object->id = $obj->rowid;
982 $object->admin = $obj->admin;
983 $object->ref = $obj->rowid;
984 $object->login = $obj->login;
985 $object->statut = $obj->status;
986 $object->status = $obj->status;
987 $object->office_phone = $obj->office_phone;
988 $object->user_mobile = $obj->user_mobile;
989 $object->job = $obj->job;
990 $object->email = $obj->email;
991 $object->gender = $obj->gender;
992 $object->socid = $obj->fk_soc;
993 $object->firstname = $obj->firstname;
994 $object->lastname = $obj->lastname;
995 $object->employee = $obj->employee;
996 $object->photo = $obj->photo;
997 $object->datestartvalidity = $db->jdate($obj->datestartvalidity);
998 $object->dateendvalidity = $db->jdate($obj->dateendvalidity);
1000 $li = $object->getNomUrl(-1,
'', 0, 0, 24, 1,
'login',
'', 1);
1002 $canreadhrmdata = 0;
1003 if ((isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"read") && in_array($obj->rowid, $childids))
1004 || (isModEnabled(
'salaries') && $user->hasRight(
"salaries",
"readall"))
1005 || (isModEnabled(
'hrm') && $user->hasRight(
"hrm",
"employee",
"read"))) {
1006 $canreadhrmdata = 1;
1008 $canreadsecretapi = 0;
1009 if ($user->id == $obj->rowid || !empty($user->admin)) {
1010 $canreadsecretapi = 1;
1013 if ($mode ==
'kanban') {
1015 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1016 print
'<div class="box-flex-container kanban">';
1020 print $object->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
1021 if ($i == ($imaxinloop - 1)) {
1028 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1031 print
'<td class="nowrap center">';
1032 if ($massactionbutton || $massaction) {
1034 if (in_array($object->id, $arrayofselected)) {
1037 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1041 $totalarray[
'nbfield']++;
1045 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1046 print
'<td class="nowraponall tdoverflowmax150">';
1048 if (isModEnabled(
'multicompany') && $obj->admin && !$obj->entity) {
1049 print
img_picto($langs->trans(
"SuperAdministrator"),
'redstar',
'class="valignmiddle paddingright paddingleft"');
1050 } elseif ($obj->admin) {
1051 print
img_picto($langs->trans(
"Administrator"),
'star',
'class="valignmiddle paddingright paddingleft"');
1055 $totalarray[
'nbfield']++;
1058 if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
1059 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->lastname).
'</td>';
1061 $totalarray[
'nbfield']++;
1064 if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
1065 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->firstname).
'</td>';
1067 $totalarray[
'nbfield']++;
1070 if (!empty($arrayfields[
'u.gender'][
'checked'])) {
1071 print
'<td class="center">';
1075 switch ($obj->gender) {
1077 $addgendertxt .=
'<i class="fas fa-mars" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1080 $addgendertxt .=
'<i class="fas fa-venus" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1083 $addgendertxt .=
'<i class="fas fa-transgender" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1086 print $addgendertxt;
1091 $totalarray[
'nbfield']++;
1095 if (!empty($arrayfields[
'u.employee'][
'checked'])) {
1096 print
'<td class="center">'.yn($obj->employee).
'</td>';
1098 $totalarray[
'nbfield']++;
1103 if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
1104 print
'<td class="tdoverflowmax125">';
1106 $user2->id = $obj->id2;
1107 $user2->login = $obj->login2;
1108 $user2->lastname = $obj->lastname2;
1109 $user2->firstname = $obj->firstname2;
1110 $user2->gender = $obj->gender2;
1111 $user2->photo = $obj->photo2;
1112 $user2->admin = $obj->admin2;
1113 $user2->office_phone = $obj->office_phone;
1114 $user2->user_mobile = $obj->user_mobile;
1115 $user2->email = $obj->email2;
1116 $user2->socid = $obj->fk_soc2;
1117 $user2->statut = $obj->status2;
1118 $user2->status = $obj->status2;
1119 if (isModEnabled(
'multicompany') && $obj->admin2 && !$obj->entity2) {
1120 print
img_picto($langs->trans(
"SuperAdministrator"),
'redstar',
'class="valignmiddle paddingright"');
1121 } elseif ($obj->admin2) {
1122 print
img_picto($langs->trans(
"Administrator"),
'star',
'class="valignmiddle paddingright"');
1124 print $user2->getNomUrl(-1,
'', 0, 0, 24, 0,
'',
'', 1);
1128 $totalarray[
'nbfield']++;
1132 if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
1133 print
'<td>'.$obj->accountancy_code.
'</td>';
1135 $totalarray[
'nbfield']++;
1140 if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
1141 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'phone').
"</td>\n";
1143 $totalarray[
'nbfield']++;
1146 if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
1147 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'mobile').
"</td>\n";
1149 $totalarray[
'nbfield']++;
1152 if (!empty($arrayfields[
'u.email'][
'checked'])) {
1153 print
'<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc,
'AC_EMAIL', 0, 0, 1).
"</td>\n";
1155 $totalarray[
'nbfield']++;
1158 if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
1160 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($api_key).
'">';
1162 if ($canreadsecretapi) {
1163 print
'<span class="opacitymedium">';
1167 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1172 $totalarray[
'nbfield']++;
1175 if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
1176 print
'<td class="tdoverflowmax150">';
1177 if ($obj->fk_soc > 0) {
1178 $companystatic->id = $obj->fk_soc;
1179 $companystatic->name = $obj->name;
1180 $companystatic->canvas = $obj->canvas;
1181 print $companystatic->getNomUrl(1);
1182 } elseif ($obj->ldap_sid) {
1183 print
'<span class="opacitymedium">'.$langs->trans(
"DomainUser").
'</span>';
1185 print
'<span class="opacitymedium">'.$langs->trans(
"InternalUser").
'</span>';
1189 $totalarray[
'nbfield']++;
1193 if (isModEnabled(
'multicompany') && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
1194 if (!empty($arrayfields[
'u.entity'][
'checked'])) {
1195 if (!$obj->entity) {
1196 $labeltouse = $langs->trans(
"AllEntities");
1198 $mc->getInfo($obj->entity);
1199 $labeltouse = $mc->label;
1201 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labeltouse).
'">';
1205 $totalarray[
'nbfield']++;
1211 if (!empty($arrayfields[
'u.ref_employee'][
'checked'])) {
1212 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_employee).
'">';
1216 $totalarray[
'nbfield']++;
1220 if (!empty($arrayfields[
'u.national_registration_number'][
'checked'])) {
1221 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->national_registration_number).
'">';
1225 $totalarray[
'nbfield']++;
1229 if (!empty($arrayfields[
'u.job'][
'checked'])) {
1230 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->job).
'">';
1234 $totalarray[
'nbfield']++;
1239 if (!empty($arrayfields[
'u.salary'][
'checked'])) {
1240 print
'<td class="nowraponall right amount">';
1242 if ($canreadhrmdata) {
1243 print
price($obj->salary);
1245 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1250 $totalarray[
'nbfield']++;
1253 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'u.salary';
1255 if (!isset($totalarray[
'val'])) {
1256 $totalarray[
'val'] = array();
1258 if (!isset($totalarray[
'val'][
'u.salary'])) {
1259 $totalarray[
'val'][
'u.salary'] = 0;
1261 $totalarray[
'val'][
'u.salary'] += $obj->salary;
1265 if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
1266 print
'<td class="nowrap center">'.dol_print_date($db->jdate($obj->datelastlogin),
"dayhour").
'</td>';
1268 $totalarray[
'nbfield']++;
1272 if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
1273 print
'<td class="nowrap center">'.dol_print_date($db->jdate($obj->datepreviouslogin),
"dayhour").
'</td>';
1275 $totalarray[
'nbfield']++;
1280 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1282 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1283 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
1284 print $hookmanager->resPrint;
1286 if (!empty($arrayfields[
'u.datec'][
'checked'])) {
1287 print
'<td class="center nowraponall">';
1288 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1291 $totalarray[
'nbfield']++;
1295 if (!empty($arrayfields[
'u.tms'][
'checked'])) {
1296 print
'<td class="center nowraponall">';
1297 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1300 $totalarray[
'nbfield']++;
1304 if (!empty($arrayfields[
'u.statut'][
'checked'])) {
1305 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
1307 $totalarray[
'nbfield']++;
1312 print
'<td class="nowrap center">';
1313 if ($massactionbutton || $massaction) {
1315 if (in_array($object->id, $arrayofselected)) {
1318 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1322 $totalarray[
'nbfield']++;
1333include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1338 foreach ($arrayfields as $key => $val) {
1339 if (!empty($val[
'checked'])) {
1343 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1349$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1350$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1351print $hookmanager->resPrint;
1353print
'</table>'.
"\n";
1356print
'</form>'.
"\n";
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 informations (by default a local PHP server timestamp) Re...
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
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.
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.
print_barre_liste($titre, $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.
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 symetric encryption.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.