36 require
'../main.inc.php';
37 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43 $langs->loadLangs(array(
"companies",
"suppliers",
"categories"));
47 $action =
GETPOST(
'action',
'aZ09');
48 $massaction =
GETPOST(
'massaction',
'alpha');
49 $show_files =
GETPOST(
'show_files',
'int');
50 $confirm =
GETPOST(
'confirm',
'alpha');
51 $toselect =
GETPOST(
'toselect',
'array');
52 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'contactlist';
56 $contactid =
GETPOST(
'id',
'int');
58 if ($user->socid) $socid = $user->socid;
61 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
62 $search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
63 $search_phone =
GETPOST(
"search_phone",
'alpha');
65 $search_id =
GETPOST(
"search_id",
"int");
66 $search_firstlast_only =
GETPOST(
"search_firstlast_only",
'alpha');
67 $search_lastname =
GETPOST(
"search_lastname",
'alpha');
68 $search_firstname =
GETPOST(
"search_firstname",
'alpha');
69 $search_societe =
GETPOST(
"search_societe",
'alpha');
70 $search_poste =
GETPOST(
"search_poste",
'alpha');
71 $search_phone_perso =
GETPOST(
"search_phone_perso",
'alpha');
72 $search_phone_pro =
GETPOST(
"search_phone_pro",
'alpha');
73 $search_phone_mobile =
GETPOST(
"search_phone_mobile",
'alpha');
74 $search_fax =
GETPOST(
"search_fax",
'alpha');
75 $search_email =
GETPOST(
"search_email",
'alpha');
76 $search_no_email =
GETPOST(
"search_no_email",
'int');
77 if (!empty($conf->socialnetworks->enabled)) {
78 foreach ($socialnetworks as $key => $value) {
79 if ($value[
'active']) {
80 $search_[$key] =
GETPOST(
"search_".$key,
'alpha');
84 $search_priv =
GETPOST(
"search_priv",
'alpha');
85 $search_categ =
GETPOST(
"search_categ",
'int');
86 $search_categ_thirdparty =
GETPOST(
"search_categ_thirdparty",
'int');
87 $search_categ_supplier =
GETPOST(
"search_categ_supplier",
'int');
88 $search_status =
GETPOST(
"search_status",
'int');
89 $search_type =
GETPOST(
'search_type',
'alpha');
90 $search_zip =
GETPOST(
'search_zip',
'alpha');
91 $search_town =
GETPOST(
'search_town',
'alpha');
92 $search_import_key =
GETPOST(
"search_import_key",
"alpha");
93 $search_country =
GETPOST(
"search_country",
'intcomma');
94 $search_roles =
GETPOST(
"search_roles",
'array');
95 $search_level =
GETPOST(
"search_level",
"array");
96 $search_stcomm =
GETPOST(
'search_stcomm',
'int');
98 if ($search_status ==
'') $search_status = 1;
100 $optioncss =
GETPOST(
'optioncss',
'alpha');
104 $view =
GETPOST(
"view",
'alpha');
106 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
107 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
108 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
110 $userid =
GETPOST(
'userid',
'int');
112 if (!$sortorder) $sortorder =
"ASC";
113 if (!$sortfield) $sortfield =
"p.lastname";
114 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) { $page = 0; }
115 $offset = $limit * $page;
117 $titre = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(
"ListOfContacts") : $langs->trans(
"ListOfContactsAddresses"));
120 if (empty($contextpage) || $contextpage ==
'contactlist') $contextpage =
'contactprospectlist';
121 $titre .=
' ('.$langs->trans(
"ThirdPartyProspects").
')';
122 $urlfiche =
"card.php";
126 if (empty($contextpage) || $contextpage ==
'contactlist') $contextpage =
'contactcustomerlist';
127 $titre .=
' ('.$langs->trans(
"ThirdPartyCustomers").
')';
128 $urlfiche =
"card.php";
129 } elseif ($type ==
"f")
131 if (empty($contextpage) || $contextpage ==
'contactlist') $contextpage =
'contactsupplierlist';
132 $titre .=
' ('.$langs->trans(
"ThirdPartySuppliers").
')';
133 $urlfiche =
"card.php";
134 } elseif ($type ==
"o")
136 if (empty($contextpage) || $contextpage ==
'contactlist') $contextpage =
'contactotherlist';
137 $titre .=
' ('.$langs->trans(
"OthersNotLinkedToThirdParty").
')';
143 $hookmanager->initHooks(array(
'contactlist'));
147 $extrafields->fetch_name_optionals_label($object->table_element);
149 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
152 $fieldstosearchall = array();
153 foreach ($object->fields as $key => $val)
156 if (!empty($user->socid) && $key ==
"note_private") {
160 if (empty($val[
'searchall'])) {
164 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
168 if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
169 $fieldstosearchall[
's.nom'] =
"ThirdParty";
173 $arrayfields = array();
174 foreach ($object->fields as $key => $val) {
176 if (empty($val[
'visible'])) {
180 $arrayfields[
'p.'.$key] = array(
181 'label'=>$val[
'label'],
182 'checked'=>(($val[
'visible'] < 0) ? 0 : 1),
183 'enabled'=>($val[
'enabled'] && ($val[
'visible'] != 3)),
184 'position'=>$val[
'position']);
188 $arrayfields[
'country.code_iso'] = array(
'label'=>
"Country",
'position'=>22,
'checked'=>0);
189 if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
190 $arrayfields[
's.nom'] = array(
'label'=>
"ThirdParty",
'position'=>25,
'checked'=>1);
193 if (!empty($conf->socialnetworks->enabled)) {
194 foreach ($socialnetworks as $key => $value) {
195 if ($value[
'active']) {
196 $arrayfields[
'p.'.$key] = array(
197 'label' => $value[
'label'],
206 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
212 if (($id > 0 || !empty($ref)) && $action !=
'add')
214 $result = $object->fetch($id, $ref);
223 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
224 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
226 $parameters = array();
227 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
228 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
233 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
236 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
240 $search_firstlast_only =
"";
241 $search_lastname =
"";
242 $search_firstname =
"";
243 $search_societe =
"";
246 $search_country =
"";
249 $search_phone_perso =
"";
250 $search_phone_pro =
"";
251 $search_phone_mobile =
"";
254 $search_no_email = -1;
255 if (!empty($conf->socialnetworks->enabled)) {
256 foreach ($socialnetworks as $key => $value) {
257 if ($value[
'active']) {
267 $search_categ_thirdparty =
'';
268 $search_categ_supplier =
'';
269 $search_import_key =
'';
271 $search_array_options = array();
272 $search_roles = array();
276 $objectclass =
'Contact';
277 $objectlabel =
'Contact';
278 $permissiontoread = $user->rights->societe->lire;
279 $permissiontodelete = $user->rights->societe->supprimer;
280 $uploaddir = $conf->societe->dir_output;
281 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
283 if ($action ==
'setstcomm')
286 $result = $object->fetch(
GETPOST(
'stcommcontactid'));
288 $result = $object->update($object->id, $user);
289 if ($result < 0)
setEventMessages($object->error, $object->errors,
'errors');
295 if ($search_priv < 0) $search_priv =
'';
302 $form =
new Form($db);
305 $contactstatic =
new Contact($db);
307 if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
308 $contactstatic->loadCacheOfProspStatus();
311 $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
314 $tab_level = array();
315 $sql =
"SELECT code, label, sortorder";
316 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
317 $sql .=
" WHERE active > 0";
318 $sql .=
" ORDER BY sortorder";
319 $resql = $db->query($sql);
322 while ($obj = $db->fetch_object(
$resql))
325 $level = $langs->trans($obj->code);
326 if ($level == $obj->code) $level = $langs->trans($obj->label);
327 $tab_level[$obj->code] = $level;
332 $sql =
"SELECT s.rowid as socid, s.nom as name,";
333 $sql .=
" p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email,";
334 $sql .=
" p.socialnetworks, p.photo,";
335 $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_update,";
336 $sql .=
" st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,";
337 $sql .=
" co.label as country, co.code as country_code";
339 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
340 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
' as options_'.$key :
'');
343 $parameters = array();
344 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
345 $sql .= $hookmanager->resPrint;
346 $sql .=
" FROM ".MAIN_DB_PREFIX.
"socpeople as p";
347 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
348 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as co ON co.rowid = p.fk_pays";
349 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = p.fk_soc";
350 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_stcommcontact as st ON st.id = p.fk_stcommcontact";
351 if (!empty($search_categ)) $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_contact as cc ON p.rowid = cc.fk_socpeople";
352 if (!empty($search_categ_thirdparty)) $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cs ON s.rowid = cs.fk_soc";
353 if (!empty($search_categ_supplier)) $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc";
354 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON s.rowid = sc.fk_soc";
355 $sql .=
' WHERE p.entity IN ('.getEntity(
'socpeople').
')';
356 if (!$user->rights->societe->client->voir && !$socid)
358 $sql .=
" AND (sc.fk_user = ".$user->id.
" OR p.fk_soc IS NULL)";
362 $sql .=
" AND p.fk_user_creat=".$db->escape($userid);
364 if ($search_level) $sql .=
natural_search(
"p.fk_prospectcontactlevel", join(
',', $search_level), 3);
365 if ($search_stcomm !=
'' && $search_stcomm != -2) $sql .=
natural_search(
"p.fk_stcommcontact", $search_stcomm, 2);
368 if ($search_priv !=
'0' && $search_priv !=
'1')
370 $sql .=
" AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id.
"))";
372 if ($search_priv ==
'0') $sql .=
" AND p.priv='0'";
373 if ($search_priv ==
'1') $sql .=
" AND (p.priv='1' AND p.fk_user_creat=".$user->id.
")";
376 if ($search_categ > 0) $sql .=
" AND cc.fk_categorie = ".$db->escape($search_categ);
377 if ($search_categ == -2) $sql .=
" AND cc.fk_categorie IS NULL";
378 if ($search_categ_thirdparty > 0) $sql .=
" AND cs.fk_categorie = ".$db->escape($search_categ_thirdparty);
379 if ($search_categ_thirdparty == -2) $sql .=
" AND cs.fk_categorie IS NULL";
380 if ($search_categ_supplier > 0) $sql .=
" AND cs2.fk_categorie = ".$db->escape($search_categ_supplier);
381 if ($search_categ_supplier == -2) $sql .=
" AND cs2.fk_categorie IS NULL";
383 if ($sall) $sql .=
natural_search(array_keys($fieldstosearchall), $sall);
384 if (strlen($search_phone)) $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_phone);
385 if (strlen($search_cti)) $sql .=
natural_search(array(
'p.phone',
'p.phone_perso',
'p.phone_mobile'), $search_cti);
386 if (strlen($search_firstlast_only)) $sql .=
natural_search(array(
'p.lastname',
'p.firstname'), $search_firstlast_only);
388 if ($search_id > 0) $sql .=
natural_search(
'p.rowid', $search_id, 1);
389 if ($search_lastname) $sql .=
natural_search(
'p.lastname', $search_lastname);
390 if ($search_firstname) $sql .=
natural_search(
'p.firstname', $search_firstname);
391 if ($search_societe) $sql .=
natural_search(empty($conf->global->SOCIETE_DISABLE_CONTACTS) ?
's.nom' :
'p.fk_soc', $search_societe);
392 if ($search_country) $sql .=
" AND p.fk_pays IN (".$search_country.
')';
393 if (strlen($search_poste)) $sql .=
natural_search(
'p.poste', $search_poste);
394 if (strlen($search_phone_perso)) $sql .=
natural_search(
'p.phone_perso', $search_phone_perso);
395 if (strlen($search_phone_pro)) $sql .=
natural_search(
'p.phone', $search_phone_pro);
396 if (strlen($search_phone_mobile)) $sql .=
natural_search(
'p.phone_mobile', $search_phone_mobile);
397 if (strlen($search_fax)) $sql .=
natural_search(
'p.fax', $search_fax);
398 if (!empty($conf->socialnetworks->enabled)) {
399 foreach ($socialnetworks as $key => $value) {
400 if ($value[
'active'] && strlen($search_[$key])) {
401 $sql .=
' AND p.socialnetworks LIKE \'%"'.$key.
'":"'.$search_[$key].
'%\'';
405 if (strlen($search_email)) $sql .=
natural_search(
'p.email', $search_email);
406 if (strlen($search_zip)) $sql .=
natural_search(
"p.zip", $search_zip);
407 if (strlen($search_town)) $sql .=
natural_search(
"p.town", $search_town);
408 if (count($search_roles) > 0) {
409 $sql .=
" AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX.
"societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(
',', $search_roles).
"))";
412 if ($search_no_email !=
'' && $search_no_email >= 0) $sql .=
" AND p.no_email = ".$db->escape($search_no_email);
413 if ($search_status !=
'' && $search_status >= 0) $sql .=
" AND p.statut = ".$db->escape($search_status);
414 if ($search_import_key) $sql .=
natural_search(
"p.import_key", $search_import_key);
417 $sql .=
" AND p.fk_soc IS NULL";
418 } elseif ($type ==
"f")
420 $sql .=
" AND s.fournisseur = 1";
421 } elseif ($type ==
"c")
423 $sql .=
" AND s.client IN (1, 3)";
424 } elseif ($type ==
"p")
426 $sql .=
" AND s.client IN (2, 3)";
430 $sql .=
" AND s.rowid = ".$socid;
433 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
435 $parameters = array();
436 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
437 $sql .= $hookmanager->resPrint;
439 if ($view ==
"recent")
441 $sql .= $db->order(
"p.datec",
"DESC");
443 $sql .= $db->order($sortfield, $sortorder);
447 $nbtotalofrecords =
'';
448 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
450 $resql = $db->query($sql);
451 $nbtotalofrecords = $db->num_rows(
$resql);
452 if (($page * $limit) > $nbtotalofrecords)
459 $sql .= $db->plimit($limit + 1, $offset);
461 $resql = $db->query($sql);
468 $num = $db->num_rows(
$resql);
470 $arrayofselected = is_array($toselect) ? $toselect : array();
472 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall !=
'' || $search_cti !=
''))
474 $obj = $db->fetch_object(
$resql);
476 header(
"Location: ".DOL_URL_ROOT.
'/contact/card.php?id='.$id);
480 $help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas';
484 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.$contextpage;
485 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.$limit;
486 $param .=
'&begin='.urlencode($begin).
'&userid='.urlencode($userid).
'&contactname='.urlencode($sall);
487 $param .=
'&type='.urlencode($type).
'&view='.urlencode($view);
488 if (!empty($search_categ)) $param .=
'&search_categ='.urlencode($search_categ);
489 if (!empty($search_categ_thirdparty)) $param .=
'&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
490 if (!empty($search_categ_supplier)) $param .=
'&search_categ_supplier='.urlencode($search_categ_supplier);
491 if ($sall !=
'') $param .=
'&sall='.urlencode($sall);
492 if ($search_id > 0) $param .=
"&search_id=".urlencode($search_id);
493 if ($search_lastname !=
'') $param .=
'&search_lastname='.urlencode($search_lastname);
494 if ($search_firstname !=
'') $param .=
'&search_firstname='.urlencode($search_firstname);
495 if ($search_societe !=
'') $param .=
'&search_societe='.urlencode($search_societe);
496 if ($search_zip !=
'') $param .=
'&search_zip='.urlencode($search_zip);
497 if ($search_town !=
'') $param .=
'&search_town='.urlencode($search_town);
498 if ($search_country !=
'') $param .=
"&search_country=".urlencode($search_country);
499 if ($search_poste !=
'') $param .=
'&search_poste='.urlencode($search_poste);
500 if ($search_phone_pro !=
'') $param .=
'&search_phone_pro='.urlencode($search_phone_pro);
501 if ($search_phone_perso !=
'') $param .=
'&search_phone_perso='.urlencode($search_phone_perso);
502 if ($search_phone_mobile !=
'') $param .=
'&search_phone_mobile='.urlencode($search_phone_mobile);
503 if ($search_fax !=
'') $param .=
'&search_fax='.urlencode($search_fax);
504 if ($search_email !=
'') $param .=
'&search_email='.urlencode($search_email);
505 if ($search_no_email !=
'') $param .=
'&search_no_email='.urlencode($search_no_email);
506 if ($search_status !=
'') $param .=
'&search_status='.urlencode($search_status);
507 if ($search_priv ==
'0' || $search_priv ==
'1') $param .=
"&search_priv=".urlencode($search_priv);
508 if ($search_stcomm !=
'') $param .=
'&search_stcomm='.urlencode($search_stcomm);
509 if (is_array($search_level) && count($search_level)) {
510 foreach ($search_level as $slevel) {
511 $param .=
'&search_level[]='.urlencode($slevel);
514 if ($search_import_key !=
'') $param .=
'&search_import_key='.urlencode($search_import_key);
515 if ($optioncss !=
'') $param .=
'&optioncss='.urlencode($optioncss);
516 if (count($search_roles) > 0) $param .= implode(
'&search_roles[]=', $search_roles);
519 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
522 $arrayofmassactions = array(
527 if ($user->rights->societe->supprimer) $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
528 if (in_array($massaction, array(
'presend',
'predelete'))) $arrayofmassactions = array();
529 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
531 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewContactAddress'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create',
'', $user->rights->societe->contact->creer);
533 print '<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter">';
534 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
535 print '<input type="hidden" name="token" value="'.newToken().
'">';
536 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
537 print '<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
538 print '<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
540 print '<input type="hidden" name="type" value="'.$type.
'">';
541 print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
543 print_barre_liste($titre, $page,
$_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'address', 0, $newcardbutton,
'', $limit, 0, 0, 1);
545 $topicmail =
"Information";
546 $modelmail =
"contact";
548 $trackid =
'ctc'.$object->id;
549 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
553 foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
554 print '<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
556 if ($search_firstlast_only)
558 print '<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_firstlast_only).$langs->trans(
"Lastname").
", ".$langs->trans(
"Firstname").
'</div>';
562 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire)
564 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
565 $moreforfilter .=
'<div class="divsearchfield">';
566 $moreforfilter .= $langs->trans(
'Categories').
': ';
567 $moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, $search_categ,
'search_categ', 1);
568 $moreforfilter .=
'</div>';
569 if (empty($type) || $type ==
'c' || $type ==
'p')
571 $moreforfilter .=
'<div class="divsearchfield">';
572 if ($type ==
'c') $moreforfilter .= $langs->trans(
'CustomersCategoriesShort').
': ';
573 elseif ($type ==
'p') $moreforfilter .= $langs->trans('ProspectsCategoriesShort').': ';
574 else $moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': ';
575 $moreforfilter .= $formother->select_categories(
Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1);
576 $moreforfilter .= '</div>';
578 if (empty($type) || $type == 'f')
580 $moreforfilter .=
'<div class="divsearchfield">';
581 $moreforfilter .= $langs->trans(
'SuppliersCategoriesShort').
': ';
582 $moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier,
'search_categ_supplier', 1);
583 $moreforfilter .=
'</div>';
587 $moreforfilter .=
'<div class="divsearchfield">';
588 $moreforfilter .= $langs->trans(
'Roles').
': ';
589 $moreforfilter .= $formcompany->showRoles(
"search_roles", $objecttmp,
'edit', $search_roles);
590 $moreforfilter .=
'</div>';
592 print '<div class="liste_titre liste_titre_bydiv centpercent">';
593 print $moreforfilter;
594 $parameters = array(
'type'=>$type);
595 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
596 print $hookmanager->resPrint;
599 $varpage = empty($contextpage) ?
$_SERVER[
"PHP_SELF"] : $contextpage;
600 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
601 if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
603 print '<div class="div-table-responsive">';
604 print '<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
607 print '<tr class="liste_titre_filter">';
608 if (!empty($arrayfields[
'p.rowid'][
'checked']))
610 print
'<td class="liste_titre">';
611 print
'<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).
'">';
614 if (!empty($arrayfields[
'p.lastname'][
'checked']))
616 print
'<td class="liste_titre">';
617 print
'<input class="flat" type="text" name="search_lastname" size="6" value="'.dol_escape_htmltag($search_lastname).
'">';
620 if (!empty($arrayfields[
'p.firstname'][
'checked']))
622 print
'<td class="liste_titre">';
623 print
'<input class="flat" type="text" name="search_firstname" size="6" value="'.dol_escape_htmltag($search_firstname).
'">';
626 if (!empty($arrayfields[
'p.poste'][
'checked']))
628 print
'<td class="liste_titre">';
629 print
'<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).
'">';
632 if (!empty($arrayfields[
'p.zip'][
'checked']))
634 print
'<td class="liste_titre">';
635 print
'<input class="flat" type="text" name="search_zip" size="3" value="'.dol_escape_htmltag($search_zip).
'">';
638 if (!empty($arrayfields[
'p.town'][
'checked']))
640 print
'<td class="liste_titre">';
641 print
'<input class="flat" type="text" name="search_town" size="5" value="'.dol_escape_htmltag($search_town).
'">';
659 if (!empty($arrayfields[
'country.code_iso'][
'checked']))
661 print
'<td class="liste_titre center">';
662 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
665 if (!empty($arrayfields[
'p.phone'][
'checked']))
667 print
'<td class="liste_titre">';
668 print
'<input class="flat" type="text" name="search_phone_pro" size="6" value="'.dol_escape_htmltag($search_phone_pro).
'">';
671 if (!empty($arrayfields[
'p.phone_perso'][
'checked']))
673 print
'<td class="liste_titre">';
674 print
'<input class="flat" type="text" name="search_phone_perso" size="6" value="'.dol_escape_htmltag($search_phone_perso).
'">';
677 if (!empty($arrayfields[
'p.phone_mobile'][
'checked']))
679 print
'<td class="liste_titre">';
680 print
'<input class="flat" type="text" name="search_phone_mobile" size="6" value="'.dol_escape_htmltag($search_phone_mobile).
'">';
683 if (!empty($arrayfields[
'p.fax'][
'checked']))
685 print
'<td class="liste_titre">';
686 print
'<input class="flat" type="text" name="search_fax" size="6" value="'.dol_escape_htmltag($search_fax).
'">';
689 if (!empty($arrayfields[
'p.email'][
'checked']))
691 print
'<td class="liste_titre">';
692 print
'<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).
'">';
695 if (!empty($arrayfields[
'p.no_email'][
'checked']))
697 print
'<td class="liste_titre center">';
698 print $form->selectarray(
'search_no_email', array(
'-1'=>
'',
'0'=>$langs->trans(
'No'),
'1'=>$langs->trans(
'Yes')), $search_no_email);
701 if (!empty($conf->socialnetworks->enabled)) {
702 foreach ($socialnetworks as $key => $value) {
703 if ($value[
'active']) {
704 if (!empty($arrayfields[
'p.'.$key][
'checked']))
706 print
'<td class="liste_titre">';
707 print
'<input class="flat" type="text" name="search_'.$key.
'" size="6" value="'.
dol_escape_htmltag($search_[$key]).
'">';
713 if (!empty($arrayfields[
'p.fk_soc'][
'checked']) || !empty($arrayfields[
's.nom'][
'checked']))
715 print
'<td class="liste_titre">';
716 print
'<input class="flat" type="text" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
719 if (!empty($arrayfields[
'p.priv'][
'checked']))
721 print
'<td class="liste_titre center">';
722 $selectarray = array(
'0'=>$langs->trans(
"ContactPublic"),
'1'=>$langs->trans(
"ContactPrivate"));
723 print $form->selectarray(
'search_priv', $selectarray, $search_priv, 1);
727 if (!empty($arrayfields[
'p.fk_prospectcontactlevel'][
'checked']))
729 print
'<td class="liste_titre center">';
730 print $form->multiselectarray(
'search_level', $tab_level, $search_level, 0, 0,
'width75', 0, 0,
'',
'',
'', 2);
734 if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked']))
736 print
'<td class="liste_titre maxwidthonsmartphone center">';
737 $arraystcomm = array();
738 foreach ($contactstatic->cacheprospectstatus as $key => $val)
740 $arraystcomm[$val[
'id']] = ($langs->trans(
"StatusProspect".$val[
'id']) !=
"StatusProspect".$val[
'id'] ? $langs->trans(
"StatusProspect".$val[
'id']) : $val[
'label']);
742 print $form->selectarray(
'search_stcomm', $arraystcomm, $search_stcomm, -2, 0, 0,
'', 0, 0, 0,
'',
'nowrap ');
746 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
749 $parameters = array(
'arrayfields'=>$arrayfields);
750 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
751 print $hookmanager->resPrint;
753 if (!empty($arrayfields[
'p.datec'][
'checked']))
755 print
'<td class="liste_titre">';
759 if (!empty($arrayfields[
'p.tms'][
'checked']))
761 print
'<td class="liste_titre">';
765 if (!empty($arrayfields[
'p.statut'][
'checked']))
767 print
'<td class="liste_titre center">';
768 print $form->selectarray(
'search_status', array(
'-1'=>
'',
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $search_status);
771 if (!empty($arrayfields[
'p.import_key'][
'checked']))
773 print
'<td class="liste_titre center">';
774 print
'<input class="flat searchstring" type="text" name="search_import_key" size="3" value="'.dol_escape_htmltag($search_import_key).
'">';
778 print
'<td class="liste_titre maxwidthsearch">';
779 $searchpicto = $form->showFilterAndCheckAddButtons(0);
786 print
'<tr class="liste_titre">';
787 if (!empty($arrayfields[
'p.rowid'][
'checked']))
print_liste_field_titre($arrayfields[
'p.rowid'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
"", $sortfield, $sortorder);
788 if (!empty($arrayfields[
'p.lastname'][
'checked']))
print_liste_field_titre($arrayfields[
'p.lastname'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.lastname", $begin, $param,
'', $sortfield, $sortorder);
789 if (!empty($arrayfields[
'p.firstname'][
'checked']))
print_liste_field_titre($arrayfields[
'p.firstname'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.firstname", $begin, $param,
'', $sortfield, $sortorder);
790 if (!empty($arrayfields[
'p.poste'][
'checked']))
print_liste_field_titre($arrayfields[
'p.poste'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.poste", $begin, $param,
'', $sortfield, $sortorder);
791 if (!empty($arrayfields[
'p.zip'][
'checked']))
print_liste_field_titre($arrayfields[
'p.zip'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.zip", $begin, $param,
'', $sortfield, $sortorder);
792 if (!empty($arrayfields[
'p.town'][
'checked']))
print_liste_field_titre($arrayfields[
'p.town'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.town", $begin, $param,
'', $sortfield, $sortorder);
795 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
796 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'],
$_SERVER[
"PHP_SELF"],
"co.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
798 if (!empty($arrayfields[
'p.phone'][
'checked']))
print_liste_field_titre($arrayfields[
'p.phone'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.phone", $begin, $param,
'', $sortfield, $sortorder);
799 if (!empty($arrayfields[
'p.phone_perso'][
'checked']))
print_liste_field_titre($arrayfields[
'p.phone_perso'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.phone_perso", $begin, $param,
'', $sortfield, $sortorder);
800 if (!empty($arrayfields[
'p.phone_mobile'][
'checked']))
print_liste_field_titre($arrayfields[
'p.phone_mobile'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.phone_mobile", $begin, $param,
'', $sortfield, $sortorder);
801 if (!empty($arrayfields[
'p.fax'][
'checked']))
print_liste_field_titre($arrayfields[
'p.fax'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.fax", $begin, $param,
'', $sortfield, $sortorder);
802 if (!empty($arrayfields[
'p.email'][
'checked']))
print_liste_field_titre($arrayfields[
'p.email'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.email", $begin, $param,
'', $sortfield, $sortorder);
803 if (!empty($arrayfields[
'p.no_email'][
'checked']))
print_liste_field_titre($arrayfields[
'p.no_email'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.no_email", $begin, $param,
'', $sortfield, $sortorder,
'center ');
804 if (!empty($conf->socialnetworks->enabled)) {
805 foreach ($socialnetworks as $key => $value) {
806 if ($value[
'active'] && !empty($arrayfields[
'p.'.$key][
'checked'])) {
811 if (!empty($arrayfields[
'p.fk_soc'][
'checked']))
print_liste_field_titre($arrayfields[
'p.fk_soc'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.fk_soc", $begin, $param,
'', $sortfield, $sortorder);
812 if (!empty($arrayfields[
's.nom'][
'checked']))
print_liste_field_titre($arrayfields[
's.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.nom", $begin, $param,
'', $sortfield, $sortorder);
813 if (!empty($arrayfields[
'p.priv'][
'checked']))
print_liste_field_titre($arrayfields[
'p.priv'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.priv", $begin, $param,
'', $sortfield, $sortorder,
'center ');
814 if (!empty($arrayfields[
'p.fk_prospectcontactlevel'][
'checked']))
print_liste_field_titre($arrayfields[
'p.fk_prospectcontactlevel'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.fk_prospectcontactlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
815 if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked']))
print_liste_field_titre($arrayfields[
'p.fk_stcommcontact'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.fk_stcommcontact",
"", $param,
'', $sortfield, $sortorder,
'center ');
817 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
820 'arrayfields'=>$arrayfields,
822 'sortfield'=>$sortfield,
823 'sortorder'=>$sortorder,
825 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
826 print $hookmanager->resPrint;
827 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
830 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
833 if (!empty($arrayfields[
'p.statut'][
'checked'])) {
836 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
837 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'],
$_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
844 $totalarray = array();
845 while ($i < min($num, $limit))
847 $obj = $db->fetch_object(
$resql);
849 $arraysocialnetworks = (array) json_decode($obj->socialnetworks,
true);
850 $contactstatic->lastname = $obj->lastname;
851 $contactstatic->firstname =
'';
852 $contactstatic->id = $obj->rowid;
853 $contactstatic->statut = $obj->statut;
854 $contactstatic->poste = $obj->poste;
855 $contactstatic->email = $obj->email;
856 $contactstatic->phone_pro = $obj->phone_pro;
857 $contactstatic->phone_perso = $obj->phone_perso;
858 $contactstatic->phone_mobile = $obj->phone_mobile;
859 $contactstatic->zip = $obj->zip;
860 $contactstatic->town = $obj->town;
861 $contactstatic->socialnetworks = $arraysocialnetworks;
862 $contactstatic->country = $obj->country;
863 $contactstatic->country_code = $obj->country_code;
864 $contactstatic->photo = $obj->photo;
866 $contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel;
868 print
'<tr class="oddeven">';
871 if (!empty($arrayfields[
'p.rowid'][
'checked']))
873 print
'<td class="tdoverflowmax50">';
876 if (!$i) $totalarray[
'nbfield']++;
879 if (!empty($arrayfields[
'p.lastname'][
'checked']))
881 print
'<td class="middle tdoverflowmax200">';
882 print $contactstatic->getNomUrl(1);
884 if (!$i) $totalarray[
'nbfield']++;
887 if (!empty($arrayfields[
'p.firstname'][
'checked']))
889 print
'<td class="tdoverflowmax200">'.$obj->firstname.
'</td>';
890 if (!$i) $totalarray[
'nbfield']++;
893 if (!empty($arrayfields[
'p.poste'][
'checked']))
895 print
'<td class="tdoverflowmax100">'.$obj->poste.
'</td>';
896 if (!$i) $totalarray[
'nbfield']++;
899 if (!empty($arrayfields[
'p.zip'][
'checked']))
901 print
'<td>'.$obj->zip.
'</td>';
902 if (!$i) $totalarray[
'nbfield']++;
905 if (!empty($arrayfields[
'p.town'][
'checked']))
907 print
'<td>'.$obj->town.
'</td>';
908 if (!$i) $totalarray[
'nbfield']++;
923 if (!empty($arrayfields[
'country.code_iso'][
'checked']))
925 print
'<td class="center">';
927 print $tmparray[
'label'];
929 if (!$i) $totalarray[
'nbfield']++;
932 if (!empty($arrayfields[
'p.phone'][
'checked']))
934 print
'<td>'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid,
'AC_TEL').
'</td>';
935 if (!$i) $totalarray[
'nbfield']++;
938 if (!empty($arrayfields[
'p.phone_perso'][
'checked']))
940 print
'<td>'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid,
'AC_TEL').
'</td>';
941 if (!$i) $totalarray[
'nbfield']++;
944 if (!empty($arrayfields[
'p.phone_mobile'][
'checked']))
946 print
'<td>'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid,
'AC_TEL').
'</td>';
947 if (!$i) $totalarray[
'nbfield']++;
950 if (!empty($arrayfields[
'p.fax'][
'checked']))
952 print
'<td>'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid,
'AC_TEL').
'</td>';
953 if (!$i) $totalarray[
'nbfield']++;
956 if (!empty($arrayfields[
'p.email'][
'checked']))
958 print
'<td>'.dol_print_email($obj->email, $obj->rowid, $obj->socid,
'AC_EMAIL', 18).
'</td>';
959 if (!$i) $totalarray[
'nbfield']++;
962 if (!empty($arrayfields[
'p.no_email'][
'checked']))
964 print
'<td class="center">'.yn($obj->no_email).
'</td>';
965 if (!$i) $totalarray[
'nbfield']++;
967 if (!empty($conf->socialnetworks->enabled)) {
968 foreach ($socialnetworks as $key => $value) {
969 if ($value[
'active'] && !empty($arrayfields[
'p.'.$key][
'checked'])) {
970 print
'<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).
'</td>';
971 if (!$i) $totalarray[
'nbfield']++;
976 if (!empty($arrayfields[
'p.fk_soc'][
'checked']) || !empty($arrayfields[
's.nom'][
'checked']))
982 $objsoc->fetch($obj->socid);
983 print $objsoc->getNomUrl(1);
984 }
else print
' ';
986 if (!$i) $totalarray[
'nbfield']++;
990 if (!empty($arrayfields[
'p.priv'][
'checked']))
992 print
'<td class="center">'.$contactstatic->LibPubPriv($obj->priv).
'</td>';
993 if (!$i) $totalarray[
'nbfield']++;
996 if (!empty($arrayfields[
'p.fk_prospectcontactlevel'][
'checked']))
999 print
'<td class="center">';
1000 print $contactstatic->getLibProspLevel();
1002 if (!$i) $totalarray[
'nbfield']++;
1005 if (!empty($arrayfields[
'p.fk_stcommcontact'][
'checked']))
1008 print
'<td class="center nowrap"><div class="nowrap">';
1009 print
'<div class="inline-block">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id][
'label'], $obj->stcomm_picto);
1010 print
'</div> - <div class="inline-block">';
1011 foreach ($contactstatic->cacheprospectstatus as $key => $val) {
1012 $titlealt =
'default';
1013 if (!empty($val[
'code']) && !in_array($val[
'code'], array(
'ST_NO',
'ST_NEVER',
'ST_TODO',
'ST_PEND',
'ST_DONE'))) $titlealt = $val[
'label'];
1014 if ($obj->stcomm_id != $val[
'id']) print
'<a class="pictosubstatus" href="'.$_SERVER[
"PHP_SELF"].
'?stcommcontactid='.$obj->rowid.
'&stcomm='.$val[
'code'].
'&action=setstcomm&token='.
newToken().$param.($page ?
'&page='.urlencode($page) :
'').
'">'.
img_action($titlealt, $val[
'code'], $val[
'picto']).
'</a>';
1016 print
'</div></div></td>';
1017 if (!$i) $totalarray[
'nbfield']++;
1021 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1023 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1024 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1025 print $hookmanager->resPrint;
1027 if (!empty($arrayfields[
'p.datec'][
'checked']))
1029 print
'<td class="center">';
1030 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1032 if (!$i) $totalarray[
'nbfield']++;
1035 if (!empty($arrayfields[
'p.tms'][
'checked']))
1037 print
'<td class="center">';
1038 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1040 if (!$i) $totalarray[
'nbfield']++;
1043 if (!empty($arrayfields[
'p.statut'][
'checked']))
1045 print
'<td class="center">'.$contactstatic->getLibStatut(5).
'</td>';
1046 if (!$i) $totalarray[
'nbfield']++;
1048 if (!empty($arrayfields[
'p.import_key'][
'checked']))
1050 print
'<td class="tdoverflowmax100">';
1051 print $obj->import_key;
1053 if (!$i) $totalarray[
'nbfield']++;
1057 print
'<td class="nowrap center">';
1058 if ($massactionbutton || $massaction)
1061 if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
1062 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1065 if (!$i) $totalarray[
'nbfield']++;
1073 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1074 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1075 print $hookmanager->resPrint;
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
getArrayOfSocialNetworks()
Get array of social network dictionary.
img_action($titlealt, $numaction, $picto= '')
Show logo action.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Class to manage categories.
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_getIdFromCode($db, $key, $tablename, $fieldkey= 'code', $fieldid= 'id', $entityfilter=0)
Return an id or code from a code or id.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...