21if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
22 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
27@phan-var-force FormAdvTargetEmailing $formadvtargetemaling
28@phan-var-force AdvanceTargetingMailing $advTarget
29@phan-var-force array<string,string|int|string[]> $array_query
33 $(document).ready(function() {
36 $(":button[name=addcontact]").click(function() {
37 $(":hidden[name=action]").val("add");
38 $("#find_customer").submit();
41 $(":button[name=loadfilter]").click(function() {
42 $(":hidden[name=action]").val("loadfilter");
43 $("#find_customer").submit();
46 $(":button[name=deletefilter]").click(function() {
47 $(":hidden[name=action]").val("deletefilter");
48 $("#find_customer").submit();
51 $(":button[name=savefilter]").click(function() {
52 $(":hidden[name=action]").val("savefilter");
53 $("#find_customer").submit();
56 $(":button[name=createfilter]").click(function() {
57 $(":hidden[name=action]").val("createfilter");
58 $("#find_customer").submit();
66print
'<div class="tabBar">'.
"\n";
67print
'<form name="find_customer" id="find_customer" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$id.
'" method="POST">'.
"\n";
68print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
69print
'<input type="hidden" name="action" value="">'.
"\n";
70print
'<table class="border centpercent">'.
"\n";
73print
'<td colspan="3" class="right">'.
"\n";
75print
'<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans(
'AdvTgtAddContact').
'" class="button"/>'.
"\n";
80print
'<tr><td>'.$langs->trans(
'AdvTgtNameTemplate').
'</td><td class="valignmiddle">';
81if (!empty($template_id)) {
82 $default_template = $template_id;
84 $default_template = $advTarget->id;
86print $formadvtargetemaling->selectAdvtargetemailingTemplate(
'template_id', $default_template, 0, $advTarget->type_element,
'valignmiddle');
87print
'<input type="button" name="loadfilter" id="loadfilter" value="'.$langs->trans(
'AdvTgtLoadFilter').
'" class="button"/>';
88print
'<input type="button" name="deletefilter" id="deletefilter" value="'.$langs->trans(
'AdvTgtDeleteFilter').
'" class="button"/>';
89print
'<input type="button" name="savefilter" id="savefilter" value="'.$langs->trans(
'AdvTgtSaveFilter').
'" class="button"/>';
90print
'</td><td>'.
"\n";
91print
'</td></tr>'.
"\n";
93print
'<tr><td>'.$langs->trans(
'AdvTgtOrCreateNewFilter').
'</td><td>';
94print
'<input type="text" name="template_name" id="template_name" value=""/>';
95print
'<input type="button" name="createfilter" id="createfilter" value="'.$langs->trans(
'AdvTgtCreateFilter').
'" class="button"/>';
96print
'</td><td>'.
"\n";
97print
'</td></tr>'.
"\n";
99print
'<tr><td>'.$langs->trans(
'AdvTgtTypeOfIncude').
'</td><td>';
100print $form->selectarray(
'type_of_target', $advTarget->select_target_type, $array_query[
'type_of_target']);
101print
'</td><td>'.
"\n";
102print $form->textwithpicto(
'', $langs->trans(
"AdvTgtTypeOfIncudeHelp"), 1,
'help');
103print
'</td></tr>'.
"\n";
106print
'<tr><td>'.$langs->trans(
'ThirdPartyName');
107if (!empty($array_query[
'cust_name'])) {
108 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
110print
'</td><td><input type="text" name="cust_name" value="'.$array_query[
'cust_name'].
'"/></td><td>'.
"\n";
111print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
112print
'</td></tr>'.
"\n";
115print
'<tr><td>'.$langs->trans(
'CustomerCode');
116if (!empty($array_query[
'cust_code'])) {
117 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
118 $cust_code_str = (string) $array_query[
'cust_code'];
120 $cust_code_str =
null;
122print
'</td><td><input type="text" name="cust_code"'.($cust_code_str !=
null ?
' value="'.$cust_code_str :
'').
'"/></td><td>'.
"\n";
123print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
124print
'</td></tr>'.
"\n";
127print
'<tr><td>'.$langs->trans(
'Address');
128if (!empty($array_query[
'cust_adress'])) {
129 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
131print
'</td><td><input type="text" name="cust_adress" value="'.$array_query[
'cust_adress'].
'"/></td><td>'.
"\n";
132print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
133print
'</td></tr>'.
"\n";
136print
'<tr><td>'.$langs->trans(
'Zip');
137if (!empty($array_query[
'cust_zip'])) {
138 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
140print
'</td><td><input type="text" name="cust_zip" value="'.$array_query[
'cust_zip'].
'"/></td><td>'.
"\n";
141print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
142print
'</td></tr>'.
"\n";
145print
'<tr><td>'.$langs->trans(
'Town');
146if (!empty($array_query[
'cust_city'])) {
147 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
149print
'</td><td><input type="text" name="cust_city" value="'.$array_query[
'cust_city'].
'"/></td><td>'.
"\n";
150print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
151print
'</td></tr>'.
"\n";
154print
'<tr><td>'.$langs->trans(
'State');
155if (!empty($array_query[
'cust_state'])) {
156 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
158print
'</td><td>'.
"\n";
159print $formadvtargetemaling->multiselectState(
'cust_state', $array_query[
'cust_state']);
160print
'</td><td>'.
"\n";
161print
'</td></tr>'.
"\n";
164print
'<tr><td>'.$langs->trans(
"Country");
165if (!empty($array_query[
'cust_country'])) {
166 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
168print
'</td><td>'.
"\n";
169print $formadvtargetemaling->multiselectCountry(
'cust_country', $array_query[
'cust_country']);
170print
'</td><td>'.
"\n";
171print
'</td></tr>'.
"\n";
174print
'<tr><td>'.$langs->trans(
'Status').
' '.$langs->trans(
'ThirdParty');
175if (!empty($array_query[
'cust_status'])) {
176 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
179print $formadvtargetemaling->advMultiselectarray(
182 '0' => $langs->trans(
'ActivityCeased'),
183 '1' => $langs->trans(
'InActivity')
185 $array_query[
'cust_status']
187print
'</td><td>'.
"\n";
188print
'</td></tr>'.
"\n";
191print
'<tr><td>'.$langs->trans(
"ParentCompany");
192if (!empty($array_query[
'cust_mothercompany'])) {
193 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
195print
'</td><td>'.
"\n";
196print
'<input type="text" name="cust_mothercompany" value="'.$array_query[
'cust_mothercompany'].
'"/>';
197print
'</td><td>'.
"\n";
198print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
199print
'</td></tr>'.
"\n";
202$selected = $array_query[
'cust_typecust'];
203print
'<tr><td>'.$langs->trans(
'ProspectCustomer').
' '.$langs->trans(
'ThirdParty');
204if (!empty($array_query[
'cust_typecust'])) {
205 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
208$options_array = array(
209 2 => $langs->trans(
'Prospect'),
210 3 => $langs->trans(
'ProspectCustomer'),
211 1 => $langs->trans(
'Customer'),
212 0 => $langs->trans(
'NorProspectNorCustomer')
214print $formadvtargetemaling->advMultiselectarray(
'cust_typecust', $options_array, $array_query[
'cust_typecust']);
215print
'</td><td>'.
"\n";
216print
'</td></tr>'.
"\n";
219print
'<tr><td>'.$langs->trans(
'ProspectLevel');
220if (!empty($array_query[
'cust_prospect_status'])) {
221 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
224print $formadvtargetemaling->multiselectProspectionStatus($array_query[
'cust_prospect_status'],
'cust_prospect_status');
225print
'</td><td>'.
"\n";
226print
'</td></tr>'.
"\n";
229print
'<tr><td>'.$langs->trans(
'StatusProsp');
230if (!empty($array_query[
'cust_comm_status'])) {
231 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
234print $formadvtargetemaling->advMultiselectarray(
'cust_comm_status', $advTarget->type_statuscommprospect, $array_query[
'cust_comm_status']);
235print
'</td><td>'.
"\n";
236print
'</td></tr>'.
"\n";
239print
'<tr><td>'.$langs->trans(
"ThirdPartyType");
240if (!empty($array_query[
'cust_typeent'])) {
241 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
243print
'</td><td>'.
"\n";
244print $formadvtargetemaling->advMultiselectarray(
'cust_typeent', $formcompany->typent_array(0,
" AND id <> 0"), $array_query[
'cust_typeent']);
245print
'</td><td>'.
"\n";
246print
'</td></tr>'.
"\n";
249print
'<td>'.$langs->trans(
"Staff");
250if (!empty($array_query[
'cust_effectif_id'])) {
251 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
254print $formadvtargetemaling->advMultiselectarray(
"cust_effectif_id", $formcompany->effectif_array(0,
" AND id <> 0"), $array_query[
'cust_effectif_id']);
255print
'</td><td>'.
"\n";
256print
'</td></tr>'.
"\n";
259print
'<tr><td>'.$langs->trans(
"SalesRepresentatives");
260if (!empty($array_query[
'cust_saleman'])) {
261 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
263print
'</td><td>'.
"\n";
264print $formadvtargetemaling->multiselectselectSalesRepresentatives(
'cust_saleman', $array_query[
'cust_saleman'], $user);
265print
'</td><td>'.
"\n";
266print
'</td></tr>'.
"\n";
270 print
'<tr><td>'.$langs->trans(
"DefaultLang");
271 if (!empty($array_query[
'cust_language'])) {
272 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
274 print
'</td><td>'.
"\n";
275 print $formadvtargetemaling->multiselectselectLanguage(
'cust_language', $array_query[
'cust_language']);
276 print
'</td><td>'.
"\n";
277 print
'</td></tr>'.
"\n";
280if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
282 print
'<tr><td>'.$langs->trans(
"CustomersCategoryShort");
283 if (!empty($array_query[
'cust_categ'])) {
284 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
286 print
'</td><td>'.
"\n";
287 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER,
'',
'parent', 0, 0, 1);
288 print $form->multiselectarray(
'cust_categ', $cate_arbo,
GETPOST(
'cust_categ',
'array'), 0, 0,
'', 0,
"90%");
289 print
'</td><td>'.
"\n";
290 print
'</td></tr>'.
"\n";
296 $elementtype = $socstatic->table_element;
298 require_once DOL_DOCUMENT_ROOT .
'/core/class/extrafields.class.php';
300 $extrafields->fetch_name_optionals_label($elementtype);
301 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $val) {
302 if ($key !=
'ts_nameextra' && $key !=
'ts_payeur') {
303 print
'<tr><td>'.$extrafields->attributes[$elementtype][
'label'][$key];
304 if (!empty($array_query[
'options_'.$key]) || (is_array($array_query[
'options_'.$key]) && count($array_query[
'options_'.$key]) > 0)) {
305 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
308 if (($extrafields->attributes[$elementtype][
'type'][$key] ==
'varchar') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'text')) {
309 print
'<input type="text" name="options_'.$key.
'"/></td><td>'.
"\n";
310 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
311 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'int') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'double')) {
312 print $langs->trans(
"AdvTgtMinVal").
'<input type="text" name="options'.$key.
'_min"/>';
313 print $langs->trans(
"AdvTgtMaxVal").
'<input type="text" name="options'.$key.
'_max"/>';
314 print
'</td><td>'.
"\n";
315 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchIntHelp"), 1,
'help');
316 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'date') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'datetime')) {
317 print
'<table class="nobordernopadding"><tr>';
318 print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
319 print $form->selectDate(
'',
'options_'.$key.
'_st_dt');
320 print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
321 print $form->selectDate(
'',
'options_'.$key.
'_end_dt');
322 print
'</td></tr></table>';
324 print
'</td><td>'.
"\n";
325 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchDtHelp"), 1,
'help');
326 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'boolean')) {
327 print $form->selectarray(
331 '1' => $langs->trans(
'Yes'),
332 '0' => $langs->trans(
'No')
334 $array_query[
'options_'.$key]
336 print
'</td><td>'.
"\n";
337 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'select')) {
338 print $formadvtargetemaling->advMultiselectarray(
'options_'.$key, $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key]);
339 print
'</td><td>'.
"\n";
340 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'sellist')) {
341 print $formadvtargetemaling->advMultiselectarraySelllist(
'options_'.$key, $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key]);
342 print
'</td><td>'.
"\n";
344 print
'<table class="nobordernopadding"><tr>';
345 print
'<td></td><td>';
346 if (is_array($array_query[
'options_'.$key])) {
347 print $extrafields->showInputField($key, implode(
',', $array_query[
'options_'.$key]));
349 print $extrafields->showInputField($key, $array_query[
'options_'.$key]);
351 print
'</td></tr></table>';
353 print
'</td><td>'.
"\n";
355 print
'</td></tr>'.
"\n";
360 $action_search =
'query';
362 $parameters = array(
'advtarget' => 1);
363 if (!empty($advTarget->id)) {
364 $parameters = array(
'array_query' => $advTarget->filtervalue);
367 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $std_soc, $action_search);
368 print $hookmanager->resPrint;
372print
'<tr><td>'.$langs->trans(
'Status').
' '.$langs->trans(
'Contact');
373if (!empty($array_query[
'contact_status'])) {
374 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
377print $formadvtargetemaling->advMultiselectarray(
380 '0' => $langs->trans(
'ActivityCeased'),
381 '1' => $langs->trans(
'InActivity')
383 $array_query[
'contact_status']
385print
'</td><td>'.
"\n";
386print $form->textwithpicto(
'', $langs->trans(
"AdvTgtContactHelp"), 1,
'help');
387print
'</td></tr>'.
"\n";
390print
'<tr><td width="15%">'.$langs->trans(
"UserTitle");
391if (!empty($array_query[
'contact_civility'])) {
392 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
395print $formadvtargetemaling->multiselectCivility(
'contact_civility', $array_query[
'contact_civility']);
399print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
'Lastname');
400if (!empty($array_query[
'contact_lastname'])) {
401 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
403print
'</td><td><input type="text" name="contact_lastname" value="'.$array_query[
'contact_lastname'].
'"/></td><td>'.
"\n";
404print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
405print
'</td></tr>'.
"\n";
406print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
'Firstname');
407if (!empty($array_query[
'contact_firstname'])) {
408 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
410print
'</td><td><input type="text" name="contact_firstname" value="'.$array_query[
'contact_firstname'].
'"/></td><td>'.
"\n";
411print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
412print
'</td></tr>'.
"\n";
415print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"Country");
416if (!empty($array_query[
'contact_country'])) {
417 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
419print
'</td><td>'.
"\n";
420print $formadvtargetemaling->multiselectCountry(
'contact_country', $array_query[
'contact_country']);
421print
'</td><td>'.
"\n";
422print
'</td></tr>'.
"\n";
425print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"No_Email");
426if (!empty($array_query[
'contact_no_email'])) {
427 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
429print
'</td><td>'.
"\n";
430print $form->selectarray(
434 '1' => $langs->trans(
'Yes'),
435 '0' => $langs->trans(
'No')
437 $array_query[
'contact_no_email']
439print
'</td><td>'.
"\n";
440print
'</td></tr>'.
"\n";
443print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"DateCreation");
444if (!empty($array_query[
'contact_create_st_dt'])) {
445 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
447print
'</td><td>'.
"\n";
448print
'<table class="nobordernopadding"><tr>';
449print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
450print $form->selectDate($array_query[
'contact_create_st_dt'],
'contact_create_st_dt', 0, 0, 1,
'find_customer', 1, 1);
451print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
452print $form->selectDate($array_query[
'contact_create_end_dt'],
'contact_create_end_dt', 0, 0, 1,
'find_customer', 1, 1);
453print
'</td></tr></table>';
454print
'</td><td>'.
"\n";
455print
'</td></tr>'.
"\n";
458print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"DateLastModification");
459if (!empty($array_query[
'contact_update_st_dt'])) {
460 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
462print
'</td><td>'.
"\n";
463print
'<table class="nobordernopadding"><tr>';
464print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
465print $form->selectDate($array_query[
'contact_update_st_dt'],
'contact_update_st_dt', 0, 0, 1,
'find_customer', 1, 1);
466print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
467print $form->selectDate($array_query[
'contact_update_end_dt'],
'contact_update_end_dt', 0, 0, 1,
'find_customer', 1, 1);
468print
'</td></tr></table>';
469print
'</td><td>'.
"\n";
470print
'</td></tr>'.
"\n";
472if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
474 print
'<tr><td>'.$langs->trans(
"ContactCategoriesShort");
475 if (!empty($array_query[
'contact_categ'])) {
476 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
478 print
'</td><td>'.
"\n";
479 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT,
'',
'parent', 0, 0, 1);
480 print $form->multiselectarray(
'contact_categ', $cate_arbo,
GETPOST(
'contact_categ',
'array'), 0, 0,
'', 0,
"90%");
481 print
'</td><td>'.
"\n";
482 print
'</td></tr>'.
"\n";
487 $contactstatic =
new Contact($db);
488 $elementype = $contactstatic->table_element;
492 $extrafields->fetch_name_optionals_label($elementype);
493 if (!empty($extrafields->attributes[$elementtype][
'type'])) {
494 foreach ($extrafields->attributes[$elementtype][
'type'] as $key => &$value) {
495 if ($value ==
'radio') {
500 if (!empty($extrafields->attributes[$elementtype][
'label'])) {
501 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $val) {
502 print
'<tr><td>'.$extrafields->attributes[$elementtype][
'label'][$key];
503 if ($array_query[
'options_'.$key.
'_cnct'] !=
'' || (is_array($array_query[
'options_'.$key.
'_cnct']) && count($array_query[
'options_'.$key.
'_cnct']) > 0)) {
504 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
507 if (($extrafields->attributes[$elementtype][
'type'][$key] ==
'varchar') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'text')) {
508 print
'<input type="text" name="options_'.$key.
'_cnct"/></td><td>'.
"\n";
509 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
510 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'int') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'double')) {
511 print $langs->trans(
"AdvTgtMinVal").
'<input type="text" name="options_'.$key.
'_min_cnct"/>';
512 print $langs->trans(
"AdvTgtMaxVal").
'<input type="text" name="options_'.$key.
'_max_cnct"/>';
513 print
'</td><td>'.
"\n";
514 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchIntHelp"), 1,
'help');
515 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'date') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'datetime')) {
516 print
'<table class="nobordernopadding"><tr>';
517 print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
518 print $form->selectDate(
'',
'options_'.$key.
'_st_dt_cnct');
519 print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
520 print $form->selectDate(
'',
'options_'.$key.
'_end_dt_cnct');
521 print
'</td></tr></table>';
522 print
'</td><td>'.
"\n";
523 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchDtHelp"), 1,
'help');
524 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'boolean')) {
525 print $form->selectarray(
526 'options_'.$key.
'_cnct',
529 '1' => $langs->trans(
'Yes'),
530 '0' => $langs->trans(
'No')
532 $array_query[
'options_'.$key.
'_cnct']
534 print
'</td><td>'.
"\n";
535 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'select')) {
536 print $formadvtargetemaling->advMultiselectarray(
'options_'.$key.
'_cnct', $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key.
'_cnct']);
537 print
'</td><td>'.
"\n";
538 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'sellist')) {
539 print $formadvtargetemaling->advMultiselectarraySelllist(
'options_'.$key.
'_cnct', $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key.
'_cnct']);
540 print
'</td><td>'.
"\n";
542 if (is_array($array_query[
'options_'.$key.
'_cnct'])) {
543 print $extrafields->showInputField($key, implode(
',', $array_query[
'options_'.$key.
'_cnct']),
'',
'_cnct');
545 print $extrafields->showInputField($key, $array_query[
'options_'.$key.
'_cnct'],
'',
'_cnct');
547 print
'</td><td>'.
"\n";
549 print
'</td></tr>'.
"\n";
554print
'<td colspan="3" class="right">'.
"\n";
555print
'<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans(
'AdvTgtAddContact').
'" class="butAction"/>'.
"\n";
558print
'</table>'.
"\n";
561print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?action=clear&id='.
$object->id.
'" method="POST">';
562print
'<input type="hidden" name="token" value="'.newToken().
'">';
564print
'<table class="noborder centpercent">';
565print
'<tr class="liste_titre">';
566print
'<td class="liste_titre right"><input type="submit" class="button" value="'.$langs->trans(
"TargetsReset").
'"></td>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.