40require
'../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
47$langs->loadLangs(array(
"companies",
"suppliers",
"categories"));
52$action =
GETPOST(
'action',
'aZ09');
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$toselect =
GETPOST(
'toselect',
'array');
57$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'contactlist';
58$mode =
GETPOST(
'mode',
'alpha');
60if ($contextpage ==
'poslist') {
69$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
70$search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
71$search_phone =
GETPOST(
"search_phone",
'alpha');
73$search_id =
GETPOST(
"search_id",
"intcomma");
74$search_firstlast_only =
GETPOST(
"search_firstlast_only",
'alpha');
75$search_lastname =
GETPOST(
"search_lastname",
'alpha');
76$search_firstname =
GETPOST(
"search_firstname",
'alpha');
77$search_societe =
GETPOST(
"search_societe",
'alpha');
78$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
79$search_poste =
GETPOST(
"search_poste",
'alpha');
80$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
81$search_phone_pro =
GETPOST(
"search_phone_pro",
'alpha');
82$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
83$search_fax =
GETPOST(
"search_fax",
'alpha');
84$search_email =
GETPOST(
"search_email",
'alpha');
85if (isModEnabled(
'mailing')) {
86 $search_no_email = GETPOSTISSET(
"search_no_email") ?
GETPOSTINT(
"search_no_email") : -1;
88 $search_no_email = -1;
93if (isModEnabled(
'socialnetworks')) {
94 foreach ($socialnetworks as $key => $value) {
95 if ($value[
'active']) {
96 $search_[$key] =
GETPOST(
"search_".$key,
'alpha');
100$search_priv =
GETPOST(
"search_priv",
'alpha');
101$search_sale =
GETPOST(
'search_sale',
'intcomma');
102$search_categ =
GETPOST(
"search_categ",
'intcomma');
103$search_categ_thirdparty =
GETPOST(
"search_categ_thirdparty",
'intcomma');
104$search_categ_supplier =
GETPOST(
"search_categ_supplier",
'intcomma');
105$search_status =
GETPOST(
"search_status",
"intcomma");
106$search_type =
GETPOST(
'search_type',
'alpha');
107$search_address =
GETPOST(
'search_address',
'alpha');
108$search_zip =
GETPOST(
'search_zip',
'alpha');
109$search_town =
GETPOST(
'search_town',
'alpha');
110$search_import_key =
GETPOST(
"search_import_key",
'alpha');
111$search_country =
GETPOST(
"search_country",
'aZ09');
112$search_roles =
GETPOST(
"search_roles",
'array');
113$search_level =
GETPOST(
"search_level",
'array');
114$search_stcomm =
GETPOST(
'search_stcomm',
'intcomma');
118if ($search_status ===
'') {
121if ($search_no_email ===
'') {
122 $search_no_email = -1;
125$optioncss =
GETPOST(
'optioncss',
'alpha');
127$place =
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0';
130$view =
GETPOST(
"view",
'alpha');
137$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
138$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
144 $sortfield =
"p.lastname";
146if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
150$offset = $limit * $page;
151$pageprev = $page - 1;
152$pagenext = $page + 1;
155$title = (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
157 if (empty($contextpage) || $contextpage ==
'contactlist') {
158 $contextpage =
'contactprospectlist';
160 $title .=
' ('.$langs->trans(
"ThirdPartyProspects").
')';
161 $urlfiche =
"card.php";
164 if (empty($contextpage) || $contextpage ==
'contactlist') {
165 $contextpage =
'contactcustomerlist';
167 $title .=
' ('.$langs->trans(
"ThirdPartyCustomers").
')';
168 $urlfiche =
"card.php";
169} elseif ($type ==
"f") {
170 if (empty($contextpage) || $contextpage ==
'contactlist') {
171 $contextpage =
'contactsupplierlist';
173 $title .=
' ('.$langs->trans(
"ThirdPartySuppliers").
')';
174 $urlfiche =
"card.php";
175} elseif ($type ==
"o") {
176 if (empty($contextpage) || $contextpage ==
'contactlist') {
177 $contextpage =
'contactotherlist';
179 $title .=
' ('.$langs->trans(
"OthersNotLinkedToThirdParty").
')';
186$hookmanager->initHooks(array($contextpage));
188if ($user->socid > 0) {
189 $socid = $user->socid;
194$extrafields->fetch_name_optionals_label(
$object->table_element);
196$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
199$fieldstosearchall = array();
200foreach (
$object->fields as $key => $val) {
202 if (!empty($user->socid) && $key ==
"note_private") {
206 if (empty($val[
'searchall'])) {
210 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
215 $fieldstosearchall[
's.nom'] =
"ThirdParty";
216 $fieldstosearchall[
's.name_alias'] =
"AliasNames";
219$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
220$reshook = $hookmanager->executeHooks(
'completeFieldsToSearchAll', $parameters, $object, $action);
222 $fieldstosearchall = empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall'];
223} elseif ($reshook == 0) {
224 $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall']);
228$arrayfields = array();
229foreach (
$object->fields as $key => $val) {
231 if (!empty($val[
'visible'])) {
232 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
233 $arrayfields[
'p.'.$key] = array(
234 'label' => $val[
'label'],
235 'checked' => (($visible < 0) ? 0 : 1),
236 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
237 'position' => $val[
'position'],
238 'help' => isset($val[
'help']) ? $val[
'help'] :
''
244$arrayfields[
'country.code_iso'] = array(
'label' =>
"Country",
'position' => 66,
'checked' => 0);
246 $arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'position' => 113,
'checked' => 1);
247 $arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'position' => 114,
'checked' => 1);
250$arrayfields[
'unsubscribed'] = array(
251 'label' =>
'No_Email',
253 'enabled' => (isModEnabled(
'mailing')),
256if (isModEnabled(
'socialnetworks')) {
257 foreach ($socialnetworks as $key => $value) {
258 if ($value[
'active']) {
259 $arrayfields[
'p.'.$key] = array(
260 'label' => $value[
'label'],
269include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
274'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
277if ((
$id > 0 || !empty($ref)) && $action !=
'add') {
284$permissiontoread = $user->hasRight(
'societe',
'contact',
'lire');
285$permissiontodelete = $user->hasRight(
'societe',
'contact',
'supprimer');
286$permissiontoadd = $user->hasRight(
'societe',
'contact',
'creer');
288if (!$permissiontoread) {
297if ($action ==
"change" && $user->hasRight(
'takepos',
'run')) {
302 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' AND entity IN (".
getEntity(
'invoice').
")";
303 $result = $db->query($sql);
304 $num_lines = $db->num_rows($result);
305 if ($num_lines == 0) {
306 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
308 $constforthirdpartyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"];
311 $invoice->module_source =
'takepos';
312 $invoice->pos_source = $_SESSION[
"takeposterminal"];
313 $placeid = $invoice->create($user);
314 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' where rowid = ".((int) $placeid);
318 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set fk_soc=".((int) $idcustomer).
" where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")'";
319 $resql = $db->query($sql);
322 if (!isset($invoice)) {
323 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
325 $invoice->fetch(
null,
"(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")");
326 $invoice->delete_linked_contact(
'external',
'BILLING');
328 $invoice->add_contact($idcontact,
'BILLING'); ?>
330 console.log(
"Reload page invoice.php with place=<?php print $place; ?>");
331 parent.$(
"#poslines").load(
"invoice.php?place=<?php print $place; ?>",
function() {
333 <?php
if (!$resql) { ?>
334 alert(
'Error failed to update customer on draft invoice.');
336 parent.$(
"#idcustomer").val(<?php echo $idcustomer; ?>);
337 parent.$.colorbox.close();
344if (
GETPOST(
'cancel',
'alpha')) {
348if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
352$parameters = array(
'arrayfields' => &$arrayfields);
353$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
358if (empty($reshook)) {
360 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
363 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
366 $search_firstlast_only =
"";
367 $search_lastname =
"";
368 $search_firstname =
"";
369 $search_societe =
"";
370 $search_societe_alias =
"";
372 $search_address =
"";
374 $search_country =
"";
377 $search_phone_perso =
"";
378 $search_phone_pro =
"";
379 $search_phone_mobile =
"";
382 $search_no_email = -1;
383 if (isModEnabled(
'socialnetworks')) {
384 foreach ($socialnetworks as $key => $value) {
385 if ($value[
'active']) {
396 $search_categ_thirdparty =
'';
397 $search_categ_supplier =
'';
398 $search_import_key =
'';
400 $search_array_options = array();
401 $search_roles = array();
402 $search_birthday_start =
'';
403 $search_birthday_end =
'';
407 $objectclass =
'Contact';
408 $objectlabel =
'Contact';
409 $uploaddir = $conf->societe->dir_output;
410 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
412 if ($action ==
'setstcomm' && $permissiontoadd) {
425if ($search_priv < 0) {
430if (!$user->hasRight(
'societe',
'client',
'voir')) {
431 $socid = $user->socid;
439$form =
new Form($db);
442$contactstatic =
new Contact($db);
446$title = $langs->trans(
"Contacts").
" - ".$langs->trans(
"List");
447$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
452 $contactstatic->loadCacheOfProspStatus();
455$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
456$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
460$sql =
"SELECT code, label, sortorder";
461$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
462$sql .=
" WHERE active > 0";
463$sql .=
" ORDER BY sortorder";
464$resql = $db->query($sql);
466 while ($obj = $db->fetch_object($resql)) {
468 $level = $langs->trans($obj->code);
469 if ($level == $obj->code) {
470 $level = $langs->trans($obj->label);
472 $tab_level[$obj->code] = $level;
480$sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias as alias,";
481$sql .=
" p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.birthday,";
482$sql .=
" p.socialnetworks, p.photo,";
483$sql .=
" p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_modification,";
484$sql .=
" p.import_key, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,";
485$sql .=
" st.libelle as stcomm, st.picto as stcomm_picto,";
486$sql .=
" co.label as country, co.code as country_code";
488if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
489 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
490 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
493if (isModEnabled(
'mailing')) {
494 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) as unsubscribed";
498$parameters = array();
499$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
500$sql .= $hookmanager->resPrint;
501$sql = preg_replace(
'/,\s*$/',
'', $sql);
505$sql .=
" FROM ".MAIN_DB_PREFIX.
"socpeople as p";
506if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
507 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
509$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as co ON co.rowid = p.fk_pays";
510$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = p.fk_soc";
511$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_stcommcontact as st ON st.id = p.fk_stcommcontact";
514$parameters = array();
515$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
516$sql .= $hookmanager->resPrint;
517$sql .=
' WHERE p.entity IN ('.getEntity(
'contact').
')';
518if (!empty($userid)) {
519 $sql .=
" AND p.fk_user_creat=".((int) $userid);
522 $sql .=
natural_search(
"p.fk_prospectlevel", implode(
',', $search_level), 3);
524if ($search_stcomm !=
'' && $search_stcomm != -2) {
529if ($search_priv !=
'0' && $search_priv !=
'1') {
530 $sql .=
" AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
"))";
532 if ($search_priv ==
'0') {
533 $sql .=
" AND p.priv='0'";
535 if ($search_priv ==
'1') {
536 $sql .=
" AND (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
")";
540if (!empty($search_sale) && $search_sale !=
'-1') {
541 if ($search_sale == -2) {
542 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
543 } elseif ($search_sale > 0) {
544 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
549$searchCategoryContactList = $search_categ ? array($search_categ) : array();
550$searchCategoryContactOperator = 0;
552if (!empty($searchCategoryContactList)) {
553 $searchCategoryContactSqlList = array();
554 $listofcategoryid =
'';
555 foreach ($searchCategoryContactList as $searchCategoryContact) {
556 if (intval($searchCategoryContact) == -2) {
557 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX.
"categorie_contact as ck WHERE p.rowid = ck.fk_socpeople)";
558 } elseif (intval($searchCategoryContact) > 0) {
559 if ($searchCategoryContactOperator == 0) {
560 $searchCategoryContactSqlList[] =
" EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX.
"categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).
")";
562 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
566 if ($listofcategoryid) {
567 $searchCategoryContactSqlList[] =
" EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX.
"categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
569 if ($searchCategoryContactOperator == 1) {
570 if (!empty($searchCategoryContactSqlList)) {
571 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
574 if (!empty($searchCategoryContactSqlList)) {
575 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
581$searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array();
582$searchCategoryCustomerOperator = 0;
584if (!empty($searchCategoryCustomerList)) {
585 $searchCategoryCustomerSqlList = array();
586 $listofcategoryid =
'';
587 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
588 if (intval($searchCategoryCustomer) == -2) {
589 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
590 } elseif (intval($searchCategoryCustomer) > 0) {
591 if ($searchCategoryCustomerOperator == 0) {
592 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).
")";
594 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
598 if ($listofcategoryid) {
599 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
601 if ($searchCategoryCustomerOperator == 1) {
602 if (!empty($searchCategoryCustomerSqlList)) {
603 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
606 if (!empty($searchCategoryCustomerSqlList)) {
607 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
613$searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array();
614$searchCategorySupplierOperator = 0;
616if (!empty($searchCategorySupplierList)) {
617 $searchCategorySupplierSqlList = array();
618 $listofcategoryid =
'';
619 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
620 if (intval($searchCategorySupplier) == -2) {
621 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
622 } elseif (intval($searchCategorySupplier) > 0) {
623 if ($searchCategorySupplierOperator == 0) {
624 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).
")";
626 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
630 if ($listofcategoryid) {
631 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
633 if ($searchCategorySupplierOperator == 1) {
634 if (!empty($searchCategorySupplierSqlList)) {
635 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
638 if (!empty($searchCategorySupplierSqlList)) {
639 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
645 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
647if (strlen($search_phone)) {
648 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_phone);
650if (strlen($search_cti)) {
651 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_cti);
653if (strlen($search_firstlast_only)) {
654 $sql .=
natural_search(array(
'p.lastname',
'p.firstname'), $search_firstlast_only);
660if ($search_lastname) {
663if ($search_firstname) {
666if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
667 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
669 if ($search_societe) {
672 if ($search_societe_alias) {
676if ($search_country) {
677 $sql .=
" AND p.fk_pays IN (".$db->sanitize($search_country).
')';
679if (strlen($search_poste)) {
682if (strlen($search_phone_perso)) {
685if (strlen($search_phone_pro)) {
688if (strlen($search_phone_mobile)) {
691if (strlen($search_fax)) {
694if (isModEnabled(
'socialnetworks')) {
695 foreach ($socialnetworks as $key => $value) {
696 if ($value[
'active'] && strlen($search_[$key])) {
697 $searchkeyinjsonformat = preg_replace(
'/"$/',
'', preg_replace(
'/^"/',
'', json_encode($search_[$key])));
698 if (in_array($db->type, array(
'mysql',
'mysqli'))) {
699 $sql .=
" AND p.socialnetworks REGEXP '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
700 } elseif ($db->type ==
'pgsql') {
701 $sql .=
" AND p.socialnetworks ~ '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
704 $sql .=
" AND p.socialnetworks LIKE '%\"".$db->escape($db->escapeforlike($key)).
"\":\"".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"%'";
711if (strlen($search_email)) {
714if (strlen($search_address)) {
717if (strlen($search_zip)) {
720if (strlen($search_town)) {
723if (count($search_roles) > 0) {
724 $sql .=
" AND EXISTS (SELECT sc.rowid FROM ".MAIN_DB_PREFIX.
"societe_contacts as sc WHERE p.rowid = sc.fk_socpeople AND sc.fk_c_type_contact IN (".$db->sanitize(implode(
',', $search_roles)).
"))";
726if ($search_no_email != -1 && $search_no_email > 0) {
727 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) > 0";
729if ($search_no_email != -1 && $search_no_email == 0) {
730 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
732if ($search_status !=
'' && $search_status >= 0) {
733 $sql .=
" AND p.statut = ".((int) $search_status);
735if ($search_import_key) {
739 $sql .=
" AND p.fk_soc IS NULL";
740} elseif ($type ==
"f") {
741 $sql .=
" AND s.fournisseur = 1";
742} elseif ($type ==
"c") {
743 $sql .=
" AND s.client IN (1, 3)";
744} elseif ($type ==
"p") {
745 $sql .=
" AND s.client IN (2, 3)";
748 $sql .=
" AND s.rowid = ".((int) $socid);
750if ($search_birthday_start) {
751 $sql .=
" AND p.birthday >= '".$db->idate($search_birthday_start).
"'";
753if ($search_birthday_end) {
754 $sql .=
" AND p.birthday <= '".$db->idate($search_birthday_end).
"'";
758include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
761$parameters = array();
762$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
763$sql .= $hookmanager->resPrint;
767$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
768$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
769$sql .= $hookmanager->resPrint;
773$nbtotalofrecords =
'';
776 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
777 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
778 $resql = $db->query($sqlforcount);
780 $objforcount = $db->fetch_object($resql);
781 $nbtotalofrecords = $objforcount->nbtotalofrecords;
786 if (($page * $limit) > $nbtotalofrecords) {
794if ($view ==
"recent") {
795 $sql .= $db->order(
"p.datec",
"DESC");
797 $sql .= $db->order($sortfield, $sortorder);
800 $sql .= $db->plimit($limit + 1, $offset);
803$resql = $db->query($sql);
809$num = $db->num_rows($resql);
812if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($search_all !=
'' || $search_cti !=
'') && !$page) {
813 $obj = $db->fetch_object($resql);
815 header(
"Location: ".DOL_URL_ROOT.
'/contact/card.php?id='.
$id);
823llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-societe page-contact-list bodyforlist');
825$arrayofselected = is_array($toselect) ? $toselect : array();
829 $param .=
'&mode='.urlencode($mode);
831if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
832 $param .=
'&contextpage='.urlencode($contextpage);
834if ($limit > 0 && $limit != $conf->liste_limit) {
835 $param .=
'&limit='.((int) $limit);
837if ($optioncss !=
'') {
838 $param .=
'&optioncss='.urlencode($optioncss);
840$param .=
'&begin='.urlencode((
string) ($begin)).
'&userid='.urlencode((
string) ($userid)).
'&contactname='.urlencode((
string) ($search_all));
841$param .=
'&type='.urlencode($type).
'&view='.urlencode($view);
842if (!empty($search_sale) && $search_sale !=
'-1') {
843 $param .=
'&search_sale='.urlencode($search_sale);
845if (!empty($search_categ) && $search_categ !=
'-1') {
846 $param .=
'&search_categ='.urlencode((
string) ($search_categ));
848if (!empty($search_categ_thirdparty) && $search_categ_thirdparty !=
'-1') {
849 $param .=
'&search_categ_thirdparty='.urlencode((
string) ($search_categ_thirdparty));
851if (!empty($search_categ_supplier) && $search_categ_supplier !=
'-1') {
852 $param .=
'&search_categ_supplier='.urlencode((
string) ($search_categ_supplier));
854if ($search_all !=
'') {
855 $param .=
'&search_all='.urlencode($search_all);
858 $param .=
"&search_id=".urlencode((
string) ($search_id));
860if ($search_lastname !=
'') {
861 $param .=
'&search_lastname='.urlencode($search_lastname);
863if ($search_firstname !=
'') {
864 $param .=
'&search_firstname='.urlencode($search_firstname);
866if ($search_societe !=
'') {
867 $param .=
'&search_societe='.urlencode($search_societe);
869if ($search_societe_alias !=
'') {
870 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
872if ($search_address !=
'') {
873 $param .=
'&search_address='.urlencode($search_address);
875if ($search_zip !=
'') {
876 $param .=
'&search_zip='.urlencode($search_zip);
878if ($search_town !=
'') {
879 $param .=
'&search_town='.urlencode($search_town);
881if ($search_country !=
'') {
882 $param .=
"&search_country=".urlencode($search_country);
884if ($search_poste !=
'') {
885 $param .=
'&search_poste='.urlencode($search_poste);
887if ($search_phone_pro !=
'') {
888 $param .=
'&search_phone_pro='.urlencode($search_phone_pro);
890if ($search_phone_perso !=
'') {
891 $param .=
'&search_phone_perso='.urlencode($search_phone_perso);
893if ($search_phone_mobile !=
'') {
894 $param .=
'&search_phone_mobile='.urlencode($search_phone_mobile);
896if ($search_fax !=
'') {
897 $param .=
'&search_fax='.urlencode($search_fax);
899if ($search_email !=
'') {
900 $param .=
'&search_email='.urlencode($search_email);
902if ($search_no_email !=
'') {
903 $param .=
'&search_no_email='.urlencode((
string) ($search_no_email));
905if ($search_status !=
'') {
906 $param .=
'&search_status='.urlencode((
string) ($search_status));
908if ($search_priv ==
'0' || $search_priv ==
'1') {
909 $param .=
"&search_priv=".urlencode($search_priv);
911if ($search_stcomm !=
'') {
912 $param .=
'&search_stcomm='.urlencode((
string) ($search_stcomm));
914if (is_array($search_level) && count($search_level)) {
915 foreach ($search_level as $slevel) {
916 $param .=
'&search_level[]='.urlencode($slevel);
919if ($search_import_key !=
'') {
920 $param .=
'&search_import_key='.urlencode($search_import_key);
922if (count($search_roles) > 0) {
923 $param .= implode(
'&search_roles[]=', $search_roles);
925if ($search_birthday_start) {
926 $param .=
'&search_birthday_start='.urlencode(
dol_print_date($search_birthday_start,
'%d')).
'&search_birthday_startmonth='.urlencode(
dol_print_date($search_birthday_start,
'%m')).
'&search_birthday_startyear='.urlencode(
dol_print_date($search_birthday_start,
'%Y'));
928if ($search_birthday_end) {
929 $param .=
'&search_birthday_end='.urlencode(
dol_print_date($search_birthday_end,
'%d')).
'&search_birthday_endmonth='.urlencode(
dol_print_date($search_birthday_end,
'%m')).
'&search_birthday_endyear='.urlencode(
dol_print_date($search_birthday_end,
'%Y'));
932include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
935$arrayofmassactions = array(
936 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
940if (!empty($permissiontodelete)) {
941 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
943if (isModEnabled(
'category') && $user->hasRight(
'societe',
'creer')) {
944 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
946if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
947 $arrayofmassactions = array();
950$massactionbutton =
'';
951if ($contextpage !=
'poslist') {
952 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
955print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter">';
956if ($optioncss !=
'') {
957 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
959print
'<input type="hidden" name="token" value="'.newToken().
'">';
960print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
961print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
962print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
963print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
965print
'<input type="hidden" name="type" value="'.$type.
'">';
966print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
967print
'<input type="hidden" name="page_y" value="">';
968print
'<input type="hidden" name="mode" value="'.$mode.
'">';
972$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
973$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'));
975if ($contextpage !=
'poslist') {
976 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewContactAddress'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create',
'', $permissiontoadd);
977} elseif ($user->hasRight(
'societe',
'contact',
'creer')) {
978 $url = DOL_URL_ROOT .
'/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage=' . urlencode($_SERVER[
"PHP_SELF"] .
'?token=' .
newToken() .
'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
979 $label =
'MenuNewCustomer';
980 $newcardbutton .=
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url);
983print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'address', 0, $newcardbutton,
'', $limit, 0, 0, 1);
985$topicmail =
"Information";
986$modelmail =
"contact";
988$trackid =
'ctc'.$object->id;
989include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
993 foreach ($fieldstosearchall as $key => $val) {
994 $fieldstosearchall[$key] = $langs->trans($val);
995 $setupstring .= $key.
"=".$val.
";";
997 print
'<!-- Search done like if CONTACT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
998 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1000if ($search_firstlast_only) {
1001 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_firstlast_only).$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
'</div>';
1007if ($user->hasRight(
'societe',
'client',
'voir')) {
1008 $langs->load(
'commercial');
1009 $moreforfilter .=
'<div class="divsearchfield">';
1010 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1011 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1012 $moreforfilter .=
'</div>';
1015if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1016 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1017 $moreforfilter .=
'<div class="divsearchfield">';
1018 $tmptitle = $langs->trans(
'ContactCategoriesShort');
1019 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1020 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, $search_categ,
'search_categ', 1, $tmptitle);
1021 $moreforfilter .=
'</div>';
1022 if (empty($type) || $type ==
'c' || $type ==
'p') {
1023 $moreforfilter .=
'<div class="divsearchfield">';
1026 $tmptitle .= $langs->trans(
'CustomersCategoriesShort');
1027 } elseif ($type ==
'p') {
1028 $tmptitle .= $langs->trans(
'ProspectsCategoriesShort');
1030 $tmptitle .= $langs->trans(
'CustomersProspectsCategoriesShort');
1032 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1033 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty,
'search_categ_thirdparty', 1, $tmptitle);
1034 $moreforfilter .=
'</div>';
1037 if (isModEnabled(
"fournisseur") && (empty($type) || $type ==
'f')) {
1038 $moreforfilter .=
'<div class="divsearchfield">';
1039 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1040 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1041 $moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier,
'search_categ_supplier', 1, $tmptitle);
1042 $moreforfilter .=
'</div>';
1046$moreforfilter .=
'<div class="divsearchfield">';
1047$moreforfilter .= $formcompany->showRoles(
"search_roles", $objecttmp,
'edit', $search_roles,
'minwidth500', $langs->transnoentitiesnoconv(
'ContactRoles'));
1048$moreforfilter .=
'</div>';
1050print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1051print $moreforfilter;
1052$parameters = array(
'type' => $type);
1053$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1054print $hookmanager->resPrint;
1057$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1058$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1059$selectedfields .= ((count($arrayofmassactions) && $contextpage !=
'poslist') ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1061print
'<div class="div-table-responsive">';
1062print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1066print
'<tr class="liste_titre_filter">';
1069 print
'<td class="liste_titre center maxwidthsearch actioncolumn">';
1070 $searchpicto = $form->showFilterButtons(
'left');
1074if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1075 print
'<td class="liste_titre">';
1076 print
'<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).
'">';
1079if (!empty($arrayfields[
'p.lastname'][
'checked'])) {
1080 print
'<td class="liste_titre">';
1081 print
'<input class="flat" type="text" name="search_lastname" size="6" value="'.dol_escape_htmltag($search_lastname).
'">';
1084if (!empty($arrayfields[
'p.firstname'][
'checked'])) {
1085 print
'<td class="liste_titre">';
1086 print
'<input class="flat" type="text" name="search_firstname" size="6" value="'.dol_escape_htmltag($search_firstname).
'">';
1089if (!empty($arrayfields[
'p.poste'][
'checked'])) {
1090 print
'<td class="liste_titre">';
1091 print
'<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).
'">';
1094if (!empty($arrayfields[
'p.address'][
'checked'])) {
1095 print
'<td class="liste_titre">';
1096 print
'<input class="flat" type="text" name="search_address" size="6" value="'.dol_escape_htmltag($search_address).
'">';
1099if (!empty($arrayfields[
'p.zip'][
'checked'])) {
1100 print
'<td class="liste_titre">';
1101 print
'<input class="flat" type="text" name="search_zip" size="3" value="'.dol_escape_htmltag($search_zip).
'">';
1104if (!empty($arrayfields[
'p.town'][
'checked'])) {
1105 print
'<td class="liste_titre">';
1106 print
'<input class="flat" type="text" name="search_town" size="5" value="'.dol_escape_htmltag($search_town).
'">';
1129if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1130 print
'<td class="liste_titre center">';
1131 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1134if (!empty($arrayfields[
'p.phone'][
'checked'])) {
1135 print
'<td class="liste_titre">';
1136 print
'<input class="flat" type="text" name="search_phone_pro" size="6" value="'.dol_escape_htmltag($search_phone_pro).
'">';
1139if (!empty($arrayfields[
'p.phone_perso'][
'checked'])) {
1140 print
'<td class="liste_titre">';
1141 print
'<input class="flat" type="text" name="search_phone_perso" size="6" value="'.dol_escape_htmltag($search_phone_perso).
'">';
1144if (!empty($arrayfields[
'p.phone_mobile'][
'checked'])) {
1145 print
'<td class="liste_titre">';
1146 print
'<input class="flat" type="text" name="search_phone_mobile" size="6" value="'.dol_escape_htmltag($search_phone_mobile).
'">';
1149if (!empty($arrayfields[
'p.fax'][
'checked'])) {
1150 print
'<td class="liste_titre">';
1151 print
'<input class="flat" type="text" name="search_fax" size="6" value="'.dol_escape_htmltag($search_fax).
'">';
1154if (!empty($arrayfields[
'p.email'][
'checked'])) {
1155 print
'<td class="liste_titre">';
1156 print
'<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).
'">';
1159if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1160 print
'<td class="liste_titre center">';
1161 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1164if (isModEnabled(
'socialnetworks')) {
1165 foreach ($socialnetworks as $key => $value) {
1166 if ($value[
'active']) {
1167 if (!empty($arrayfields[
'p.'.$key][
'checked'])) {
1168 print
'<td class="liste_titre">';
1169 print
'<input class="flat" type="text" name="search_'.$key.
'" size="6" value="'.
dol_escape_htmltag($search_[$key]).
'">';
1175if (!empty($arrayfields[
'p.fk_soc'][
'checked']) || !empty($arrayfields[
's.nom'][
'checked'])) {
1176 print
'<td class="liste_titre">';
1177 print
'<input class="flat" type="text" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1181if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1182 print
'<td class="liste_titre" align="left">';
1183 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1186if (!empty($arrayfields[
'p.priv'][
'checked'])) {
1187 print
'<td class="liste_titre center">';
1188 $selectarray = array(
'0' => $langs->trans(
"ContactPublic"),
'1' => $langs->trans(
"ContactPrivate"));
1189 print $form->selectarray(
'search_priv', $selectarray, $search_priv, 1);
1193if (!empty($arrayfields[
'p.fk_prospectlevel'][
'checked'])) {
1194 print
'<td class="liste_titre center">';
1195 print $form->multiselectarray(
'search_level', $tab_level, $search_level, 0, 0,
'width75', 0, 0,
'',
'',
'', 2);
1199if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked'])) {
1200 print
'<td class="liste_titre maxwidthonsmartphone center">';
1201 $arraystcomm = array();
1202 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1203 $arraystcomm[$val[
'id']] = ($langs->trans(
"StatusProspect".$val[
'id']) !=
"StatusProspect".$val[
'id'] ? $langs->trans(
"StatusProspect".$val[
'id']) : $val[
'label']);
1205 print $form->selectarray(
'search_stcomm', $arraystcomm, $search_stcomm, -2, 0, 0,
'', 0, 0, 0,
'',
'nowrap ');
1208if (!empty($arrayfields[
'p.birthday'][
'checked'])) {
1209 print
'<td class="liste_titre center">';
1210 print
'<div class="nowrap">';
1211 print $form->selectDate($search_birthday_start ? $search_birthday_start : -1,
'search_birthday_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1213 print
'<div class="nowrap">';
1214 print $form->selectDate($search_birthday_end ? $search_birthday_end : -1,
'search_birthday_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1220include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1223$parameters = array(
'arrayfields' => $arrayfields);
1224$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1225print $hookmanager->resPrint;
1227if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1228 print
'<td class="liste_titre">';
1232if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1233 print
'<td class="liste_titre">';
1237if (!empty($arrayfields[
'p.statut'][
'checked'])) {
1238 print
'<td class="liste_titre center parentonrightofpage">';
1239 print $form->selectarray(
'search_status', array(
'-1' =>
'',
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')), $search_status, 0, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1242if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1243 print
'<td class="liste_titre center">';
1244 print
'<input class="flat searchstring" type="text" name="search_import_key" size="3" value="'.dol_escape_htmltag($search_import_key).
'">';
1249 print
'<td class="liste_titre center maxwidthsearch">';
1250 $searchpicto = $form->showFilterButtons();
1256$totalarray = array();
1257$totalarray[
'nbfield'] = 0;
1261print
'<tr class="liste_titre">';
1263 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1264 $totalarray[
'nbfield']++;
1266if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'p.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
"", $sortfield, $sortorder);
1268 $totalarray[
'nbfield']++;
1270if (!empty($arrayfields[
'p.lastname'][
'checked'])) {
1271 print_liste_field_titre($arrayfields[
'p.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"p.lastname", $begin, $param,
'', $sortfield, $sortorder);
1272 $totalarray[
'nbfield']++;
1274if (!empty($arrayfields[
'p.firstname'][
'checked'])) {
1275 print_liste_field_titre($arrayfields[
'p.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"p.firstname", $begin, $param,
'', $sortfield, $sortorder);
1276 $totalarray[
'nbfield']++;
1278if (!empty($arrayfields[
'p.poste'][
'checked'])) {
1279 print_liste_field_titre($arrayfields[
'p.poste'][
'label'], $_SERVER[
"PHP_SELF"],
"p.poste", $begin, $param,
'', $sortfield, $sortorder);
1280 $totalarray[
'nbfield']++;
1282if (!empty($arrayfields[
'p.address'][
'checked'])) {
1283 print_liste_field_titre($arrayfields[
'p.address'][
'label'], $_SERVER[
"PHP_SELF"],
"p.address", $begin, $param,
'', $sortfield, $sortorder);
1284 $totalarray[
'nbfield']++;
1286if (!empty($arrayfields[
'p.zip'][
'checked'])) {
1287 print_liste_field_titre($arrayfields[
'p.zip'][
'label'], $_SERVER[
"PHP_SELF"],
"p.zip", $begin, $param,
'', $sortfield, $sortorder);
1288 $totalarray[
'nbfield']++;
1290if (!empty($arrayfields[
'p.town'][
'checked'])) {
1291 print_liste_field_titre($arrayfields[
'p.town'][
'label'], $_SERVER[
"PHP_SELF"],
"p.town", $begin, $param,
'', $sortfield, $sortorder);
1292 $totalarray[
'nbfield']++;
1296if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1297 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"co.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1298 $totalarray[
'nbfield']++;
1300if (!empty($arrayfields[
'p.phone'][
'checked'])) {
1301 print_liste_field_titre($arrayfields[
'p.phone'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone", $begin, $param,
'', $sortfield, $sortorder);
1302 $totalarray[
'nbfield']++;
1304if (!empty($arrayfields[
'p.phone_perso'][
'checked'])) {
1305 print_liste_field_titre($arrayfields[
'p.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone_perso", $begin, $param,
'', $sortfield, $sortorder);
1306 $totalarray[
'nbfield']++;
1308if (!empty($arrayfields[
'p.phone_mobile'][
'checked'])) {
1309 print_liste_field_titre($arrayfields[
'p.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone_mobile", $begin, $param,
'', $sortfield, $sortorder);
1310 $totalarray[
'nbfield']++;
1312if (!empty($arrayfields[
'p.fax'][
'checked'])) {
1313 print_liste_field_titre($arrayfields[
'p.fax'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fax", $begin, $param,
'', $sortfield, $sortorder);
1314 $totalarray[
'nbfield']++;
1316if (!empty($arrayfields[
'p.email'][
'checked'])) {
1317 print_liste_field_titre($arrayfields[
'p.email'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email", $begin, $param,
'', $sortfield, $sortorder);
1318 $totalarray[
'nbfield']++;
1320if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1321 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
"unsubscribed", $begin, $param,
'', $sortfield, $sortorder,
'center ');
1322 $totalarray[
'nbfield']++;
1324if (isModEnabled(
'socialnetworks')) {
1325 foreach ($socialnetworks as $key => $value) {
1326 if ($value[
'active'] && !empty($arrayfields[
'p.'.$key][
'checked'])) {
1327 print_liste_field_titre($arrayfields[
'p.'.$key][
'label'], $_SERVER[
"PHP_SELF"],
"p.".$key, $begin, $param,
'', $sortfield, $sortorder);
1328 $totalarray[
'nbfield']++;
1332if (!empty($arrayfields[
'p.fk_soc'][
'checked'])) {
1333 print_liste_field_titre($arrayfields[
'p.fk_soc'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_soc", $begin, $param,
'', $sortfield, $sortorder);
1334 $totalarray[
'nbfield']++;
1336if (!empty($arrayfields[
's.nom'][
'checked'])) {
1337 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $begin, $param,
'', $sortfield, $sortorder);
1338 $totalarray[
'nbfield']++;
1340if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1342 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias", $begin, $param,
'', $sortfield, $sortorder);
1343 $totalarray[
'nbfield']++;
1345if (!empty($arrayfields[
'p.priv'][
'checked'])) {
1346 print_liste_field_titre($arrayfields[
'p.priv'][
'label'], $_SERVER[
"PHP_SELF"],
"p.priv", $begin, $param,
'', $sortfield, $sortorder,
'center ');
1347 $totalarray[
'nbfield']++;
1349if (!empty($arrayfields[
'p.fk_prospectlevel'][
'checked'])) {
1350 print_liste_field_titre($arrayfields[
'p.fk_prospectlevel'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_prospectlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
1351 $totalarray[
'nbfield']++;
1353if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked'])) {
1354 print_liste_field_titre($arrayfields[
'p.fk_stcommcontact'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_stcommcontact",
"", $param,
'', $sortfield, $sortorder,
'center ');
1355 $totalarray[
'nbfield']++;
1357if (!empty($arrayfields[
'p.birthday'][
'checked'])) {
1358 print_liste_field_titre($arrayfields[
'p.birthday'][
'label'], $_SERVER[
"PHP_SELF"],
"p.birthday",
"", $param,
'', $sortfield, $sortorder,
'center ');
1359 $totalarray[
'nbfield']++;
1362include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1364$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1365$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1366print $hookmanager->resPrint;
1367if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1368 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1369 $totalarray[
'nbfield']++;
1371if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1372 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1373 $totalarray[
'nbfield']++;
1375if (!empty($arrayfields[
'p.statut'][
'checked'])) {
1376 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1377 $totalarray[
'nbfield']++;
1379if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1380 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1381 $totalarray[
'nbfield']++;
1384 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1385 $totalarray[
'nbfield']++;
1393$savnbfield = $totalarray[
'nbfield'];
1394$totalarray = array();
1395$totalarray[
'nbfield'] = 0;
1396$imaxinloop = ($limit ? min($num, $limit) : $num);
1397while ($i < $imaxinloop) {
1398 $obj = $db->fetch_object($resql);
1403 $arraysocialnetworks = (array) json_decode($obj->socialnetworks,
true);
1404 $contactstatic->lastname = $obj->lastname;
1405 $contactstatic->firstname = $obj->firstname;
1406 $contactstatic->id = $obj->rowid;
1407 $contactstatic->statut = $obj->statut;
1408 $contactstatic->poste = $obj->poste;
1409 $contactstatic->email = $obj->email;
1410 $contactstatic->phone_pro = $obj->phone_pro;
1411 $contactstatic->phone_perso = $obj->phone_perso;
1412 $contactstatic->phone_mobile = $obj->phone_mobile;
1413 $contactstatic->address = $obj->address;
1414 $contactstatic->zip = $obj->zip;
1415 $contactstatic->town = $obj->town;
1416 $contactstatic->socialnetworks = $arraysocialnetworks;
1417 $contactstatic->country = $obj->country;
1418 $contactstatic->country_code = $obj->country_code;
1419 $contactstatic->photo = $obj->photo;
1420 $contactstatic->import_key = $obj->import_key;
1421 $contactstatic->photo = $obj->photo;
1422 $contactstatic->fk_prospectlevel = $obj->fk_prospectlevel;
1426 if ($mode ==
'kanban') {
1428 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1429 print
'<div class="box-flex-container kanban">';
1432 if ($massactionbutton || $massaction) {
1434 if (in_array(
$object->id, $arrayofselected)) {
1438 if ($obj->socid > 0) {
1439 $contactstatic->fetch_thirdparty($obj->socid);
1441 print $contactstatic->getKanbanView(
'', array(
'selected' => in_array($contactstatic->id, $arrayofselected)));
1442 if ($i == ($imaxinloop - 1)) {
1449 print
'<tr data-rowid="'.$object->id.
'" class="oddeven"';
1450 if ($contextpage ==
'poslist') {
1451 print
' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->socid.
'&idcontact='.$obj->rowid.
'&place='.urlencode($place).
'\'"';
1456 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1457 print '<td class="nowrap center
">';
1458 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1460 if (in_array($obj->rowid, $arrayofselected)) {
1463 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1467 $totalarray['nbfield']++;
1472 if (!empty($arrayfields['p.rowid']['checked'])) {
1473 print '<td class="tdoverflowmax50
">';
1474 print dol_escape_htmltag($obj->rowid);
1477 $totalarray['nbfield']++;
1482 if (!empty($arrayfields['p.lastname']['checked'])) {
1483 print '<td class="middle tdoverflowmax150
">';
1484 if ($contextpage == 'poslist') {
1485 print $contactstatic->lastname;
1487 print $contactstatic->getNomUrl(1);
1491 $totalarray['nbfield']++;
1496 if (!empty($arrayfields['p.firstname']['checked'])) {
1497 print '<td class="tdoverflowmax150
" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
1499 $totalarray['nbfield']++;
1504 if (!empty($arrayfields['p.poste']['checked'])) {
1505 print '<td class="tdoverflowmax100
">'.dol_escape_htmltag($obj->poste).'</td>';
1507 $totalarray['nbfield']++;
1512 if (!empty($arrayfields['p.address']['checked'])) {
1513 print '<td>'.dol_escape_htmltag($obj->address).'</td>';
1515 $totalarray['nbfield']++;
1520 if (!empty($arrayfields['p.zip']['checked'])) {
1521 print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
1523 $totalarray['nbfield']++;
1528 if (!empty($arrayfields['p.town']['checked'])) {
1529 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->town).'">'.dol_escape_htmltag($obj->town).'</td>';
1531 $totalarray['nbfield']++;
1537 if (!empty($arrayfields['state.nom']['checked']))
1539 print "<td>
".$obj->state_name."</td>\n
";
1540 if (! $i) $totalarray['nbfield']++;
1544 if (!empty($arrayfields['region.nom']['checked']))
1546 print "<td>
".$obj->region_name."</td>\n
";
1547 if (! $i) $totalarray['nbfield']++;
1551 if (!empty($arrayfields['country.code_iso']['checked'])) {
1552 print '<td class="center
">';
1553 $tmparray = getCountry($obj->fk_pays, 'all');
1554 print dol_escape_htmltag($tmparray['label']);
1557 $totalarray['nbfield']++;
1562 if (!empty($arrayfields['p.phone']['checked'])) {
1563 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1565 $totalarray['nbfield']++;
1570 if (!empty($arrayfields['p.phone_perso']['checked'])) {
1571 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1573 $totalarray['nbfield']++;
1578 if (!empty($arrayfields['p.phone_mobile']['checked'])) {
1579 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
1581 $totalarray['nbfield']++;
1586 if (!empty($arrayfields['p.fax']['checked'])) {
1587 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
1589 $totalarray['nbfield']++;
1594 if (!empty($arrayfields['p.email']['checked'])) {
1595 print '<td class="nowraponall tdoverflowmax300
">';
1596 if ($contextpage == 'poslist') {
1599 print dol_print_email($obj->email, $obj->rowid, $obj->socid, 1, 18, 0, 1);
1603 $totalarray['nbfield']++;
1607 // No EMail Subscription
1608 if (!empty($arrayfields['unsubscribed']['checked'])) {
1609 print '<td class="center
">';
1610 if (empty($obj->email)) {
1611 //print '<span class="opacitymedium
">'.$langs->trans("NoEmail
").'</span>';
1613 print yn(($obj->unsubscribed > 0) ? 1 : 0);
1617 $totalarray['nbfield']++;
1622 if (isModEnabled('socialnetworks')) {
1623 foreach ($socialnetworks as $key => $value) {
1624 if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
1625 print '<td class="tdoverflowmax100
">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>';
1627 $totalarray['nbfield']++;
1633 // Company / Third Party
1634 if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
1635 print '<td class="tdoverflowmax150
">';
1637 $objsoc = new Societe($db);
1638 $objsoc->fetch($obj->socid);
1639 $option_link = 'customer';
1640 if ($objsoc->client == 0 && $objsoc->fournisseur > 0) {
1641 $option_link = 'supplier';
1642 } elseif ($objsoc->client == 0 && $objsoc->fournisseur == 0) {
1645 if ($contextpage == 'poslist') {
1646 print $objsoc->name;
1648 print $objsoc->getNomUrl(1, $option_link, 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
1655 $totalarray['nbfield']++;
1660 if (!empty($arrayfields['s.name_alias']['checked'])) {
1661 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->alias).'">';
1662 print dol_escape_htmltag($obj->alias);
1665 $totalarray['nbfield']++;
1670 if (!empty($arrayfields['p.priv']['checked'])) {
1671 print '<td class="center
">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
1673 $totalarray['nbfield']++;
1678 if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
1679 print '<td class="center
">';
1680 print $contactstatic->getLibProspLevel();
1683 $totalarray['nbfield']++;
1688 if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
1689 print '<td class="center nowrap
"><div class="nowrap
">';
1690 print '<div class="inline-block
">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
1691 print '</div> - <div class="inline-block
">';
1692 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1693 $titlealt = 'default';
1694 if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) {
1695 $titlealt = $val['label'];
1697 if ($obj->stcomm_id != $val['id']) {
1698 print '<a class="pictosubstatus
" href="'.$_SERVER["PHP_SELF"].'?stcommcontactid=
'.$obj->rowid.'&stcomm=
'.urlencode((string) ($val['code
'])).'&action=setstcomm&token=
'.newToken().$param.($page ? '&page=
'.urlencode((string) ($page)) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).'</a>';
1701 print '</div></div></td>';
1703 $totalarray['nbfield']++;
1708 if (!empty($arrayfields['p.birthday']['checked'])) {
1709 print '<td class="center nowraponall
">';
1710 print dol_print_date($db->jdate($obj->birthday), 'day', 'tzuser');
1713 $totalarray['nbfield']++;
1718 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1721 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
1722 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1723 print $hookmanager->resPrint;
1725 if (!empty($arrayfields['p.datec']['checked'])) {
1726 print '<td class="center nowraponall
">';
1727 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
1730 $totalarray['nbfield']++;
1734 // Date modification
1735 if (!empty($arrayfields['p.tms']['checked'])) {
1736 print '<td class="center nowraponall
">';
1737 print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser');
1740 $totalarray['nbfield']++;
1745 if (!empty($arrayfields['p.statut']['checked'])) {
1746 print '<td class="center
">'.$contactstatic->getLibStatut(5).'</td>';
1748 $totalarray['nbfield']++;
1753 if (!empty($arrayfields['p.import_key']['checked'])) {
1754 print '<td class="tdoverflowmax100
">';
1755 print dol_escape_htmltag($obj->import_key);
1758 $totalarray['nbfield']++;
1763 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1764 print '<td class="nowrap center
">';
1765 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1767 if (in_array($obj->rowid, $arrayofselected)) {
1770 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1774 $totalarray['nbfield']++;
1784include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1786// If no record found
1789 foreach ($arrayfields as $key => $val) {
1790 if (!empty($val['checked'])) {
1794 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium
">'.$langs->trans("NoRecordFound
").'</span></td></tr>';
1799$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1800$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1801print $hookmanager->resPrint;
1803print '</table>'."\n
";
1806print '</form>'."\n
";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage invoices.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
getArrayOfSocialNetworks()
Get array of social network dictionary.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.