dolibarr 18.0.6
advtarget.tpl.php
1<?php
2/*
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
19 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
20}
21
22print '<script>
23 $(document).ready(function() {
24
25 // Click Function
26 $(":button[name=addcontact]").click(function() {
27 $(":hidden[name=action]").val("add");
28 $("#find_customer").submit();
29 });
30
31 $(":button[name=loadfilter]").click(function() {
32 $(":hidden[name=action]").val("loadfilter");
33 $("#find_customer").submit();
34 });
35
36 $(":button[name=deletefilter]").click(function() {
37 $(":hidden[name=action]").val("deletefilter");
38 $("#find_customer").submit();
39 });
40
41 $(":button[name=savefilter]").click(function() {
42 $(":hidden[name=action]").val("savefilter");
43 $("#find_customer").submit();
44 });
45
46 $(":button[name=createfilter]").click(function() {
47 $(":hidden[name=action]").val("createfilter");
48 $("#find_customer").submit();
49 });
50 });
51</script>';
52
53
54print load_fiche_titre($langs->trans("AdvTgtTitle"));
55
56print '<div class="tabBar">'."\n";
57print '<form name="find_customer" id="find_customer" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n";
58print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
59print '<input type="hidden" name="action" value="">'."\n";
60print '<table class="border centpercent">'."\n";
61
62print '<tr>'."\n";
63print '<td colspan="3" class="right">'."\n";
64
65print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="button"/>'."\n";
66
67print '</td>'."\n";
68print '</tr>'."\n";
69
70print '<tr><td>'.$langs->trans('AdvTgtNameTemplate').'</td><td class="valignmiddle">';
71if (!empty($template_id)) {
72 $default_template = $template_id;
73} else {
74 $default_template = $advTarget->id;
75}
76print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element, 'valignmiddle');
77print '<input type="button" name="loadfilter" id="loadfilter" value="'.$langs->trans('AdvTgtLoadFilter').'" class="button"/>';
78print '<input type="button" name="deletefilter" id="deletefilter" value="'.$langs->trans('AdvTgtDeleteFilter').'" class="button"/>';
79print '<input type="button" name="savefilter" id="savefilter" value="'.$langs->trans('AdvTgtSaveFilter').'" class="button"/>';
80print '</td><td>'."\n";
81print '</td></tr>'."\n";
82
83print '<tr><td>'.$langs->trans('AdvTgtOrCreateNewFilter').'</td><td>';
84print '<input type="text" name="template_name" id="template_name" value=""/>';
85print '<input type="button" name="createfilter" id="createfilter" value="'.$langs->trans('AdvTgtCreateFilter').'" class="button"/>';
86print '</td><td>'."\n";
87print '</td></tr>'."\n";
88
89print '<tr><td>'.$langs->trans('AdvTgtTypeOfIncude').'</td><td>';
90print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']);
91print '</td><td>'."\n";
92print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help');
93print '</td></tr>'."\n";
94
95// Customer name
96print '<tr><td>'.$langs->trans('ThirdPartyName');
97if (!empty($array_query['cust_name'])) {
98 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
99}
100print '</td><td><input type="text" name="cust_name" value="'.$array_query['cust_name'].'"/></td><td>'."\n";
101print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
102print '</td></tr>'."\n";
103
104// Code Client
105print '<tr><td>'.$langs->trans('CustomerCode');
106if (!empty($array_query['cust_code'])) {
107 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
108}
109print '</td><td><input type="text" name="cust_code" value="'.$array_query['cust_code'].'"/></td><td>'."\n";
110print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
111print '</td></tr>'."\n";
112
113// Address Client
114print '<tr><td>'.$langs->trans('Address');
115if (!empty($array_query['cust_adress'])) {
116 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
117}
118print '</td><td><input type="text" name="cust_adress" value="'.$array_query['cust_adress'].'"/></td><td>'."\n";
119print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
120print '</td></tr>'."\n";
121
122// Zip Client
123print '<tr><td>'.$langs->trans('Zip');
124if (!empty($array_query['cust_zip'])) {
125 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
126}
127print '</td><td><input type="text" name="cust_zip" value="'.$array_query['cust_zip'].'"/></td><td>'."\n";
128print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
129print '</td></tr>'."\n";
130
131// City Client
132print '<tr><td>'.$langs->trans('Town');
133if (!empty($array_query['cust_city'])) {
134 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
135}
136print '</td><td><input type="text" name="cust_city" value="'.$array_query['cust_city'].'"/></td><td>'."\n";
137print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
138print '</td></tr>'."\n";
139
140// Customer Country
141print '<tr><td>'.$langs->trans("Country");
142if (!empty($array_query['cust_country'])) {
143 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
144}
145print '</td><td>'."\n";
146print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']);
147print '</td><td>'."\n";
148print '</td></tr>'."\n";
149
150// State Customer
151print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('ThirdParty');
152if (!empty($array_query['cust_status'])) {
153 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
154}
155print '</td><td>';
156print $formadvtargetemaling->advMultiselectarray(
157 'cust_status',
158 array(
159 '0' => $langs->trans('ActivityCeased'),
160 '1' => $langs->trans('InActivity')
161 ),
162 $array_query['cust_status']
163);
164print '</td><td>'."\n";
165print '</td></tr>'."\n";
166
167// Mother Company
168print '<tr><td>'.$langs->trans("Maison mère");
169if (!empty($array_query['cust_mothercompany'])) {
170 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
171}
172print '</td><td>'."\n";
173print '<input type="text" name="cust_mothercompany" value="'.$array_query['cust_mothercompany'].'"/>';
174print '</td><td>'."\n";
175print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
176print '</td></tr>'."\n";
177
178// Prospect/Customer
179$selected = $array_query['cust_typecust'];
180print '<tr><td>'.$langs->trans('ProspectCustomer').' '.$langs->trans('ThirdParty');
181if (!empty($array_query['cust_typecust'])) {
182 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
183}
184print '</td><td>';
185$options_array = array(
186 2 => $langs->trans('Prospect'),
187 3 => $langs->trans('ProspectCustomer'),
188 1 => $langs->trans('Customer'),
189 0 => $langs->trans('NorProspectNorCustomer')
190);
191print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']);
192print '</td><td>'."\n";
193print '</td></tr>'."\n";
194
195// Prospection status
196print '<tr><td>'.$langs->trans('ProspectLevel');
197if (!empty($array_query['cust_prospect_status'])) {
198 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
199}
200print '</td><td>';
201print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status');
202print '</td><td>'."\n";
203print '</td></tr>'."\n";
204
205// Prospection comm status
206print '<tr><td>'.$langs->trans('StatusProsp');
207if (!empty($array_query['cust_comm_status'])) {
208 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
209}
210print '</td><td>';
211print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']);
212print '</td><td>'."\n";
213print '</td></tr>'."\n";
214
215// Customer Type
216print '<tr><td>'.$langs->trans("ThirdPartyType");
217if (!empty($array_query['cust_typeent'])) {
218 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
219}
220print '</td><td>'."\n";
221print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']);
222print '</td><td>'."\n";
223print '</td></tr>'."\n";
224
225// Staff number
226print '<td>'.$langs->trans("Staff");
227if (!empty($array_query['cust_effectif_id'])) {
228 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
229}
230print '</td><td>';
231print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']);
232print '</td><td>'."\n";
233print '</td></tr>'."\n";
234
235// Sales manager
236print '<tr><td>'.$langs->trans("SalesRepresentatives");
237if (!empty($array_query['cust_saleman'])) {
238 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
239}
240print '</td><td>'."\n";
241print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user);
242print '</td><td>'."\n";
243print '</td></tr>'."\n";
244
245// Customer Default Langauge
246if (getDolGlobalInt('MAIN_MULTILANGS')) {
247 print '<tr><td>'.$langs->trans("DefaultLang");
248 if (!empty($array_query['cust_language'])) {
249 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
250 }
251 print '</td><td>'."\n";
252 print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']);
253 print '</td><td>'."\n";
254 print '</td></tr>'."\n";
255}
256
257if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
258 // Customer Categories
259 print '<tr><td>'.$langs->trans("CustomersCategoryShort");
260 if (!empty($array_query['cust_categ'])) {
261 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
262 }
263 print '</td><td>'."\n";
264 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
265 print $form->multiselectarray('cust_categ', $cate_arbo, GETPOST('cust_categ', 'array'), null, null, null, null, "90%");
266 print '</td><td>'."\n";
267 print '</td></tr>'."\n";
268}
269
270// Standard Extrafield feature
271if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
272 $socstatic = new Societe($db);
273 $elementtype = $socstatic->table_element;
274 // fetch optionals attributes and labels
275 dol_include_once('/core/class/extrafields.class.php');
276 $extrafields = new ExtraFields($db);
277 $extrafields->fetch_name_optionals_label($elementtype);
278 foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
279 if ($key != 'ts_nameextra' && $key != 'ts_payeur') {
280 print '<tr><td>'.$extrafields->attributes[$elementtype]['label'][$key];
281 if (!empty($array_query['options_'.$key]) || (is_array($array_query['options_'.$key]) && count($array_query['options_'.$key]) > 0)) {
282 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
283 }
284 print '</td><td>';
285 if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
286 print '<input type="text" name="options_'.$key.'"/></td><td>'."\n";
287 print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
288 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
289 print $langs->trans("AdvTgtMinVal").'<input type="text" name="options'.$key.'_min"/>';
290 print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options'.$key.'_max"/>';
291 print '</td><td>'."\n";
292 print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
293 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
294 print '<table class="nobordernopadding"><tr>';
295 print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
296 print $form->selectDate('', 'options_'.$key.'_st_dt');
297 print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
298 print $form->selectDate('', 'options_'.$key.'_end_dt');
299 print '</td></tr></table>';
300
301 print '</td><td>'."\n";
302 print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
303 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
304 print $form->selectarray(
305 'options_'.$key,
306 array(
307 '' => '',
308 '1' => $langs->trans('Yes'),
309 '0' => $langs->trans('No')
310 ),
311 $array_query['options_'.$key]
312 );
313 print '</td><td>'."\n";
314 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) {
315 print $formadvtargetemaling->advMultiselectarray('options_'.$key, $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key]);
316 print '</td><td>'."\n";
317 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) {
318 print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key, $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key]);
319 print '</td><td>'."\n";
320 } else {
321 print '<table class="nobordernopadding"><tr>';
322 print '<td></td><td>';
323 if (is_array($array_query['options_'.$key])) {
324 print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key]));
325 } else {
326 print $extrafields->showInputField($key, $array_query['options_'.$key]);
327 }
328 print '</td></tr></table>';
329
330 print '</td><td>'."\n";
331 }
332 print '</td></tr>'."\n";
333 }
334 }
335} else {
336 $std_soc = new Societe($db);
337 $action_search = 'query';
338
339 $parameters = array('advtarget'=>1);
340 if (!empty($advTarget->id)) {
341 $parameters = array('array_query' => $advTarget->filtervalue);
342 }
343 // Other attributes
344 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search);
345 print $hookmanager->resPrint;
346}
347
348// State Contact
349print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('Contact');
350if (!empty($array_query['contact_status'])) {
351 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
352}
353print '</td><td>';
354print $formadvtargetemaling->advMultiselectarray(
355 'contact_status',
356 array(
357 '0' => $langs->trans('ActivityCeased'),
358 '1' => $langs->trans('InActivity')
359 ),
360 $array_query['contact_status']
361);
362print '</td><td>'."\n";
363print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help');
364print '</td></tr>'."\n";
365
366// Civility
367print '<tr><td width="15%">'.$langs->trans("UserTitle");
368if (!empty($array_query['contact_civility'])) {
369 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
370}
371print '</td><td>';
372print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']);
373print '</td></tr>';
374
375// contact name
376print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Lastname');
377if (!empty($array_query['contact_lastname'])) {
378 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
379}
380print '</td><td><input type="text" name="contact_lastname" value="'.$array_query['contact_lastname'].'"/></td><td>'."\n";
381print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
382print '</td></tr>'."\n";
383print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Firstname');
384if (!empty($array_query['contact_firstname'])) {
385 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
386}
387print '</td><td><input type="text" name="contact_firstname" value="'.$array_query['contact_firstname'].'"/></td><td>'."\n";
388print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
389print '</td></tr>'."\n";
390
391// Contact Country
392print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("Country");
393if (!empty($array_query['contact_country'])) {
394 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
395}
396print '</td><td>'."\n";
397print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']);
398print '</td><td>'."\n";
399print '</td></tr>'."\n";
400
401// Never send mass mailing
402print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("No_Email");
403if (!empty($array_query['contact_no_email'])) {
404 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
405}
406print '</td><td>'."\n";
407print $form->selectarray(
408 'contact_no_email',
409 array(
410 '' => '',
411 '1' => $langs->trans('Yes'),
412 '0' => $langs->trans('No')
413 ),
414 $array_query['contact_no_email']
415);
416print '</td><td>'."\n";
417print '</td></tr>'."\n";
418
419// Contact Date Create
420print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateCreation");
421if (!empty($array_query['contact_create_st_dt'])) {
422 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
423}
424print '</td><td>'."\n";
425print '<table class="nobordernopadding"><tr>';
426print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
427print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1);
428print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
429print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1);
430print '</td></tr></table>';
431print '</td><td>'."\n";
432print '</td></tr>'."\n";
433
434// Contact update Create
435print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateLastModification");
436if (!empty($array_query['contact_update_st_dt'])) {
437 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
438}
439print '</td><td>'."\n";
440print '<table class="nobordernopadding"><tr>';
441print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
442print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1);
443print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
444print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1);
445print '</td></tr></table>';
446print '</td><td>'."\n";
447print '</td></tr>'."\n";
448
449if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
450 // Customer Categories
451 print '<tr><td>'.$langs->trans("ContactCategoriesShort");
452 if (!empty($array_query['contact_categ'])) {
453 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
454 }
455 print '</td><td>'."\n";
456 $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
457 print $form->multiselectarray('contact_categ', $cate_arbo, GETPOST('contact_categ', 'array'), null, null, null, null, "90%");
458 print '</td><td>'."\n";
459 print '</td></tr>'."\n";
460}
461
462// Standard Extrafield feature
463if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
464 $contactstatic = new Contact($db);
465 $elementype = $contactstatic->table_element;
466 // fetch optionals attributes and labels
467 dol_include_once('/core/class/extrafields.class.php');
468 $extrafields = new ExtraFields($db);
469 $extrafields->fetch_name_optionals_label($elementype);
470 if (!empty($extrafields->attributes[$elementtype]['type'])) {
471 foreach ($extrafields->attributes[$elementtype]['type'] as $key => &$value) {
472 if ($value == 'radio') {
473 $value = 'select';
474 }
475 }
476 }
477 if (!empty($extrafields->attributes[$elementtype]['label'])) {
478 foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
479 print '<tr><td>'.$extrafields->attributes[$elementtype]['label'][$key];
480 if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) {
481 print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
482 }
483 print '</td><td>';
484 if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
485 print '<input type="text" name="options_'.$key.'_cnct"/></td><td>'."\n";
486 print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
487 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
488 print $langs->trans("AdvTgtMinVal").'<input type="text" name="options_'.$key.'_min_cnct"/>';
489 print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options_'.$key.'_max_cnct"/>';
490 print '</td><td>'."\n";
491 print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
492 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
493 print '<table class="nobordernopadding"><tr>';
494 print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
495 print $form->selectDate('', 'options_'.$key.'_st_dt_cnct');
496 print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
497 print $form->selectDate('', 'options_'.$key.'_end_dt_cnct');
498 print '</td></tr></table>';
499 print '</td><td>'."\n";
500 print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
501 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
502 print $form->selectarray(
503 'options_'.$key.'_cnct',
504 array(
505 '' => '',
506 '1' => $langs->trans('Yes'),
507 '0' => $langs->trans('No')
508 ),
509 $array_query['options_'.$key.'_cnct']
510 );
511 print '</td><td>'."\n";
512 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) {
513 print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
514 print '</td><td>'."\n";
515 } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) {
516 print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
517 print '</td><td>'."\n";
518 } else {
519 if (is_array($array_query['options_'.$key.'_cnct'])) {
520 print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct');
521 } else {
522 print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct');
523 }
524 print '</td><td>'."\n";
525 }
526 print '</td></tr>'."\n";
527 }
528 }
529}
530print '<tr>'."\n";
531print '<td colspan="3" class="right">'."\n";
532print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="butAction"/>'."\n";
533print '</td>'."\n";
534print '</tr>'."\n";
535print '</table>'."\n";
536print '</form>'."\n";
537print '</div>'."\n";
538print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&id='.$object->id.'" method="POST">';
539print '<input type="hidden" name="token" value="'.newToken().'">';
540print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere"));
541print '<table class="noborder centpercent">';
542print '<tr class="liste_titre">';
543print '<td class="liste_titre right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>';
544print '</tr>';
545print '</table>';
546print '</form>';
547print '<br>';
Class to manage contact/addresses.
Class to manage standard extra fields.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.