29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
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');
47 $mode =
GETPOST(
"mode",
'alpha');
51 if ($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');
60 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
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') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
89 foreach ($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);
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"
115 if (!empty($conf->api->enabled)) {
116 $fieldstosearchall[
'u.api_key'] =
"ApiKey";
120 $arrayfields = array(
121 'u.login'=>array(
'label'=>
"Login",
'checked'=>1,
'position'=>10),
122 'u.lastname'=>array(
'label'=>
"Lastname",
'checked'=>1,
'position'=>15),
123 'u.firstname'=>array(
'label'=>
"Firstname",
'checked'=>1,
'position'=>20),
124 'u.entity'=>array(
'label'=>
"Entity",
'checked'=>1,
'position'=>50,
'enabled'=>(
isModEnabled(
'multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))),
125 'u.gender'=>array(
'label'=>
"Gender",
'checked'=>0,
'position'=>22),
126 'u.employee'=>array(
'label'=>
"Employee",
'checked'=>($contextpage ==
'employeelist' ? 1 : 0),
'position'=>25),
127 'u.fk_user'=>array(
'label'=>
"HierarchicalResponsible",
'checked'=>1,
'position'=>27),
128 'u.accountancy_code'=>array(
'label'=>
"AccountancyCode",
'checked'=>0,
'position'=>30),
129 'u.office_phone'=>array(
'label'=>
"PhonePro",
'checked'=>1,
'position'=>31),
130 'u.user_mobile'=>array(
'label'=>
"PhoneMobile",
'checked'=>1,
'position'=>32),
131 'u.email'=>array(
'label'=>
"EMail",
'checked'=>1,
'position'=>35),
132 'u.api_key'=>array(
'label'=>
"ApiKey",
'checked'=>0,
'position'=>40,
"enabled"=>(!empty($conf->api->enabled) && $user->admin)),
133 'u.fk_soc'=>array(
'label'=>
"Company",
'checked'=>($contextpage ==
'employeelist' ? 0 : 1),
'position'=>45),
134 'u.salary'=>array(
'label'=>
"Salary",
'checked'=>1,
'position'=>80,
'enabled'=>(!empty($conf->salaries->enabled) && $user->hasRight(
"salaries",
"readall"))),
135 'u.datelastlogin'=>array(
'label'=>
"LastConnexion",
'checked'=>1,
'position'=>100),
136 'u.datepreviouslogin'=>array(
'label'=>
"PreviousConnexion",
'checked'=>0,
'position'=>110),
137 'u.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>500),
138 'u.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>500),
139 'u.statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
142 include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_list_array_fields.tpl.php';
148 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
149 $search_user =
GETPOST(
'search_user',
'alpha');
150 $search_login =
GETPOST(
'search_login',
'alpha');
151 $search_lastname =
GETPOST(
'search_lastname',
'alpha');
152 $search_firstname =
GETPOST(
'search_firstname',
'alpha');
153 $search_gender =
GETPOST(
'search_gender',
'alpha');
154 $search_employee =
GETPOST(
'search_employee',
'alpha');
155 $search_accountancy_code =
GETPOST(
'search_accountancy_code',
'alpha');
156 $search_phonepro =
GETPOST(
'search_phonepro',
'alpha');
157 $search_phonemobile =
GETPOST(
'search_phonemobile',
'alpha');
158 $search_email =
GETPOST(
'search_email',
'alpha');
159 $search_api_key =
GETPOST(
'search_api_key',
'alphanohtml');
160 $search_statut =
GETPOST(
'search_statut',
'intcomma');
161 $search_thirdparty =
GETPOST(
'search_thirdparty',
'alpha');
162 $search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
163 $search_supervisor =
GETPOST(
'search_supervisor',
'intcomma');
164 $search_categ =
GETPOST(
"search_categ",
'int');
165 $searchCategoryUserOperator = 0;
167 $searchCategoryUserOperator =
GETPOSTINT(
'search_category_user_operator');
168 } elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
169 $searchCategoryUserOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
171 $searchCategoryUserList =
GETPOST(
'search_category_user_list',
'array');
172 $catid =
GETPOST(
'catid',
'int');
173 if (!empty($catid) && empty($searchCategoryUserList)) {
174 $searchCategoryUserList = array($catid);
176 $catid =
GETPOST(
'catid',
'int');
177 if (!empty($catid) && empty($search_categ)) {
178 $search_categ = $catid;
182 if ($search_statut ==
'') {
183 $search_statut =
'1';
185 if ($contextpage ==
'employeelist' && !
GETPOSTISSET(
'search_employee')) {
186 $search_employee = 1;
190 $permissiontoadd = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"write"));
191 $canreaduser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"read"));
192 $canedituser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"write"));
193 $candisableuser = (!empty($user->admin) || $user->hasRight(
"user",
"user",
"delete"));
194 $canreadgroup = $canreaduser;
195 $caneditgroup = $canedituser;
196 if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
197 $canreadgroup = (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"read"));
198 $caneditgroup = (!empty($user->admin) || $user->hasRight(
"user",
"group_advance",
"write"));
204 if ($contextpage ==
'employeelist' && $search_employee == 1) {
205 if (!$user->hasRight(
"salaries",
"read")) {
209 if (!$user->hasRight(
"user",
"user",
"read") && empty($user->admin)) {
214 $childids = $user->getAllChildIds(1);
221 if (
GETPOST(
'cancel',
'alpha')) {
225 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
229 $parameters = array();
230 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
235 if (empty($reshook)) {
237 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
240 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
243 $search_lastname =
"";
244 $search_firstname =
"";
246 $search_employee =
"";
247 $search_accountancy_code =
"";
248 $search_phonepro =
"";
249 $search_phonemobile =
"";
252 $search_thirdparty =
"";
253 $search_warehouse =
"";
254 $search_supervisor =
"";
255 $search_api_key =
"";
256 $search_datelastlogin =
"";
257 $search_datepreviouslogin =
"";
258 $search_date_creation =
"";
259 $search_date_update =
"";
262 $search_array_options = array();
264 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
265 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
270 $objectclass =
'User';
271 $objectlabel =
'User';
272 $uploaddir = $conf->user->dir_output;
273 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
276 if (!$error && ($massaction ==
'disable' || $massaction ==
'reactivate') && $permissiontoadd) {
277 $objecttmp =
new User($db);
283 foreach ($toselect as $toselectid) {
284 if ($toselectid == $user->id) {
285 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableYourself' :
'CanEnableYourself'),
null,
'errors');
290 $result = $objecttmp->fetch($toselectid);
292 if ($objecttmp->admin) {
293 setEventMessages($langs->trans($massaction == 0 ?
'CantDisableAnAdminUserWithMassActions' :
'CantEnableAnAdminUserWithMassActions', $objecttmp->login),
null,
'errors');
298 $result = $objecttmp->setstatus($massaction ==
'disable' ? 0 : 1);
301 } elseif ($result < 0) {
315 if (!$error && !empty($conf->file->main_limit_users)) {
316 $nb = $object->getNbOfUsers(
"active");
317 if ($nb >= $conf->file->main_limit_users) {
319 setEventMessages($langs->trans(
"YourQuotaOfUsersIsReached"),
null,
'errors');
343 $user2 =
new User($db);
347 $help_url =
'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer';
348 if ($contextpage ==
'employeelist' && $search_employee == 1) {
349 $title = $langs->trans(
"Employees");
351 $title = $langs->trans(
"Users");
359 $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,";
360 $sql .=
" u.salary, u.datelastlogin, u.datepreviouslogin,";
361 $sql .=
" u.ldap_sid, u.statut as status, u.entity,";
362 $sql .=
" u.tms as date_update, u.datec as date_creation,";
363 $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,";
364 $sql .=
" s.nom as name, s.canvas";
366 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
367 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
368 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
372 $parameters = array();
373 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
374 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
375 $sql = preg_replace(
'/,\s*$/',
'', $sql);
379 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as u";
380 if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
381 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (u.rowid = ef.fk_object)";
383 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON u.fk_soc = s.rowid";
384 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u2 ON u.fk_user = u2.rowid";
386 $parameters = array();
387 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
388 $sql .= $hookmanager->resPrint;
390 $sql .= $hookmanager->resPrint;
392 $sql .=
" WHERE u.entity IN (".getEntity($object->element).
")";
394 $sql .=
" AND u.fk_soc = ".((int) $socid);
397 if ($search_supervisor > 0) {
398 $sql .=
" AND u.fk_user IN (".$db->sanitize($search_supervisor).
")";
400 if ($search_thirdparty !=
'') {
403 if ($search_warehouse > 0) {
404 $sql .=
natural_search(array(
'u.fk_warehouse'), $search_warehouse);
406 if ($search_login !=
'') {
409 if ($search_lastname !=
'') {
412 if ($search_firstname !=
'') {
415 if ($search_gender !=
'' && $search_gender !=
'-1') {
416 $sql .=
" AND u.gender = '".$db->escape($search_gender).
"'";
418 if (is_numeric($search_employee) && $search_employee >= 0) {
419 $sql .=
' AND u.employee = '.(int) $search_employee;
421 if ($search_accountancy_code !=
'') {
422 $sql .=
natural_search(
"u.accountancy_code", $search_accountancy_code);
424 if ($search_phonepro !=
'') {
427 if ($search_phonemobile !=
'') {
430 if ($search_email !=
'') {
433 if ($search_api_key !=
'') {
436 if ($search_statut !=
'' && $search_statut >= 0) {
437 $sql .=
" AND u.statut IN (".$db->sanitize($search_statut).
")";
443 $searchCategoryUserList = array($search_categ);
444 if (!empty($searchCategoryUserList)) {
445 $searchCategoryUserSqlList = array();
446 $listofcategoryid =
'';
447 foreach ($searchCategoryUserList as $searchCategoryUser) {
448 if (intval($searchCategoryUser) == -2) {
449 $searchCategoryUserSqlList[] =
"NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user)";
450 } elseif (intval($searchCategoryUser) > 0) {
451 if ($searchCategoryUserOperator == 0) {
452 $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).
")";
454 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryUser);
458 if ($listofcategoryid) {
459 $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).
"))";
461 if ($searchCategoryUserOperator == 1) {
462 if (!empty($searchCategoryUserSqlList)) {
463 $sql .=
" AND (".implode(
' OR ', $searchCategoryUserSqlList).
")";
466 if (!empty($searchCategoryUserSqlList)) {
467 $sql .=
" AND (".implode(
' AND ', $searchCategoryUserSqlList).
")";
471 if ($search_warehouse > 0) {
472 $sql .=
" AND u.fk_warehouse = ".((int) $search_warehouse);
474 if ($contextpage ==
'employeelist' && !$user->hasRight(
"salaries",
"readall")) {
475 $sql .=
" AND u.rowid IN (".$db->sanitize(join(
',', $childids)).
")";
478 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
480 $parameters = array();
481 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
482 $sql .= $hookmanager->resPrint;
486 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
488 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
489 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
490 $resql = $db->query($sqlforcount);
492 $objforcount = $db->fetch_object(
$resql);
506 $sql .= $db->order($sortfield, $sortorder);
508 $sql .= $db->plimit($limit + 1, $offset);
511 $resql = $db->query($sql);
517 $num = $db->num_rows(
$resql);
520 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
521 $obj = $db->fetch_object(
$resql);
523 header(
"Location: ".DOL_URL_ROOT.
'/user/card.php?id='.$id);
532 $arrayofselected = is_array($toselect) ? $toselect : array();
536 $param .=
'&mode='.urlencode($mode);
538 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
539 $param .=
'&contextpage='.urlencode($contextpage);
541 if ($limit > 0 && $limit != $conf->liste_limit) {
542 $param .=
'&limit='.urlencode($limit);
545 $param .=
'&sall='.urlencode($sall);
547 if ($search_user !=
'') {
548 $param .=
"&search_user=".urlencode($search_user);
550 if ($search_login !=
'') {
551 $param .=
"&search_login=".urlencode($search_login);
553 if ($search_lastname !=
'') {
554 $param .=
"&search_lastname=".urlencode($search_lastname);
556 if ($search_firstname !=
'') {
557 $param .=
"&search_firstname=".urlencode($search_firstname);
559 if ($search_gender !=
'' && $search_gender !=
'-1') {
560 $param .=
"&search_gender=".urlencode($search_gender);
562 if ($search_employee !=
'' && $search_employee !=
'-1') {
563 $param .=
"&search_employee=".urlencode($search_employee);
565 if ($search_accountancy_code !=
'') {
566 $param .=
"&search_accountancy_code=".urlencode($search_accountancy_code);
568 if ($search_phonepro !=
'') {
569 $param .=
"&search_phonepro=".urlencode($search_phonepro);
571 if ($search_phonemobile !=
'') {
572 $param .=
"&search_phonemobile=".urlencode($search_phonemobile);
574 if ($search_email !=
'') {
575 $param .=
"&search_email=".urlencode($search_email);
577 if ($search_api_key !=
'') {
578 $param .=
"&search_api_key=".urlencode($search_api_key);
580 if ($search_supervisor > 0) {
581 $param .=
"&search_supervisor=".urlencode($search_supervisor);
583 if ($search_statut !=
'') {
584 $param .=
"&search_statut=".urlencode($search_statut);
586 if ($optioncss !=
'') {
587 $param .=
'&optioncss='.urlencode($optioncss);
589 if ($search_categ > 0) {
590 $param .=
'&search_categ='.urlencode($search_categ);
592 if ($search_warehouse > 0) {
593 $param .=
'&search_warehouse='.urlencode($search_warehouse);
596 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
599 $arrayofmassactions = array();
600 if ($permissiontoadd) {
601 $arrayofmassactions[
'disable'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"DisableUser");
603 if ($permissiontoadd) {
604 $arrayofmassactions[
'reactivate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Reactivate");
607 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
609 if ($permissiontoadd) {
610 $arrayofmassactions[
'presetsupervisor'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"SetSupervisor");
614 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'presetsupervisor'))) {
615 $arrayofmassactions = array();
617 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
619 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
620 if ($optioncss !=
'') {
621 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
623 print
'<input type="hidden" name="token" value="'.newToken().
'">';
624 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
625 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
626 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
627 print
'<input type="hidden" name="page" value="'.$page.
'">';
628 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
629 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
631 $url = DOL_URL_ROOT.
'/user/card.php?action=create'.($contextpage ==
'employeelist' ?
'&search_employee=1' :
'').
'&leftmenu=';
632 if (!empty($socid)) {
633 $url .=
'&socid='.urlencode($socid);
637 $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'));
638 $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'));
639 $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'));
641 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewUser'),
'',
'fa fa-plus-circle', $url,
'', $permissiontoadd);
648 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'user', 0, $morehtmlright.
' '.$newcardbutton,
'', $limit, 0, 0, 1);
653 $topicmail =
"SendUserRef";
655 $objecttmp =
new User($db);
656 $trackid =
'use'.$object->id;
657 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
659 if (!empty($catid)) {
660 print
"<div id='ways'>";
662 $ways = $c->print_all_ways(
' > ',
'user/list.php');
663 print
" > ".$ways[0].
"<br>\n";
668 foreach ($fieldstosearchall as $key => $val) {
669 $fieldstosearchall[$key] = $langs->trans($val);
671 print
'<!-- Search done like if USER_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
672 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
681 if (
isModEnabled(
'categorie') && $user->hasRight(
"categorie",
"read")) {
682 $moreforfilter .=
'<div class="divsearchfield">';
683 $tmptitle = $langs->trans(
'Category');
684 $moreforfilter .=
img_picto($langs->trans(
"Category"),
'category',
'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ,
'search_categ', 1, $tmptitle);
685 $moreforfilter .=
'</div>';
688 if (
isModEnabled(
'stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
689 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
691 $moreforfilter .=
'<div class="divsearchfield">';
692 $tmptitle = $langs->trans(
'Warehouse');
693 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
694 $moreforfilter .=
'</div>';
697 $parameters = array();
698 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
699 if (empty($reshook)) {
700 $moreforfilter .= $hookmanager->resPrint;
702 $moreforfilter = $hookmanager->resPrint;
705 if (!empty($moreforfilter)) {
706 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
707 print $moreforfilter;
711 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
712 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
713 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
715 print
'<div class="div-table-responsive">';
716 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
720 print
'<tr class="liste_titre">';
722 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
723 print
'<td class="liste_titre maxwidthsearch">';
724 $searchpicto =
$form->showFilterButtons(
'left');
728 if (!empty($arrayfields[
'u.login'][
'checked'])) {
729 print
'<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.
'"></td>';
731 if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
732 print
'<td class="liste_titre"><input type="text" name="search_lastname" class="maxwidth50" value="'.$search_lastname.
'"></td>';
734 if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
735 print
'<td class="liste_titre"><input type="text" name="search_firstname" class="maxwidth50" value="'.$search_firstname.
'"></td>';
737 if (!empty($arrayfields[
'u.gender'][
'checked'])) {
738 print
'<td class="liste_titre center">';
739 $arraygender = array(
'man'=>$langs->trans(
"Genderman"),
'woman'=>$langs->trans(
"Genderwoman"),
'other'=>$langs->trans(
"Genderother"));
740 print
$form->selectarray(
'search_gender', $arraygender, $search_gender, 1);
743 if (!empty($arrayfields[
'u.employee'][
'checked'])) {
744 print
'<td class="liste_titre">';
745 print
$form->selectyesno(
'search_employee', $search_employee, 1,
false, 1);
749 if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
750 print
'<td class="liste_titre">';
751 print
$form->select_dolusers($search_supervisor,
'search_supervisor', 1, array(), 0,
'', 0, 0, 0, 0,
'', 0,
'',
'maxwidth150');
754 if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
755 print
'<td class="liste_titre"><input type="text" name="search_accountancy_code" class="maxwidth50" value="'.$search_accountancy_code.
'"></td>';
757 if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
758 print
'<td class="liste_titre"><input type="text" name="search_phonepro" class="maxwidth50" value="'.$search_phonepro.
'"></td>';
760 if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
761 print
'<td class="liste_titre"><input type="text" name="search_phonemobile" class="maxwidth50" value="'.$search_phonemobile.
'"></td>';
763 if (!empty($arrayfields[
'u.email'][
'checked'])) {
764 print
'<td class="liste_titre"><input type="text" name="search_email" class="maxwidth75" value="'.$search_email.
'"></td>';
766 if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
767 print
'<td class="liste_titre"><input type="text" name="search_api_key" class="maxwidth50" value="'.$search_api_key.
'"></td>';
769 if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
770 print
'<td class="liste_titre"><input type="text" name="search_thirdparty" class="maxwidth75" value="'.$search_thirdparty.
'"></td>';
772 if (!empty($arrayfields[
'u.entity'][
'checked'])) {
773 print
'<td class="liste_titre"></td>';
775 if (!empty($arrayfields[
'u.salary'][
'checked'])) {
776 print
'<td class="liste_titre"></td>';
778 if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
779 print
'<td class="liste_titre"></td>';
781 if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
782 print
'<td class="liste_titre"></td>';
785 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
787 $parameters = array(
'arrayfields'=>$arrayfields);
788 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
789 print $hookmanager->resPrint;
790 if (!empty($arrayfields[
'u.datec'][
'checked'])) {
792 print
'<td class="liste_titre">';
795 if (!empty($arrayfields[
'u.tms'][
'checked'])) {
797 print
'<td class="liste_titre">';
800 if (!empty($arrayfields[
'u.statut'][
'checked'])) {
802 print
'<td class="liste_titre center">';
803 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 minwidth75imp maxwidth125 onrightofpage');
807 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
808 print
'<td class="liste_titre maxwidthsearch">';
809 $searchpicto =
$form->showFilterButtons();
815 $totalarray = array();
816 $totalarray[
'nbfield'] = 0;
820 print
'<tr class="liste_titre">';
821 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
822 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
823 $totalarray[
'nbfield']++;
825 if (!empty($arrayfields[
'u.login'][
'checked'])) {
827 $totalarray[
'nbfield']++;
829 if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
830 print_liste_field_titre(
"Lastname", $_SERVER[
'PHP_SELF'],
"u.lastname", $param,
"",
"", $sortfield, $sortorder);
831 $totalarray[
'nbfield']++;
833 if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
834 print_liste_field_titre(
"FirstName", $_SERVER[
'PHP_SELF'],
"u.firstname", $param,
"",
"", $sortfield, $sortorder);
835 $totalarray[
'nbfield']++;
837 if (!empty($arrayfields[
'u.gender'][
'checked'])) {
838 print_liste_field_titre(
"Gender", $_SERVER[
'PHP_SELF'],
"u.gender", $param,
"",
"", $sortfield, $sortorder,
'center ');
839 $totalarray[
'nbfield']++;
841 if (!empty($arrayfields[
'u.employee'][
'checked'])) {
842 print_liste_field_titre(
"Employee", $_SERVER[
'PHP_SELF'],
"u.employee", $param,
"",
"", $sortfield, $sortorder,
'center ');
843 $totalarray[
'nbfield']++;
845 if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
846 print_liste_field_titre(
"HierarchicalResponsible", $_SERVER[
'PHP_SELF'],
"u.fk_user", $param,
"",
"", $sortfield, $sortorder);
847 $totalarray[
'nbfield']++;
849 if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
850 print_liste_field_titre(
"AccountancyCode", $_SERVER[
'PHP_SELF'],
"u.accountancy_code", $param,
"",
"", $sortfield, $sortorder);
851 $totalarray[
'nbfield']++;
853 if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
854 print_liste_field_titre(
"PhonePro", $_SERVER[
'PHP_SELF'],
"u.office_phone", $param,
"",
"", $sortfield, $sortorder);
855 $totalarray[
'nbfield']++;
857 if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
858 print_liste_field_titre(
"PhoneMobile", $_SERVER[
'PHP_SELF'],
"u.user_mobile", $param,
"",
"", $sortfield, $sortorder);
859 $totalarray[
'nbfield']++;
861 if (!empty($arrayfields[
'u.email'][
'checked'])) {
863 $totalarray[
'nbfield']++;
865 if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
867 $totalarray[
'nbfield']++;
869 if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
871 $totalarray[
'nbfield']++;
873 if (!empty($arrayfields[
'u.entity'][
'checked'])) {
875 $totalarray[
'nbfield']++;
877 if (!empty($arrayfields[
'u.salary'][
'checked'])) {
878 print_liste_field_titre(
"Salary", $_SERVER[
'PHP_SELF'],
"u.salary", $param,
"",
"", $sortfield, $sortorder,
'right ');
879 $totalarray[
'nbfield']++;
881 if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
882 print_liste_field_titre(
"LastConnexion", $_SERVER[
'PHP_SELF'],
"u.datelastlogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
883 $totalarray[
'nbfield']++;
885 if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
886 print_liste_field_titre(
"PreviousConnexion", $_SERVER[
'PHP_SELF'],
"u.datepreviouslogin", $param,
"",
'', $sortfield, $sortorder,
'center ');
887 $totalarray[
'nbfield']++;
890 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
892 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
893 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
894 print $hookmanager->resPrint;
895 if (!empty($arrayfields[
'u.datec'][
'checked'])) {
896 print_liste_field_titre(
"DateCreationShort", $_SERVER[
"PHP_SELF"],
"u.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
897 $totalarray[
'nbfield']++;
899 if (!empty($arrayfields[
'u.tms'][
'checked'])) {
900 print_liste_field_titre(
"DateModificationShort", $_SERVER[
"PHP_SELF"],
"u.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
901 $totalarray[
'nbfield']++;
903 if (!empty($arrayfields[
'u.statut'][
'checked'])) {
904 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"u.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
905 $totalarray[
'nbfield']++;
908 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
909 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
910 $totalarray[
'nbfield']++;
916 $needToFetchEachLine = 0;
917 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
918 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
919 if (preg_match(
'/\$object/', $val)) {
920 $needToFetchEachLine++;
929 $savnbfield = $totalarray[
'nbfield'];
930 $totalarray[
'nbfield'] = 0;
931 $imaxinloop = ($limit ? min($num, $limit) : $num);
932 while ($i < $imaxinloop) {
933 $obj = $db->fetch_object(
$resql);
938 if (empty($obj->country_code)) $obj->country_code =
'';
941 $object->setVarsFromFetchObj($obj);
943 $object->id = $obj->rowid;
944 $object->admin = $obj->admin;
945 $object->ref = $obj->rowid;
946 $object->login = $obj->login;
947 $object->statut = $obj->status;
948 $object->status = $obj->status;
949 $object->office_phone = $obj->office_phone;
950 $object->user_mobile = $obj->user_mobile;
951 $object->email = $obj->email;
952 $object->gender = $obj->gender;
953 $object->socid = $obj->fk_soc;
954 $object->firstname = $obj->firstname;
955 $object->lastname = $obj->lastname;
956 $object->employee = $obj->employee;
957 $object->photo = $obj->photo;
959 $li = $object->getNomUrl(-1,
'', 0, 0, 24, 1,
'login',
'', 1);
962 if ((!empty($conf->salaries->enabled) && $user->hasRight(
"salaries",
"read") && in_array($obj->rowid, $childids))
963 || (!empty($conf->salaries->enabled) && $user->hasRight(
"salaries",
"readall"))
964 || (
isModEnabled(
'hrm') && $user->hasRight(
"hrm",
"employee",
"read"))) {
967 $canreadsecretapi = 0;
968 if ($user->id == $obj->rowid || !empty($user->admin)) {
969 $canreadsecretapi = 1;
972 if ($mode ==
'kanban') {
974 print
'<tr><td colspan="'.$savnbfield.
'">';
975 print
'<div class="box-flex-container">';
979 print $object->getKanbanView(
'');
980 if ($i == ($imaxinloop - 1)) {
987 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
989 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
990 print
'<td class="nowrap center">';
991 if ($massactionbutton || $massaction) {
993 if (in_array($object->id, $arrayofselected)) {
996 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1001 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1002 print
'<td class="nowraponall tdoverflowmax150">';
1004 if (
isModEnabled(
'multicompany') && $obj->admin && !$obj->entity) {
1005 print
img_picto($langs->trans(
"SuperAdministrator"),
'redstar',
'class="valignmiddle paddingleft"');
1006 } elseif ($obj->admin) {
1007 print
img_picto($langs->trans(
"Administrator"),
'star',
'class="valignmiddle paddingleft"');
1011 $totalarray[
'nbfield']++;
1014 if (!empty($arrayfields[
'u.lastname'][
'checked'])) {
1015 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->lastname).
'</td>';
1017 $totalarray[
'nbfield']++;
1020 if (!empty($arrayfields[
'u.firstname'][
'checked'])) {
1021 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->firstname).
'</td>';
1023 $totalarray[
'nbfield']++;
1026 if (!empty($arrayfields[
'u.gender'][
'checked'])) {
1027 print
'<td class="center">';
1031 switch ($obj->gender) {
1033 $addgendertxt .=
'<i class="fas fa-mars" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1036 $addgendertxt .=
'<i class="fas fa-venus" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1039 $addgendertxt .=
'<i class="fas fa-transgender" title="'.dol_escape_htmltag($langs->trans(
"Gender".$obj->gender)).
'"></i>';
1042 print $addgendertxt;
1047 $totalarray[
'nbfield']++;
1051 if (!empty($arrayfields[
'u.employee'][
'checked'])) {
1052 print
'<td class="center">'.yn($obj->employee).
'</td>';
1054 $totalarray[
'nbfield']++;
1059 if (!empty($arrayfields[
'u.fk_user'][
'checked'])) {
1061 print
'<td class="nowrap">';
1063 $user2->id = $obj->id2;
1064 $user2->login = $obj->login2;
1065 $user2->lastname = $obj->lastname2;
1066 $user2->firstname = $obj->firstname2;
1067 $user2->gender = $obj->gender2;
1068 $user2->photo = $obj->photo2;
1069 $user2->admin = $obj->admin2;
1070 $user2->office_phone = $obj->office_phone;
1071 $user2->user_mobile = $obj->user_mobile;
1072 $user2->email = $obj->email2;
1073 $user2->socid = $obj->fk_soc2;
1074 $user2->statut = $obj->status2;
1075 $user2->status = $obj->status2;
1076 print $user2->getNomUrl(-1,
'', 0, 0, 24, 0,
'',
'', 1);
1077 if (
isModEnabled(
'multicompany') && $obj->admin2 && !$obj->entity2) {
1078 print
img_picto($langs->trans(
"SuperAdministrator"),
'redstar',
'class="valignmiddle paddingleft"');
1079 } elseif ($obj->admin2) {
1080 print
img_picto($langs->trans(
"Administrator"),
'star',
'class="valignmiddle paddingleft"');
1085 $totalarray[
'nbfield']++;
1089 if (!empty($arrayfields[
'u.accountancy_code'][
'checked'])) {
1090 print
'<td>'.$obj->accountancy_code.
'</td>';
1092 $totalarray[
'nbfield']++;
1097 if (!empty($arrayfields[
'u.office_phone'][
'checked'])) {
1098 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'phone').
"</td>\n";
1100 $totalarray[
'nbfield']++;
1103 if (!empty($arrayfields[
'u.user_mobile'][
'checked'])) {
1104 print
'<td class="tdoverflowmax125">'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid,
'AC_TEL',
' ',
'mobile').
"</td>\n";
1106 $totalarray[
'nbfield']++;
1109 if (!empty($arrayfields[
'u.email'][
'checked'])) {
1110 print
'<td class="tdoverflowmax150">'.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc,
'AC_EMAIL', 0, 0, 1).
"</td>\n";
1112 $totalarray[
'nbfield']++;
1115 if (!empty($arrayfields[
'u.api_key'][
'checked'])) {
1116 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->api_key).
'">';
1117 if ($obj->api_key) {
1118 if ($canreadsecretapi) {
1121 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1126 $totalarray[
'nbfield']++;
1129 if (!empty($arrayfields[
'u.fk_soc'][
'checked'])) {
1130 print
'<td class="tdoverflowmax150">';
1131 if ($obj->fk_soc > 0) {
1132 $companystatic->id = $obj->fk_soc;
1133 $companystatic->name = $obj->name;
1134 $companystatic->canvas = $obj->canvas;
1135 print $companystatic->getNomUrl(1);
1136 } elseif ($obj->ldap_sid) {
1137 print
'<span class="opacitymedium">'.$langs->trans(
"DomainUser").
'</span>';
1139 print
'<span class="opacitymedium">'.$langs->trans(
"InternalUser").
'</span>';
1143 $totalarray[
'nbfield']++;
1147 if (
isModEnabled(
'multicompany') && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
1148 if (!empty($arrayfields[
'u.entity'][
'checked'])) {
1150 if (!$obj->entity) {
1151 print $langs->trans(
"AllEntities");
1153 $mc->getInfo($obj->entity);
1158 $totalarray[
'nbfield']++;
1164 if (!empty($arrayfields[
'u.salary'][
'checked'])) {
1165 print
'<td class="nowraponall right amount">';
1167 if ($canreadhrmdata) {
1168 print
price($obj->salary);
1170 print
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
1175 $totalarray[
'nbfield']++;
1180 if (!empty($arrayfields[
'u.datelastlogin'][
'checked'])) {
1181 print
'<td class="nowrap center">'.dol_print_date($db->jdate($obj->datelastlogin),
"dayhour").
'</td>';
1183 $totalarray[
'nbfield']++;
1187 if (!empty($arrayfields[
'u.datepreviouslogin'][
'checked'])) {
1188 print
'<td class="nowrap center">'.dol_print_date($db->jdate($obj->datepreviouslogin),
"dayhour").
'</td>';
1190 $totalarray[
'nbfield']++;
1195 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1197 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1198 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
1199 print $hookmanager->resPrint;
1201 if (!empty($arrayfields[
'u.datec'][
'checked'])) {
1202 print
'<td class="center">';
1203 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1206 $totalarray[
'nbfield']++;
1210 if (!empty($arrayfields[
'u.tms'][
'checked'])) {
1211 print
'<td class="center">';
1212 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1215 $totalarray[
'nbfield']++;
1219 if (!empty($arrayfields[
'u.statut'][
'checked'])) {
1220 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
1222 $totalarray[
'nbfield']++;
1226 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1227 print
'<td class="nowrap center">';
1228 if ($massactionbutton || $massaction) {
1230 if (in_array($object->id, $arrayofselected)) {
1233 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1238 $totalarray[
'nbfield']++;
1248 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1253 foreach ($arrayfields as $key => $val) {
1254 if (!empty($val[
'checked'])) {
1258 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1264 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1265 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
1266 print $hookmanager->resPrint;
1268 print
'</table>'.
"\n";
1269 print
'</div>'.
"\n";
1271 print
'</form>'.
"\n";
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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...
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.