42require_once
'../main.inc.php';
43include_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
49if (isModEnabled(
'category')) {
50 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
55$langs->loadLangs(array(
"companies",
"commercial",
"customers",
"suppliers",
"bills",
"compta",
"categories",
"cashdesk"));
59$action =
GETPOST(
'action',
'aZ09');
60$massaction =
GETPOST(
'massaction',
'alpha');
62$confirm =
GETPOST(
'confirm',
'alpha');
63$toselect =
GETPOST(
'toselect',
'array');
64$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
65$optioncss =
GETPOST(
'optioncss',
'alpha');
66if ($contextpage ==
'poslist') {
69$mode =
GETPOST(
"mode",
'alpha');
72$search_all = trim(
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
73$search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
75$search_id =
GETPOST(
"search_id",
'int');
76$search_nom = trim(
GETPOST(
"search_nom",
'restricthtml'));
77$search_alias = trim(
GETPOST(
"search_alias",
'restricthtml'));
78$search_nom_only = trim(
GETPOST(
"search_nom_only",
'restricthtml'));
79$search_barcode = trim(
GETPOST(
"search_barcode",
'alpha'));
80$search_customer_code = trim(
GETPOST(
'search_customer_code',
'alpha'));
81$search_supplier_code = trim(
GETPOST(
'search_supplier_code',
'alpha'));
82$search_account_customer_code = trim(
GETPOST(
'search_account_customer_code',
'alpha'));
83$search_account_supplier_code = trim(
GETPOST(
'search_account_supplier_code',
'alpha'));
84$search_address = trim(
GETPOST(
'search_address',
'alpha'));
85$search_zip = trim(
GETPOST(
"search_zip",
'alpha'));
86$search_town = trim(
GETPOST(
"search_town",
'alpha'));
87$search_state = trim(
GETPOST(
"search_state",
'alpha'));
88$search_region = trim(
GETPOST(
"search_region",
'alpha'));
89$search_email = trim(
GETPOST(
'search_email',
'alpha'));
90$search_phone = trim(
GETPOST(
'search_phone',
'alpha'));
91$search_phone_mobile = trim(
GETPOST(
'search_phone_mobile',
'alpha'));
92$search_fax = trim(
GETPOST(
'search_fax',
'alpha'));
93$search_url = trim(
GETPOST(
'search_url',
'alpha'));
94$search_idprof1 = trim(
GETPOST(
'search_idprof1',
'alpha'));
95$search_idprof2 = trim(
GETPOST(
'search_idprof2',
'alpha'));
96$search_idprof3 = trim(
GETPOST(
'search_idprof3',
'alpha'));
97$search_idprof4 = trim(
GETPOST(
'search_idprof4',
'alpha'));
98$search_idprof5 = trim(
GETPOST(
'search_idprof5',
'alpha'));
99$search_idprof6 = trim(
GETPOST(
'search_idprof6',
'alpha'));
100$search_vat = trim(
GETPOST(
'search_vat',
'alpha'));
102$search_categ_cus =
GETPOSTINT(
"search_categ_cus");
103$search_categ_sup =
GETPOSTINT(
"search_categ_sup");
104$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
105$searchCategorySupplierOperator =
GETPOSTINT(
'search_category_supplier_operator');
106if (GETPOSTISSET(
'formfilteraction')) {
107 $searchCategoryCustomerOperator =
GETPOST(
'search_category_customer_operator');
108 $searchCategorySupplierOperator =
GETPOST(
'search_category_supplier_operator');
110 $searchCategoryCustomerOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
111 $searchCategorySupplierOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
113$searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
114if (!empty($search_categ_cus) && empty($searchCategoryCustomerList)) {
115 $searchCategoryCustomerList = array($search_categ_cus);
117$searchCategorySupplierList =
GETPOST(
'search_category_supplier_list',
'array');
118if (!empty($search_categ_sup) && empty($searchCategorySupplierList)) {
119 $searchCategorySupplierList = array($search_categ_sup);
121$search_country =
GETPOST(
"search_country",
'aZ09');
122$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
123$search_price_level =
GETPOST(
'search_price_level',
'int');
124$search_staff =
GETPOST(
"search_staff",
'int');
125$search_legalform =
GETPOST(
"search_legalform",
'int');
126$search_status =
GETPOST(
"search_status",
'intcomma');
127$search_type =
GETPOST(
'search_type',
'alpha');
128$search_level =
GETPOST(
"search_level",
"array:alpha");
129$search_stcomm =
GETPOST(
'search_stcomm',
"array:int");
130$search_import_key = trim(
GETPOST(
"search_import_key",
"alpha"));
131$search_parent_name = trim(
GETPOST(
'search_parent_name',
'alpha'));
133$search_date_creation_startmonth =
GETPOSTINT(
'search_date_creation_startmonth');
134$search_date_creation_startyear =
GETPOSTINT(
'search_date_creation_startyear');
135$search_date_creation_startday =
GETPOSTINT(
'search_date_creation_startday');
136$search_date_creation_start =
dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
137$search_date_creation_endmonth =
GETPOSTINT(
'search_date_creation_endmonth');
138$search_date_creation_endyear =
GETPOSTINT(
'search_date_creation_endyear');
139$search_date_creation_endday =
GETPOSTINT(
'search_date_creation_endday');
140$search_date_creation_end =
dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
142$search_date_modif_startmonth =
GETPOSTINT(
'search_date_modif_startmonth');
143$search_date_modif_startyear =
GETPOSTINT(
'search_date_modif_startyear');
144$search_date_modif_startday =
GETPOSTINT(
'search_date_modif_startday');
145$search_date_modif_start =
dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);
146$search_date_modif_endmonth =
GETPOSTINT(
'search_date_modif_endmonth');
147$search_date_modif_endyear =
GETPOSTINT(
'search_date_modif_endyear');
148$search_date_modif_endday =
GETPOSTINT(
'search_date_modif_endday');
149$search_date_modif_end =
dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);
151$type =
GETPOST(
'type',
'alpha');
152$place =
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0';
154$diroutputmassaction = $conf->societe->dir_output.
'/temp/massgeneration/'.$user->id;
158$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
159$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
165 $sortfield =
"s.nom";
167if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
171$offset = $limit * $page;
172$pageprev = $page - 1;
173$pagenext = $page + 1;
176 if (empty($contextpage) || $contextpage ==
'thirdpartylist') {
177 $contextpage =
'customerlist';
179 if ($search_type ==
'') {
180 $search_type =
'1,3';
184 if (empty($contextpage) || $contextpage ==
'thirdpartylist') {
185 $contextpage =
'prospectlist';
187 if ($search_type ==
'') {
188 $search_type =
'2,3';
192 if (empty($contextpage) || $contextpage ==
'poslist') {
193 $contextpage =
'poslist';
195 if ($search_type ==
'') {
196 $search_type =
'1,2,3';
200 if (empty($contextpage) || $contextpage ==
'thirdpartylist') {
201 $contextpage =
'supplierlist';
203 if ($search_type ==
'') {
210$hookmanager->initHooks(array($contextpage,
'thirdpartylist'));
213$extrafields->fetch_name_optionals_label(
$object->table_element);
215$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
218$fieldstosearchall = array(
219 's.nom' =>
"ThirdPartyName",
220 's.name_alias' =>
"AliasNameShort",
221 's.code_client' =>
"CustomerCode",
222 's.code_fournisseur' =>
"SupplierCode",
223 's.code_compta' =>
"CustomerAccountancyCodeShort",
224 's.code_compta_fournisseur' =>
"SupplierAccountancyCodeShort",
227 's.email' =>
"EMail",
229 's.tva_intra' =>
"VATIntra",
230 's.siren' =>
"ProfId1",
231 's.siret' =>
"ProfId2",
232 's.ape' =>
"ProfId3",
233 's.phone' =>
"Phone",
234 's.phone_mobile' =>
"PhoneMobile",
237if (($tmp = $langs->transnoentities(
"ProfId4".$mysoc->country_code)) && $tmp !=
"ProfId4".$mysoc->country_code && $tmp !=
'-') {
238 $fieldstosearchall[
's.idprof4'] =
'ProfId4';
240if (($tmp = $langs->transnoentities(
"ProfId5".$mysoc->country_code)) && $tmp !=
"ProfId5".$mysoc->country_code && $tmp !=
'-') {
241 $fieldstosearchall[
's.idprof5'] =
'ProfId5';
243if (($tmp = $langs->transnoentities(
"ProfId6".$mysoc->country_code)) && $tmp !=
"ProfId6".$mysoc->country_code && $tmp !=
'-') {
244 $fieldstosearchall[
's.idprof6'] =
'ProfId6';
246if (isModEnabled(
'barcode')) {
247 $fieldstosearchall[
's.barcode'] =
'Gencod';
256$checkedcustomercode = (in_array($contextpage, array(
'thirdpartylist',
'customerlist',
'prospectlist',
'poslist')) ? 1 : 0);
257$checkedsuppliercode = (in_array($contextpage, array(
'supplierlist')) ? 1 : 0);
258$checkedcustomeraccountcode = (in_array($contextpage, array(
'customerlist')) ? 1 : 0);
259$checkedsupplieraccountcode = (in_array($contextpage, array(
'supplierlist')) ? 1 : 0);
260$checkedtypetiers = 1;
270$checkprospectlevel = (in_array($contextpage, array(
'prospectlist')) ? 1 : 0);
271$checkstcomm = (in_array($contextpage, array(
'prospectlist')) ? 1 : 0);
273 's.rowid' => array(
'label' =>
"TechnicalID",
'position' => 1,
'checked' => -1,
'enabled' => 1),
274 's.nom' => array(
'label' =>
"ThirdPartyName",
'position' => 2,
'checked' => 1),
275 's.name_alias' => array(
'label' =>
"AliasNameShort",
'position' => 3,
'checked' => 1),
276 's.barcode' => array(
'label' =>
"Gencod",
'position' => 5,
'checked' => 1,
'enabled' => (isModEnabled(
'barcode'))),
277 's.code_client' => array(
'label' =>
"CustomerCodeShort",
'position' => 10,
'checked' => $checkedcustomercode),
278 's.code_fournisseur' => array(
'label' =>
"SupplierCodeShort",
'position' => 11,
'checked' => $checkedsuppliercode,
'enabled' => (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice"))),
279 's.code_compta' => array(
'label' =>
"CustomerAccountancyCodeShort",
'position' => 13,
'checked' => $checkedcustomeraccountcode),
280 's.code_compta_fournisseur' => array(
'label' =>
"SupplierAccountancyCodeShort",
'position' => 14,
'checked' => $checkedsupplieraccountcode,
'enabled' => (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice"))),
281 's.address' => array(
'label' =>
"Address",
'position' => 19,
'checked' => 0),
282 's.zip' => array(
'label' =>
"Zip",
'position' => 20,
'checked' => 1),
283 's.town' => array(
'label' =>
"Town",
'position' => 21,
'checked' => 0),
284 'state.nom' => array(
'label' =>
"State",
'position' => 22,
'checked' => 0),
285 'region.nom' => array(
'label' =>
"Region",
'position' => 23,
'checked' => 0),
286 'country.code_iso' => array(
'label' =>
"Country",
'position' => 24,
'checked' => 0),
287 's.email' => array(
'label' =>
"Email",
'position' => 25,
'checked' => 0),
288 's.url' => array(
'label' =>
"Url",
'position' => 26,
'checked' => 0),
289 's.phone' => array(
'label' =>
"Phone",
'position' => 27,
'checked' => 1),
290 's.fax' => array(
'label' =>
"Fax",
'position' => 28,
'checked' => 0),
291 'typent.code' => array(
'label' =>
"ThirdPartyType",
'position' => 29,
'checked' => $checkedtypetiers),
292 'staff.code' => array(
'label' =>
"Workforce",
'position' => 31,
'checked' => 0),
293 'legalform.code' => array(
'label' =>
'JuridicalStatus',
'position' => 32,
'checked' => 0),
294 's.phone_mobile' => array(
'label' =>
"PhoneMobile",
'position' => 35,
'checked' => 0),
295 's.siren' => array(
'label' =>
"ProfId1Short",
'position' => 40,
'checked' => $checkedprofid1),
296 's.siret' => array(
'label' =>
"ProfId2Short",
'position' => 41,
'checked' => $checkedprofid2),
297 's.ape' => array(
'label' =>
"ProfId3Short",
'position' => 42,
'checked' => $checkedprofid3),
298 's.idprof4' => array(
'label' =>
"ProfId4Short",
'position' => 43,
'checked' => $checkedprofid4),
299 's.idprof5' => array(
'label' =>
"ProfId5Short",
'position' => 44,
'checked' => $checkedprofid5),
300 's.idprof6' => array(
'label' =>
"ProfId6Short",
'position' => 45,
'checked' => $checkedprofid6),
301 's.tva_intra' => array(
'label' =>
"VATIntraShort",
'position' => 50,
'checked' => 0),
302 'customerorsupplier' => array(
'label' =>
'NatureOfThirdParty',
'position' => 61,
'checked' => 1),
303 's.fk_prospectlevel' => array(
'label' =>
"ProspectLevel",
'position' => 62,
'checked' => $checkprospectlevel),
304 's.fk_stcomm' => array(
'label' =>
"StatusProsp",
'position' => 63,
'checked' => $checkstcomm),
305 's2.nom' => array(
'label' =>
'ParentCompany',
'position' => 64,
'checked' => 0),
306 's.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
307 's.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
308 's.note_public' => array(
'label' =>
'NotePublic',
'checked' => 0,
'position' => 520,
'enabled' => (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
309 's.note_private' => array(
'label' =>
'NotePrivate',
'checked' => 0,
'position' => 521,
'enabled' => (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
310 's.status' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000),
311 's.import_key' => array(
'label' =>
"ImportId",
'checked' => 0,
'position' => 1100),
314 $arrayfields[
's.price_level'] = array(
'label' =>
"PriceLevel",
'position' => 30,
'checked' => 0);
318$arrayfields[
'sales.representative'] = array(
'label' => $langs->trans(
"SalesRepresentatives"),
'checked' => 1,
'position' => 12);
321include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
325'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
330 $socid = $user->socid;
334$permissiontoadd = $user->hasRight(
'societe',
'lire');
341if ($action ==
"change" && $user->hasRight(
'takepos',
'run')) {
345 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' AND entity IN (".
getEntity(
'invoice').
")";
346 $result = $db->query($sql);
347 $num_lines = $db->num_rows($result);
348 if ($num_lines == 0) {
349 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
351 $constforthirdpartyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"];
354 $invoice->module_source =
'takepos';
355 $invoice->pos_source = $_SESSION[
"takeposterminal"];
356 $placeid = $invoice->create($user);
357 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' where rowid = ".((int) $placeid);
361 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set fk_soc=".((int) $idcustomer).
" where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")'";
362 $resql = $db->query($sql); ?>
364 console.log(
"Reload page invoice.php with place=<?php print $place; ?>");
365 parent.$(
"#poslines").load(
"invoice.php?place=<?php print $place; ?>",
function() {
367 <?php
if (!$resql) { ?>
368 alert(
'Error failed to update customer on draft invoice.');
370 parent.$.colorbox.close();
377if (
GETPOST(
'cancel',
'alpha')) {
381if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
385$parameters = array(
'arrayfields' => &$arrayfields);
386$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
391if (empty($reshook)) {
393 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
396 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
400 $search_categ_cus = 0;
401 $search_categ_sup = 0;
402 $searchCategoryCustomerOperator = 0;
403 $searchCategorySupplierOperator = 0;
404 $searchCategoryCustomerList = array();
405 $searchCategorySupplierList = array();
407 $search_barcode =
"";
408 $search_customer_code =
'';
409 $search_supplier_code =
'';
410 $search_account_customer_code =
'';
411 $search_account_supplier_code =
'';
412 $search_address =
'';
417 $search_country =
'';
420 $search_phone_mobile =
'';
423 $search_idprof1 =
'';
424 $search_idprof2 =
'';
425 $search_idprof3 =
'';
426 $search_idprof4 =
'';
427 $search_idprof5 =
'';
428 $search_idprof6 =
'';
431 $search_price_level =
'';
432 $search_type_thirdparty =
'';
434 $search_legalform =
'';
435 $search_date_creation_startmonth =
"";
436 $search_date_creation_startyear =
"";
437 $search_date_creation_startday =
"";
438 $search_date_creation_start =
"";
439 $search_date_creation_endmonth =
"";
440 $search_date_creation_endyear =
"";
441 $search_date_creation_endday =
"";
442 $search_date_creation_end =
"";
443 $search_date_modif_startmonth =
"";
444 $search_date_modif_startyear =
"";
445 $search_date_modif_startday =
"";
446 $search_date_modif_start =
"";
447 $search_date_modif_endmonth =
"";
448 $search_date_modif_endyear =
"";
449 $search_date_modif_endday =
"";
450 $search_date_modif_end =
"";
454 $search_parent_name =
'';
455 $search_import_key =
'';
459 $search_array_options = array();
463 $objectclass =
'Societe';
464 $objectlabel =
'ThirdParty';
465 $permissiontoread = $user->hasRight(
'societe',
'lire');
466 $permissiontodelete = $user->hasRight(
'societe',
'supprimer');
467 $permissiontoadd = $user->hasRight(
"societe",
"creer");
468 $uploaddir = $conf->societe->dir_output;
469 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
471 if ($action ==
'setstcomm' && $permissiontoadd) {
484if ($search_status ==
'' && empty($search_all)) {
503$form =
new Form($db);
505$companystatic =
new Societe($db);
506$companyparent =
new Societe($db);
508$prospectstatic =
new Client($db);
509$prospectstatic->client = 2;
510$prospectstatic->loadCacheOfProspStatus();
514$title = $langs->trans(
"ThirdParties");
515if ($type ==
'c' && (empty($search_type) || ($search_type ==
'1,3'))) {
516 $title = $langs->trans(
"Customers");
518if ($type ==
'p' && (empty($search_type) || ($search_type ==
'2,3'))) {
519 $title = $langs->trans(
"Prospects");
521if ($type ==
'f' && (empty($search_type) || ($search_type ==
'4'))) {
522 $title = $langs->trans(
"Suppliers");
524$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
529$sql =
"SELECT code, label, sortorder";
530$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectlevel";
531$sql .=
" WHERE active > 0";
532$sql .=
" ORDER BY sortorder";
533$resql = $db->query($sql);
535 while ($obj = $db->fetch_object($resql)) {
537 $level = $langs->trans($obj->code);
538 if ($level == $obj->code) {
539 $level = $langs->trans($obj->label);
541 $tab_level[$obj->code] = $level;
549$sql =
"SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.address, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,";
551$sql .=
" st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status, s.note_private, s.note_public,";
552$sql .=
" s.email, s.phone, s.phone_mobile, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
553$sql .=
" s.tms as date_modification, s.datec as date_creation, s.import_key,";
554$sql .=
" s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,s.price_level,";
555$sql .=
" s2.nom as name2,";
556$sql .=
" typent.code as typent_code,";
557$sql .=
" staff.code as staff_code,";
558$sql .=
" s.fk_forme_juridique as legalform_code,";
559$sql .=
" country.code as country_code, country.label as country_label,";
560$sql .=
" state.code_departement as state_code, state.nom as state_name,";
561$sql .=
" region.code_region as region_code, region.nom as region_name";
563if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
564 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
565 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
569$parameters = array();
570$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
571$sql .= $hookmanager->resPrint;
572$sql = preg_replace(
'/,\s*$/',
'', $sql);
577$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
578$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s2 ON s.parent = s2.rowid";
579if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
580 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (s.rowid = ef.fk_object)";
583$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
584$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
585$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_effectif as staff on (staff.id = s.fk_effectif)";
587$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
588$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_regions as region on (region.code_region = state.fk_region)";
589$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"c_stcomm as st ON s.fk_stcomm = st.id";
591$parameters = array();
592$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
593$sql .= $hookmanager->resPrint;
594$sql .=
" WHERE s.entity IN (".getEntity(
'societe').
")";
595if (!$user->hasRight(
'fournisseur',
'lire')) {
596 $sql .=
" AND (s.fournisseur <> 1 OR s.client <> 0)";
599if ($search_sale && $search_sale !=
'-1') {
600 if ($search_sale == -2) {
601 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = s.rowid)";
602 } elseif ($search_sale > 0) {
603 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".((int) $search_sale).
")";
608if (!empty($searchCategoryCustomerList)) {
609 $searchCategoryCustomerSqlList = array();
610 $listofcategoryid =
'';
611 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
612 if (intval($searchCategoryCustomer) == -2) {
613 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
614 } elseif (intval($searchCategoryCustomer) > 0) {
615 if ($searchCategoryCustomerOperator == 0) {
616 $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).
")";
618 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
622 if ($listofcategoryid) {
623 $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).
"))";
625 if ($searchCategoryCustomerOperator == 1) {
626 if (!empty($searchCategoryCustomerSqlList)) {
627 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
630 if (!empty($searchCategoryCustomerSqlList)) {
631 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
637if (!empty($searchCategorySupplierList)) {
638 $searchCategorySupplierSqlList = array();
639 $listofcategoryid =
'';
640 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
641 if (intval($searchCategorySupplier) == -2) {
642 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
643 } elseif (intval($searchCategorySupplier) > 0) {
644 if ($searchCategorySupplierOperator == 0) {
645 $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).
")";
647 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
651 if ($listofcategoryid) {
652 $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).
"))";
654 if ($searchCategorySupplierOperator == 1) {
655 if (!empty($searchCategorySupplierSqlList)) {
656 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
659 if (!empty($searchCategorySupplierSqlList)) {
660 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
665 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
667if (strlen($search_cti)) {
673if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_nom) {
674 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_nom);
684if ($search_nom_only) {
687if ($search_customer_code) {
690if ($search_supplier_code) {
691 $sql .=
natural_search(
"s.code_fournisseur", $search_supplier_code);
693if ($search_account_customer_code) {
694 $sql .=
natural_search(
"s.code_compta", $search_account_customer_code);
696if ($search_account_supplier_code) {
697 $sql .=
natural_search(
"s.code_compta_fournisseur", $search_account_supplier_code);
699if ($search_address) {
702if (strlen($search_zip)) {
714if ($search_country && $search_country !=
'-1') {
715 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
720if (strlen($search_phone)) {
723if (strlen($search_phone_mobile)) {
726if (strlen($search_fax)) {
732if (strlen($search_idprof1)) {
735if (strlen($search_idprof2)) {
738if (strlen($search_idprof3)) {
741if (strlen($search_idprof4)) {
744if (strlen($search_idprof5)) {
747if (strlen($search_idprof6)) {
750if (strlen($search_vat)) {
754if ($search_type > 0 && in_array($search_type, array(
'1,3',
'1,2,3',
'2,3'))) {
755 $sql .=
" AND s.client IN (".$db->sanitize($search_type).
")";
757if ($search_type > 0 && in_array($search_type, array(
'4'))) {
758 $sql .=
" AND s.fournisseur = 1";
760if ($search_type ==
'0') {
761 $sql .=
" AND s.client = 0 AND s.fournisseur = 0";
763if ($search_status !=
'' && $search_status >= 0) {
766if (isModEnabled(
'barcode') && $search_barcode) {
769if ($search_price_level && $search_price_level !=
'-1') {
772if ($search_type_thirdparty && $search_type_thirdparty > 0) {
773 $sql .=
natural_search(
"s.fk_typent", $search_type_thirdparty, 2);
775if (!empty($search_staff) && $search_staff !=
'-1') {
778if (!empty($search_legalform) && $search_legalform !=
'-1') {
779 $sql .=
natural_search(
"s.fk_forme_juridique", $search_legalform, 2);
781if ($search_parent_name) {
785 $sql .=
natural_search(
"s.fk_prospectlevel", implode(
',', $search_level), 3);
788 $sql .=
natural_search(
"s.fk_stcomm", implode(
',', $search_stcomm), 2);
790if ($search_import_key) {
793if ($search_date_creation_start) {
794 $sql .=
" AND s.datec >= '".$db->idate($search_date_creation_start).
"'";
796if ($search_date_creation_end) {
797 $sql .=
" AND s.datec <= '".$db->idate($search_date_creation_end).
"'";
800if ($search_date_modif_start) {
801 $sql .=
" AND s.tms >= '".$db->idate($search_date_modif_start).
"'";
803if ($search_date_modif_end) {
804 $sql .=
" AND s.tms <= '".$db->idate($search_date_modif_end).
"'";
808include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
810$parameters = array(
'socid' => $socid);
811$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
812if (empty($reshook)) {
814 $sql .=
" AND s.rowid = ".((int) $socid);
817$sql .= $hookmanager->resPrint;
820$parameters = array(
'fieldstosearchall' => $fieldstosearchall);
821$reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
822$sql .= $hookmanager->resPrint;
825$nbtotalofrecords =
'';
828 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
829 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
830 $resql = $db->query($sqlforcount);
832 $objforcount = $db->fetch_object($resql);
833 $nbtotalofrecords = $objforcount->nbtotalofrecords;
838 if (($page * $limit) > $nbtotalofrecords) {
846$sql .= $db->order($sortfield, $sortorder);
848 $sql .= $db->plimit($limit + 1, $offset);
851$resql = $db->query($sql);
857$num = $db->num_rows($resql);
861if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($search_all !=
'' || $search_cti !=
'') && $action !=
'list') {
862 $obj = $db->fetch_object($resql);
864 if (
getDolGlobalString(
'SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD')) {
865 if ($obj->client > 0) {
866 header(
"Location: ".DOL_URL_ROOT.
'/comm/card.php?socid='.
$id);
869 if ($obj->fournisseur > 0) {
870 header(
"Location: ".DOL_URL_ROOT.
'/fourn/card.php?socid='.
$id);
875 header(
"Location: ".DOL_URL_ROOT.
'/societe/card.php?socid='.
$id);
883foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
884 $paramsCat .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
886foreach ($searchCategorySupplierList as $searchCategorySupplier) {
887 $paramsCat .=
"&search_category_supplier_list[]=".urlencode($searchCategorySupplier);
890llxHeader(
'', $title, $help_url,
'', 0, 0, array(), array(), $paramsCat,
'bodyforlist');
893$arrayofselected = is_array($toselect) ? $toselect : array();
897 $param .=
'&mode='.urlencode($mode);
899if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
900 $param .=
'&contextpage='.urlencode($contextpage);
902if ($limit > 0 && $limit != $conf->liste_limit) {
903 $param .=
'&limit='.((int) $limit);
905if ($optioncss !=
'') {
906 $param .=
'&optioncss='.urlencode($optioncss);
908if ($search_all !=
'') {
909 $param =
"&search_all=".urlencode($search_all);
911if ($search_categ_cus > 0) {
912 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
914if ($search_categ_sup > 0) {
915 $param .=
'&search_categ_sup='.urlencode((
string) ($search_categ_sup));
917if ($searchCategoryCustomerOperator == 1) {
918 $param .=
"&search_category_customer_operator=".urlencode((
string) ($searchCategoryCustomerOperator));
920if ($searchCategorySupplierOperator == 1) {
921 $param .=
"&search_category_supplier_operator=".urlencode((
string) ($searchCategorySupplierOperator));
923foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
924 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
926foreach ($searchCategorySupplierList as $searchCategorySupplier) {
927 $param .=
"&search_category_supplier_list[]=".urlencode($searchCategorySupplier);
929if ($search_sale > 0) {
930 $param .=
'&search_sale='.((int) $search_sale);
933 $param .=
"&search_id=".((int) $search_id);
935if ($search_nom !=
'') {
936 $param .=
"&search_nom=".urlencode($search_nom);
938if ($search_alias !=
'') {
939 $param .=
"&search_alias=".urlencode($search_alias);
941if ($search_address !=
'') {
942 $param .=
'&search_address='.urlencode($search_address);
944if ($search_zip !=
'') {
945 $param .=
"&search_zip=".urlencode($search_zip);
947if ($search_town !=
'') {
948 $param .=
"&search_town=".urlencode($search_town);
950if ($search_phone !=
'') {
951 $param .=
"&search_phone=".urlencode($search_phone);
953if ($search_phone_mobile !=
'') {
954 $param .=
"&search_phone_mobile=".urlencode($search_phone_mobile);
956if ($search_fax !=
'') {
957 $param .=
"&search_fax=".urlencode($search_fax);
959if ($search_email !=
'') {
960 $param .=
"&search_email=".urlencode($search_email);
962if ($search_url !=
'') {
963 $param .=
"&search_url=".urlencode($search_url);
965if ($search_state !=
'') {
966 $param .=
"&search_state=".urlencode($search_state);
968if ($search_region !=
'') {
969 $param .=
"&search_region=".urlencode($search_region);
971if ($search_country !=
'') {
972 $param .=
"&search_country=".urlencode($search_country);
974if ($search_customer_code !=
'') {
975 $param .=
"&search_customer_code=".urlencode($search_customer_code);
977if ($search_supplier_code !=
'') {
978 $param .=
"&search_supplier_code=".urlencode($search_supplier_code);
980if ($search_account_customer_code !=
'') {
981 $param .=
"&search_account_customer_code=".urlencode($search_account_customer_code);
983if ($search_account_supplier_code !=
'') {
984 $param .=
"&search_account_supplier_code=".urlencode($search_account_supplier_code);
986if ($search_barcode !=
'') {
987 $param .=
"&search_barcode=".urlencode($search_barcode);
989if ($search_idprof1 !=
'') {
990 $param .=
'&search_idprof1='.urlencode($search_idprof1);
992if ($search_idprof2 !=
'') {
993 $param .=
'&search_idprof2='.urlencode($search_idprof2);
995if ($search_idprof3 !=
'') {
996 $param .=
'&search_idprof3='.urlencode($search_idprof3);
998if ($search_idprof4 !=
'') {
999 $param .=
'&search_idprof4='.urlencode($search_idprof4);
1001if ($search_idprof5 !=
'') {
1002 $param .=
'&search_idprof5='.urlencode($search_idprof5);
1004if ($search_idprof6 !=
'') {
1005 $param .=
'&search_idprof6='.urlencode($search_idprof6);
1007if ($search_vat !=
'') {
1008 $param .=
'&search_vat='.urlencode($search_vat);
1010if ($search_price_level !=
'') {
1011 $param .=
'&search_price_level='.urlencode($search_price_level);
1013if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
1014 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1016if ($search_type !=
'') {
1017 $param .=
'&search_type='.urlencode($search_type);
1019if ($search_status !=
'') {
1020 $param .=
'&search_status='.urlencode((
string) ($search_status));
1022if (is_array($search_level) && count($search_level)) {
1023 foreach ($search_level as $slevel) {
1024 $param .=
'&search_level[]='.urlencode($slevel);
1027if (is_array($search_stcomm) && count($search_stcomm)) {
1028 foreach ($search_stcomm as $slevel) {
1029 $param .=
'&search_stcomm[]='.urlencode($slevel);
1032if ($search_parent_name !=
'') {
1033 $param .=
'&search_parent_name='.urlencode($search_parent_name);
1035if ($search_import_key !=
'') {
1036 $param .=
'&search_import_key='.urlencode($search_import_key);
1039 $param .=
'&type='.urlencode($type);
1041if ($search_date_creation_startmonth) {
1042 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
1044if ($search_date_creation_startyear) {
1045 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
1047if ($search_date_creation_startday) {
1048 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
1050if ($search_date_creation_start) {
1051 $param .=
'&search_date_creation_start='.urlencode($search_date_creation_start);
1053if ($search_date_creation_endmonth) {
1054 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
1056if ($search_date_creation_endyear) {
1057 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
1059if ($search_date_creation_endday) {
1060 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
1062if ($search_date_creation_end) {
1063 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
1065if ($search_date_modif_startmonth) {
1066 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
1068if ($search_date_modif_startyear) {
1069 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
1071if ($search_date_modif_startday) {
1072 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
1074if ($search_date_modif_start) {
1075 $param .=
'&search_date_modif_start='.urlencode($search_date_modif_start);
1077if ($search_date_modif_endmonth) {
1078 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
1080if ($search_date_modif_endyear) {
1081 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
1083if ($search_date_modif_endday) {
1084 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1086if ($search_date_modif_end) {
1087 $param .=
'&search_date_modif_end=' . urlencode($search_date_modif_end);
1091include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1093$parameters = array(
'param' => &$param);
1094$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1095$param .= $hookmanager->resPrint;
1103$arrayofmassactions = array(
1104 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
1108if (isModEnabled(
'category') && $user->hasRight(
"societe",
"creer")) {
1109 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1111if ($user->hasRight(
"societe",
"creer")) {
1112 $arrayofmassactions[
'preenable'] =
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"SetToStatus",
$object->LibStatut($object::STATUS_INACTIVITY));
1114if ($user->hasRight(
"societe",
"creer")) {
1115 $arrayofmassactions[
'predisable'] =
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"SetToStatus",
$object->LibStatut($object::STATUS_CEASED));
1117if ($user->hasRight(
"societe",
"creer")) {
1118 $arrayofmassactions[
'presetcommercial'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AllocateCommercial");
1119 $arrayofmassactions[
'unsetcommercial'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"UnallocateCommercial");
1122if ($user->hasRight(
'societe',
'supprimer')) {
1123 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1125if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preenable',
'preclose'))) {
1126 $arrayofmassactions = array();
1128$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1131$label =
'MenuNewThirdParty';
1134 $typefilter =
'&type='.$type;
1136 $label =
'MenuNewProspect';
1139 $label =
'MenuNewCustomer';
1142 $label =
'NewSupplier';
1152if ($contextpage !=
'poslist') {
1153 $url = DOL_URL_ROOT.
'/societe/card.php?action=create'.$typefilter;
1154 if (!empty($socid)) {
1155 $url .=
'&socid='.$socid;
1157 $newcardbutton =
'';
1158 $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'));
1159 $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'));
1160 $newcardbutton .=
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'societe',
'creer'));
1161} elseif ($user->hasRight(
'societe',
'creer')) {
1162 $url = DOL_URL_ROOT.
'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
1163 $label =
'MenuNewCustomer';
1164 $newcardbutton =
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url);
1167print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter" autocomplete="off">'.
"\n";
1168if ($optioncss !=
'') {
1169 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1171print
'<input type="hidden" name="token" value="'.newToken().
'">';
1172print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1173print
'<input type="hidden" name="action" value="list">';
1174print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1175print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1177print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1178if (!empty($place)) {
1179 print
'<input type="hidden" name="place" value="'.$place.
'">';
1181print
'<input type="hidden" name="page_y" value="">';
1182print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1183if (empty($arrayfields[
'customerorsupplier'][
'checked'])) {
1184 print
'<input type="hidden" name="type" value="'.$type.
'">';
1186if (!empty($place)) {
1187 print
'<input type="hidden" name="place" value="'.$place.
'">';
1190print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'building', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1192$langs->load(
"other");
1193$textprofid = array();
1194foreach (array(1, 2, 3, 4, 5, 6) as $key) {
1195 $label = $langs->transnoentities(
"ProfId".$key.$mysoc->country_code);
1196 $textprofid[$key] =
'';
1197 if ($label !=
"ProfId".$key.$mysoc->country_code) {
1198 if (preg_match(
'/\((.*)\)/i', $label, $reg)) {
1202 $textprofid[$key] = $langs->trans(
"ProfIdShortDesc", $key, $mysoc->country_code, $label);
1207$topicmail =
"Information";
1208$modelmail =
"thirdparty";
1210$trackid =
'thi'.$object->id;
1211include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1225 foreach ($fieldstosearchall as $key => $val) {
1226 $fieldstosearchall[$key] = $langs->trans($val);
1227 $setupstring .= $key.
"=".$val.
";";
1229 print
'<!-- Search done like if SOCIETE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
1230 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1236if (empty($type) || $type ==
'c' || $type ==
'p') {
1237 if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'read')) {
1239 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth300', $searchCategoryCustomerOperator ? $searchCategoryCustomerOperator : 0, 1, 1, $langs->transnoentities(
"CustomersProspectsCategoriesShort"));
1244if (empty($type) || $type ==
'f') {
1245 if (isModEnabled(
"fournisseur") && isModEnabled(
'category') && $user->hasRight(
'categorie',
'read')) {
1247 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_SUPPLIER, $searchCategorySupplierList,
'minwidth300', $searchCategorySupplierOperator ? $searchCategorySupplierOperator : 0, 1, 1, $langs->transnoentities(
"SuppliersCategoriesShort"));
1252if ($user->hasRight(
"societe",
"client",
"voir") || $socid) {
1253 $moreforfilter .=
'<div class="divsearchfield">';
1254 $tmptitle = $langs->trans(
'SalesRepresentatives');
1255 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1256 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $langs->trans(
'SalesRepresentatives'), ($conf->dol_optimize_smallscreen ?
'maxwidth200' :
'maxwidth300'), 1);
1257 $moreforfilter .=
'</div>';
1259if (!empty($moreforfilter)) {
1260 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1261 print $moreforfilter;
1262 $parameters = array(
'type' => $type);
1263 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1264 print $hookmanager->resPrint;
1268$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1269$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1270$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1271$selectedfields .= ((count($arrayofmassactions) && $contextpage !=
'poslist') ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1273print
'<div class="div-table-responsive">';
1274print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1278print
'<tr class="liste_titre_filter">';
1281 print
'<td class="liste_titre maxwidthsearch center actioncolumn">';
1282 $searchpicto = $form->showFilterButtons(
'left');
1286if (!empty($arrayfields[
's.rowid'][
'checked'])) {
1287 print
'<td class="liste_titre" data-key="id">';
1288 print
'<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).
'">';
1291if (!empty($arrayfields[
's.nom'][
'checked'])) {
1292 print
'<td class="liste_titre" data-key="ref">';
1293 if (!empty($search_nom_only) && empty($search_nom)) {
1294 $search_nom = $search_nom_only;
1296 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_nom" value="'.dol_escape_htmltag($search_nom).
'">';
1299if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1300 print
'<td class="liste_titre">';
1301 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_alias" value="'.dol_escape_htmltag($search_alias).
'">';
1305if (!empty($arrayfields[
's.barcode'][
'checked'])) {
1306 print
'<td class="liste_titre">';
1307 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_barcode" value="'.dol_escape_htmltag($search_barcode).
'">';
1311if (!empty($arrayfields[
's.code_client'][
'checked'])) {
1312 print
'<td class="liste_titre">';
1313 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).
'">';
1317if (!empty($arrayfields[
's.code_fournisseur'][
'checked'])) {
1318 print
'<td class="liste_titre">';
1319 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).
'">';
1323if (!empty($arrayfields[
's.code_compta'][
'checked'])) {
1324 print
'<td class="liste_titre">';
1325 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).
'">';
1329if (!empty($arrayfields[
's.code_compta_fournisseur'][
'checked'])) {
1330 print
'<td class="liste_titre">';
1331 print
'<input class="flat maxwidth75imp" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).
'">';
1335if (!empty($arrayfields[
's.address'][
'checked'])) {
1336 print
'<td class="liste_titre">';
1337 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'">';
1341if (!empty($arrayfields[
'sales.representative'][
'checked'])) {
1342 print
'<td class="liste_titre">';
1346if (!empty($arrayfields[
's.zip'][
'checked'])) {
1347 print
'<td class="liste_titre">';
1348 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'">';
1352if (!empty($arrayfields[
's.town'][
'checked'])) {
1353 print
'<td class="liste_titre">';
1354 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'">';
1358if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1359 print
'<td class="liste_titre">';
1360 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1364if (!empty($arrayfields[
'region.nom'][
'checked'])) {
1365 print
'<td class="liste_titre">';
1366 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).
'">';
1370if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1371 print
'<td class="liste_titre center">';
1372 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1376if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1377 print
'<td class="liste_titre maxwidthonsmartphone center">';
1379 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (!
getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'minwidth50 maxwidth125', 1);
1383if (!empty($arrayfields[
's.price_level'][
'checked'])) {
1384 print
'<td class="liste_titre">';
1385 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_price_level" value="'.dol_escape_htmltag($search_price_level).
'">';
1389if (!empty($arrayfields[
'staff.code'][
'checked'])) {
1390 print
'<td class="liste_titre maxwidthonsmartphone center">';
1391 print $form->selectarray(
"search_staff", $formcompany->effectif_array(0), $search_staff, 0, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100', 1);
1395if (!empty($arrayfields[
'legalform.code'][
'checked'])) {
1396 print
'<td class="liste_titre maxwidthonsmartphone center">';
1400if (!empty($arrayfields[
's.email'][
'checked'])) {
1402 print
'<td class="liste_titre">';
1403 print
'<input class="flat searchemail maxwidth50imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'">';
1406if (!empty($arrayfields[
's.phone'][
'checked'])) {
1408 print
'<td class="liste_titre">';
1409 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'">';
1412if (!empty($arrayfields[
's.phone_mobile'][
'checked'])) {
1414 print
'<td class="liste_titre">';
1415 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).
'">';
1418if (!empty($arrayfields[
's.fax'][
'checked'])) {
1420 print
'<td class="liste_titre">';
1421 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_fax" value="'.dol_escape_htmltag($search_fax).
'">';
1424if (!empty($arrayfields[
's.url'][
'checked'])) {
1426 print
'<td class="liste_titre">';
1427 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).
'">';
1430if (!empty($arrayfields[
's.siren'][
'checked'])) {
1432 print
'<td class="liste_titre">';
1433 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).
'">';
1436if (!empty($arrayfields[
's.siret'][
'checked'])) {
1438 print
'<td class="liste_titre">';
1439 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof2" value="'.dol_escape_htmltag($search_idprof2).
'">';
1442if (!empty($arrayfields[
's.ape'][
'checked'])) {
1444 print
'<td class="liste_titre">';
1445 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof3" value="'.dol_escape_htmltag($search_idprof3).
'">';
1448if (!empty($arrayfields[
's.idprof4'][
'checked'])) {
1450 print
'<td class="liste_titre">';
1451 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).
'">';
1454if (!empty($arrayfields[
's.idprof5'][
'checked'])) {
1456 print
'<td class="liste_titre">';
1457 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).
'">';
1460if (!empty($arrayfields[
's.idprof6'][
'checked'])) {
1462 print
'<td class="liste_titre">';
1463 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).
'">';
1466if (!empty($arrayfields[
's.tva_intra'][
'checked'])) {
1468 print
'<td class="liste_titre">';
1469 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).
'">';
1474if (!empty($arrayfields[
'customerorsupplier'][
'checked'])) {
1475 print
'<td class="liste_titre maxwidthonsmartphone center">';
1477 print
'<input type="hidden" name="type" value="'.$type.
'">';
1479 print $formcompany->selectProspectCustomerType($search_type,
'search_type',
'search_type',
'list');
1483if (!empty($arrayfields[
's.fk_prospectlevel'][
'checked'])) {
1484 print
'<td class="liste_titre center">';
1485 print $form->multiselectarray(
'search_level', $tab_level, $search_level, 0, 0,
'width75', 0, 0,
'',
'',
'', 2);
1489if (!empty($arrayfields[
's.fk_stcomm'][
'checked'])) {
1490 print
'<td class="liste_titre maxwidthonsmartphone center">';
1491 $arraystcomm = array();
1492 foreach ($prospectstatic->cacheprospectstatus as $key => $val) {
1493 $arraystcomm[$val[
'id']] = ($langs->trans(
"StatusProspect".$val[
'id']) !=
"StatusProspect".$val[
'id'] ? $langs->trans(
"StatusProspect".$val[
'id']) : $val[
'label']);
1496 print $form->multiselectarray(
'search_stcomm', $arraystcomm, $search_stcomm, 0, 0,
'width100', 0, 0,
'',
'',
'', 2);
1499if (!empty($arrayfields[
's2.nom'][
'checked'])) {
1500 print
'<td class="liste_titre center">';
1501 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_parent_name" value="'.dol_escape_htmltag($search_parent_name).
'">';
1505include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1508$parameters = array(
'arrayfields' => $arrayfields);
1509$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1510print $hookmanager->resPrint;
1512if (!empty($arrayfields[
's.datec'][
'checked'])) {
1513 print
'<td class="liste_titre center nowraponall">';
1514 print
'<div class="nowrapfordate">';
1515 print $form->selectDate($search_date_creation_start ? $search_date_creation_start : -1,
'search_date_creation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1517 print
'<div class="nowrapfordate">';
1518 print $form->selectDate($search_date_creation_end ? $search_date_creation_end : -1,
'search_date_creation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1523if (!empty($arrayfields[
's.tms'][
'checked'])) {
1524 print
'<td class="liste_titre center nowraponall">';
1525 print
'<div class="nowrapfordate">';
1526 print $form->selectDate($search_date_modif_start ? $search_date_modif_start : -1,
'search_date_modif_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1528 print
'<div class="nowrapfordate">';
1529 print $form->selectDate($search_date_modif_end ? $search_date_modif_end : -1,
'search_date_modif_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1533if (!empty($arrayfields[
's.note_public'][
'checked'])) {
1535 print
'<td class="liste_titre">';
1538if (!empty($arrayfields[
's.note_private'][
'checked'])) {
1540 print
'<td class="liste_titre">';
1544if (!empty($arrayfields[
's.status'][
'checked'])) {
1545 print
'<td class="liste_titre center minwidth75imp parentonrightofpage">';
1546 print $form->selectarray(
'search_status', array(
'0' => $langs->trans(
'ActivityCeased'),
'1' => $langs->trans(
'InActivity')), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage', 1);
1549if (!empty($arrayfields[
's.import_key'][
'checked'])) {
1550 print
'<td class="liste_titre center">';
1551 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1556 print
'<td class="liste_titre center maxwidthsearch actioncolumn">';
1557 $searchpicto = $form->showFilterButtons();
1564$totalarray = array();
1565$totalarray[
'nbfield'] = 0;
1569print
'<tr class="liste_titre">';
1572 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1573 $totalarray[
'nbfield']++;
1575if (!empty($arrayfields[
's.rowid'][
'checked'])) {
1576 print_liste_field_titre($arrayfields[
's.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"s.rowid",
"", $param,
' data-key="id"', $sortfield, $sortorder,
'');
1577 $totalarray[
'nbfield']++;
1579if (!empty($arrayfields[
's.nom'][
'checked'])) {
1580 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
' data-key="ref"', $sortfield, $sortorder,
' ');
1581 $totalarray[
'nbfield']++;
1583if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1585 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1586 $totalarray[
'nbfield']++;
1588if (!empty($arrayfields[
's.barcode'][
'checked'])) {
1589 print_liste_field_titre($arrayfields[
's.barcode'][
'label'], $_SERVER[
"PHP_SELF"],
"s.barcode", $param,
'',
'', $sortfield, $sortorder);
1590 $totalarray[
'nbfield']++;
1592if (!empty($arrayfields[
's.code_client'][
'checked'])) {
1593 print_liste_field_titre($arrayfields[
's.code_client'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_client",
"", $param,
'', $sortfield, $sortorder);
1594 $totalarray[
'nbfield']++;
1596if (!empty($arrayfields[
's.code_fournisseur'][
'checked'])) {
1597 print_liste_field_titre($arrayfields[
's.code_fournisseur'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_fournisseur",
"", $param,
'', $sortfield, $sortorder);
1598 $totalarray[
'nbfield']++;
1600if (!empty($arrayfields[
's.code_compta'][
'checked'])) {
1601 print_liste_field_titre($arrayfields[
's.code_compta'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_compta",
"", $param,
'', $sortfield, $sortorder);
1602 $totalarray[
'nbfield']++;
1604if (!empty($arrayfields[
's.code_compta_fournisseur'][
'checked'])) {
1605 print_liste_field_titre($arrayfields[
's.code_compta_fournisseur'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_compta_fournisseur",
"", $param,
'', $sortfield, $sortorder);
1606 $totalarray[
'nbfield']++;
1608if (!empty($arrayfields[
's.address'][
'checked'])) {
1609 print_liste_field_titre($arrayfields[
's.address'][
'label'], $_SERVER[
'PHP_SELF'],
's.address',
'', $param,
'', $sortfield, $sortorder);
1610 $totalarray[
'nbfield']++;
1612if (!empty($arrayfields[
'sales.representative'][
'checked'])) {
1613 print_liste_field_titre($arrayfields[
'sales.representative'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1614 $totalarray[
'nbfield']++;
1616if (!empty($arrayfields[
's.zip'][
'checked'])) {
1617 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
"s.zip",
"", $param,
'', $sortfield, $sortorder);
1618 $totalarray[
'nbfield']++;
1620if (!empty($arrayfields[
's.town'][
'checked'])) {
1621 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
"s.town",
"", $param,
'', $sortfield, $sortorder);
1622 $totalarray[
'nbfield']++;
1624if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1625 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1626 $totalarray[
'nbfield']++;
1628if (!empty($arrayfields[
'region.nom'][
'checked'])) {
1629 print_liste_field_titre($arrayfields[
'region.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"region.nom",
"", $param,
'', $sortfield, $sortorder);
1630 $totalarray[
'nbfield']++;
1632if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1633 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1634 $totalarray[
'nbfield']++;
1636if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1637 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
"", $sortfield, $sortorder,
'center ');
1638 $totalarray[
'nbfield']++;
1640if (!empty($arrayfields[
'staff.code'][
'checked'])) {
1641 print_liste_field_titre($arrayfields[
'staff.code'][
'label'], $_SERVER[
"PHP_SELF"],
"staff.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1642 $totalarray[
'nbfield']++;
1644if (!empty($arrayfields[
'legalform.code'][
'checked'])) {
1646 print_liste_field_titre($arrayfields[
'legalform.code'][
'label'], $_SERVER[
"PHP_SELF"],
"legalform_code",
"", $param,
'', $sortfield, $sortorder);
1647 $totalarray[
'nbfield']++;
1649if (!empty($arrayfields[
's.price_level'][
'checked'])) {
1650 print_liste_field_titre($arrayfields[
's.price_level'][
'label'], $_SERVER[
"PHP_SELF"],
"s.price_level",
"", $param,
'', $sortfield, $sortorder);
1651 $totalarray[
'nbfield']++;
1653if (!empty($arrayfields[
's.email'][
'checked'])) {
1654 print_liste_field_titre($arrayfields[
's.email'][
'label'], $_SERVER[
"PHP_SELF"],
"s.email",
"", $param,
'', $sortfield, $sortorder);
1655 $totalarray[
'nbfield']++;
1657if (!empty($arrayfields[
's.phone'][
'checked'])) {
1658 print_liste_field_titre($arrayfields[
's.phone'][
'label'], $_SERVER[
"PHP_SELF"],
"s.phone",
"", $param,
'', $sortfield, $sortorder);
1659 $totalarray[
'nbfield']++;
1661if (!empty($arrayfields[
's.phone_mobile'][
'checked'])) {
1662 print_liste_field_titre($arrayfields[
's.phone_mobile'][
'label'], $_SERVER[
"PHP_SELF"],
"s.phone_mobile",
"", $param,
'', $sortfield, $sortorder);
1663 $totalarray[
'nbfield']++;
1665if (!empty($arrayfields[
's.fax'][
'checked'])) {
1666 print_liste_field_titre($arrayfields[
's.fax'][
'label'], $_SERVER[
"PHP_SELF"],
"s.fax",
"", $param,
'', $sortfield, $sortorder);
1667 $totalarray[
'nbfield']++;
1669if (!empty($arrayfields[
's.url'][
'checked'])) {
1670 print_liste_field_titre($arrayfields[
's.url'][
'label'], $_SERVER[
"PHP_SELF"],
"s.url",
"", $param,
'', $sortfield, $sortorder);
1671 $totalarray[
'nbfield']++;
1673if (!empty($arrayfields[
's.siren'][
'checked'])) {
1674 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId1Short"), $textprofid[1], 1, 0), $_SERVER[
"PHP_SELF"],
"s.siren",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1675 $totalarray[
'nbfield']++;
1677if (!empty($arrayfields[
's.siret'][
'checked'])) {
1678 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId2Short"), $textprofid[2], 1, 0), $_SERVER[
"PHP_SELF"],
"s.siret",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1679 $totalarray[
'nbfield']++;
1681if (!empty($arrayfields[
's.ape'][
'checked'])) {
1682 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId3Short"), $textprofid[3], 1, 0), $_SERVER[
"PHP_SELF"],
"s.ape",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1683 $totalarray[
'nbfield']++;
1685if (!empty($arrayfields[
's.idprof4'][
'checked'])) {
1686 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId4Short"), $textprofid[4], 1, 0), $_SERVER[
"PHP_SELF"],
"s.idprof4",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1687 $totalarray[
'nbfield']++;
1689if (!empty($arrayfields[
's.idprof5'][
'checked'])) {
1690 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId5Short"), $textprofid[5], 1, 0), $_SERVER[
"PHP_SELF"],
"s.idprof5",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1691 $totalarray[
'nbfield']++;
1693if (!empty($arrayfields[
's.idprof6'][
'checked'])) {
1694 print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId6Short"), $textprofid[6], 1, 0), $_SERVER[
"PHP_SELF"],
"s.idprof6",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1695 $totalarray[
'nbfield']++;
1697if (!empty($arrayfields[
's.tva_intra'][
'checked'])) {
1698 print_liste_field_titre($arrayfields[
's.tva_intra'][
'label'], $_SERVER[
"PHP_SELF"],
"s.tva_intra",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1699 $totalarray[
'nbfield']++;
1701if (!empty($arrayfields[
'customerorsupplier'][
'checked'])) {
1702 print_liste_field_titre($arrayfields[
'customerorsupplier'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1703 $totalarray[
'nbfield']++;
1705if (!empty($arrayfields[
's.fk_prospectlevel'][
'checked'])) {
1706 print_liste_field_titre($arrayfields[
's.fk_prospectlevel'][
'label'], $_SERVER[
"PHP_SELF"],
"s.fk_prospectlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
1707 $totalarray[
'nbfield']++;
1709if (!empty($arrayfields[
's.fk_stcomm'][
'checked'])) {
1710 print_liste_field_titre($arrayfields[
's.fk_stcomm'][
'label'], $_SERVER[
"PHP_SELF"],
"s.fk_stcomm",
"", $param,
'', $sortfield, $sortorder,
'center ');
1711 $totalarray[
'nbfield']++;
1713if (!empty($arrayfields[
's2.nom'][
'checked'])) {
1714 print_liste_field_titre($arrayfields[
's2.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s2.nom",
"", $param,
'', $sortfield, $sortorder,
'center ');
1715 $totalarray[
'nbfield']++;
1718include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1720$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1721$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1722print $hookmanager->resPrint;
1723if (!empty($arrayfields[
's.datec'][
'checked'])) {
1724 print_liste_field_titre($arrayfields[
's.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"s.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1725 $totalarray[
'nbfield']++;
1727if (!empty($arrayfields[
's.tms'][
'checked'])) {
1728 print_liste_field_titre($arrayfields[
's.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"s.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1729 $totalarray[
'nbfield']++;
1731if (!empty($arrayfields[
's.status'][
'checked'])) {
1732 print_liste_field_titre($arrayfields[
's.status'][
'label'], $_SERVER[
"PHP_SELF"],
"s.status",
"", $param,
'', $sortfield, $sortorder,
'center ');
1733 $totalarray[
'nbfield']++;
1735if (!empty($arrayfields[
's.note_public'][
'checked'])) {
1736 print_liste_field_titre($arrayfields[
's.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"s.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1737 $totalarray[
'nbfield']++;
1739if (!empty($arrayfields[
's.note_private'][
'checked'])) {
1740 print_liste_field_titre($arrayfields[
's.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"s.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1741 $totalarray[
'nbfield']++;
1743if (!empty($arrayfields[
's.import_key'][
'checked'])) {
1744 print_liste_field_titre($arrayfields[
's.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"s.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1745 $totalarray[
'nbfield']++;
1749 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1750 $totalarray[
'nbfield']++;
1758$savnbfield = $totalarray[
'nbfield'];
1759$totalarray = array();
1760$totalarray[
'nbfield'] = 0;
1761$imaxinloop = ($limit ? min($num, $limit) : $num);
1762while ($i < $imaxinloop) {
1763 $obj = $db->fetch_object($resql);
1768 $parameters = array(
'staticdata' => $obj);
1771 $reshook = $hookmanager->executeHooks(
'loadStaticObject', $parameters, $companystatic, $action);
1772 if (empty($reshook)) {
1773 $companystatic->id = $obj->rowid;
1774 $companystatic->name = $obj->name;
1775 $companystatic->name_alias = $obj->name_alias;
1776 $companystatic->logo = $obj->logo;
1777 $companystatic->barcode = $obj->barcode;
1778 $companystatic->canvas = $obj->canvas;
1779 $companystatic->client = $obj->client;
1780 $companystatic->status = $obj->status;
1781 $companystatic->email = $obj->email;
1782 $companystatic->phone = $obj->phone;
1783 $companystatic->phone_mobile = $obj->phone_mobile;
1784 $companystatic->fax = $obj->fax;
1785 $companystatic->address = $obj->address;
1786 $companystatic->zip = $obj->zip;
1787 $companystatic->town = $obj->town;
1788 $companystatic->fournisseur = $obj->fournisseur;
1789 $companystatic->code_client = $obj->code_client;
1790 $companystatic->code_fournisseur = $obj->code_fournisseur;
1791 $companystatic->tva_intra = $obj->tva_intra;
1792 $companystatic->country_code = $obj->country_code;
1794 $companystatic->code_compta_client = $obj->code_compta;
1795 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1796 $companystatic->note_public = $obj->note_public;
1797 $companystatic->note_private = $obj->note_private;
1798 $companystatic->fk_prospectlevel = $obj->fk_prospectlevel;
1799 $companystatic->parent = $obj->fk_parent;
1800 $companystatic->entity = $obj->entity;
1805 if ($mode ==
'kanban') {
1807 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1808 print
'<div class="box-flex-container kanban">';
1811 print $companystatic->getKanbanView(
'', array(
'selected' => in_array($obj->rowid, $arrayofselected)));
1812 if ($i == ($imaxinloop - 1)) {
1819 print
'<tr data-rowid="'.$companystatic->id.
'" class="oddeven"';
1820 if ($contextpage ==
'poslist') {
1821 print
' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.
'&place='.urlencode($place).
'\'"';
1825 // Action column (Show the massaction button only when this page is not opend from the Extended POS)
1826 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1827 print '<td class="nowrap center actioncolumn
">';
1828 if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1830 if (in_array($obj->rowid, $arrayofselected)) {
1833 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1837 $totalarray['nbfield']++;
1840 if (!empty($arrayfields['s.rowid']['checked'])) {
1841 print '<td class="tdoverflowmax50
" data-key="id">';
1842 print dol_escape_htmltag($obj->rowid);
1845 $totalarray['nbfield']++;
1848 if (!empty($arrayfields['s.nom']['checked'])) {
1849 print '<td'.(getDolGlobalString('MAIN_SOCIETE_SHOW_COMPLETE_NAME') ? '' : ' class="tdoverflowmax200
"').' data-key="ref">';
1850 if ($contextpage == 'poslist') {
1851 print dol_escape_htmltag($companystatic->name);
1853 print $companystatic->getNomUrl(1, '', 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
1857 $totalarray['nbfield']++;
1860 if (!empty($arrayfields['s.name_alias']['checked'])) {
1861 print '<td class="tdoverflowmax150
" title="'.dol_escape_htmltag($companystatic->name_alias).'">';
1862 print dol_escape_htmltag($companystatic->name_alias);
1865 $totalarray['nbfield']++;
1869 if (!empty($arrayfields['s.barcode']['checked'])) {
1870 print '<td class="tdoverflowmax150
" title="'.dol_escape_htmltag($companystatic->barcode).'">'.dol_escape_htmltag($companystatic->barcode).'</td>';
1872 $totalarray['nbfield']++;
1876 if (!empty($arrayfields['s.code_client']['checked'])) {
1877 print '<td class="nowraponall
">'.dol_escape_htmltag($companystatic->code_client).'</td>';
1879 $totalarray['nbfield']++;
1883 if (!empty($arrayfields['s.code_fournisseur']['checked'])) {
1884 print '<td class="nowraponall
">'.dol_escape_htmltag($companystatic->code_fournisseur).'</td>';
1886 $totalarray['nbfield']++;
1889 // Account customer code
1890 if (!empty($arrayfields['s.code_compta']['checked'])) {
1891 print '<td>'.dol_escape_htmltag($companystatic->code_compta_client).'</td>';
1893 $totalarray['nbfield']++;
1896 // Account supplier code
1897 if (!empty($arrayfields['s.code_compta_fournisseur']['checked'])) {
1898 print '<td>'.dol_escape_htmltag($companystatic->code_compta_fournisseur).'</td>';
1900 $totalarray['nbfield']++;
1904 if (!empty($arrayfields['s.address']['checked'])) {
1905 print '<td class="tdoverflowmax250
" title="'.dol_escape_htmltag($companystatic->address).'">'.dol_escape_htmltag($companystatic->address).'</td>';
1907 $totalarray['nbfield']++;
1910 // Sales Representative
1911 if (!empty($arrayfields['sales.representative']['checked'])) {
1912 print '<td class="nowraponall tdoverflowmax200
">';
1913 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1914 $nbofsalesrepresentative = count($listsalesrepresentatives);
1915 if ($nbofsalesrepresentative > 6) {
1916 // We print only number
1917 print $nbofsalesrepresentative;
1918 } elseif ($nbofsalesrepresentative > 0) {
1919 $userstatic = new User($db);
1921 foreach ($listsalesrepresentatives as $val) {
1922 $userstatic->id = $val['id'];
1923 $userstatic->lastname = $val['lastname'];
1924 $userstatic->firstname = $val['firstname'];
1925 $userstatic->email = $val['email'];
1926 $userstatic->entity = $val['entity'];
1927 $userstatic->photo = $val['photo'];
1928 $userstatic->login = $val['login'];
1929 $userstatic->office_phone = $val['office_phone'];
1930 $userstatic->office_fax = $val['office_fax'];
1931 $userstatic->user_mobile = $val['user_mobile'];
1932 $userstatic->job = $val['job'];
1933 $userstatic->gender = $val['gender'];
1934 $userstatic->statut = $val['statut'];
1935 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
1937 if ($j < $nbofsalesrepresentative) {
1946 $totalarray['nbfield']++;
1950 if (!empty($arrayfields['s.zip']['checked'])) {
1951 print "<td>
".dol_escape_htmltag($companystatic->zip)."</td>\n
";
1953 $totalarray['nbfield']++;
1957 if (!empty($arrayfields['s.town']['checked'])) {
1958 print '<td class="tdoverflowmax150
" title="'.dol_escape_htmltag($companystatic->town).'">'.dol_escape_htmltag($companystatic->town)."</td>\n
";
1960 $totalarray['nbfield']++;
1964 if (!empty($arrayfields['state.nom']['checked'])) {
1965 print "<td>
".dol_escape_htmltag($obj->state_name)."</td>\n
";
1967 $totalarray['nbfield']++;
1971 if (!empty($arrayfields['region.nom']['checked'])) {
1972 print "<td>
".dol_escape_htmltag($obj->region_name)."</td>\n
";
1974 $totalarray['nbfield']++;
1978 if (!empty($arrayfields['country.code_iso']['checked'])) {
1979 print '<td class="center tdoverflowmax100
">';
1980 $labelcountry = ($companystatic->country_code && ($langs->trans("Country
".$companystatic->country_code) != "Country
".$companystatic->country_code)) ? $langs->trans("Country
".$companystatic->country_code) : $obj->country_label;
1981 print $labelcountry;
1984 $totalarray['nbfield']++;
1988 if (!empty($arrayfields['typent.code']['checked'])) {
1989 if (!isset($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
1990 $typenArray = $formcompany->typent_array(1);
1992 $labeltypeofcompany = empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code];
1994 print '<td class="center tdoverflowmax125
" title="'.dol_escape_htmltag($labeltypeofcompany).'">';
1995 print dol_escape_htmltag($labeltypeofcompany);
1998 $totalarray['nbfield']++;
2002 if (!empty($arrayfields['s.price_level']['checked'])) {
2003 print '<td class="center
">'.$obj->price_level."</td>\n
";
2005 $totalarray['nbfield']++;
2009 if (!empty($arrayfields['staff.code']['checked'])) {
2010 print '<td class="center
">';
2011 if (!empty($obj->staff_code)) {
2012 if (empty($conf->cache['staffArray'])) {
2013 $conf->cache['staffArray'] = $formcompany->effectif_array(1);
2015 print $conf->cache['staffArray'][$obj->staff_code];
2019 $totalarray['nbfield']++;
2023 if (!empty($arrayfields['legalform.code']['checked'])) {
2025 if (!empty($obj->legalform_code)) {
2026 if (empty($conf->cache['legalformArray'][$obj->legalform_code])) {
2027 $conf->cache['legalformArray'][$obj->legalform_code] = getFormeJuridiqueLabel($obj->legalform_code);
2029 $labeltoshow = $conf->cache['legalformArray'][$obj->legalform_code];
2031 print '<td class="center tdoverflowmax100
" title="'.dol_escape_htmltag($labeltoshow).'">';
2032 print dol_escape_htmltag($labeltoshow);
2035 $totalarray['nbfield']++;
2039 if (!empty($arrayfields['s.email']['checked'])) {
2040 print '<td class="tdoverflowmax150
">'.dol_print_email($obj->email, $obj->rowid, $obj->rowid, 1, 0, 0, 1)."</td>\n
";
2042 $totalarray['nbfield']++;
2045 if (!empty($arrayfields['s.phone']['checked'])) {
2046 print '<td class="nowraponall
">'.dol_print_phone($obj->phone, $companystatic->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."</td>\n
";
2048 $totalarray['nbfield']++;
2051 if (!empty($arrayfields['s.phone_mobile']['checked'])) {
2052 print '<td class="nowraponall
">'.dol_print_phone($obj->phone_mobile, $companystatic->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone_mobile')."</td>\n
";
2054 $totalarray['nbfield']++;
2057 if (!empty($arrayfields['s.fax']['checked'])) {
2058 print '<td class="nowraponall
">'.dol_print_phone($obj->fax, $companystatic->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'fax')."</td>\n
";
2060 $totalarray['nbfield']++;
2063 if (!empty($arrayfields['s.url']['checked'])) {
2064 print "<td>
".dol_print_url($obj->url, '', 0, 1)."</td>\n
";
2066 $totalarray['nbfield']++;
2069 if (!empty($arrayfields['s.siren']['checked'])) {
2070 print "<td>
".$obj->idprof1."</td>\n
";
2072 $totalarray['nbfield']++;
2075 if (!empty($arrayfields['s.siret']['checked'])) {
2076 print "<td>
".$obj->idprof2."</td>\n
";
2078 $totalarray['nbfield']++;
2081 if (!empty($arrayfields['s.ape']['checked'])) {
2082 print "<td>
".$obj->idprof3."</td>\n
";
2084 $totalarray['nbfield']++;
2087 if (!empty($arrayfields['s.idprof4']['checked'])) {
2088 print "<td>
".$obj->idprof4."</td>\n
";
2090 $totalarray['nbfield']++;
2093 if (!empty($arrayfields['s.idprof5']['checked'])) {
2094 print "<td>
".$obj->idprof5."</td>\n
";
2096 $totalarray['nbfield']++;
2099 if (!empty($arrayfields['s.idprof6']['checked'])) {
2100 print "<td>
".$obj->idprof6."</td>\n
";
2102 $totalarray['nbfield']++;
2106 if (!empty($arrayfields['s.tva_intra']['checked'])) {
2107 print '<td class="tdoverflowmax125
" title="'.dol_escape_htmltag($companystatic->tva_intra).'">';
2108 if ($companystatic->tva_intra && !isValidVATID($companystatic)) {
2109 print img_warning("BadVATNumber
", '', 'pictofixedwidth');
2111 print $companystatic->tva_intra;
2114 $totalarray['nbfield']++;
2118 if (!empty($arrayfields['customerorsupplier']['checked'])) {
2119 print '<td class="center
">';
2120 print $companystatic->getTypeUrl(1);
2123 $totalarray['nbfield']++;
2127 if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) {
2128 print '<td class="center nowraponall
">';
2129 print $companystatic->getLibProspLevel();
2132 $totalarray['nbfield']++;
2136 if (!empty($arrayfields['s.fk_stcomm']['checked'])) {
2137 print '<td class="center nowraponall
">';
2139 $prospectid = $obj->rowid;
2140 $statusprospect = $obj->stcomm_id;
2142 $formcompany->selectProspectStatus('status_prospect', $prospectstatic, $statusprospect, $prospectid);
2146 $totalarray['nbfield']++;
2150 if (!empty($arrayfields['s2.nom']['checked'])) {
2151 print '<td class="center tdoverflowmax100
">';
2152 if ($companystatic->parent > 0) {
2153 $companyparent->fetch($companystatic->parent);
2154 print $companyparent->getNomUrl(1);
2158 $totalarray['nbfield']++;
2162 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
2164 $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
2165 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
2166 print $hookmanager->resPrint;
2168 if (!empty($arrayfields['s.datec']['checked'])) {
2169 print '<td class="center nowraponall
">';
2170 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
2173 $totalarray['nbfield']++;
2176 // Date modification
2177 if (!empty($arrayfields['s.tms']['checked'])) {
2178 print '<td class="center nowraponall
">';
2179 print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser');
2182 $totalarray['nbfield']++;
2186 if (!empty($arrayfields['s.note_public']['checked'])) {
2187 print '<td class="flat maxwidth250imp
">';
2188 print dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5);
2191 $totalarray['nbfield']++;
2195 if (!empty($arrayfields['s.note_private']['checked'])) {
2196 print '<td class="flat maxwidth250imp
">';
2197 print dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5);
2200 $totalarray['nbfield']++;
2204 if (!empty($arrayfields['s.status']['checked'])) {
2205 print '<td class="center nowraponall
">'.$companystatic->getLibStatut(5).'</td>';
2207 $totalarray['nbfield']++;
2211 if (!empty($arrayfields['s.import_key']['checked'])) {
2212 print '<td class="tdoverflowmax125
" title="'.dol_escape_htmltag($obj->import_key).'">';
2213 print dol_escape_htmltag($obj->import_key);
2216 $totalarray['nbfield']++;
2219 // Action column (Show the massaction button only when this page is not opend from the Extended POS)
2220 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
2221 print '<td class="nowrap center actioncolumn
">';
2222 if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
2224 if (in_array($obj->rowid, $arrayofselected)) {
2227 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
2231 $totalarray['nbfield']++;
2241include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
2243// If no record found
2246 foreach ($arrayfields as $key => $val) {
2247 if (!empty($val['checked'])) {
2251 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium
">'.$langs->trans("NoRecordFound
").'</span></td></tr>';
2256$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
2257$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
2258print $hookmanager->resPrint;
2260print '</table>'."\n
";
2263// Line that calls the select_status function by passing it js as the 5th parameter in order to activate the js script
2264$formcompany->selectProspectStatus('status_prospect', $prospectstatic, null, null, "js
");
2266print '</form>'."\n
";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage customers or prospects.
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dolExplodeIntoArray($string, $delimiter=';', $kv='=')
Split a string with 2 keys into key 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_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
dol_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...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
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...
get_htmloutput_mesg($mesgstring='', $mesgarray=[], $style='ok', $keepembedded=0)
Get formatted messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.