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') {
68if ($user->socid > 0) {
69 $socid = $user->socid;
73$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
74$search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
75$search_phone =
GETPOST(
"search_phone",
'alpha');
77$search_id =
GETPOST(
"search_id",
"intcomma");
78$search_firstlast_only =
GETPOST(
"search_firstlast_only",
'alpha');
79$search_lastname =
GETPOST(
"search_lastname",
'alpha');
80$search_firstname =
GETPOST(
"search_firstname",
'alpha');
81$search_societe =
GETPOST(
"search_societe",
'alpha');
82$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
83$search_poste =
GETPOST(
"search_poste",
'alpha');
84$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
85$search_phone_pro =
GETPOST(
"search_phone_pro",
'alpha');
86$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
87$search_fax =
GETPOST(
"search_fax",
'alpha');
88$search_email =
GETPOST(
"search_email",
'alpha');
89if (isModEnabled(
'mailing')) {
90 $search_no_email = GETPOSTISSET(
"search_no_email") ?
GETPOSTINT(
"search_no_email") : -1;
92 $search_no_email = -1;
97if (isModEnabled(
'socialnetworks')) {
98 foreach ($socialnetworks as $key => $value) {
99 if ($value[
'active']) {
100 $search_[$key] =
GETPOST(
"search_".$key,
'alpha');
104$search_priv =
GETPOST(
"search_priv",
'alpha');
105$search_sale =
GETPOST(
'search_sale',
'intcomma');
106$search_categ =
GETPOST(
"search_categ",
'intcomma');
107$search_categ_thirdparty =
GETPOST(
"search_categ_thirdparty",
'intcomma');
108$search_categ_supplier =
GETPOST(
"search_categ_supplier",
'intcomma');
109$search_status =
GETPOST(
"search_status",
"intcomma");
110$search_type =
GETPOST(
'search_type',
'alpha');
111$search_address =
GETPOST(
'search_address',
'alpha');
112$search_zip =
GETPOST(
'search_zip',
'alpha');
113$search_town =
GETPOST(
'search_town',
'alpha');
114$search_import_key =
GETPOST(
"search_import_key",
'alpha');
115$search_country =
GETPOST(
"search_country",
'aZ09');
116$search_roles =
GETPOST(
"search_roles",
'array');
117$search_level =
GETPOST(
"search_level",
'array');
118$search_stcomm =
GETPOST(
'search_stcomm',
'intcomma');
122if ($search_status ===
'') {
125if ($search_no_email ===
'') {
126 $search_no_email = -1;
129$optioncss =
GETPOST(
'optioncss',
'alpha');
131$place =
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0';
134$view =
GETPOST(
"view",
'alpha');
141$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
142$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
148 $sortfield =
"p.lastname";
150if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
154$offset = $limit * $page;
155$pageprev = $page - 1;
156$pagenext = $page + 1;
159$title = (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
161 if (empty($contextpage) || $contextpage ==
'contactlist') {
162 $contextpage =
'contactprospectlist';
164 $title .=
' ('.$langs->trans(
"ThirdPartyProspects").
')';
165 $urlfiche =
"card.php";
168 if (empty($contextpage) || $contextpage ==
'contactlist') {
169 $contextpage =
'contactcustomerlist';
171 $title .=
' ('.$langs->trans(
"ThirdPartyCustomers").
')';
172 $urlfiche =
"card.php";
173} elseif ($type ==
"f") {
174 if (empty($contextpage) || $contextpage ==
'contactlist') {
175 $contextpage =
'contactsupplierlist';
177 $title .=
' ('.$langs->trans(
"ThirdPartySuppliers").
')';
178 $urlfiche =
"card.php";
179} elseif ($type ==
"o") {
180 if (empty($contextpage) || $contextpage ==
'contactlist') {
181 $contextpage =
'contactotherlist';
183 $title .=
' ('.$langs->trans(
"OthersNotLinkedToThirdParty").
')';
190$hookmanager->initHooks(array($contextpage));
193$extrafields->fetch_name_optionals_label(
$object->table_element);
195$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
198$fieldstosearchall = array();
199foreach (
$object->fields as $key => $val) {
201 if (!empty($user->socid) && $key ==
"note_private") {
205 if (empty($val[
'searchall'])) {
209 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
214 $fieldstosearchall[
's.nom'] =
"ThirdParty";
215 $fieldstosearchall[
's.name_alias'] =
"AliasNames";
218$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
219$reshook = $hookmanager->executeHooks(
'completeFieldsToSearchAll', $parameters, $object, $action);
221 $fieldstosearchall = empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall'];
222} elseif ($reshook == 0) {
223 $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall']);
227$arrayfields = array();
228foreach (
$object->fields as $key => $val) {
230 if (!empty($val[
'visible'])) {
231 $visible = (int)
dol_eval($val[
'visible'], 1);
232 $arrayfields[
'p.'.$key] = array(
233 'label' => $val[
'label'],
234 'checked' => (($visible < 0) ? 0 : 1),
235 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
236 'position' => $val[
'position'],
237 'help' => isset($val[
'help']) ? $val[
'help'] :
''
243$arrayfields[
'country.code_iso'] = array(
'label' =>
"Country",
'position' => 66,
'checked' => 0);
245 $arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'position' => 113,
'checked' => 1);
246 $arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'position' => 114,
'checked' => 1);
249$arrayfields[
'unsubscribed'] = array(
250 'label' =>
'No_Email',
252 'enabled' => (isModEnabled(
'mailing')),
255if (isModEnabled(
'socialnetworks')) {
256 foreach ($socialnetworks as $key => $value) {
257 if ($value[
'active']) {
258 $arrayfields[
'p.'.$key] = array(
259 'label' => $value[
'label'],
268include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
273'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
276if (($id > 0 || !empty($ref)) && $action !=
'add') {
277 $result =
$object->fetch($id, $ref);
283$permissiontoread = $user->hasRight(
'societe',
'contact',
'lire');
284$permissiontodelete = $user->hasRight(
'societe',
'contact',
'supprimer');
285$permissiontoadd = $user->hasRight(
'societe',
'contact',
'creer');
287if (!$permissiontoread) {
296if ($action ==
"change" && $user->hasRight(
'takepos',
'run')) {
301 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' AND entity IN (".
getEntity(
'invoice').
")";
302 $result = $db->query($sql);
303 $num_lines = $db->num_rows($result);
304 if ($num_lines == 0) {
305 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
307 $constforthirdpartyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"];
310 $invoice->module_source =
'takepos';
311 $invoice->pos_source = $_SESSION[
"takeposterminal"];
312 $placeid = $invoice->create($user);
313 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' where rowid = ".((int) $placeid);
317 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set fk_soc=".((int) $idcustomer).
" where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")'";
318 $resql = $db->query($sql);
321 if (!isset($invoice)) {
322 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
324 $invoice->fetch(
null,
"(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")");
325 $invoice->delete_linked_contact(
'external',
'BILLING');
327 $invoice->add_contact($idcontact,
'BILLING'); ?>
329 console.log(
"Reload page invoice.php with place=<?php print $place; ?>");
330 parent.$(
"#poslines").load(
"invoice.php?place=<?php print $place; ?>",
function() {
332 <?php
if (!$resql) { ?>
333 alert(
'Error failed to update customer on draft invoice.');
335 parent.$(
"#idcustomer").val(<?php echo $idcustomer; ?>);
336 parent.$.colorbox.close();
343if (
GETPOST(
'cancel',
'alpha')) {
347if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
351$parameters = array(
'arrayfields' => &$arrayfields);
352$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
357if (empty($reshook)) {
359 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
362 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
365 $search_firstlast_only =
"";
366 $search_lastname =
"";
367 $search_firstname =
"";
368 $search_societe =
"";
369 $search_societe_alias =
"";
371 $search_address =
"";
373 $search_country =
"";
376 $search_phone_perso =
"";
377 $search_phone_pro =
"";
378 $search_phone_mobile =
"";
381 $search_no_email = -1;
382 if (isModEnabled(
'socialnetworks')) {
383 foreach ($socialnetworks as $key => $value) {
384 if ($value[
'active']) {
395 $search_categ_thirdparty =
'';
396 $search_categ_supplier =
'';
397 $search_import_key =
'';
399 $search_array_options = array();
400 $search_roles = array();
401 $search_birthday_start =
'';
402 $search_birthday_end =
'';
406 $objectclass =
'Contact';
407 $objectlabel =
'Contact';
408 $uploaddir = $conf->societe->dir_output;
409 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
411 if ($action ==
'setstcomm') {
424if ($search_priv < 0) {
429if (!$user->hasRight(
'societe',
'client',
'voir')) {
430 $socid = $user->socid;
438$form =
new Form($db);
441$contactstatic =
new Contact($db);
445$title = $langs->trans(
"Contacts").
" - ".$langs->trans(
"List");
446$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
451 $contactstatic->loadCacheOfProspStatus();
454$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
455$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
459$sql =
"SELECT code, label, sortorder";
460$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
461$sql .=
" WHERE active > 0";
462$sql .=
" ORDER BY sortorder";
463$resql = $db->query($sql);
465 while ($obj = $db->fetch_object($resql)) {
467 $level = $langs->trans($obj->code);
468 if ($level == $obj->code) {
469 $level = $langs->trans($obj->label);
471 $tab_level[$obj->code] = $level;
479$sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias as alias,";
480$sql .=
" p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.birthday,";
481$sql .=
" p.socialnetworks, p.photo,";
482$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,";
483$sql .=
" p.import_key, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,";
484$sql .=
" st.libelle as stcomm, st.picto as stcomm_picto,";
485$sql .=
" co.label as country, co.code as country_code";
487if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
488 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
489 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
492if (isModEnabled(
'mailing')) {
493 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) as unsubscribed";
497$parameters = array();
498$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
499$sql .= $hookmanager->resPrint;
500$sql = preg_replace(
'/,\s*$/',
'', $sql);
504$sql .=
" FROM ".MAIN_DB_PREFIX.
"socpeople as p";
505if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
506 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
508$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as co ON co.rowid = p.fk_pays";
509$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = p.fk_soc";
510$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_stcommcontact as st ON st.id = p.fk_stcommcontact";
513$parameters = array();
514$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
515$sql .= $hookmanager->resPrint;
516$sql .=
' WHERE p.entity IN ('.getEntity(
'contact').
')';
517if (!empty($userid)) {
518 $sql .=
" AND p.fk_user_creat=".((int) $userid);
521 $sql .=
natural_search(
"p.fk_prospectlevel", implode(
',', $search_level), 3);
523if ($search_stcomm !=
'' && $search_stcomm != -2) {
528if ($search_priv !=
'0' && $search_priv !=
'1') {
529 $sql .=
" AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
"))";
531 if ($search_priv ==
'0') {
532 $sql .=
" AND p.priv='0'";
534 if ($search_priv ==
'1') {
535 $sql .=
" AND (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
")";
539if (!empty($search_sale) && $search_sale !=
'-1') {
540 if ($search_sale == -2) {
541 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
542 } elseif ($search_sale > 0) {
543 $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).
")";
548$searchCategoryContactList = $search_categ ? array($search_categ) : array();
549$searchCategoryContactOperator = 0;
551if (!empty($searchCategoryContactList)) {
552 $searchCategoryContactSqlList = array();
553 $listofcategoryid =
'';
554 foreach ($searchCategoryContactList as $searchCategoryContact) {
555 if (intval($searchCategoryContact) == -2) {
556 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX.
"categorie_contact as ck WHERE p.rowid = ck.fk_socpeople)";
557 } elseif (intval($searchCategoryContact) > 0) {
558 if ($searchCategoryContactOperator == 0) {
559 $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).
")";
561 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
565 if ($listofcategoryid) {
566 $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).
"))";
568 if ($searchCategoryContactOperator == 1) {
569 if (!empty($searchCategoryContactSqlList)) {
570 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
573 if (!empty($searchCategoryContactSqlList)) {
574 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
580$searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array();
581$searchCategoryCustomerOperator = 0;
583if (!empty($searchCategoryCustomerList)) {
584 $searchCategoryCustomerSqlList = array();
585 $listofcategoryid =
'';
586 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
587 if (intval($searchCategoryCustomer) == -2) {
588 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
589 } elseif (intval($searchCategoryCustomer) > 0) {
590 if ($searchCategoryCustomerOperator == 0) {
591 $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).
")";
593 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
597 if ($listofcategoryid) {
598 $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).
"))";
600 if ($searchCategoryCustomerOperator == 1) {
601 if (!empty($searchCategoryCustomerSqlList)) {
602 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
605 if (!empty($searchCategoryCustomerSqlList)) {
606 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
612$searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array();
613$searchCategorySupplierOperator = 0;
615if (!empty($searchCategorySupplierList)) {
616 $searchCategorySupplierSqlList = array();
617 $listofcategoryid =
'';
618 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
619 if (intval($searchCategorySupplier) == -2) {
620 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
621 } elseif (intval($searchCategorySupplier) > 0) {
622 if ($searchCategorySupplierOperator == 0) {
623 $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).
")";
625 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
629 if ($listofcategoryid) {
630 $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).
"))";
632 if ($searchCategorySupplierOperator == 1) {
633 if (!empty($searchCategorySupplierSqlList)) {
634 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
637 if (!empty($searchCategorySupplierSqlList)) {
638 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
644 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
646if (strlen($search_phone)) {
647 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_phone);
649if (strlen($search_cti)) {
650 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_cti);
652if (strlen($search_firstlast_only)) {
653 $sql .=
natural_search(array(
'p.lastname',
'p.firstname'), $search_firstlast_only);
659if ($search_lastname) {
662if ($search_firstname) {
665if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
666 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
668 if ($search_societe) {
671 if ($search_societe_alias) {
675if ($search_country) {
676 $sql .=
" AND p.fk_pays IN (".$db->sanitize($search_country).
')';
678if (strlen($search_poste)) {
681if (strlen($search_phone_perso)) {
684if (strlen($search_phone_pro)) {
687if (strlen($search_phone_mobile)) {
690if (strlen($search_fax)) {
693if (isModEnabled(
'socialnetworks')) {
694 foreach ($socialnetworks as $key => $value) {
695 if ($value[
'active'] && strlen($search_[$key])) {
696 $searchkeyinjsonformat = preg_replace(
'/"$/',
'', preg_replace(
'/^"/',
'', json_encode($search_[$key])));
697 if (in_array($db->type, array(
'mysql',
'mysqli'))) {
698 $sql .=
" AND p.socialnetworks REGEXP '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
699 } elseif ($db->type ==
'pgsql') {
700 $sql .=
" AND p.socialnetworks ~ '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
703 $sql .=
" AND p.socialnetworks LIKE '%\"".$db->escape($db->escapeforlike($key)).
"\":\"".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"%'";
710if (strlen($search_email)) {
713if (strlen($search_address)) {
716if (strlen($search_zip)) {
719if (strlen($search_town)) {
722if (count($search_roles) > 0) {
723 $sql .=
" AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX.
"societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(
',', $search_roles)).
"))";
725if ($search_no_email != -1 && $search_no_email > 0) {
726 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) > 0";
728if ($search_no_email != -1 && $search_no_email == 0) {
729 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
731if ($search_status !=
'' && $search_status >= 0) {
732 $sql .=
" AND p.statut = ".((int) $search_status);
734if ($search_import_key) {
738 $sql .=
" AND p.fk_soc IS NULL";
739} elseif ($type ==
"f") {
740 $sql .=
" AND s.fournisseur = 1";
741} elseif ($type ==
"c") {
742 $sql .=
" AND s.client IN (1, 3)";
743} elseif ($type ==
"p") {
744 $sql .=
" AND s.client IN (2, 3)";
747 $sql .=
" AND s.rowid = ".((int) $socid);
749if ($search_birthday_start) {
750 $sql .=
" AND p.birthday >= '".$db->idate($search_birthday_start).
"'";
752if ($search_birthday_end) {
753 $sql .=
" AND p.birthday <= '".$db->idate($search_birthday_end).
"'";
757include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
760$parameters = array();
761$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
762$sql .= $hookmanager->resPrint;
766$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
767$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
768$sql .= $hookmanager->resPrint;
772$nbtotalofrecords =
'';
775 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
776 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
777 $resql = $db->query($sqlforcount);
779 $objforcount = $db->fetch_object($resql);
780 $nbtotalofrecords = $objforcount->nbtotalofrecords;
785 if (($page * $limit) > $nbtotalofrecords) {
793if ($view ==
"recent") {
794 $sql .= $db->order(
"p.datec",
"DESC");
796 $sql .= $db->order($sortfield, $sortorder);
799 $sql .= $db->plimit($limit + 1, $offset);
802$resql = $db->query($sql);
808$num = $db->num_rows($resql);
811if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($search_all !=
'' || $search_cti !=
'') && !$page) {
812 $obj = $db->fetch_object($resql);
814 header(
"Location: ".DOL_URL_ROOT.
'/contact/card.php?id='.$id);
822llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'bodyforlist');
824$arrayofselected = is_array($toselect) ? $toselect : array();
828 $param .=
'&mode='.urlencode($mode);
830if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
831 $param .=
'&contextpage='.urlencode($contextpage);
833if ($limit > 0 && $limit != $conf->liste_limit) {
834 $param .=
'&limit='.((int) $limit);
836if ($optioncss !=
'') {
837 $param .=
'&optioncss='.urlencode($optioncss);
839$param .=
'&begin='.urlencode((
string) ($begin)).
'&userid='.urlencode((
string) ($userid)).
'&contactname='.urlencode((
string) ($search_all));
840$param .=
'&type='.urlencode($type).
'&view='.urlencode($view);
841if (!empty($search_sale) && $search_sale !=
'-1') {
842 $param .=
'&search_sale='.urlencode($search_sale);
844if (!empty($search_categ) && $search_categ !=
'-1') {
845 $param .=
'&search_categ='.urlencode((
string) ($search_categ));
847if (!empty($search_categ_thirdparty) && $search_categ_thirdparty !=
'-1') {
848 $param .=
'&search_categ_thirdparty='.urlencode((
string) ($search_categ_thirdparty));
850if (!empty($search_categ_supplier) && $search_categ_supplier !=
'-1') {
851 $param .=
'&search_categ_supplier='.urlencode((
string) ($search_categ_supplier));
853if ($search_all !=
'') {
854 $param .=
'&search_all='.urlencode($search_all);
857 $param .=
"&search_id=".urlencode((
string) ($search_id));
859if ($search_lastname !=
'') {
860 $param .=
'&search_lastname='.urlencode($search_lastname);
862if ($search_firstname !=
'') {
863 $param .=
'&search_firstname='.urlencode($search_firstname);
865if ($search_societe !=
'') {
866 $param .=
'&search_societe='.urlencode($search_societe);
868if ($search_societe_alias !=
'') {
869 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
871if ($search_address !=
'') {
872 $param .=
'&search_address='.urlencode($search_address);
874if ($search_zip !=
'') {
875 $param .=
'&search_zip='.urlencode($search_zip);
877if ($search_town !=
'') {
878 $param .=
'&search_town='.urlencode($search_town);
880if ($search_country !=
'') {
881 $param .=
"&search_country=".urlencode($search_country);
883if ($search_poste !=
'') {
884 $param .=
'&search_poste='.urlencode($search_poste);
886if ($search_phone_pro !=
'') {
887 $param .=
'&search_phone_pro='.urlencode($search_phone_pro);
889if ($search_phone_perso !=
'') {
890 $param .=
'&search_phone_perso='.urlencode($search_phone_perso);
892if ($search_phone_mobile !=
'') {
893 $param .=
'&search_phone_mobile='.urlencode($search_phone_mobile);
895if ($search_fax !=
'') {
896 $param .=
'&search_fax='.urlencode($search_fax);
898if ($search_email !=
'') {
899 $param .=
'&search_email='.urlencode($search_email);
901if ($search_no_email !=
'') {
902 $param .=
'&search_no_email='.urlencode((
string) ($search_no_email));
904if ($search_status !=
'') {
905 $param .=
'&search_status='.urlencode((
string) ($search_status));
907if ($search_priv ==
'0' || $search_priv ==
'1') {
908 $param .=
"&search_priv=".urlencode($search_priv);
910if ($search_stcomm !=
'') {
911 $param .=
'&search_stcomm='.urlencode((
string) ($search_stcomm));
913if (is_array($search_level) && count($search_level)) {
914 foreach ($search_level as $slevel) {
915 $param .=
'&search_level[]='.urlencode($slevel);
918if ($search_import_key !=
'') {
919 $param .=
'&search_import_key='.urlencode($search_import_key);
921if (count($search_roles) > 0) {
922 $param .= implode(
'&search_roles[]=', $search_roles);
924if ($search_birthday_start) {
925 $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'));
927if ($search_birthday_end) {
928 $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'));
931include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
934$arrayofmassactions = array(
935 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
939if (!empty($permissiontodelete)) {
940 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
942if (isModEnabled(
'category') && $user->hasRight(
'societe',
'creer')) {
943 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
945if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
946 $arrayofmassactions = array();
949$massactionbutton =
'';
950if ($contextpage !=
'poslist') {
951 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
954print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter">';
955if ($optioncss !=
'') {
956 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
958print
'<input type="hidden" name="token" value="'.newToken().
'">';
959print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
960print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
961print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
962print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
964print
'<input type="hidden" name="type" value="'.$type.
'">';
965print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
966print
'<input type="hidden" name="page_y" value="">';
967print
'<input type="hidden" name="mode" value="'.$mode.
'">';
971$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'));
972$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'));
974if ($contextpage !=
'poslist') {
975 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewContactAddress'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create',
'', $permissiontoadd);
976} elseif ($user->hasRight(
'societe',
'contact',
'creer')) {
977 $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);
978 $label =
'MenuNewCustomer';
979 $newcardbutton .=
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url);
982print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'address', 0, $newcardbutton,
'', $limit, 0, 0, 1);
984$topicmail =
"Information";
985$modelmail =
"contact";
987$trackid =
'ctc'.$object->id;
988include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
992 foreach ($fieldstosearchall as $key => $val) {
993 $fieldstosearchall[$key] = $langs->trans($val);
994 $setupstring .= $key.
"=".$val.
";";
996 print
'<!-- Search done like if CONTACT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
997 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
999if ($search_firstlast_only) {
1000 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_firstlast_only).$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
'</div>';
1006if ($user->hasRight(
'societe',
'client',
'voir')) {
1007 $langs->load(
'commercial');
1008 $moreforfilter .=
'<div class="divsearchfield">';
1009 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1010 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1011 $moreforfilter .=
'</div>';
1014if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1015 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1016 $moreforfilter .=
'<div class="divsearchfield">';
1017 $tmptitle = $langs->trans(
'ContactCategoriesShort');
1018 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1019 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, $search_categ,
'search_categ', 1, $tmptitle);
1020 $moreforfilter .=
'</div>';
1021 if (empty($type) || $type ==
'c' || $type ==
'p') {
1022 $moreforfilter .=
'<div class="divsearchfield">';
1025 $tmptitle .= $langs->trans(
'CustomersCategoriesShort');
1026 } elseif ($type ==
'p') {
1027 $tmptitle .= $langs->trans(
'ProspectsCategoriesShort');
1029 $tmptitle .= $langs->trans(
'CustomersProspectsCategoriesShort');
1031 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1032 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty,
'search_categ_thirdparty', 1, $tmptitle);
1033 $moreforfilter .=
'</div>';
1036 if (isModEnabled(
"fournisseur") && (empty($type) || $type ==
'f')) {
1037 $moreforfilter .=
'<div class="divsearchfield">';
1038 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1039 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1040 $moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier,
'search_categ_supplier', 1, $tmptitle);
1041 $moreforfilter .=
'</div>';
1045$moreforfilter .=
'<div class="divsearchfield">';
1046$moreforfilter .= $langs->trans(
'Roles').
': ';
1047$moreforfilter .= $formcompany->showRoles(
"search_roles", $objecttmp,
'edit', $search_roles);
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'])) {
1341 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias", $begin, $param,
'', $sortfield, $sortorder);
1342 $totalarray[
'nbfield']++;
1344if (!empty($arrayfields[
'p.priv'][
'checked'])) {
1345 print_liste_field_titre($arrayfields[
'p.priv'][
'label'], $_SERVER[
"PHP_SELF"],
"p.priv", $begin, $param,
'', $sortfield, $sortorder,
'center ');
1346 $totalarray[
'nbfield']++;
1348if (!empty($arrayfields[
'p.fk_prospectlevel'][
'checked'])) {
1349 print_liste_field_titre($arrayfields[
'p.fk_prospectlevel'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_prospectlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
1350 $totalarray[
'nbfield']++;
1352if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked'])) {
1353 print_liste_field_titre($arrayfields[
'p.fk_stcommcontact'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_stcommcontact",
"", $param,
'', $sortfield, $sortorder,
'center ');
1354 $totalarray[
'nbfield']++;
1356if (!empty($arrayfields[
'p.birthday'][
'checked'])) {
1357 print_liste_field_titre($arrayfields[
'p.birthday'][
'label'], $_SERVER[
"PHP_SELF"],
"p.birthday",
"", $param,
'', $sortfield, $sortorder,
'center ');
1358 $totalarray[
'nbfield']++;
1361include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1363$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1364$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1365print $hookmanager->resPrint;
1366if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1367 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1368 $totalarray[
'nbfield']++;
1370if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1371 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1372 $totalarray[
'nbfield']++;
1374if (!empty($arrayfields[
'p.statut'][
'checked'])) {
1375 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1376 $totalarray[
'nbfield']++;
1378if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1379 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1380 $totalarray[
'nbfield']++;
1383 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1384 $totalarray[
'nbfield']++;
1392$savnbfield = $totalarray[
'nbfield'];
1393$totalarray = array();
1394$totalarray[
'nbfield'] = 0;
1395$imaxinloop = ($limit ? min($num, $limit) : $num);
1396while ($i < $imaxinloop) {
1397 $obj = $db->fetch_object($resql);
1402 $arraysocialnetworks = (array) json_decode($obj->socialnetworks,
true);
1403 $contactstatic->lastname = $obj->lastname;
1404 $contactstatic->firstname = $obj->firstname;
1405 $contactstatic->id = $obj->rowid;
1406 $contactstatic->statut = $obj->statut;
1407 $contactstatic->poste = $obj->poste;
1408 $contactstatic->email = $obj->email;
1409 $contactstatic->phone_pro = $obj->phone_pro;
1410 $contactstatic->phone_perso = $obj->phone_perso;
1411 $contactstatic->phone_mobile = $obj->phone_mobile;
1412 $contactstatic->address = $obj->address;
1413 $contactstatic->zip = $obj->zip;
1414 $contactstatic->town = $obj->town;
1415 $contactstatic->socialnetworks = $arraysocialnetworks;
1416 $contactstatic->country = $obj->country;
1417 $contactstatic->country_code = $obj->country_code;
1418 $contactstatic->photo = $obj->photo;
1419 $contactstatic->import_key = $obj->import_key;
1420 $contactstatic->photo = $obj->photo;
1421 $contactstatic->fk_prospectlevel = $obj->fk_prospectlevel;
1425 if ($mode ==
'kanban') {
1427 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1428 print
'<div class="box-flex-container kanban">';
1431 if ($massactionbutton || $massaction) {
1433 if (in_array(
$object->id, $arrayofselected)) {
1437 if ($obj->socid > 0) {
1438 $contactstatic->fetch_thirdparty($obj->socid);
1440 print $contactstatic->getKanbanView(
'', array(
'selected' => in_array($contactstatic->id, $arrayofselected)));
1441 if ($i == ($imaxinloop - 1)) {
1448 print
'<tr data-rowid="'.$object->id.
'" class="oddeven"';
1449 if ($contextpage ==
'poslist') {
1450 print
' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->socid.
'&idcontact='.$obj->rowid.
'&place='.urlencode($place).
'\'"';
1455 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1456 print '<td class="nowrap center
">';
1457 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1459 if (in_array($obj->rowid, $arrayofselected)) {
1462 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1466 $totalarray['nbfield']++;
1471 if (!empty($arrayfields['p.rowid']['checked'])) {
1472 print '<td class="tdoverflowmax50
">';
1473 print dol_escape_htmltag($obj->rowid);
1476 $totalarray['nbfield']++;
1481 if (!empty($arrayfields['p.lastname']['checked'])) {
1482 print '<td class="middle tdoverflowmax150
">';
1483 if ($contextpage == 'poslist') {
1484 print $contactstatic->lastname;
1486 print $contactstatic->getNomUrl(1);
1490 $totalarray['nbfield']++;
1495 if (!empty($arrayfields['p.firstname']['checked'])) {
1496 print '<td class="tdoverflowmax150
" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
1498 $totalarray['nbfield']++;
1503 if (!empty($arrayfields['p.poste']['checked'])) {
1504 print '<td class="tdoverflowmax100
">'.dol_escape_htmltag($obj->poste).'</td>';
1506 $totalarray['nbfield']++;
1511 if (!empty($arrayfields['p.address']['checked'])) {
1512 print '<td>'.dol_escape_htmltag($obj->address).'</td>';
1514 $totalarray['nbfield']++;
1519 if (!empty($arrayfields['p.zip']['checked'])) {
1520 print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
1522 $totalarray['nbfield']++;
1527 if (!empty($arrayfields['p.town']['checked'])) {
1528 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->town).'">'.dol_escape_htmltag($obj->town).'</td>';
1530 $totalarray['nbfield']++;
1536 if (!empty($arrayfields['state.nom']['checked']))
1538 print "<td>
".$obj->state_name."</td>\n
";
1539 if (! $i) $totalarray['nbfield']++;
1543 if (!empty($arrayfields['region.nom']['checked']))
1545 print "<td>
".$obj->region_name."</td>\n
";
1546 if (! $i) $totalarray['nbfield']++;
1550 if (!empty($arrayfields['country.code_iso']['checked'])) {
1551 print '<td class="center
">';
1552 $tmparray = getCountry($obj->fk_pays, 'all');
1553 print dol_escape_htmltag($tmparray['label']);
1556 $totalarray['nbfield']++;
1561 if (!empty($arrayfields['p.phone']['checked'])) {
1562 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1564 $totalarray['nbfield']++;
1569 if (!empty($arrayfields['p.phone_perso']['checked'])) {
1570 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1572 $totalarray['nbfield']++;
1577 if (!empty($arrayfields['p.phone_mobile']['checked'])) {
1578 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
1580 $totalarray['nbfield']++;
1585 if (!empty($arrayfields['p.fax']['checked'])) {
1586 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
1588 $totalarray['nbfield']++;
1593 if (!empty($arrayfields['p.email']['checked'])) {
1594 print '<td class="nowraponall tdoverflowmax300
">';
1595 if ($contextpage == 'poslist') {
1598 print dol_print_email($obj->email, $obj->rowid, $obj->socid, 1, 18, 0, 1);
1602 $totalarray['nbfield']++;
1606 // No EMail Subscription
1607 if (!empty($arrayfields['unsubscribed']['checked'])) {
1608 print '<td class="center
">';
1609 if (empty($obj->email)) {
1610 //print '<span class="opacitymedium
">'.$langs->trans("NoEmail
").'</span>';
1612 print yn(($obj->unsubscribed > 0) ? 1 : 0);
1616 $totalarray['nbfield']++;
1621 if (isModEnabled('socialnetworks')) {
1622 foreach ($socialnetworks as $key => $value) {
1623 if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
1624 print '<td class="tdoverflowmax100
">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>';
1626 $totalarray['nbfield']++;
1632 // Company / Third Party
1633 if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
1634 print '<td class="tdoverflowmax150
">';
1636 $objsoc = new Societe($db);
1637 $objsoc->fetch($obj->socid);
1638 $option_link = 'customer';
1639 if ($objsoc->client == 0 && $objsoc->fournisseur > 0) {
1640 $option_link = 'supplier';
1641 } elseif ($objsoc->client == 0 && $objsoc->fournisseur == 0) {
1644 if ($contextpage == 'poslist') {
1645 print $objsoc->name;
1647 print $objsoc->getNomUrl(1, $option_link, 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
1654 $totalarray['nbfield']++;
1659 if (!empty($arrayfields['s.name_alias']['checked'])) {
1660 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->alias).'">';
1661 print dol_escape_htmltag($obj->alias);
1664 $totalarray['nbfield']++;
1669 if (!empty($arrayfields['p.priv']['checked'])) {
1670 print '<td class="center
">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
1672 $totalarray['nbfield']++;
1677 if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
1678 print '<td class="center
">';
1679 print $contactstatic->getLibProspLevel();
1682 $totalarray['nbfield']++;
1687 if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
1688 print '<td class="center nowrap
"><div class="nowrap
">';
1689 print '<div class="inline-block
">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
1690 print '</div> - <div class="inline-block
">';
1691 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1692 $titlealt = 'default';
1693 if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) {
1694 $titlealt = $val['label'];
1696 if ($obj->stcomm_id != $val['id']) {
1697 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>';
1700 print '</div></div></td>';
1702 $totalarray['nbfield']++;
1707 if (!empty($arrayfields['p.birthday']['checked'])) {
1708 print '<td class="center nowraponall
">';
1709 print dol_print_date($db->jdate($obj->birthday), 'day', 'tzuser');
1712 $totalarray['nbfield']++;
1717 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1720 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
1721 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1722 print $hookmanager->resPrint;
1724 if (!empty($arrayfields['p.datec']['checked'])) {
1725 print '<td class="center nowraponall
">';
1726 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
1729 $totalarray['nbfield']++;
1733 // Date modification
1734 if (!empty($arrayfields['p.tms']['checked'])) {
1735 print '<td class="center nowraponall
">';
1736 print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser');
1739 $totalarray['nbfield']++;
1744 if (!empty($arrayfields['p.statut']['checked'])) {
1745 print '<td class="center
">'.$contactstatic->getLibStatut(5).'</td>';
1747 $totalarray['nbfield']++;
1752 if (!empty($arrayfields['p.import_key']['checked'])) {
1753 print '<td class="tdoverflowmax100
">';
1754 print dol_escape_htmltag($obj->import_key);
1757 $totalarray['nbfield']++;
1762 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1763 print '<td class="nowrap center
">';
1764 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1766 if (in_array($obj->rowid, $arrayofselected)) {
1769 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1773 $totalarray['nbfield']++;
1783include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1785// If no record found
1788 foreach ($arrayfields as $key => $val) {
1789 if (!empty($val['checked'])) {
1793 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium
">'.$langs->trans("NoRecordFound
").'</span></td></tr>';
1798$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1799$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1800print $hookmanager->resPrint;
1802print '</table>'."\n
";
1805print '</form>'."\n
";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage 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...
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.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return 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.