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';
55$langs->loadLangs(array(
"companies",
"suppliers",
"categories"));
60$action =
GETPOST(
'action',
'aZ09');
61$massaction =
GETPOST(
'massaction',
'alpha');
63$confirm =
GETPOST(
'confirm',
'alpha');
64$toselect =
GETPOST(
'toselect',
'array');
65$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'contactlist';
66$mode =
GETPOST(
'mode',
'alpha');
68if ($contextpage ==
'poslist') {
77$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
78$search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
79$search_phone =
GETPOST(
"search_phone",
'alpha');
81$search_id =
GETPOST(
"search_id",
"intcomma");
82$search_ref_ext =
GETPOST(
"search_ref_ext",
"alpha");
83$search_firstlast_only =
GETPOST(
"search_firstlast_only",
'alpha');
84$search_lastname =
GETPOST(
"search_lastname",
'alpha');
85$search_firstname =
GETPOST(
"search_firstname",
'alpha');
86$search_societe =
GETPOST(
"search_societe",
'alpha');
87$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
88$search_poste =
GETPOST(
"search_poste",
'alpha');
89$search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
90$search_phone_pro =
GETPOST(
"search_phone_pro",
'alpha');
91$search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
92$search_fax =
GETPOST(
"search_fax",
'alpha');
93$search_email =
GETPOST(
"search_email",
'alpha');
94if (isModEnabled(
'mailing')) {
95 $search_no_email = GETPOSTISSET(
"search_no_email") ?
GETPOSTINT(
"search_no_email") : -1;
97 $search_no_email = -1;
102if (isModEnabled(
'socialnetworks')) {
103 foreach ($socialnetworks as $key => $value) {
104 if ($value[
'active']) {
105 $search_[$key] =
GETPOST(
"search_".$key,
'alpha');
109$search_priv =
GETPOST(
"search_priv",
'alpha');
110$search_sale =
GETPOST(
'search_sale',
'intcomma');
111$search_categ =
GETPOST(
"search_categ",
'intcomma');
112$search_categ_thirdparty =
GETPOST(
"search_categ_thirdparty",
'intcomma');
113$search_categ_supplier =
GETPOST(
"search_categ_supplier",
'intcomma');
114$search_status =
GETPOST(
"search_status",
"intcomma");
115$search_type =
GETPOST(
'search_type',
'alpha');
116$search_address =
GETPOST(
'search_address',
'alpha');
117$search_zip =
GETPOST(
'search_zip',
'alpha');
118$search_town =
GETPOST(
'search_town',
'alpha');
119$search_import_key =
GETPOST(
"search_import_key",
'alpha');
120$search_country =
GETPOST(
"search_country",
'aZ09');
121$search_roles =
GETPOST(
"search_roles",
'array');
122$search_level =
GETPOST(
"search_level",
'array');
123$search_stcomm =
GETPOST(
'search_stcomm',
'intcomma');
127if ($search_status ===
'') {
130if ($search_no_email ===
'') {
131 $search_no_email = -1;
134$optioncss =
GETPOST(
'optioncss',
'alpha');
136$place =
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0';
139$view =
GETPOST(
"view",
'alpha');
146$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
147$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
153 $sortfield =
"p.lastname";
155if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
159$offset = $limit * $page;
160$pageprev = $page - 1;
161$pagenext = $page + 1;
164$title = (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
166 if (empty($contextpage) || $contextpage ==
'contactlist') {
167 $contextpage =
'contactprospectlist';
169 $title .=
' ('.$langs->trans(
"ThirdPartyProspects").
')';
172 if (empty($contextpage) || $contextpage ==
'contactlist') {
173 $contextpage =
'contactcustomerlist';
175 $title .=
' ('.$langs->trans(
"ThirdPartyCustomers").
')';
176} elseif ($type ==
"f") {
177 if (empty($contextpage) || $contextpage ==
'contactlist') {
178 $contextpage =
'contactsupplierlist';
180 $title .=
' ('.$langs->trans(
"ThirdPartySuppliers").
')';
181} elseif ($type ==
"o") {
182 if (empty($contextpage) || $contextpage ==
'contactlist') {
183 $contextpage =
'contactotherlist';
185 $title .=
' ('.$langs->trans(
"OthersNotLinkedToThirdParty").
')';
191$hookmanager->initHooks(array($contextpage));
193if ($user->socid > 0) {
194 $socid = $user->socid;
199$extrafields->fetch_name_optionals_label(
$object->table_element);
201$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
204$fieldstosearchall = array();
205foreach (
$object->fields as $key => $val) {
207 if (!empty($user->socid) && $key ==
"note_private") {
211 if (empty($val[
'searchall'])) {
215 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
220 $fieldstosearchall[
's.nom'] =
"ThirdParty";
221 $fieldstosearchall[
's.name_alias'] =
"AliasNames";
224$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
225$reshook = $hookmanager->executeHooks(
'completeFieldsToSearchAll', $parameters, $object, $action);
227 $fieldstosearchall = empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall'];
228} elseif ($reshook == 0) {
229 $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray[
'fieldstosearchall']) ? array() : $hookmanager->resArray[
'fieldstosearchall']);
233$arrayfields = array();
234foreach (
$object->fields as $key => $val) {
236 if (!empty($val[
'visible'])) {
237 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
238 $arrayfields[
'p.'.$key] = array(
239 'label' => $val[
'label'],
240 'checked' => (($visible < 0) ?
'0' :
'1'),
241 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
242 'position' => $val[
'position'],
243 'help' => isset($val[
'help']) ? $val[
'help'] :
''
249$arrayfields[
'country.code_iso'] = array(
'label' =>
"Country",
'position' => 66,
'checked' =>
'0');
251 $arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'position' => 113,
'checked' =>
'1');
252 $arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'position' => 114,
'checked' =>
'1');
255$arrayfields[
'unsubscribed'] = array(
256 'label' =>
'No_Email',
258 'enabled' => (
string) (
int) (isModEnabled(
'mailing')),
261if (isModEnabled(
'socialnetworks')) {
262 foreach ($socialnetworks as $key => $value) {
263 if ($value[
'active']) {
264 $arrayfields[
'p.'.$key] = array(
265 'label' => $value[
'label'],
274include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
281if ((
$id > 0 || !empty($ref)) && $action !=
'add') {
288$permissiontoread = $user->hasRight(
'societe',
'contact',
'lire');
289$permissiontodelete = $user->hasRight(
'societe',
'contact',
'supprimer');
290$permissiontoadd = $user->hasRight(
'societe',
'contact',
'creer');
292if (!$permissiontoread) {
301if ($action ==
"change" && $user->hasRight(
'takepos',
'run')) {
306 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' AND entity IN (".
getEntity(
'invoice').
")";
307 $result = $db->query($sql);
308 $num_lines = $db->num_rows($result);
309 if ($num_lines == 0) {
310 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
312 $constforthirdpartyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"];
315 $invoice->module_source =
'takepos';
316 $invoice->pos_source = $_SESSION[
"takeposterminal"];
317 $placeid = $invoice->create($user);
318 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' where rowid = ".((int) $placeid);
322 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set fk_soc=".((int) $idcustomer).
" where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")'";
323 $resql = $db->query($sql);
326 if (!isset($invoice)) {
327 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
329 $invoice->fetch(0,
"(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")");
330 $invoice->delete_linked_contact(
'external',
'BILLING');
332 $invoice->add_contact($idcontact,
'BILLING'); ?>
334 console.log(
"Reload page invoice.php with place=<?php print $place; ?>");
335 parent.$(
"#poslines").load(
"invoice.php?place=<?php print $place; ?>",
function() {
337 <?php
if (!$resql) { ?>
338 alert(
'Error failed to update customer on draft invoice.');
340 parent.$(
"#idcustomer").val(<?php echo $idcustomer; ?>);
341 parent.$.colorbox.close();
348if (
GETPOST(
'cancel',
'alpha')) {
352if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
356$parameters = array(
'arrayfields' => &$arrayfields);
357$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
362if (empty($reshook)) {
364 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
367 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
370 $search_ref_ext =
'';
371 $search_firstlast_only =
"";
372 $search_lastname =
"";
373 $search_firstname =
"";
374 $search_societe =
"";
375 $search_societe_alias =
"";
377 $search_address =
"";
379 $search_country =
"";
382 $search_phone_perso =
"";
383 $search_phone_pro =
"";
384 $search_phone_mobile =
"";
387 $search_no_email = -1;
388 if (isModEnabled(
'socialnetworks')) {
389 foreach ($socialnetworks as $key => $value) {
390 if ($value[
'active']) {
401 $search_categ_thirdparty =
'';
402 $search_categ_supplier =
'';
403 $search_import_key =
'';
405 $search_array_options = array();
406 $search_roles = array();
407 $search_birthday_start =
'';
408 $search_birthday_end =
'';
412 $objectclass =
'Contact';
413 $objectlabel =
'Contact';
414 $uploaddir =
$conf->societe->dir_output;
415 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
417 if ($action ==
'setstcomm' && $permissiontoadd) {
430if ($search_priv < 0) {
435if (!$user->hasRight(
'societe',
'client',
'voir')) {
436 $socid = $user->socid;
444$form =
new Form($db);
447$contactstatic =
new Contact($db);
451$title = $langs->trans(
"Contacts");
452$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
457 $contactstatic->loadCacheOfProspStatus();
460$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
461$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
465$sql =
"SELECT code, label, sortorder";
466$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
467$sql .=
" WHERE active > 0";
468$sql .=
" ORDER BY sortorder";
469$resql = $db->query($sql);
471 while ($obj = $db->fetch_object($resql)) {
473 $level = $langs->trans($obj->code);
474 if ($level == $obj->code) {
475 $level = $langs->trans($obj->label);
477 $tab_level[$obj->code] = $level;
485$sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias as alias,";
486$sql .=
" p.rowid, p.ref_ext, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.birthday,";
487$sql .=
" p.socialnetworks, p.photo,";
488$sql .=
" p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.ip, p.datec as date_creation, p.tms as date_modification,";
489$sql .=
" p.import_key, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,";
490$sql .=
" st.libelle as stcomm, st.picto as stcomm_picto,";
491$sql .=
" co.label as country, co.code as country_code";
493if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
494 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
495 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
498if (isModEnabled(
'mailing')) {
499 $sql .=
", (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) as unsubscribed";
503$parameters = array();
504$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
505$sql .= $hookmanager->resPrint;
506$sql = preg_replace(
'/,\s*$/',
'', $sql);
510$sql .=
" FROM ".MAIN_DB_PREFIX.
"socpeople as p";
511if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
512 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
514$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as co ON co.rowid = p.fk_pays";
515$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = p.fk_soc";
516$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_stcommcontact as st ON st.id = p.fk_stcommcontact";
519$parameters = array();
520$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
521$sql .= $hookmanager->resPrint;
522$sql .=
' WHERE p.entity IN ('.getEntity(
'contact').
')';
523if (!empty($userid)) {
524 $sql .=
" AND p.fk_user_creat=".((int) $userid);
527 $sql .=
natural_search(
"p.fk_prospectlevel", implode(
',', $search_level), 3);
529if ($search_stcomm !=
'' && $search_stcomm != -2) {
534if ($search_priv !=
'0' && $search_priv !=
'1') {
535 $sql .=
" AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
"))";
537 if ($search_priv ==
'0') {
538 $sql .=
" AND p.priv='0'";
540 if ($search_priv ==
'1') {
541 $sql .=
" AND (p.priv='1' AND p.fk_user_creat=".((int) $user->id).
")";
545if (!empty($search_sale) && $search_sale !=
'-1') {
546 if ($search_sale == -2) {
547 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
548 } elseif ($search_sale > 0) {
549 $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).
")";
554$searchCategoryContactList = $search_categ ? array($search_categ) : array();
555$searchCategoryContactOperator = 0;
557if (!empty($searchCategoryContactList)) {
558 $searchCategoryContactSqlList = array();
559 $listofcategoryid =
'';
560 foreach ($searchCategoryContactList as $searchCategoryContact) {
561 if (intval($searchCategoryContact) == -2) {
562 $searchCategoryContactSqlList[] =
"NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX.
"categorie_contact as ck WHERE p.rowid = ck.fk_socpeople)";
563 } elseif (intval($searchCategoryContact) > 0) {
564 if ($searchCategoryContactOperator == 0) {
565 $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).
")";
567 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryContact);
571 if ($listofcategoryid) {
572 $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).
"))";
574 if ($searchCategoryContactOperator == 1) {
575 if (!empty($searchCategoryContactSqlList)) {
576 $sql .=
" AND (".implode(
' OR ', $searchCategoryContactSqlList).
")";
579 if (!empty($searchCategoryContactSqlList)) {
580 $sql .=
" AND (".implode(
' AND ', $searchCategoryContactSqlList).
")";
586$searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array();
587$searchCategoryCustomerOperator = 0;
589if (!empty($searchCategoryCustomerList)) {
590 $searchCategoryCustomerSqlList = array();
591 $listofcategoryid =
'';
592 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
593 if (intval($searchCategoryCustomer) == -2) {
594 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
595 } elseif (intval($searchCategoryCustomer) > 0) {
596 if ($searchCategoryCustomerOperator == 0) {
597 $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).
")";
599 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
603 if ($listofcategoryid) {
604 $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).
"))";
606 if ($searchCategoryCustomerOperator == 1) {
607 if (!empty($searchCategoryCustomerSqlList)) {
608 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
611 if (!empty($searchCategoryCustomerSqlList)) {
612 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
618$searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array();
619$searchCategorySupplierOperator = 0;
621if (!empty($searchCategorySupplierList)) {
622 $searchCategorySupplierSqlList = array();
623 $listofcategoryid =
'';
624 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
625 if (intval($searchCategorySupplier) == -2) {
626 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
627 } elseif (intval($searchCategorySupplier) > 0) {
628 if ($searchCategorySupplierOperator == 0) {
629 $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).
")";
631 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
635 if ($listofcategoryid) {
636 $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).
"))";
638 if ($searchCategorySupplierOperator == 1) {
639 if (!empty($searchCategorySupplierSqlList)) {
640 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
643 if (!empty($searchCategorySupplierSqlList)) {
644 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
650 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
652if (strlen($search_phone)) {
653 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_phone);
655if (strlen($search_cti)) {
656 $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_cti);
658if (strlen($search_firstlast_only)) {
659 $sql .=
natural_search(array(
'p.lastname',
'p.firstname'), $search_firstlast_only);
665if ($search_ref_ext) {
668if ($search_lastname) {
671if ($search_firstname) {
674if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
675 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
677 if ($search_societe) {
680 if ($search_societe_alias) {
684if ($search_country) {
685 $sql .=
" AND p.fk_pays IN (".$db->sanitize($search_country).
')';
687if (strlen($search_poste)) {
690if (strlen($search_phone_perso)) {
693if (strlen($search_phone_pro)) {
696if (strlen($search_phone_mobile)) {
699if (strlen($search_fax)) {
702if (isModEnabled(
'socialnetworks')) {
703 foreach ($socialnetworks as $key => $value) {
704 if ($value[
'active'] && strlen($search_[$key])) {
705 $searchkeyinjsonformat = preg_replace(
'/"$/',
'', preg_replace(
'/^"/',
'', json_encode($search_[$key])));
706 if (in_array($db->type, array(
'mysql',
'mysqli'))) {
707 $sql .=
" AND p.socialnetworks REGEXP '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
708 } elseif ($db->type ==
'pgsql') {
709 $sql .=
" AND p.socialnetworks ~ '\"".$db->escape($db->escapeforlike($key)).
"\":\"[^\"]*".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"'";
712 $sql .=
" AND p.socialnetworks LIKE '%\"".$db->escape($db->escapeforlike($key)).
"\":\"".$db->escape($db->escapeforlike($searchkeyinjsonformat)).
"%'";
719if (strlen($search_email)) {
722if (strlen($search_address)) {
725if (strlen($search_zip)) {
728if (strlen($search_town)) {
731if (count($search_roles) > 0) {
732 $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)).
"))";
734if ($search_no_email != -1 && $search_no_email > 0) {
735 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) > 0";
737if ($search_no_email != -1 && $search_no_email == 0) {
738 $sql .=
" AND (SELECT count(*) FROM ".MAIN_DB_PREFIX.
"mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
740if ($search_status !=
'' && $search_status >= 0) {
741 $sql .=
" AND p.statut = ".((int) $search_status);
743if ($search_import_key) {
747 $sql .=
" AND p.fk_soc IS NULL";
748} elseif ($type ==
"f") {
749 $sql .=
" AND s.fournisseur = 1";
750} elseif ($type ==
"c") {
751 $sql .=
" AND s.client IN (1, 3)";
752} elseif ($type ==
"p") {
753 $sql .=
" AND s.client IN (2, 3)";
756 $sql .=
" AND s.rowid = ".((int) $socid);
758if ($search_birthday_start) {
759 $sql .=
" AND p.birthday >= '".$db->idate($search_birthday_start).
"'";
761if ($search_birthday_end) {
762 $sql .=
" AND p.birthday <= '".$db->idate($search_birthday_end).
"'";
766include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
769$parameters = array();
770$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
771$sql .= $hookmanager->resPrint;
775$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
776$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
777$sql .= $hookmanager->resPrint;
781$nbtotalofrecords =
'';
784 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
785 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
786 $resql = $db->query($sqlforcount);
788 $objforcount = $db->fetch_object($resql);
789 $nbtotalofrecords = $objforcount->nbtotalofrecords;
794 if (($page * $limit) > $nbtotalofrecords) {
802if ($view ==
"recent") {
803 $sql .= $db->order(
"p.datec",
"DESC");
805 $sql .= $db->order($sortfield, $sortorder);
808 $sql .= $db->plimit($limit + 1, $offset);
811$resql = $db->query($sql);
817$num = $db->num_rows($resql);
820if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($search_all !=
'' || $search_cti !=
'') && !$page) {
821 $obj = $db->fetch_object($resql);
823 header(
"Location: ".DOL_URL_ROOT.
'/contact/card.php?id='.
$id);
831llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-societe page-contact-list bodyforlist');
833$arrayofselected = is_array($toselect) ? $toselect : array();
837 $param .=
'&mode='.urlencode($mode);
839if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
840 $param .=
'&contextpage='.urlencode($contextpage);
842if ($limit > 0 && $limit !=
$conf->liste_limit) {
843 $param .=
'&limit='.((int) $limit);
845if ($optioncss !=
'') {
846 $param .=
'&optioncss='.urlencode($optioncss);
848$param .=
'&userid='.urlencode((
string) $userid).
'&contactname='.urlencode((
string) $search_all);
849$param .=
'&type='.urlencode($type).
'&view='.urlencode($view);
850if (!empty($search_sale) && $search_sale !=
'-1') {
851 $param .=
'&search_sale='.urlencode($search_sale);
853if (!empty($search_categ) && $search_categ !=
'-1') {
854 $param .=
'&search_categ='.urlencode((
string) ($search_categ));
856if (!empty($search_categ_thirdparty) && $search_categ_thirdparty !=
'-1') {
857 $param .=
'&search_categ_thirdparty='.urlencode((
string) ($search_categ_thirdparty));
859if (!empty($search_categ_supplier) && $search_categ_supplier !=
'-1') {
860 $param .=
'&search_categ_supplier='.urlencode((
string) ($search_categ_supplier));
862if ($search_all !=
'') {
863 $param .=
'&search_all='.urlencode($search_all);
866 $param .=
"&search_id=".((int) $search_id);
868if ($search_ref_ext) {
869 $param .=
"&search_ref_ext=".urlencode($search_ref_ext);
871if ($search_lastname !=
'') {
872 $param .=
'&search_lastname='.urlencode($search_lastname);
874if ($search_firstname !=
'') {
875 $param .=
'&search_firstname='.urlencode($search_firstname);
877if ($search_societe !=
'') {
878 $param .=
'&search_societe='.urlencode($search_societe);
880if ($search_societe_alias !=
'') {
881 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
883if ($search_address !=
'') {
884 $param .=
'&search_address='.urlencode($search_address);
886if ($search_zip !=
'') {
887 $param .=
'&search_zip='.urlencode($search_zip);
889if ($search_town !=
'') {
890 $param .=
'&search_town='.urlencode($search_town);
892if ($search_country !=
'') {
893 $param .=
"&search_country=".urlencode($search_country);
895if ($search_poste !=
'') {
896 $param .=
'&search_poste='.urlencode($search_poste);
898if ($search_phone_pro !=
'') {
899 $param .=
'&search_phone_pro='.urlencode($search_phone_pro);
901if ($search_phone_perso !=
'') {
902 $param .=
'&search_phone_perso='.urlencode($search_phone_perso);
904if ($search_phone_mobile !=
'') {
905 $param .=
'&search_phone_mobile='.urlencode($search_phone_mobile);
907if ($search_fax !=
'') {
908 $param .=
'&search_fax='.urlencode($search_fax);
910if ($search_email !=
'') {
911 $param .=
'&search_email='.urlencode($search_email);
913if ($search_no_email !=
'') {
914 $param .=
'&search_no_email='.urlencode((
string) ($search_no_email));
916if ($search_status !=
'') {
917 $param .=
'&search_status='.urlencode((
string) ($search_status));
919if ($search_priv ==
'0' || $search_priv ==
'1') {
920 $param .=
"&search_priv=".urlencode($search_priv);
922if ($search_stcomm !=
'') {
923 $param .=
'&search_stcomm='.urlencode((
string) ($search_stcomm));
925if (is_array($search_level) && count($search_level)) {
926 foreach ($search_level as $slevel) {
927 $param .=
'&search_level[]='.urlencode($slevel);
930if ($search_import_key !=
'') {
931 $param .=
'&search_import_key='.urlencode($search_import_key);
933if (count($search_roles) > 0) {
934 $param .= implode(
'&search_roles[]=', $search_roles);
936if ($search_birthday_start) {
937 $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'));
939if ($search_birthday_end) {
940 $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'));
943include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
946$arrayofmassactions = array(
947 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
951if (!empty($permissiontodelete)) {
952 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
954if (isModEnabled(
'category') && $user->hasRight(
'societe',
'creer')) {
955 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
957if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
958 $arrayofmassactions = array();
961$massactionbutton =
'';
962if ($contextpage !=
'poslist') {
963 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
966print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter">';
967if ($optioncss !=
'') {
968 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
970print
'<input type="hidden" name="token" value="'.newToken().
'">';
971print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
972print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
973print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
974print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
976print
'<input type="hidden" name="type" value="'.$type.
'">';
977print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
978print
'<input type="hidden" name="page_y" value="">';
979print
'<input type="hidden" name="mode" value="'.$mode.
'">';
983$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'));
984$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'));
986if ($contextpage !=
'poslist') {
987 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewContactAddress'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create',
'', $permissiontoadd);
988} elseif ($user->hasRight(
'societe',
'contact',
'creer')) {
989 $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);
990 $label =
'MenuNewCustomer';
991 $newcardbutton .=
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url);
994print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, (
string) $massactionbutton, $num, $nbtotalofrecords,
'address', 0, $newcardbutton,
'', $limit, 0, 0, 1);
996$topicmail =
"Information";
997$modelmail =
"contact";
999$trackid =
'ctc'.$object->id;
1000include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1004 foreach ($fieldstosearchall as $key => $val) {
1005 $fieldstosearchall[$key] = $langs->trans($val);
1006 $setupstring .= $key.
"=".$val.
";";
1008 print
'<!-- Search done like if CONTACT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
1009 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1011if ($search_firstlast_only) {
1012 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_firstlast_only).$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
'</div>';
1018if ($user->hasRight(
'societe',
'client',
'voir')) {
1019 $langs->load(
'commercial');
1020 $moreforfilter .=
'<div class="divsearchfield">';
1021 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1022 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1023 $moreforfilter .=
'</div>';
1026if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1027 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1028 $moreforfilter .=
'<div class="divsearchfield">';
1029 $tmptitle = $langs->trans(
'ContactCategoriesShort');
1030 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1031 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, (
int) $search_categ,
'search_categ', 1, $tmptitle);
1032 $moreforfilter .=
'</div>';
1033 if (empty($type) || $type ==
'c' || $type ==
'p') {
1034 $moreforfilter .=
'<div class="divsearchfield">';
1037 $tmptitle .= $langs->trans(
'CustomersCategoriesShort');
1038 } elseif ($type ==
'p') {
1039 $tmptitle .= $langs->trans(
'ProspectsCategoriesShort');
1041 $tmptitle .= $langs->trans(
'CustomersProspectsCategoriesShort');
1043 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1044 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, (
int) $search_categ_thirdparty,
'search_categ_thirdparty', 1, $tmptitle);
1045 $moreforfilter .=
'</div>';
1048 if (isModEnabled(
"fournisseur") && (empty($type) || $type ==
'f')) {
1049 $moreforfilter .=
'<div class="divsearchfield">';
1050 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1051 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1052 $moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, (
int) $search_categ_supplier,
'search_categ_supplier', 1, $tmptitle);
1053 $moreforfilter .=
'</div>';
1057$moreforfilter .=
'<div class="divsearchfield">';
1058$moreforfilter .= $formcompany->showRoles(
"search_roles", $objecttmp,
'edit', $search_roles,
'minwidth500', $langs->transnoentitiesnoconv(
'ContactRoles'));
1059$moreforfilter .=
'</div>';
1061print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1062print $moreforfilter;
1063$parameters = array(
'type' => $type);
1064$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1065print $hookmanager->resPrint;
1068$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1069$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1070$selectedfields .= ((count($arrayofmassactions) && $contextpage !=
'poslist') ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1072print
'<div class="div-table-responsive">';
1073print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1077print
'<tr class="liste_titre_filter">';
1080 print
'<td class="liste_titre center maxwidthsearch actioncolumn">';
1081 $searchpicto = $form->showFilterButtons(
'left');
1085if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1086 print
'<td class="liste_titre">';
1087 print
'<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).
'">';
1090if (!empty($arrayfields[
'p.lastname'][
'checked'])) {
1091 print
'<td class="liste_titre">';
1092 print
'<input class="flat width75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'">';
1095if (!empty($arrayfields[
'p.firstname'][
'checked'])) {
1096 print
'<td class="liste_titre">';
1097 print
'<input class="flat width75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'">';
1100if (!empty($arrayfields[
'p.ref_ext'][
'checked'])) {
1101 print
'<td class="liste_titre">';
1102 print
'<input class="flat width50" type="text" name="search_ref_ext" value="'.dol_escape_htmltag($search_ref_ext).
'">';
1105if (!empty($arrayfields[
'p.poste'][
'checked'])) {
1106 print
'<td class="liste_titre">';
1107 print
'<input class="flat width50" type="text" name="search_poste" value="'.dol_escape_htmltag($search_poste).
'">';
1110if (!empty($arrayfields[
'p.address'][
'checked'])) {
1111 print
'<td class="liste_titre">';
1112 print
'<input class="flat width50" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'">';
1115if (!empty($arrayfields[
'p.zip'][
'checked'])) {
1116 print
'<td class="liste_titre">';
1117 print
'<input class="flat width50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'">';
1120if (!empty($arrayfields[
'p.town'][
'checked'])) {
1121 print
'<td class="liste_titre">';
1122 print
'<input class="flat width50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'">';
1145if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1146 print
'<td class="liste_titre center">';
1147 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1150if (!empty($arrayfields[
'p.phone'][
'checked'])) {
1151 print
'<td class="liste_titre">';
1152 print
'<input class="flat" type="text" name="search_phone_pro" size="6" value="'.dol_escape_htmltag($search_phone_pro).
'">';
1155if (!empty($arrayfields[
'p.phone_perso'][
'checked'])) {
1156 print
'<td class="liste_titre">';
1157 print
'<input class="flat" type="text" name="search_phone_perso" size="6" value="'.dol_escape_htmltag($search_phone_perso).
'">';
1160if (!empty($arrayfields[
'p.phone_mobile'][
'checked'])) {
1161 print
'<td class="liste_titre">';
1162 print
'<input class="flat" type="text" name="search_phone_mobile" size="6" value="'.dol_escape_htmltag($search_phone_mobile).
'">';
1165if (!empty($arrayfields[
'p.fax'][
'checked'])) {
1166 print
'<td class="liste_titre">';
1167 print
'<input class="flat" type="text" name="search_fax" size="6" value="'.dol_escape_htmltag($search_fax).
'">';
1170if (!empty($arrayfields[
'p.email'][
'checked'])) {
1171 print
'<td class="liste_titre">';
1172 print
'<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).
'">';
1175if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1176 print
'<td class="liste_titre center">';
1177 print $form->selectarray(
'search_no_email', array(
'-1' =>
'',
'0' => $langs->trans(
'No'),
'1' => $langs->trans(
'Yes')), $search_no_email);
1180if (isModEnabled(
'socialnetworks')) {
1181 foreach ($socialnetworks as $key => $value) {
1182 if ($value[
'active']) {
1183 if (!empty($arrayfields[
'p.'.$key][
'checked'])) {
1184 print
'<td class="liste_titre">';
1185 print
'<input class="flat" type="text" name="search_'.$key.
'" size="6" value="'.
dol_escape_htmltag($search_[$key]).
'">';
1191if (!empty($arrayfields[
'p.fk_soc'][
'checked']) || !empty($arrayfields[
's.nom'][
'checked'])) {
1192 print
'<td class="liste_titre">';
1193 print
'<input class="flat" type="text" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1197if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1198 print
'<td class="liste_titre" align="left">';
1199 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1202if (!empty($arrayfields[
'p.priv'][
'checked'])) {
1203 print
'<td class="liste_titre center">';
1204 $selectarray = array(
'0' => $langs->trans(
"ContactPublic"),
'1' => $langs->trans(
"ContactPrivate"));
1205 print $form->selectarray(
'search_priv', $selectarray, $search_priv, 1);
1209if (!empty($arrayfields[
'p.fk_prospectlevel'][
'checked'])) {
1210 print
'<td class="liste_titre center">';
1211 print $form->multiselectarray(
'search_level', $tab_level, $search_level, 0, 0,
'width75', 0, 0,
'',
'',
'', 2);
1215if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked'])) {
1216 print
'<td class="liste_titre maxwidthonsmartphone center">';
1217 $arraystcomm = array();
1218 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1219 $arraystcomm[$val[
'id']] = ($langs->trans(
"StatusProspect".$val[
'id']) !=
"StatusProspect".$val[
'id'] ? $langs->trans(
"StatusProspect".$val[
'id']) : $val[
'label']);
1221 print $form->selectarray(
'search_stcomm', $arraystcomm, $search_stcomm, -2, 0, 0,
'', 0, 0, 0,
'',
'nowrap ');
1224if (!empty($arrayfields[
'p.birthday'][
'checked'])) {
1225 print
'<td class="liste_titre center">';
1226 print
'<div class="nowrap">';
1227 print $form->selectDate($search_birthday_start ? $search_birthday_start : -1,
'search_birthday_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1229 print
'<div class="nowrap">';
1230 print $form->selectDate($search_birthday_end ? $search_birthday_end : -1,
'search_birthday_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1236include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1239$parameters = array(
'arrayfields' => $arrayfields);
1240$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1241print $hookmanager->resPrint;
1243if (!empty($arrayfields[
'p.ip'][
'checked'])) {
1244 print
'<td class="liste_titre">';
1248if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1249 print
'<td class="liste_titre">';
1253if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1254 print
'<td class="liste_titre">';
1258if (!empty($arrayfields[
'p.statut'][
'checked'])) {
1259 print
'<td class="liste_titre center parentonrightofpage">';
1260 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');
1263if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1264 print
'<td class="liste_titre center">';
1265 print
'<input class="flat searchstring" type="text" name="search_import_key" size="3" value="'.dol_escape_htmltag($search_import_key).
'">';
1270 print
'<td class="liste_titre center maxwidthsearch">';
1271 $searchpicto = $form->showFilterButtons();
1282print
'<tr class="liste_titre">';
1284 print
getTitleFieldOfList(($mode !=
'kanban' ? $selectedfields :
''), 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1287if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1288 print_liste_field_titre($arrayfields[
'p.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
"", $sortfield, $sortorder);
1291if (!empty($arrayfields[
'p.lastname'][
'checked'])) {
1292 print_liste_field_titre($arrayfields[
'p.lastname'][
'label'], $_SERVER[
"PHP_SELF"],
"p.lastname", $begin, $param,
'', $sortfield, $sortorder);
1295if (!empty($arrayfields[
'p.firstname'][
'checked'])) {
1296 print_liste_field_titre($arrayfields[
'p.firstname'][
'label'], $_SERVER[
"PHP_SELF"],
"p.firstname", $begin, $param,
'', $sortfield, $sortorder);
1299if (!empty($arrayfields[
'p.ref_ext'][
'checked'])) {
1300 print_liste_field_titre($arrayfields[
'p.ref_ext'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref_ext", $begin, $param,
'', $sortfield, $sortorder);
1303if (!empty($arrayfields[
'p.poste'][
'checked'])) {
1304 print_liste_field_titre($arrayfields[
'p.poste'][
'label'], $_SERVER[
"PHP_SELF"],
"p.poste", $begin, $param,
'', $sortfield, $sortorder);
1307if (!empty($arrayfields[
'p.address'][
'checked'])) {
1308 print_liste_field_titre($arrayfields[
'p.address'][
'label'], $_SERVER[
"PHP_SELF"],
"p.address", $begin, $param,
'', $sortfield, $sortorder);
1311if (!empty($arrayfields[
'p.zip'][
'checked'])) {
1312 print_liste_field_titre($arrayfields[
'p.zip'][
'label'], $_SERVER[
"PHP_SELF"],
"p.zip", $begin, $param,
'', $sortfield, $sortorder);
1315if (!empty($arrayfields[
'p.town'][
'checked'])) {
1316 print_liste_field_titre($arrayfields[
'p.town'][
'label'], $_SERVER[
"PHP_SELF"],
"p.town", $begin, $param,
'', $sortfield, $sortorder);
1321if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1322 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"co.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1325if (!empty($arrayfields[
'p.phone'][
'checked'])) {
1326 print_liste_field_titre($arrayfields[
'p.phone'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone", $begin, $param,
'', $sortfield, $sortorder);
1329if (!empty($arrayfields[
'p.phone_perso'][
'checked'])) {
1330 print_liste_field_titre($arrayfields[
'p.phone_perso'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone_perso", $begin, $param,
'', $sortfield, $sortorder);
1333if (!empty($arrayfields[
'p.phone_mobile'][
'checked'])) {
1334 print_liste_field_titre($arrayfields[
'p.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
"p.phone_mobile", $begin, $param,
'', $sortfield, $sortorder);
1337if (!empty($arrayfields[
'p.fax'][
'checked'])) {
1338 print_liste_field_titre($arrayfields[
'p.fax'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fax", $begin, $param,
'', $sortfield, $sortorder);
1341if (!empty($arrayfields[
'p.email'][
'checked'])) {
1342 print_liste_field_titre($arrayfields[
'p.email'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email", $begin, $param,
'', $sortfield, $sortorder);
1345if (!empty($arrayfields[
'unsubscribed'][
'checked'])) {
1346 print_liste_field_titre($arrayfields[
'unsubscribed'][
'label'], $_SERVER[
"PHP_SELF"],
"unsubscribed", $begin, $param,
'', $sortfield, $sortorder,
'center ');
1349if (isModEnabled(
'socialnetworks')) {
1350 foreach ($socialnetworks as $key => $value) {
1351 if ($value[
'active'] && !empty($arrayfields[
'p.'.$key][
'checked'])) {
1352 print_liste_field_titre($arrayfields[
'p.'.$key][
'label'], $_SERVER[
"PHP_SELF"],
"p.".$key, $begin, $param,
'', $sortfield, $sortorder);
1357if (!empty($arrayfields[
'p.fk_soc'][
'checked'])) {
1358 print_liste_field_titre($arrayfields[
'p.fk_soc'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_soc", $begin, $param,
'', $sortfield, $sortorder);
1361if (!empty($arrayfields[
's.nom'][
'checked'])) {
1362 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $begin, $param,
'', $sortfield, $sortorder);
1365if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1367 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias", $begin, $param,
'', $sortfield, $sortorder);
1370if (!empty($arrayfields[
'p.priv'][
'checked'])) {
1371 print_liste_field_titre($arrayfields[
'p.priv'][
'label'], $_SERVER[
"PHP_SELF"],
"p.priv", $begin, $param,
'', $sortfield, $sortorder,
'center ');
1374if (!empty($arrayfields[
'p.fk_prospectlevel'][
'checked'])) {
1375 print_liste_field_titre($arrayfields[
'p.fk_prospectlevel'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_prospectlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
1378if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked'])) {
1379 print_liste_field_titre($arrayfields[
'p.fk_stcommcontact'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_stcommcontact",
"", $param,
'', $sortfield, $sortorder,
'center ');
1382if (!empty($arrayfields[
'p.birthday'][
'checked'])) {
1383 print_liste_field_titre($arrayfields[
'p.birthday'][
'label'], $_SERVER[
"PHP_SELF"],
"p.birthday",
"", $param,
'', $sortfield, $sortorder,
'center ');
1387include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1389$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1390$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1391print $hookmanager->resPrint;
1393if (!empty($arrayfields[
'p.ip'][
'checked'])) {
1394 print_liste_field_titre($arrayfields[
'p.ip'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ip",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1398if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1399 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1402if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1403 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1406if (!empty($arrayfields[
'p.statut'][
'checked'])) {
1407 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1410if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1411 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1415 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1427$imaxinloop = ($limit ? min($num, $limit) : $num);
1428while ($i < $imaxinloop) {
1429 $obj = $db->fetch_object($resql);
1434 $arraysocialnetworks = (array) json_decode($obj->socialnetworks,
true);
1435 $contactstatic->id = $obj->rowid;
1436 $contactstatic->ref_ext = $obj->ref_ext;
1437 $contactstatic->lastname = $obj->lastname;
1438 $contactstatic->firstname = $obj->firstname;
1439 $contactstatic->statut = $obj->statut;
1440 $contactstatic->poste = $obj->poste;
1441 $contactstatic->email = $obj->email;
1442 $contactstatic->phone_pro = $obj->phone_pro;
1443 $contactstatic->phone_perso = $obj->phone_perso;
1444 $contactstatic->phone_mobile = $obj->phone_mobile;
1445 $contactstatic->address = $obj->address;
1446 $contactstatic->zip = $obj->zip;
1447 $contactstatic->town = $obj->town;
1448 $contactstatic->socialnetworks = $arraysocialnetworks;
1449 $contactstatic->country = $obj->country;
1450 $contactstatic->country_code = $obj->country_code;
1451 $contactstatic->photo = $obj->photo;
1452 $contactstatic->import_key = $obj->import_key;
1453 $contactstatic->photo = $obj->photo;
1454 $contactstatic->fk_prospectlevel = $obj->fk_prospectlevel;
1458 if ($mode ==
'kanban') {
1460 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1461 print
'<div class="box-flex-container kanban">';
1464 if ($massactionbutton || $massaction) {
1466 if (in_array(
$object->id, $arrayofselected)) {
1470 if ($obj->socid > 0) {
1471 $contactstatic->fetch_thirdparty($obj->socid);
1473 print $contactstatic->getKanbanView(
'', array(
'selected' => in_array($contactstatic->id, $arrayofselected)));
1474 if ($i == ($imaxinloop - 1)) {
1480 print
'<tr data-rowid="'.$object->id.
'" class="oddeven"';
1481 if ($contextpage ==
'poslist') {
1482 print
' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->socid.
'&idcontact='.$obj->rowid.
'&place='.urlencode($place).
'\'"';
1487 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1488 print '<td class="nowrap center
">';
1489 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1491 if (in_array($obj->rowid, $arrayofselected)) {
1494 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1498 $totalarray['nbfield']++;
1503 if (!empty($arrayfields['p.rowid']['checked'])) {
1504 print '<td class="tdoverflowmax50
">';
1505 print dol_escape_htmltag($obj->rowid);
1508 $totalarray['nbfield']++;
1513 if (!empty($arrayfields['p.lastname']['checked'])) {
1514 print '<td class="middle tdoverflowmax150
" title="'.dolPrintHTMLForAttribute($contactstatic->lastname).'">';
1515 if ($contextpage == 'poslist') {
1516 print $contactstatic->lastname;
1518 print $contactstatic->getNomUrl(1);
1522 $totalarray['nbfield']++;
1527 if (!empty($arrayfields['p.firstname']['checked'])) {
1528 print '<td class="tdoverflowmax150
" title="'.dolPrintHTMLForAttribute($obj->firstname).'">';
1529 print dolPrintHTML($obj->firstname);
1532 $totalarray['nbfield']++;
1537 if (!empty($arrayfields['p.ref_ext']['checked'])) {
1538 print '<td class="middle tdoverflowmax100
" title="'.dolPrintHTMLForAttribute($contactstatic->ref_ext).'">';
1539 print dolPrintHTML($contactstatic->ref_ext);
1542 $totalarray['nbfield']++;
1547 if (!empty($arrayfields['p.poste']['checked'])) {
1548 print '<td class="tdoverflowmax100
">'.dol_escape_htmltag($obj->poste).'</td>';
1550 $totalarray['nbfield']++;
1555 if (!empty($arrayfields['p.address']['checked'])) {
1556 print '<td>'.dol_escape_htmltag($obj->address).'</td>';
1558 $totalarray['nbfield']++;
1563 if (!empty($arrayfields['p.zip']['checked'])) {
1564 print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
1566 $totalarray['nbfield']++;
1571 if (!empty($arrayfields['p.town']['checked'])) {
1572 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->town).'">'.dol_escape_htmltag($obj->town).'</td>';
1574 $totalarray['nbfield']++;
1580 if (!empty($arrayfields['state.nom']['checked']))
1582 print "<td>
".$obj->state_name."</td>\n
";
1583 if (! $i) $totalarray['nbfield']++;
1587 if (!empty($arrayfields['region.nom']['checked']))
1589 print "<td>
".$obj->region_name."</td>\n
";
1590 if (! $i) $totalarray['nbfield']++;
1594 if (!empty($arrayfields['country.code_iso']['checked'])) {
1595 print '<td class="center
">';
1596 $tmparray = getCountry($obj->fk_pays, 'all');
1597 print dol_escape_htmltag($tmparray['label']);
1600 $totalarray['nbfield']++;
1605 if (!empty($arrayfields['p.phone']['checked'])) {
1606 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1608 $totalarray['nbfield']++;
1613 if (!empty($arrayfields['p.phone_perso']['checked'])) {
1614 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
1616 $totalarray['nbfield']++;
1621 if (!empty($arrayfields['p.phone_mobile']['checked'])) {
1622 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
1624 $totalarray['nbfield']++;
1629 if (!empty($arrayfields['p.fax']['checked'])) {
1630 print '<td class="nowraponall tdoverflowmax150
">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
1632 $totalarray['nbfield']++;
1637 if (!empty($arrayfields['p.email']['checked'])) {
1638 print '<td class="nowraponall tdoverflowmax200
" title="'.dolPrintHTML($obj->email).'">';
1639 if ($contextpage == 'poslist') {
1642 print dol_print_email($obj->email, $obj->rowid, $obj->socid, 1, 18, 0, 1);
1646 $totalarray['nbfield']++;
1650 // No EMail Subscription
1651 if (!empty($arrayfields['unsubscribed']['checked'])) {
1652 print '<td class="center
">';
1653 if (empty($obj->email)) {
1654 //print '<span class="opacitymedium
">'.$langs->trans("NoEmail
").'</span>';
1656 print yn(($obj->unsubscribed > 0) ? 1 : 0);
1660 $totalarray['nbfield']++;
1665 if (isModEnabled('socialnetworks')) {
1666 foreach ($socialnetworks as $key => $value) {
1667 if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
1668 print '<td class="tdoverflowmax100
">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>';
1670 $totalarray['nbfield']++;
1676 // Company / Third Party
1677 if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
1678 print '<td class="tdoverflowmax125
">';
1680 $objsoc = new Societe($db);
1681 $objsoc->fetch($obj->socid);
1682 $option_link = 'customer';
1683 if ($objsoc->client == 0 && $objsoc->fournisseur > 0) {
1684 $option_link = 'supplier';
1685 } elseif ($objsoc->client == 0 && $objsoc->fournisseur == 0) {
1688 if ($contextpage == 'poslist') {
1689 print $objsoc->name;
1691 print $objsoc->getNomUrl(1, $option_link, 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
1698 $totalarray['nbfield']++;
1703 if (!empty($arrayfields['s.name_alias']['checked'])) {
1704 print '<td class="tdoverflowmax100
" title="'.dol_escape_htmltag($obj->alias).'">';
1705 print dol_escape_htmltag($obj->alias);
1708 $totalarray['nbfield']++;
1713 if (!empty($arrayfields['p.priv']['checked'])) {
1714 print '<td class="center
">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
1716 $totalarray['nbfield']++;
1721 if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
1722 print '<td class="center
">';
1723 print $contactstatic->getLibProspLevel();
1726 $totalarray['nbfield']++;
1731 if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
1732 print '<td class="center nowrap
"><div class="nowrap
">';
1733 print '<div class="inline-block
">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
1734 print '</div> - <div class="inline-block
">';
1735 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1736 $titlealt = 'default';
1737 if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) {
1738 $titlealt = $val['label'];
1740 if ($obj->stcomm_id != $val['id']) {
1741 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>';
1744 print '</div></div></td>';
1746 $totalarray['nbfield']++;
1751 if (!empty($arrayfields['p.birthday']['checked'])) {
1752 print '<td class="center nowraponall
">';
1753 print dol_print_date($db->jdate($obj->birthday), 'day', 'tzuser');
1756 $totalarray['nbfield']++;
1761 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1764 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
1765 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1766 print $hookmanager->resPrint;
1769 if (!empty($arrayfields['p.ip']['checked'])) {
1770 print '<td class="center nowraponall
">';
1771 print dol_print_ip($obj->ip);
1774 $totalarray['nbfield']++;
1779 if (!empty($arrayfields['p.datec']['checked'])) {
1780 print '<td class="center nowraponall
">';
1781 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
1784 $totalarray['nbfield']++;
1788 // Date modification
1789 if (!empty($arrayfields['p.tms']['checked'])) {
1790 print '<td class="center nowraponall
">';
1791 print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser');
1794 $totalarray['nbfield']++;
1799 if (!empty($arrayfields['p.statut']['checked'])) {
1800 print '<td class="center
">'.$contactstatic->getLibStatut(5).'</td>';
1802 $totalarray['nbfield']++;
1807 if (!empty($arrayfields['p.import_key']['checked'])) {
1808 print '<td class="tdoverflowmax100
">';
1809 print dol_escape_htmltag($obj->import_key);
1812 $totalarray['nbfield']++;
1817 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1818 print '<td class="nowrap center
">';
1819 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1821 if (in_array($obj->rowid, $arrayofselected)) {
1824 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1828 $totalarray['nbfield']++;
1838include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1840// If no record found
1843 foreach ($arrayfields as $key => $val) {
1844 if (!empty($val['checked'])) {
1848 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium
">'.$langs->trans("NoRecordFound
").'</span></td></tr>';
1853$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1854$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1855print $hookmanager->resPrint;
1857print '</table>'."\n
";
1860print '</form>'."\n
";
$id
Support class for third parties, contacts, members, users or resources.
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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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, $allowothertags=array())
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_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'.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.