35if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
36 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41@phan-var-force FormAdvTargetEmailing $formadvtargetemaling
42@phan-var-force AdvanceTargetingMailing $advTarget
43@phan-var-force array<string,string|int|string[]> $array_query
47 $(document).ready(function() {
50 $(":button[name=addcontact]").click(function() {
51 $(":hidden[name=action]").val("add");
52 $("#find_customer").submit();
55 $(":button[name=loadfilter]").click(function() {
56 $(":hidden[name=action]").val("loadfilter");
57 $("#find_customer").submit();
60 $(":button[name=deletefilter]").click(function() {
61 $(":hidden[name=action]").val("deletefilter");
62 $("#find_customer").submit();
65 $(":button[name=savefilter]").click(function() {
66 $(":hidden[name=action]").val("savefilter");
67 $("#find_customer").submit();
70 $(":button[name=createfilter]").click(function() {
71 $(":hidden[name=action]").val("createfilter");
72 $("#find_customer").submit();
80print
'<div class="tabBar">'.
"\n";
81print
'<form name="find_customer" id="find_customer" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$id.
'" method="POST">'.
"\n";
82print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
83print
'<input type="hidden" name="action" value="">'.
"\n";
84print
'<table class="border centpercent">'.
"\n";
87print
'<td colspan="3" class="right">'.
"\n";
89print
'<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans(
'AdvTgtAddContact').
'" class="button"/>'.
"\n";
94print
'<tr><td>'.$langs->trans(
'AdvTgtNameTemplate').
'</td><td class="valignmiddle">';
95if (!empty($template_id)) {
96 $default_template = $template_id;
98 $default_template = $advTarget->id;
100print $formadvtargetemaling->selectAdvtargetemailingTemplate(
'template_id', $default_template, 0, $advTarget->type_element,
'valignmiddle');
101print
'<input type="button" name="loadfilter" id="loadfilter" value="'.$langs->trans(
'AdvTgtLoadFilter').
'" class="button"/>';
102print
'<input type="button" name="deletefilter" id="deletefilter" value="'.$langs->trans(
'AdvTgtDeleteFilter').
'" class="button"/>';
103print
'<input type="button" name="savefilter" id="savefilter" value="'.$langs->trans(
'AdvTgtSaveFilter').
'" class="button"/>';
104print
'</td><td>'.
"\n";
105print
'</td></tr>'.
"\n";
107print
'<tr><td>'.$langs->trans(
'AdvTgtOrCreateNewFilter').
'</td><td>';
108print
'<input type="text" name="template_name" id="template_name" value=""/>';
109print
'<input type="button" name="createfilter" id="createfilter" value="'.$langs->trans(
'AdvTgtCreateFilter').
'" class="button"/>';
110print
'</td><td>'.
"\n";
111print
'</td></tr>'.
"\n";
113print
'<tr><td>'.$langs->trans(
'AdvTgtTypeOfIncude').
'</td><td>';
114print $form->selectarray(
'type_of_target', $advTarget->select_target_type, $array_query[
'type_of_target']);
115print
'</td><td>'.
"\n";
116print $form->textwithpicto(
'', $langs->trans(
"AdvTgtTypeOfIncudeHelp"), 1,
'help');
117print
'</td></tr>'.
"\n";
120print
'<tr><td>'.$langs->trans(
'ThirdPartyName');
121if (!empty($array_query[
'cust_name'])) {
122 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
124print
'</td><td><input type="text" name="cust_name" value="'.$array_query[
'cust_name'].
'"/></td><td>'.
"\n";
125print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
126print
'</td></tr>'.
"\n";
129print
'<tr><td>'.$langs->trans(
'CustomerCode');
130if (!empty($array_query[
'cust_code'])) {
131 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
132 $cust_code_str = (string) $array_query[
'cust_code'];
134 $cust_code_str =
null;
136print
'</td><td><input type="text" name="cust_code"'.($cust_code_str !=
null ?
' value="'.$cust_code_str :
'').
'"/></td><td>'.
"\n";
137print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
138print
'</td></tr>'.
"\n";
141print
'<tr><td>'.$langs->trans(
'Address');
142if (!empty($array_query[
'cust_adress'])) {
143 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
145print
'</td><td><input type="text" name="cust_adress" value="'.$array_query[
'cust_adress'].
'"/></td><td>'.
"\n";
146print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
147print
'</td></tr>'.
"\n";
150print
'<tr><td>'.$langs->trans(
'Zip');
151if (!empty($array_query[
'cust_zip'])) {
152 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
154print
'</td><td><input type="text" name="cust_zip" value="'.$array_query[
'cust_zip'].
'"/></td><td>'.
"\n";
155print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
156print
'</td></tr>'.
"\n";
159print
'<tr><td>'.$langs->trans(
'Town');
160if (!empty($array_query[
'cust_city'])) {
161 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
163print
'</td><td><input type="text" name="cust_city" value="'.$array_query[
'cust_city'].
'"/></td><td>'.
"\n";
164print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
165print
'</td></tr>'.
"\n";
168print
'<tr><td>'.$langs->trans(
'State');
169if (!empty($array_query[
'cust_state'])) {
170 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
172print
'</td><td>'.
"\n";
173print $formadvtargetemaling->multiselectState(
'cust_state', $array_query[
'cust_state']);
174print
'</td><td>'.
"\n";
175print
'</td></tr>'.
"\n";
178print
'<tr><td>'.$langs->trans(
"Country");
179if (!empty($array_query[
'cust_country'])) {
180 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
182print
'</td><td>'.
"\n";
183print $formadvtargetemaling->multiselectCountry(
'cust_country', $array_query[
'cust_country']);
184print
'</td><td>'.
"\n";
185print
'</td></tr>'.
"\n";
188print
'<tr><td>'.$langs->trans(
'Status').
' '.$langs->trans(
'ThirdParty');
189if (!empty($array_query[
'cust_status'])) {
190 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
193print $formadvtargetemaling->advMultiselectarray(
196 '0' => $langs->trans(
'ActivityCeased'),
197 '1' => $langs->trans(
'InActivity')
199 $array_query[
'cust_status']
201print
'</td><td>'.
"\n";
202print
'</td></tr>'.
"\n";
205print
'<tr><td>'.$langs->trans(
"ParentCompany");
206if (!empty($array_query[
'cust_mothercompany'])) {
207 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
209print
'</td><td>'.
"\n";
210print
'<input type="text" name="cust_mothercompany" value="'.$array_query[
'cust_mothercompany'].
'"/>';
211print
'</td><td>'.
"\n";
212print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
213print
'</td></tr>'.
"\n";
216$selected = $array_query[
'cust_typecust'];
217print
'<tr><td>'.$langs->trans(
'ProspectCustomer').
' '.$langs->trans(
'ThirdParty');
218if (!empty($array_query[
'cust_typecust'])) {
219 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
222$options_array = array(
223 2 => $langs->trans(
'Prospect'),
224 3 => $langs->trans(
'ProspectCustomer'),
225 1 => $langs->trans(
'Customer'),
226 0 => $langs->trans(
'NorProspectNorCustomer')
228print $formadvtargetemaling->advMultiselectarray(
'cust_typecust', $options_array, $array_query[
'cust_typecust']);
229print
'</td><td>'.
"\n";
230print
'</td></tr>'.
"\n";
233print
'<tr><td>'.$langs->trans(
'ProspectLevel');
234if (!empty($array_query[
'cust_prospect_status'])) {
235 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
238print $formadvtargetemaling->multiselectProspectionStatus($array_query[
'cust_prospect_status'],
'cust_prospect_status');
239print
'</td><td>'.
"\n";
240print
'</td></tr>'.
"\n";
243print
'<tr><td>'.$langs->trans(
'StatusProsp');
244if (!empty($array_query[
'cust_comm_status'])) {
245 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
248print $formadvtargetemaling->advMultiselectarray(
'cust_comm_status', $advTarget->type_statuscommprospect, $array_query[
'cust_comm_status']);
249print
'</td><td>'.
"\n";
250print
'</td></tr>'.
"\n";
253print
'<tr><td>'.$langs->trans(
"ThirdPartyType");
254if (!empty($array_query[
'cust_typeent'])) {
255 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
257print
'</td><td>'.
"\n";
258print $formadvtargetemaling->advMultiselectarray(
'cust_typeent', $formcompany->typent_array(0,
" AND id <> 0"), $array_query[
'cust_typeent']);
259print
'</td><td>'.
"\n";
260print
'</td></tr>'.
"\n";
263print
'<td>'.$langs->trans(
"Staff");
264if (!empty($array_query[
'cust_effectif_id'])) {
265 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
268print $formadvtargetemaling->advMultiselectarray(
"cust_effectif_id", $formcompany->effectif_array(0,
" AND id <> 0"), $array_query[
'cust_effectif_id']);
269print
'</td><td>'.
"\n";
270print
'</td></tr>'.
"\n";
273print
'<tr><td>'.$langs->trans(
"SalesRepresentatives");
274if (!empty($array_query[
'cust_saleman'])) {
275 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
277print
'</td><td>'.
"\n";
278print $formadvtargetemaling->multiselectselectSalesRepresentatives(
'cust_saleman', $array_query[
'cust_saleman'], $user);
279print
'</td><td>'.
"\n";
280print
'</td></tr>'.
"\n";
284 print
'<tr><td>'.$langs->trans(
"DefaultLang");
285 if (!empty($array_query[
'cust_language'])) {
286 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
288 print
'</td><td>'.
"\n";
289 print $formadvtargetemaling->multiselectselectLanguage(
'cust_language', $array_query[
'cust_language']);
290 print
'</td><td>'.
"\n";
291 print
'</td></tr>'.
"\n";
294if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
296 print
'<tr><td>'.$langs->trans(
"CustomersCategoryShort");
297 if (!empty($array_query[
'cust_categ'])) {
298 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
300 print
'</td><td>'.
"\n";
301 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER,
'',
'parent', 0, 0, 1);
302 print $form->multiselectarray(
'cust_categ', $cate_arbo,
GETPOST(
'cust_categ',
'array'), 0, 0,
'', 0,
"90%");
303 print
'</td><td>'.
"\n";
304 print
'</td></tr>'.
"\n";
310 $elementtype = $socstatic->table_element;
312 require_once DOL_DOCUMENT_ROOT .
'/core/class/extrafields.class.php';
314 $extrafields->fetch_name_optionals_label($elementtype);
315 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $val) {
316 if ($key !=
'ts_nameextra' && $key !=
'ts_payeur') {
317 print
'<tr><td>'.$extrafields->attributes[$elementtype][
'label'][$key];
318 if (!empty($array_query[
'options_'.$key]) || (is_array($array_query[
'options_'.$key]) && count($array_query[
'options_'.$key]) > 0)) {
319 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
322 if (($extrafields->attributes[$elementtype][
'type'][$key] ==
'varchar') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'text')) {
323 print
'<input type="text" name="options_'.$key.
'"/></td><td>'.
"\n";
324 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
325 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'int') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'double')) {
326 print $langs->trans(
"AdvTgtMinVal").
'<input type="text" name="options'.$key.
'_min"/>';
327 print $langs->trans(
"AdvTgtMaxVal").
'<input type="text" name="options'.$key.
'_max"/>';
328 print
'</td><td>'.
"\n";
329 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchIntHelp"), 1,
'help');
330 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'date') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'datetime')) {
331 print
'<table class="nobordernopadding"><tr>';
332 print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
333 print $form->selectDate(
'',
'options_'.$key.
'_st_dt');
334 print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
335 print $form->selectDate(
'',
'options_'.$key.
'_end_dt');
336 print
'</td></tr></table>';
338 print
'</td><td>'.
"\n";
339 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchDtHelp"), 1,
'help');
340 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'boolean')) {
341 print $form->selectarray(
345 '1' => $langs->trans(
'Yes'),
346 '0' => $langs->trans(
'No')
348 $array_query[
'options_'.$key]
350 print
'</td><td>'.
"\n";
351 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'select')) {
352 print $formadvtargetemaling->advMultiselectarray(
'options_'.$key, $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key]);
353 print
'</td><td>'.
"\n";
354 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'sellist')) {
355 print $formadvtargetemaling->advMultiselectarraySelllist(
'options_'.$key, $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key]);
356 print
'</td><td>'.
"\n";
358 print
'<table class="nobordernopadding"><tr>';
359 print
'<td></td><td>';
360 if (is_array($array_query[
'options_'.$key])) {
361 print $extrafields->showInputField($key, implode(
',', $array_query[
'options_'.$key]));
363 print $extrafields->showInputField($key, $array_query[
'options_'.$key]);
365 print
'</td></tr></table>';
367 print
'</td><td>'.
"\n";
369 print
'</td></tr>'.
"\n";
374 $action_search =
'query';
376 $parameters = array(
'advtarget' => 1);
377 if (!empty($advTarget->id)) {
378 $parameters = array(
'array_query' => $advTarget->filtervalue);
381 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $std_soc, $action_search);
382 print $hookmanager->resPrint;
386print
'<tr><td>'.$langs->trans(
'Status').
' '.$langs->trans(
'Contact');
387if (!empty($array_query[
'contact_status'])) {
388 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
391print $formadvtargetemaling->advMultiselectarray(
394 '0' => $langs->trans(
'ActivityCeased'),
395 '1' => $langs->trans(
'InActivity')
397 $array_query[
'contact_status']
399print
'</td><td>'.
"\n";
400print $form->textwithpicto(
'', $langs->trans(
"AdvTgtContactHelp"), 1,
'help');
401print
'</td></tr>'.
"\n";
404print
'<tr><td width="15%">'.$langs->trans(
"UserTitle");
405if (!empty($array_query[
'contact_civility'])) {
406 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
409print $formadvtargetemaling->multiselectCivility(
'contact_civility', $array_query[
'contact_civility']);
413print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
'Lastname');
414if (!empty($array_query[
'contact_lastname'])) {
415 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
417print
'</td><td><input type="text" name="contact_lastname" value="'.$array_query[
'contact_lastname'].
'"/></td><td>'.
"\n";
418print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
419print
'</td></tr>'.
"\n";
420print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
'Firstname');
421if (!empty($array_query[
'contact_firstname'])) {
422 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
424print
'</td><td><input type="text" name="contact_firstname" value="'.$array_query[
'contact_firstname'].
'"/></td><td>'.
"\n";
425print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
426print
'</td></tr>'.
"\n";
429print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"Country");
430if (!empty($array_query[
'contact_country'])) {
431 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
433print
'</td><td>'.
"\n";
434print $formadvtargetemaling->multiselectCountry(
'contact_country', $array_query[
'contact_country']);
435print
'</td><td>'.
"\n";
436print
'</td></tr>'.
"\n";
439print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"No_Email");
440if (!empty($array_query[
'contact_no_email'])) {
441 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
443print
'</td><td>'.
"\n";
444print $form->selectarray(
448 '1' => $langs->trans(
'Yes'),
449 '0' => $langs->trans(
'No')
451 $array_query[
'contact_no_email']
453print
'</td><td>'.
"\n";
454print
'</td></tr>'.
"\n";
457print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"DateCreation");
458if (!empty($array_query[
'contact_create_st_dt'])) {
459 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
461print
'</td><td>'.
"\n";
462print
'<table class="nobordernopadding"><tr>';
463print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
464print $form->selectDate($array_query[
'contact_create_st_dt'],
'contact_create_st_dt', 0, 0, 1,
'find_customer', 1, 1);
465print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
466print $form->selectDate($array_query[
'contact_create_end_dt'],
'contact_create_end_dt', 0, 0, 1,
'find_customer', 1, 1);
467print
'</td></tr></table>';
468print
'</td><td>'.
"\n";
469print
'</td></tr>'.
"\n";
472print
'<tr><td>'.$langs->trans(
'Contact').
' '.$langs->trans(
"DateLastModification");
473if (!empty($array_query[
'contact_update_st_dt'])) {
474 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
476print
'</td><td>'.
"\n";
477print
'<table class="nobordernopadding"><tr>';
478print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
479print $form->selectDate($array_query[
'contact_update_st_dt'],
'contact_update_st_dt', 0, 0, 1,
'find_customer', 1, 1);
480print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
481print $form->selectDate($array_query[
'contact_update_end_dt'],
'contact_update_end_dt', 0, 0, 1,
'find_customer', 1, 1);
482print
'</td></tr></table>';
483print
'</td><td>'.
"\n";
484print
'</td></tr>'.
"\n";
486if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
488 print
'<tr><td>'.$langs->trans(
"ContactCategoriesShort");
489 if (!empty($array_query[
'contact_categ'])) {
490 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
492 print
'</td><td>'.
"\n";
493 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT,
'',
'parent', 0, 0, 1);
494 print $form->multiselectarray(
'contact_categ', $cate_arbo,
GETPOST(
'contact_categ',
'array'), 0, 0,
'', 0,
"90%");
495 print
'</td><td>'.
"\n";
496 print
'</td></tr>'.
"\n";
501 $contactstatic =
new Contact($db);
502 $elementype = $contactstatic->table_element;
506 $extrafields->fetch_name_optionals_label($elementype);
507 if (!empty($extrafields->attributes[$elementtype][
'type'])) {
508 foreach ($extrafields->attributes[$elementtype][
'type'] as $key => &$value) {
509 if ($value ==
'radio') {
514 if (!empty($extrafields->attributes[$elementtype][
'label'])) {
515 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $val) {
516 print
'<tr><td>'.$extrafields->attributes[$elementtype][
'label'][$key];
517 if ($array_query[
'options_'.$key.
'_cnct'] !=
'' || (is_array($array_query[
'options_'.$key.
'_cnct']) && count($array_query[
'options_'.$key.
'_cnct']) > 0)) {
518 print
img_picto($langs->trans(
'AdvTgtUse'),
'ok.png@advtargetemailing');
521 if (($extrafields->attributes[$elementtype][
'type'][$key] ==
'varchar') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'text')) {
522 print
'<input type="text" name="options_'.$key.
'_cnct"/></td><td>'.
"\n";
523 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchTextHelp"), 1,
'help');
524 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'int') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'double')) {
525 print $langs->trans(
"AdvTgtMinVal").
'<input type="text" name="options_'.$key.
'_min_cnct"/>';
526 print $langs->trans(
"AdvTgtMaxVal").
'<input type="text" name="options_'.$key.
'_max_cnct"/>';
527 print
'</td><td>'.
"\n";
528 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchIntHelp"), 1,
'help');
529 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'date') || ($extrafields->attributes[$elementtype][
'type'][$key] ==
'datetime')) {
530 print
'<table class="nobordernopadding"><tr>';
531 print
'<td>'.$langs->trans(
"AdvTgtStartDt").
'</td><td>';
532 print $form->selectDate(
'',
'options_'.$key.
'_st_dt_cnct');
533 print
'</td><td>'.$langs->trans(
"AdvTgtEndDt").
'</td><td>';
534 print $form->selectDate(
'',
'options_'.$key.
'_end_dt_cnct');
535 print
'</td></tr></table>';
536 print
'</td><td>'.
"\n";
537 print $form->textwithpicto(
'', $langs->trans(
"AdvTgtSearchDtHelp"), 1,
'help');
538 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'boolean')) {
539 print $form->selectarray(
540 'options_'.$key.
'_cnct',
543 '1' => $langs->trans(
'Yes'),
544 '0' => $langs->trans(
'No')
546 $array_query[
'options_'.$key.
'_cnct']
548 print
'</td><td>'.
"\n";
549 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'select')) {
550 print $formadvtargetemaling->advMultiselectarray(
'options_'.$key.
'_cnct', $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key.
'_cnct']);
551 print
'</td><td>'.
"\n";
552 } elseif (($extrafields->attributes[$elementtype][
'type'][$key] ==
'sellist')) {
553 print $formadvtargetemaling->advMultiselectarraySelllist(
'options_'.$key.
'_cnct', $extrafields->attributes[$key][
'param'][
'options'], $array_query[
'options_'.$key.
'_cnct']);
554 print
'</td><td>'.
"\n";
556 if (is_array($array_query[
'options_'.$key.
'_cnct'])) {
557 print $extrafields->showInputField($key, implode(
',', $array_query[
'options_'.$key.
'_cnct']),
'',
'_cnct');
559 print $extrafields->showInputField($key, $array_query[
'options_'.$key.
'_cnct'],
'',
'_cnct');
561 print
'</td><td>'.
"\n";
563 print
'</td></tr>'.
"\n";
568print
'<td colspan="3" class="right">'.
"\n";
569print
'<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans(
'AdvTgtAddContact').
'" class="butAction"/>'.
"\n";
572print
'</table>'.
"\n";
575print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?action=clear&id='.
$object->id.
'" method="POST">';
576print
'<input type="hidden" name="token" value="'.newToken().
'">';
578print
'<table class="noborder centpercent">';
579print
'<tr class="liste_titre">';
580print
'<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.