PEEL Shopping
Open source ecommerce : PEEL Shopping
display_user_forms.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: display_user_forms.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
18 
19 if (!function_exists('get_user_change_params_form')) {
27  function get_user_change_params_form(&$frm, &$form_error_object)
28  {
29  $output = '';
30  $tpl = $GLOBALS['tplEngine']->createTemplate('user_change_params_form.tpl');
31  if ($form_error_object->has_error('token')) {
32  $tpl->assign('token_error', $form_error_object->text('token'));
33  }
34  $tpl->assign('action', get_current_url(false));
35  if (check_if_module_active('abonnement')) {
36  $tpl->assign('verified_account_info', get_verified_account_info());
37  $tpl->assign('content_rows_info', (is_user_verified($_SESSION['session_utilisateur']['id_utilisateur'])?'disabled="disabled"':''));
38  } else {
39  $tpl->assign('content_rows_info', '');
40  }
41  if(String::substr(vb($frm['email_bounce']), 0, 2)=='5.' || empty($frm['email'])){
42  // Email vide ou ayant généré une erreur
43  $email_form='';
44  $domain=explode('@', vb($frm['email']));
45  $email_explain= sprintf($GLOBALS['STR_EMAIL_BOUNCE_REPLACE'], vb($domain[1]), vb($frm['email_bounce']), vb($frm['email']));
46  }else{
47  $email_form=vb($frm['email']);
48  }
49  $tpl->assign('email', $email_form);
50  $tpl->assign('email_explain', vb($email_explain));
51  $tpl->assign('email_error', $form_error_object->text('email'));
52  $tpl->assign('civilite_mlle_issel', (vb($frm['civilite']) == "Mlle"));
53  $tpl->assign('civilite_mme_issel', (vb($frm['civilite']) == "Mme"));
54  $tpl->assign('civilite_m_issel', (vb($frm['civilite']) == "M."));
55  $tpl->assign('gender_error', $form_error_object->text('civilite'));
56  if (empty($GLOBALS['site_parameters']['pseudo_is_not_used'])) {
57  $tpl->assign('STR_PSEUDO', $GLOBALS['STR_PSEUDO']);
58  $tpl->assign('pseudo_is_optionnal', !empty($GLOBALS['site_parameters']['pseudo_is_optionnal']));
59  $tpl->assign('pseudo', (isset($frm['pseudo'])?vb($frm['pseudo']):$_SESSION['session_utilisateur']['pseudo']));
60  $tpl->assign('pseudo_error', $form_error_object->text('pseudo'));
61  }
62  $tpl->assign('first_name', vb($frm['prenom']));
63  $tpl->assign('first_name_error', $form_error_object->text('prenom'));
64  $tpl->assign('name', vb($frm['nom_famille']));
65  $tpl->assign('name_error', $form_error_object->text('nom_famille'));
66  $tpl->assign('societe', vb($frm['societe']));
67  $tpl->assign('societe_error', $form_error_object->text('societe'));
68 
69  // On mentionne le champ obligatoire - en fait on le vérifiera uniquement pour la France
70  $tpl->assign('siret_txt', $GLOBALS['STR_COMPANY_IDENTIFICATION'] . ' <span class="etoile">*</span>');
71  $tpl->assign('siret', vb($frm['siret']));
72  $tpl->assign('siret_error', $form_error_object->text('siret'));
73  $tpl->assign('intracom_form', vb($frm['intracom_for_billing']));
74  $tpl->assign('intracom_form_error', $form_error_object->text('intracom_for_billing'));
75  $tpl->assign('telephone', vb($frm['telephone']));
76  $tpl->assign('telephone_error', $form_error_object->text('telephone'));
77  $tpl->assign('portable', vb($frm['portable']));
78  $tpl->assign('fax', vb($frm['fax'])); // La variable est renseignée mais par défaut dans le template Smarty, l'affichage du fax est désactivé car plus beaucoup utilisé de nos jours
79  $tpl->assign('url', vb($frm['url']));
80  $tpl->assign('type', vb($frm['type']));
81  $tpl->assign('type_error', $form_error_object->text('type'));
82  $tpl->assign('activity', vb($frm['activity']));
83  $tpl->assign('activity_error', $form_error_object->text('activity'));
84  if (vb($frm['naissance']) != "0000-00-00") {
85  // Si la date de naissance est définie, on l'affiche et on permet de changer leur date de naissance
86  $tpl->assign('birthday_edit', true);
87  } else {
88  // Décommentez la ligne suivante si vous voulez informer l'utilisateur de demander à l'administrateur pour mettre sa date de naissance
89  // $tpl->assign('birthday_show', true);
90  // $tpl->assign('birthday_contact_admin', true);
91  }
92  $tpl->assign('fonction_options', get_user_job_options(vb($frm['fonction'])));
93  $tpl->assign('fonction_error', $form_error_object->text('fonction'));
94  if (!empty($GLOBALS['site_parameters']['user_fields_enable_code_promo'])) {
95  $tpl->assign('promo_code', vb($frm['promo_code']));
96  $tpl->assign('STR_PROMO_CODE', $GLOBALS['STR_PROMO_CODE']);
97  }
98  if (check_if_module_active('annonces')) {
99  // si le module d'annonce est activé, on confirme le mot de passe
100  $tpl->assign('STR_PASSWORD_CONFIRMATION', $GLOBALS['STR_PASSWORD_CONFIRMATION']);
101  $tpl->assign('password_confirmation_error', $form_error_object->text('mot_passe_confirm'));
102  if (vb($GLOBALS['site_parameters']['type_affichage_user_favorite_id_categories']) == 'checkbox') {
103  $tpl->assign('id_categories', get_ad_select_options(null, vb($frm['id_categories']), 'id', false, false, 'checkbox', 'id_categories'));
104  $tpl->assign('id_categories_error', $form_error_object->text('id_categories_error'));
105  } elseif (vb($GLOBALS['site_parameters']['type_affichage_user_favorite_id_categories']) == 'select') {
106  $tpl->assign('id_cat_1_error', $form_error_object->text('id_cat_1'));
107  $tpl->assign('id_cat_2_error', $form_error_object->text('id_cat_2'));
108  $tpl->assign('id_cat_3_error', $form_error_object->text('id_cat_3'));
109  $tpl->assign('id_cat_1', get_ad_select_options(null, vb($frm['id_cat_1']), 'id'));
110  $tpl->assign('id_cat_2', get_ad_select_options(null, vb($frm['id_cat_2']), 'id'));
111  $tpl->assign('id_cat_3', get_ad_select_options(null, vb($frm['id_cat_3']), 'id'));
112  }
113  $tpl->assign('STR_WEBSITE', $GLOBALS['STR_WEBSITE']);
114  $tpl->assign('STR_ANNOUNCEMENT_INDICATION', $GLOBALS['STR_ANNOUNCEMENT_INDICATION']);
115  $tpl->assign('STR_FIRST_CHOICE', $GLOBALS['STR_FIRST_CHOICE']);
116  $tpl->assign('STR_SECOND_CHOICE', $GLOBALS['STR_SECOND_CHOICE']);
117  $tpl->assign('STR_THIRD_CHOICE', $GLOBALS['STR_THIRD_CHOICE']);
118  }
119  $tpl->assign('naissance', get_formatted_date(vb($frm['naissance'])));
120  $tpl->assign('naissance_error', $form_error_object->text('naissance'));
121  $tpl->assign('adresse', vb($frm['adresse']));
122  $tpl->assign('adresse_error', $form_error_object->text('adresse'));
123  $tpl->assign('zip', vb($frm['code_postal']));
124  $tpl->assign('zip_error', $form_error_object->text('code_postal'));
125  $tpl->assign('town', vb($frm['ville']));
126  $tpl->assign('town_error', $form_error_object->text('ville'));
127  $tpl->assign('country_options', get_country_select_options(null, $_SESSION['session_utilisateur']['pays'], 'id'));
128  $tpl_origin_options = array();
129  $i = 1;
130  while (isset($GLOBALS['STR_USER_ORIGIN_OPTIONS_' . $i])) {
131  $tpl_origin_options[] = array('value' => $i,
132  'issel' => vb($frm['origin']) == $i,
133  'name' => $GLOBALS['STR_USER_ORIGIN_OPTIONS_' . $i]
134  );
135  $i++;
136  }
137  $tpl->assign('origin_infos', array('options' => $tpl_origin_options,
138  'is_origin_other_activated' => in_array(vb($frm['origin']), $GLOBALS['origin_other_ids']),
139  'origin_other_ids_for_javascript' => 'new Array('.implode(',', $GLOBALS['origin_other_ids']).')',
140  'origin_other' => vb($frm['origin_other']),
141  'error_text' => $form_error_object->text('origin'),
142  'STR_CHOOSE' => $GLOBALS['STR_CHOOSE']
143  ));
144 
145  $tpl->assign('enable_display_only_user_specific_field', !empty($GLOBALS['site_parameters']['enable_display_only_user_specific_field']));
146  $tpl->assign('specific_fields', get_specific_field_infos($frm, $form_error_object, 'user'));
147 
148  // Select pour paramétrer la langue par défaut du compte lors de l'envoi d'email
149  $sqlLng = "SELECT lang, nom_".$_SESSION['session_langue']." AS nom_lang
150  FROM peel_langues
151  WHERE (etat = '1'" . (!empty($_GET['langue'])?" OR lang='" . word_real_escape_string($_GET['langue']) . "'":'') . ") AND " . get_filter_site_cond('langues') . "" . (!empty($GLOBALS['site_parameters']['language_for_contacts'])? " AND lang IN ('".implode("','", $GLOBALS['site_parameters']['language_for_contacts'])."')" : '' ) . "
152  GROUP BY lang
153  ORDER BY position";
154  $resLng = query($sqlLng);
155  $language_for_automatic_emails_options = array();
156  $language_for_automatic_emails_selected = null;
157 
158  if (!empty($frm['lang'])) {
159  while ($lng = fetch_assoc($resLng)) {
160  $language_for_automatic_emails_options[vb($lng['lang'])] = vb($lng['nom_lang']);
161  if ($lng['lang'] == $frm['lang']) {
162  $language_for_automatic_emails_selected = vb($lng['lang']);
163  }
164  }
165  }
166  if (!empty($GLOBALS['site_parameters']['user_front_office_logo_edit'])) {
167  $tpl->assign('STR_LOGO', $GLOBALS['STR_LOGO']);
168  if (!empty($frm["logo"])) {
169  $tpl->assign('logo', get_uploaded_file_infos("logo", $frm["logo"], get_current_url(false) . '?mode=supprfile&id=' . vb($_SESSION['session_utilisateur']['id_utilisateur']) . '&file=logo'));
170  }
171  }
172  $tpl->assign('language_for_automatic_emails_options', $language_for_automatic_emails_options);
173  $tpl->assign('language_for_automatic_emails_selected', $language_for_automatic_emails_selected);
174  $tpl->assign('newsletter_issel', (!isset($frm['newsletter']) || !empty($frm['newsletter'])));
175  $tpl->assign('commercial_issel', (!isset($frm['commercial']) || $frm['commercial']));
176  $tpl->assign('token', get_form_token_input('change_params'));
177  $tpl->assign('id_utilisateur', $_SESSION['session_utilisateur']['id_utilisateur']);
178  $tpl->assign('is_annonce_module_active', check_if_module_active('annonces'));
179  $tpl->assign('add_b2b_form_inputs', !empty($GLOBALS['site_parameters']['add_b2b_form_inputs']));
180  $tpl->assign('cnil_txt', String::textEncode($GLOBALS['STR_CNIL']));
181  $tpl->assign('STR_CHANGE', $GLOBALS['STR_CHANGE']);
182  $tpl->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
183  $tpl->assign('STR_LEADER', $GLOBALS['STR_LEADER']);
184  $tpl->assign('STR_MANAGER', $GLOBALS['STR_MANAGER']);
185  $tpl->assign('STR_EMPLOYEE', $GLOBALS['STR_EMPLOYEE']);
186  $tpl->assign('STR_ADDRESS', $GLOBALS['STR_ADDRESS']);
187  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
188  $tpl->assign('STR_FONCTION', $GLOBALS['STR_FONCTION']);
189  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
190  $tpl->assign('STR_CHANGE_PARAMS', $GLOBALS['STR_CHANGE_PARAMS']);
191  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
192  $tpl->assign('STR_GENDER', $GLOBALS['STR_GENDER']);
193  $tpl->assign('STR_MLLE', $GLOBALS['STR_MLLE']);
194  $tpl->assign('STR_MME', $GLOBALS['STR_MME']);
195  $tpl->assign('STR_M', $GLOBALS['STR_M']);
196  $tpl->assign('STR_STRONG_PSEUDO_NOTIFICATION', $GLOBALS['STR_STRONG_PSEUDO_NOTIFICATION']);
197  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
198  $tpl->assign('STR_NAME', $GLOBALS['STR_NAME']);
199  $tpl->assign('STR_SOCIETE', $GLOBALS['STR_SOCIETE']);
200  $tpl->assign('STR_INTRACOM_FORM', $GLOBALS['STR_INTRACOM_FORM']);
201  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
202  $tpl->assign('STR_PORTABLE', $GLOBALS['STR_PORTABLE']);
203  $tpl->assign('STR_FAX', $GLOBALS['STR_FAX']);
204  $tpl->assign('STR_NAISSANCE', $GLOBALS['STR_NAISSANCE']);
205  $tpl->assign('STR_ERR_BIRTHDAY1', $GLOBALS['STR_ERR_BIRTHDAY1']);
206  $tpl->assign('STR_ERR_BIRTHDAY2', $GLOBALS['STR_ERR_BIRTHDAY2']);
207  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
208  $tpl->assign('STR_COUNTRY', $GLOBALS['STR_COUNTRY']);
209  $tpl->assign('STR_USER_ORIGIN', $GLOBALS['STR_USER_ORIGIN']);
210  $tpl->assign('STR_COMMERCIAL_AGENT', $GLOBALS['STR_COMMERCIAL_AGENT']);
211  $tpl->assign('STR_LANGUAGE_FOR_AUTOMATIC_EMAILS', $GLOBALS['STR_LANGUAGE_FOR_AUTOMATIC_EMAILS']);
212  $tpl->assign('STR_NEWSLETTER_YES', (!empty($GLOBALS['STR_NEWSLETTER_YES'])?$GLOBALS['STR_NEWSLETTER_YES']:''));
213  $tpl->assign('STR_COMMERCIAL_YES', $GLOBALS['STR_COMMERCIAL_YES']);
214  $tpl->assign('STR_ACTIVITY', $GLOBALS['STR_ACTIVITY']);
215  $tpl->assign('STR_YOU_ARE', $GLOBALS['STR_YOU_ARE']);
216  $tpl->assign('STR_BUYERS', $GLOBALS['STR_BUYERS']);
217  $tpl->assign('STR_IMPORTERS_EXPORTERS', $GLOBALS['STR_IMPORTERS_EXPORTERS']);
218  $tpl->assign('STR_COMMERCIAL_AGENT', $GLOBALS['STR_COMMERCIAL_AGENT']);
219  $tpl->assign('STR_PURCHASING_MANAGER', $GLOBALS['STR_PURCHASING_MANAGER']);
220  $tpl->assign('STR_WORD_SELLERS', $GLOBALS['STR_WORD_SELLERS']);
221  $tpl->assign('STR_WHOLESALER', $GLOBALS['STR_WHOLESALER']);
222  $tpl->assign('STR_HALF_WHOLESALER', $GLOBALS['STR_HALF_WHOLESALER']);
223  $tpl->assign('STR_RETAILERS', $GLOBALS['STR_RETAILERS']);
224  $tpl->assign('STR_PUNCTUAL', $GLOBALS['STR_PUNCTUAL']);
225  $tpl->assign('STR_RECURRENT', $GLOBALS['STR_RECURRENT']);
226  $output .= $tpl->fetch();
227  return $output;
228  }
229 }
230 
231 if (!function_exists('get_user_register_form')) {
243  function get_user_register_form(&$frm, &$form_error_object, $for_quote = false, $short_register_form = false, $url_account_register = null, $mandatory_fields = null)
244  {
245  $output = '';
246  $tpl = $GLOBALS['tplEngine']->createTemplate('user_register_form.tpl');
247  // for_home => Séparé en 3 blocs
248  if(empty($url_account_register)) {
249  $url_account_register = get_current_url(true);
250  }
251  $tpl->assign('mandatory_fields', $mandatory_fields);
252  $tpl->assign('short_register_form', $short_register_form);
253  $tpl->assign('is_annonce_module_active', check_if_module_active('annonces'));
254  $tpl->assign('add_b2b_form_inputs', !empty($GLOBALS['site_parameters']['add_b2b_form_inputs']));
255  $tpl->assign('action', $url_account_register);
256  $tpl->assign('email', vb($frm['email']));
257  $tpl->assign('email_error', $form_error_object->text('email'));
258  if(empty($GLOBALS['site_parameters']['pseudo_is_not_used'])) {
259  $tpl->assign('STR_PSEUDO', $GLOBALS['STR_PSEUDO']);
260  $tpl->assign('pseudo', vb($frm['pseudo']));
261  $tpl->assign('pseudo_error', $form_error_object->text('pseudo'));
262  }
263  $tpl->assign('mot_passe', vb($frm['mot_passe']));
264  $tpl->assign('mot_passe_confirm', vb($frm['mot_passe_confirm']));
265  $tpl->assign('password_error', $form_error_object->text('mot_passe'));
266  $tpl->assign('civilite_mlle_issel', (vb($frm['civilite']) == "Mlle"));
267  $tpl->assign('civilite_mme_issel', (vb($frm['civilite']) == "Mme"));
268  $tpl->assign('civilite_m_issel', (vb($frm['civilite']) == "M."));
269  $tpl->assign('gender_error', $form_error_object->text('civilite'));
270  $tpl->assign('first_name', vb($frm['prenom']));
271  $tpl->assign('first_name_error', $form_error_object->text('prenom'));
272  $tpl->assign('name', vb($frm['nom_famille']));
273  $tpl->assign('name_error', $form_error_object->text('nom_famille'));
274  $tpl->assign('societe', vb($frm['societe']));
275  $tpl->assign('societe_error', $form_error_object->text('societe'));
276  $tpl->assign('intracom_form', vb($frm['intracom_for_billing']));
277  $tpl->assign('intracom_form_error', $form_error_object->text('intracom_for_billing'));
278  $tpl->assign('naissance', get_formatted_date(vb($frm['naissance'])));
279  $tpl->assign('telephone', vb($frm['telephone']));
280  $tpl->assign('telephone_error', $form_error_object->text('telephone'));
281  $tpl->assign('fax', vb($frm['fax'])); // La variable est renseignée mais par défaut dans le template Smarty, l'affichage du fax est désactivé car plus beaucoup utilisé de nos jours
282  $tpl->assign('portable', vb($frm['portable']));
283  $tpl->assign('adresse', vb($frm['adresse']));
284  $tpl->assign('adresse_error', $form_error_object->text('adresse'));
285  $tpl->assign('zip', vb($frm['code_postal']));
286  $tpl->assign('zip_error', $form_error_object->text('code_postal'));
287  $tpl->assign('town', vb($frm['ville']));
288  $tpl->assign('town_error', $form_error_object->text('ville'));
289  $tpl->assign('fonction_options', get_user_job_options(vb($frm['fonction'])));
290  $tpl->assign('fonction_error', $form_error_object->text('fonction'));
291  $tpl->assign('country_options', get_country_select_options(null, vb($frm['pays']), 'id'));
292  $tpl->assign('type_error', $form_error_object->text('type'));
293  $tpl->assign('activity_error', $form_error_object->text('activity'));
294  $tpl->assign('type', vb($frm['type']));
295  $tpl->assign('activity', vb($frm['activity']));
296  $tpl->assign('url', vb($frm['url']));
297  // On mentionne le champ si obligatoire - en fait on le vérifiera uniquement pour la France
298  $tpl->assign('siret', vb($frm['siret']));
299  $tpl->assign('siret_error', $form_error_object->text('siret'));
300  $tpl->assign('siret_txt', $GLOBALS['STR_COMPANY_IDENTIFICATION']);
301  if (!empty($GLOBALS['site_parameters']['user_fields_enable_code_promo'])) {
302  $tpl->assign('promo_code', vb($frm['promo_code']));
303  $tpl->assign('STR_PROMO_CODE', $GLOBALS['STR_PROMO_CODE']);
304  }
305  if (check_if_module_active('annonces')) {
306  // si le module d'annonce est activé, on confirme le mot de passe
307  $tpl->assign('STR_PASSWORD_CONFIRMATION', $GLOBALS['STR_PASSWORD_CONFIRMATION']);
308  $tpl->assign('password_confirmation_error', $form_error_object->text('mot_passe_confirm'));
309  // si le module d'annonce est activé, on renseigne le site web, et catégories promo
310  if (vb($GLOBALS['site_parameters']['type_affichage_user_favorite_id_categories']) == 'checkbox') {
311  $tpl->assign('id_categories', get_ad_select_options(null, vb($frm['id_categories']), 'id', false, false, 'checkbox', 'id_categories'));
312  $tpl->assign('id_categories_error', $form_error_object->text('id_categories_error'));
313  } elseif (vb($GLOBALS['site_parameters']['type_affichage_user_favorite_id_categories']) == 'select') {
314  $tpl->assign('id_cat_1_error', $form_error_object->text('id_cat_1'));
315  $tpl->assign('id_cat_2_error', $form_error_object->text('id_cat_2'));
316  $tpl->assign('id_cat_3_error', $form_error_object->text('id_cat_3'));
317  $tpl->assign('id_cat_1', get_ad_select_options(null, vb($frm['id_cat_1']), 'id'));
318  $tpl->assign('id_cat_2', get_ad_select_options(null, vb($frm['id_cat_2']), 'id'));
319  $tpl->assign('id_cat_3', get_ad_select_options(null, vb($frm['id_cat_3']), 'id'));
320  }
321  $tpl->assign('STR_WEBSITE', $GLOBALS['STR_WEBSITE']);
322  $tpl->assign('STR_ANNOUNCEMENT_INDICATION', $GLOBALS['STR_ANNOUNCEMENT_INDICATION']);
323  $tpl->assign('STR_FIRST_CHOICE', $GLOBALS['STR_FIRST_CHOICE']);
324  $tpl->assign('STR_SECOND_CHOICE', $GLOBALS['STR_SECOND_CHOICE']);
325  $tpl->assign('STR_THIRD_CHOICE', $GLOBALS['STR_THIRD_CHOICE']);
326  }
327  $tpl_origin_options = array();
328  $i = 1;
329  while (isset($GLOBALS['STR_USER_ORIGIN_OPTIONS_' . $i])) {
330  $tpl_origin_options[] = array('value' => $i,
331  'issel' => vb($frm['origin']) == $i,
332  'name' => $GLOBALS['STR_USER_ORIGIN_OPTIONS_' . $i]
333  );
334  $i++;
335  }
336  $tpl->assign('origin_infos', array('options' => $tpl_origin_options,
337  'is_origin_other_activated' => in_array(vb($frm['origin']), $GLOBALS['origin_other_ids']),
338  'origin_other_ids_for_javascript' => 'new Array('.implode(',', $GLOBALS['origin_other_ids']).')',
339  'origin_other' => vb($frm['origin_other']),
340  'error_text' => $form_error_object->text('origin'),
341  'STR_CHOOSE' => $GLOBALS['STR_CHOOSE']
342  ));
343 
344  $tpl->assign('enable_display_only_user_specific_field', !empty($GLOBALS['site_parameters']['enable_display_only_user_specific_field']));
345  $tpl->assign('specific_fields', get_specific_field_infos($frm, $form_error_object, 'user'));
346  if (check_if_module_active('captcha')) {
347  // L'appel à get_captcha_inside_form($frm) réinitialise la valeur de $frm['code'] si le code donné n'est pas bon, en même temps que générer nouvelle image
348  $tpl->assign('captcha', array(
349  'validation_code_txt' => $GLOBALS['STR_VALIDATION_CODE'],
350  'inside_form' => get_captcha_inside_form($frm),
351  'validation_code_copy_txt' => $GLOBALS['STR_VALIDATION_CODE_COPY'],
352  'error' => $form_error_object->text('code'),
353  'value' => vb($frm['code'])
354  ));
355  }
356  if (check_if_module_active('annonces')) {
357  // si le module d'annonce est activé, on confirme les cgv
358  $tpl->assign('cgv_issel', !empty($frm['cgv_confirm']));
359  $tpl->assign('STR_CGV_YES', $GLOBALS['STR_CGV_YES']);
360  $tpl->assign('cgv_yes_error', $form_error_object->text('cgv_confirm'));
361  }
362 
363  // Select permettant de paramétrer la langue par défaut du compte lors de l'envoi d'email
364  $sqlLng = "SELECT lang, nom_".$_SESSION['session_langue']." AS nom_lang
365  FROM peel_langues
366  WHERE " . get_filter_site_cond('langues') . " AND (etat = '1'" . (!empty($_GET['langue'])?" OR lang='" . word_real_escape_string($_GET['langue']) . "'":'') . ")
367  " . (!empty($GLOBALS['site_parameters']['language_for_contacts'])? " AND lang IN ('".implode("','", $GLOBALS['site_parameters']['language_for_contacts'])."')" : '' ) . "
368  GROUP BY lang
369  ORDER BY position";
370  $resLng = query($sqlLng);
371  $language_for_automatic_emails_options = array();
372  $language_for_automatic_emails_selected = null;
373  while ($lng = fetch_assoc($resLng)) {
374  $language_for_automatic_emails_options[vb($lng['lang'])] = vb($lng['nom_lang']);
375  if ($lng['lang'] == $_SESSION['session_langue']) {
376  $language_for_automatic_emails_selected = vb($lng['lang']);
377  }
378  }
379  if (!empty($GLOBALS['site_parameters']['user_front_office_logo_edit'])) {
380  $tpl->assign('STR_LOGO', $GLOBALS['STR_LOGO']);
381  if (!empty($frm["logo"])) {
382  $tpl->assign('logo', get_uploaded_file_infos("logo", $frm["logo"], get_current_url(false) . '?mode=supprfile&id=' . vb($_SESSION['session_utilisateur']['id_utilisateur']) . '&file=logo'));
383  }
384  }
385  $tpl->assign('language_for_automatic_emails_options', $language_for_automatic_emails_options);
386  $tpl->assign('language_for_automatic_emails_selected', $language_for_automatic_emails_selected);
387  $tpl->assign('STR_LANGUAGE_FOR_AUTOMATIC_EMAILS', $GLOBALS['STR_LANGUAGE_FOR_AUTOMATIC_EMAILS']);
388  $tpl->assign('newsletter_issel', (!isset($frm['newsletter']) || !empty($frm['newsletter'])));
389  $tpl->assign('newsletter_option_selected', vb($frm['newsletter_format']));
390  $tpl->assign('commercial_issel', (!$form_error_object->count() || !empty($frm['commercial'])));
391  $tpl->assign('cnil_txt', String::textEncode($GLOBALS['STR_CNIL']));
392  $tpl->assign('token', get_form_token_input('get_user_register_form', true));
393  $tpl->assign('js_password_control', js_password_control('mot_passe'));
394  $tpl->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
395  $tpl->assign('STR_LEADER', $GLOBALS['STR_LEADER']);
396  $tpl->assign('STR_MANAGER', $GLOBALS['STR_MANAGER']);
397  $tpl->assign('STR_EMPLOYEE', $GLOBALS['STR_EMPLOYEE']);
398  if($for_quote && check_if_module_active('devis')) {
399  $tpl->assign('STR_FIRST_REGISTER_TITLE', $GLOBALS['STR_DEVIS']);
400  $tpl->assign('STR_FIRST_REGISTER_TEXT', $GLOBALS['STR_MODULE_DEVIS_CONSEIL']);
401  $tpl->assign('submit_text', $GLOBALS['STR_SEND']);
402  } else {
403  $tpl->assign('STR_FIRST_REGISTER_TITLE', $GLOBALS['STR_FIRST_REGISTER_TITLE']);
404  $tpl->assign('STR_FIRST_REGISTER_TEXT', $GLOBALS['STR_FIRST_REGISTER_TEXT']);
405  $tpl->assign('STR_OPEN_ACCOUNT', $GLOBALS['STR_OPEN_ACCOUNT']);
406  $tpl->assign('submit_text', $GLOBALS['STR_OPEN_ACCOUNT']);
407  }
408  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
409  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
410  $tpl->assign('STR_STRONG_PSEUDO_NOTIFICATION', $GLOBALS['STR_STRONG_PSEUDO_NOTIFICATION']);
411  $tpl->assign('STR_PASSWORD', $GLOBALS['STR_PASSWORD']);
412  $tpl->assign('STR_PASSWORD_SECURITY', $GLOBALS['STR_PASSWORD_SECURITY']);
413  $tpl->assign('STR_STRONG_PASSWORD_NOTIFICATION', $GLOBALS['STR_STRONG_PASSWORD_NOTIFICATION']);
414  $tpl->assign('STR_GENDER', $GLOBALS['STR_GENDER']);
415  $tpl->assign('STR_MLLE', $GLOBALS['STR_MLLE']);
416  $tpl->assign('STR_MME', $GLOBALS['STR_MME']);
417  $tpl->assign('STR_M', $GLOBALS['STR_M']);
418  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
419  $tpl->assign('STR_NAME', $GLOBALS['STR_NAME']);
420  $tpl->assign('STR_SOCIETE', $GLOBALS['STR_SOCIETE']);
421  $tpl->assign('STR_INTRACOM_FORM', $GLOBALS['STR_INTRACOM_FORM']);
422  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
423  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
424  $tpl->assign('STR_COUNTRY', $GLOBALS['STR_COUNTRY']);
425  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
426  $tpl->assign('STR_PORTABLE', $GLOBALS['STR_PORTABLE']);
427  $tpl->assign('STR_FAX', $GLOBALS['STR_FAX']);
428  $tpl->assign('STR_NAISSANCE', $GLOBALS['STR_NAISSANCE']);
429  $tpl->assign('STR_MANDATORY', $GLOBALS['STR_MANDATORY']);
430  $tpl->assign('STR_USER_ORIGIN', $GLOBALS['STR_USER_ORIGIN']);
431  $tpl->assign('STR_COMMERCIAL_AGENT', $GLOBALS['STR_COMMERCIAL_AGENT']);
432  $tpl->assign('STR_NEWSLETTER_YES', (!empty($GLOBALS['STR_NEWSLETTER_YES'])?$GLOBALS['STR_NEWSLETTER_YES']:''));
433  $tpl->assign('STR_COMMERCIAL_YES', $GLOBALS['STR_COMMERCIAL_YES']);
434  $tpl->assign('STR_ADDRESS', $GLOBALS['STR_ADDRESS']);
435  $tpl->assign('STR_FONCTION', $GLOBALS['STR_FONCTION']);
436  $tpl->assign('STR_ACTIVITY', $GLOBALS['STR_ACTIVITY']);
437  $tpl->assign('STR_YOU_ARE', $GLOBALS['STR_YOU_ARE']);
438  $tpl->assign('STR_BUYERS', $GLOBALS['STR_BUYERS']);
439  $tpl->assign('STR_IMPORTERS_EXPORTERS', $GLOBALS['STR_IMPORTERS_EXPORTERS']);
440  $tpl->assign('STR_COMMERCIAL_AGENT', $GLOBALS['STR_COMMERCIAL_AGENT']);
441  $tpl->assign('STR_PURCHASING_MANAGER', $GLOBALS['STR_PURCHASING_MANAGER']);
442  $tpl->assign('STR_WORD_SELLERS', $GLOBALS['STR_WORD_SELLERS']);
443  $tpl->assign('STR_WHOLESALER', $GLOBALS['STR_WHOLESALER']);
444  $tpl->assign('STR_HALF_WHOLESALER', $GLOBALS['STR_HALF_WHOLESALER']);
445  $tpl->assign('STR_RETAILERS', $GLOBALS['STR_RETAILERS']);
446  $tpl->assign('STR_PUNCTUAL', $GLOBALS['STR_PUNCTUAL']);
447  $tpl->assign('STR_RECURRENT', $GLOBALS['STR_RECURRENT']);
448  $output .= $tpl->fetch();
449  return $output;
450  }
451 }
452 
453 if (!function_exists('get_user_register_success')) {
460  function get_user_register_success(&$frm)
461  {
462  $output = '
463 <h1 property="name" class="page_title">' . $GLOBALS['STR_HELLO'] . ' ' . String::html_entity_decode_if_needed($frm['prenom']) . '</h1>';
464  if ($frm['priv']=='stop') {
465  $output .= '<p>' . nl2br($GLOBALS['STR_MODULE_PREMIUM_MSG_RETAILER']) . '</p>';
466  } else {
467  $output .= '
468 <p>' . nl2br(String::textEncode($GLOBALS['STR_LOGIN_OK'])) . '</p>';
469  }
470  return $output;
471  }
472 }
473 
474 if (!function_exists('get_change_password_form')) {
483  function get_change_password_form(&$frm, &$form_error_object, $noticemsg = null)
484  {
485  $output = '';
486  $tpl = $GLOBALS['tplEngine']->createTemplate('change_password_form.tpl');
487  $tpl->assign('change_password', $GLOBALS['STR_CHANGE_PASSWORD']);
488  if ($form_error_object->has_error('token')) {
489  $tpl->assign('token_error', $form_error_object->text('token'));
490  }
491  $tpl->assign('noticemsg', $noticemsg);
492  $tpl->assign('action', get_current_url(false));
493  $tpl->assign('old_password', vb($frm['ancien_mot_passe']));
494  $tpl->assign('old_password_error', $form_error_object->text('ancien_mot_passe'));
495  $tpl->assign('old_password_error2', $form_error_object->text('ancien_mot_passe2'));
496  $tpl->assign('new_password', vb($frm['nouveau_mot_passe']));
497  $tpl->assign('new_password_error', $form_error_object->text('nouveau_mot_passe'));
498  $tpl->assign('new_password_confirm', vb($frm['nouveau_mot_passe2']));
499  $tpl->assign('new_password_confirm_error', $form_error_object->text('nouveau_mot_passe2'));
500  $tpl->assign('token', get_form_token_input('change_password'));
501  $tpl->assign('js_password_control', js_password_control('nouveau_mot_passe'));
502  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
503  $tpl->assign('STR_OLD_PASSWORD', $GLOBALS['STR_OLD_PASSWORD']);
504  $tpl->assign('STR_NEW_PASSWORD', $GLOBALS['STR_NEW_PASSWORD']);
505  $tpl->assign('STR_STRONG_PASSWORD_NOTIFICATION', $GLOBALS['STR_STRONG_PASSWORD_NOTIFICATION']);
506  $tpl->assign('STR_NEW_PASSWORD_CONFIRM', $GLOBALS['STR_NEW_PASSWORD_CONFIRM']);
507  $tpl->assign('STR_CHANGE', $GLOBALS['STR_CHANGE']);
508  $tpl->assign('STR_EMPTY_FIELDS', $GLOBALS['STR_EMPTY_FIELDS']);
509  $output .= $tpl->fetch();
510  return $output;
511  }
512 }
513 
514 if (!function_exists('get_recover_password_form')) {
523  function get_recover_password_form(&$frm, &$form_error_object, $mode = 'filing_email')
524  {
525  $output = '';
526  $tpl = $GLOBALS['tplEngine']->createTemplate('recover_password_form.tpl');
527  $tpl->assign('get_password', $GLOBALS['STR_GET_PASSWORD']);
528  $tpl->assign('action', $_SERVER['REQUEST_URI']);
529  $tpl->assign('STR_SEND', $GLOBALS['STR_SEND']);
530  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
531  $tpl->assign('token', get_form_token_input('oubli_mot_passe', true));
532  $tpl->assign('login_href', get_url('membre'));
533  $tpl->assign('login_txt', $GLOBALS['STR_LOGIN']);
534  $tpl->assign('home_href', get_url('/'));
535  $tpl->assign('home_txt', $GLOBALS['STR_HOME']);
536  $tpl->assign('js_password_control', js_password_control('rec_password_once'));
537  if ($mode == 'filing_email') {
538  $tpl->assign('email', array(
539  'msg_insert' => $GLOBALS['STR_INSERT_EMAIL'],
540  'label' => $GLOBALS['STR_EMAIL'] . $GLOBALS['STR_BEFORE_TWO_POINTS'],
541  'value' => vb($frm['email']),
542  'error' => $form_error_object->text('email')
543  ));
544  }elseif ($mode == 'renew_password') {
545  $tpl->assign('pass', array(
546  'empty_field_error' => $form_error_object->text('empty_field'),
547  'mismatch_password_error' => $form_error_object->text('mismatch_password'),
548  'msg_insert_new_password' => $GLOBALS['STR_INSERT_NEW_PASSWORD'],
549  'STR_NEW_PASSWORD' => $GLOBALS['STR_NEW_PASSWORD'],
550  'STR_BEFORE_TWO_POINTS' => $GLOBALS['STR_BEFORE_TWO_POINTS'],
551  'password_once' => vb($frm['password_once']),
552  'password_once_error' => $form_error_object->text('password_once'),
553  'STR_STRONG_PASSWORD_NOTIFICATION' => $GLOBALS['STR_STRONG_PASSWORD_NOTIFICATION'],
554  'STR_NEW_PASSWORD_CONFIRM' => $GLOBALS['STR_NEW_PASSWORD_CONFIRM'],
555  'password_twice' => vb($frm['password_twice']),
556  'password_twice_error' => $form_error_object->text('password_twice'),
557  ));
558  }
559  $output .= $tpl->fetch();
560  return $output;
561  }
562 }
563 
564 if (!function_exists('get_access_account_form')) {
574  function get_access_account_form(&$frm, &$form_error_object, $forced_new_client_area_html = null, $skip_title = false)
575  {
576  $output = '';
577  if(empty($forced_new_client_area_html)){
578  $forced_new_client_area_html = '' . nl2br($GLOBALS['STR_MSG_NEW_CUSTOMER']) . '<br />';
579  }
580  $tpl = $GLOBALS['tplEngine']->createTemplate('access_account_form.tpl');
581  if(!$skip_title) {
582  $tpl->assign('acces_account_txt', $GLOBALS['STR_ACCES_ACCOUNT']);
583  } else {
584  $tpl->assign('acces_account_txt', null);
585  }
586  $tpl->assign('new_customer', $GLOBALS['STR_NEW_CUSTOMER']);
587  $tpl->assign('msg_new_customer', $forced_new_client_area_html);
588  $tpl->assign('still_customer', $GLOBALS['STR_STILL_CUSTOMER']);
589  $tpl->assign('msg_still_customer', $GLOBALS['STR_MSG_STILL_CUSTOMER']);
590  $tpl->assign('pass_perdu_txt', $GLOBALS['STR_PASS_PERDU']);
591  $tpl->assign('pass_perdu_href', get_url('/utilisateurs/oubli_mot_passe.php'));
592  $tpl->assign('email_or_pseudo', $GLOBALS['STR_EMAIL_OR_PSEUDO'] . $GLOBALS['STR_BEFORE_TWO_POINTS']);
593  $tpl->assign('email', vb($frm['email']));
594  $tpl->assign('email_error', $form_error_object->text('email'));
595  $tpl->assign('STR_PASSWORD', $GLOBALS['STR_PASSWORD'] . $GLOBALS['STR_BEFORE_TWO_POINTS']);
596  $tpl->assign('password', vb($frm['mot_passe']));
597  $tpl->assign('password_error', $form_error_object->text('mot_passe'));
598  $tpl->assign('token', get_form_token_input('membre.php', true));
599  $tpl->assign('login_txt', $GLOBALS['STR_LOGIN']);
600  if (function_exists('get_social_icone')) {
601  $tpl->assign('social_icone', get_social_icone());
602  }
603  $social = array('is_any' => false);
604  if (check_if_module_active('facebook_connect')) {
605  $social['is_any'] = true;
606  $social['facebook'] = get_facebook_connect_btn();
607  }
608  if (check_if_module_active('sign_in_twitter')) {
609  $social['is_any'] = true;
610  $social['twitter'] = get_sign_in_twitter_btn();
611  }
612  if (check_if_module_active('openid')) {
613  $social['is_any'] = true;
614  $social['openid'] = get_openid_btn();
615  }
616  $tpl->assign('social', $social);
617  $output .= $tpl->fetch();
618  return $output;
619  }
620 }
621 
622 if (!function_exists('get_contact_form')) {
631  function get_contact_form(&$frm, &$form_error_object, $skip_introduction_text = false)
632  {
633  $output = '';
634  $tpl = $GLOBALS['tplEngine']->createTemplate('contact_form.tpl');
635  $tpl->assign('skip_introduction_text', $skip_introduction_text);
636  $tpl->assign('short_form', !empty($GLOBALS['site_parameters']['contact_form_short_mode']));
637  if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
638  $tpl->assign('ssl_image_src', $GLOBALS['repertoire_images'] . '/security.png');
639  }
640  if ($form_error_object->has_error('token')) {
641  $tpl->assign('token_error', $form_error_object->text('token'));
642  }
643  if (!empty($frm['is_ok'])) {
644  $tpl->assign('success_msg', $GLOBALS['STR_TICKET_OK']);
645  }
646  $tpl->assign('contact_info', affiche_contenu_html("contact_page", true) . (function_exists('get_details_societe')?get_details_societe():''));
647  $tpl->assign('action', get_current_url(false).(!empty($GLOBALS['main_div_id'])?'?ctx='.$GLOBALS['main_div_id']:''));
648  $tpl->assign('extra_field', get_contact_extra_field());
649  $sujet_options = array(
650  '' => $GLOBALS['STR_CONTACT_LB']);
651  for($i=1; isset($GLOBALS['STR_CONTACT_SELECT'.$i]); $i++) {
652  if(!empty($GLOBALS['STR_CONTACT_SELECT'.$i])) {
653  $sujet_options[$GLOBALS['STR_CONTACT_SELECT'.$i]]=$GLOBALS['STR_CONTACT_SELECT'.$i];
654  }
655  }
656  $tpl->assign('sujet_options', $sujet_options);
657  $tpl->assign('sujet_options_selected', vb($frm['sujet']));
658  $tpl->assign('sujet_error', $form_error_object->text('sujet'));
659 
660  $tpl->assign('commande_id', vb($frm['commande_id']));
661  $tpl->assign('commande_error', $form_error_object->text('commande_id'));
662  $tpl->assign('email_value', vb($frm['email']));
663  $tpl->assign('email_error', $form_error_object->text('email'));
664  $tpl->assign('name_value', vb($frm['nom']));
665  $tpl->assign('name_error', $form_error_object->text('nom'));
666 
667  $tpl->assign('societe_value', vb($frm['societe']));
668  $tpl->assign('societe_error', $form_error_object->text('societe'));
669  $tpl->assign('first_name_value', vb($frm['prenom']));
670  $tpl->assign('first_name_error', $form_error_object->text('prenom'));
671  $tpl->assign('address_value', vb($frm['adresse']));
672  $tpl->assign('zip_value', vb($frm['code_postal']));
673  $tpl->assign('town_value', vb($frm['ville']));
674  $tpl->assign('country_value', vb($frm['pays']));
675  $tpl->assign('telephone_value', vb($frm['telephone']));
676  $tpl->assign('telephone_error', $form_error_object->text('telephone'));
677  $tpl->assign('texte_value', vb($frm['texte']));
678  $tpl->assign('texte_error', $form_error_object->text('texte'));
679  $tpl->assign('STR_DISPO', $GLOBALS['STR_DISPO']);
680 
681  if (check_if_module_active('captcha')) {
682  // L'appel à get_captcha_inside_form($frm) réinitialise la valeur de $frm['code'] si le code donné n'est pas bon, en même temps que générer nouvelle image
683  $tpl->assign('captcha', array(
684  'validation_code_txt' => $GLOBALS['STR_VALIDATION_CODE'],
685  'inside_form' => get_captcha_inside_form($frm),
686  'validation_code_copy_txt' => $GLOBALS['STR_VALIDATION_CODE_COPY'],
687  'error' => $form_error_object->text('code'),
688  'value' => vb($frm['code'])
689  ));
690  }
691  $tpl->assign('align', (!empty($GLOBALS['site_parameters']['contact_form_align']) ? $GLOBALS['site_parameters']['contact_form_align'] : 'left'));
692  $tpl->assign('token', get_form_token_input('user_contact'));
693  $tpl->assign('href', get_current_url(false));
694  $tpl->assign('STR_SEND', $GLOBALS['STR_SEND']);
695  $tpl->assign('cnil_txt', String::textEncode($GLOBALS['STR_CNIL']));
696  $tpl->assign('STR_CONTACT', $GLOBALS['STR_CONTACT']);
697  $tpl->assign('STR_CONTACT_INTRO', $GLOBALS['STR_CONTACT_INTRO']);
698  $tpl->assign('STR_CONTACT_SUBJECT', $GLOBALS['STR_CONTACT_SUBJECT']);
699  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
700  $tpl->assign('STR_ORDER_NUMBER', $GLOBALS['STR_ORDER_NUMBER']);
701  $tpl->assign('STR_REQUIRED_ORDER_NUMBER', $GLOBALS['STR_REQUIRED_ORDER_NUMBER']);
702  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
703  $tpl->assign('STR_NAME', $GLOBALS['STR_NAME']);
704  $tpl->assign('STR_SOCIETE', $GLOBALS['STR_SOCIETE']);
705  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
706  $tpl->assign('STR_ADDRESS', $GLOBALS['STR_ADDRESS']);
707  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
708  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
709  $tpl->assign('STR_COUNTRY', $GLOBALS['STR_COUNTRY']);
710  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
711  $tpl->assign('STR_TEXT', $GLOBALS['STR_TEXT']);
712  $tpl->assign('STR_DAY_AM', $GLOBALS['STR_DAY_AM']);
713  $tpl->assign('STR_DAY_PM', $GLOBALS['STR_DAY_PM']);
714  $tpl->assign('STR_MANDATORY', $GLOBALS['STR_MANDATORY']);
715  $output .= $tpl->fetch();
716  return $output;
717  }
718 }
719 
720 if (!function_exists('get_contact_success')) {
727  function get_contact_success(&$frm)
728  {
729  $output = '
730 <h1 property="name" class="page_title">' . $GLOBALS['STR_CONTACT'] . '</h1>
731 <div class="page_content">
732  <div class="alert alert-success">' . String::nl2br_if_needed($GLOBALS['STR_TICKET_OK']) . '</div>
733 </div>
734 ' . vb($GLOBALS['site_parameters']['contact_form_success_tag']);
735  return $output;
736  }
737 }
738 
739 if (!function_exists('get_contact_extra_field')) {
744  function get_contact_extra_field()
745  {
746  return '';
747  }
748 }
749 
750 if (!function_exists('js_password_control')) {
756  function js_password_control($field_id)
757  {
758  $GLOBALS['js_ready_content_array'][] = '
759  set_password_image_level("' . filtre_javascript($field_id, true, false, true, true, false) . '","' . $GLOBALS['repertoire_images'] . '","' . filtre_javascript('pwd_level_image', true, false, true, true, false) . '",' . (!empty($GLOBALS['site_parameters']['bootstrap_enabled'])?'true':'false') . ');
760 ';
761  }
762 }
763 
764 if (!function_exists('get_address_form')) {
771  function get_address_form($frm = null)
772  {
773  $output = '';
774  if(empty($_SESSION['session_utilisateur']['id_utilisateur'])) {
775  return false;
776  }
777  $output .= '
778  <form class="entryform form-inline" method="post" action="'.get_current_url(false).'">
779  <fieldset>
780 ';
781  if (!empty($frm['id'])) {
782  $output .= '
783  <input type="hidden" name="id" value="'.vn($frm['id']).'">
784  <input type="hidden" name="mode" value="update_address">';
785  } else {
786  $output .= '
787  <input type="hidden" name="mode" value="insert_address">';
788  }
789  if (!empty($GLOBALS['site_parameters']['mode_transport'])) {
790  $options = ' <option value="" ' . frmvalide(vb($frm['address_type']) == "", ' selected="selected"') . '>' . $GLOBALS['STR_INVOICE_ADDRESS'] . ' / ' . $GLOBALS['STR_SHIP_ADDRESS'] . '</option>
791  <option value="bill" ' . frmvalide(vb($frm['address_type']) == "bill", ' selected="selected"') . '>' . $GLOBALS['STR_INVOICE_ADDRESS'] . '</option>
792  <option value="ship" ' . frmvalide(vb($frm['address_type']) == "ship", ' selected="selected"') . '>' . $GLOBALS['STR_SHIP_ADDRESS'] . '</option>
793 ';
794  } else {
795  $options = '<option value="bill" ' . frmvalide(vb($frm['address_type']) == "bill", ' selected="selected"') . '>' . $GLOBALS['STR_INVOICE_ADDRESS'] . '</option>';
796  }
797  $output .= '
798  <div class="enregistrement">
799  <span class="enregistrementgauche"><label for="name_adresse">' .$GLOBALS['STR_NAME'] . ' ' . String::strtoupper($GLOBALS['STR_ADDRESS']) . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
800  <span class="enregistrementdroite"><input type="text" class="form-control" id="name_adresse" name="name_adresse" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['nom']))).'" required /></span>
801  </div>
802  <div class="enregistrement">
803  <span class="enregistrementgauche"><label>' . $GLOBALS['STR_TYPE'] .$GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
804  <span class="enregistrementdroite">
805  <select name="address_type" class="form-control">
806  '.$options.'
807  </select>
808  </span>
809  </div>
810  <div class="enregistrement">
811  <span class="enregistrementgauche"><label>' . $GLOBALS['STR_GENDER'] .$GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
812  <span class="enregistrementdroite">
813  <input type="radio" name="civilite" value="Mlle" ' . frmvalide(vb($frm['civilite']) == "Mlle") . ' /> ' . $GLOBALS['STR_MLLE'] . ' &nbsp;
814  <input type="radio" name="civilite" value="Mme" ' . frmvalide(vb($frm['civilite']) == "Mme") . ' /> ' . $GLOBALS['STR_MME'] . ' &nbsp;
815  <input type="radio" name="civilite" value="M." ' . frmvalide(vb($frm['civilite']) == "M.") . ' /> ' . $GLOBALS['STR_M'] . '
816  </span>
817  </div>
818  <div class="enregistrement">
819  <span class="enregistrementgauche"><label for="nom_famille">' . $GLOBALS['STR_NAME'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
820  <span class="enregistrementdroite"><input type="text" class="form-control" id="nom_famille" name="nom_famille" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['nom_famille']))).'" required /></span>
821  </div>
822  <div class="enregistrement">
823  <span class="enregistrementgauche"><label for="prenom">' . $GLOBALS['STR_FIRST_NAME'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
824  <span class="enregistrementdroite"><input type="text" class="form-control" id="prenom" name="prenom" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['prenom']))).'" required /><span class="notice"></span>
825  </div>
826  <div class="enregistrement">
827  <span class="enregistrementgauche"><label for="prenom">' . $GLOBALS['STR_EMAIL'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
828  <span class="enregistrementdroite"><input type="text" class="form-control" id="email" name="email" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['email']))).'" required /><span class="notice"></span>
829  </div>
830  <div class="enregistrement">
831  <span class="enregistrementgauche"><label for="societe">' . $GLOBALS['STR_SOCIETE'] . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
832  <span class="enregistrementdroite"><input type="text" class="form-control" id="societe" name="societe" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['societe']))).'" /></span>
833  </div>
834  <div class="enregistrement">
835  <span class="enregistrementgauche"><label for="adresse">' . $GLOBALS['STR_ADDRESS'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
836  <span class="enregistrementdroite"><input type="text" class="form-control" id="adresse" name="adresse" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['adresse']))).'" required /></span>
837  </div>
838  <div class="enregistrement">
839  <span class="enregistrementgauche"><label for="code_postal">' . $GLOBALS['STR_ZIP'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
840  <span class="enregistrementdroite"><input type="text" class="form-control" id="code_postal" name="code_postal" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['code_postal']))).'" required /></span>
841  </div>
842  <div class="enregistrement">
843  <span class="enregistrementgauche"><label for="ville">' . $GLOBALS['STR_TOWN'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
844  <span class="enregistrementdroite"><input type="text" class="form-control" id="ville" name="ville" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['ville']))).'" required /></span>
845  </div>
846  <div class="enregistrement">
847  <span class="enregistrementgauche"><label for="pays">' . $GLOBALS['STR_COUNTRY'] . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
848  <span class="enregistrementdroite">
849  <select id="pays" name="pays" class="form-control">
850  ' . get_country_select_options(null, vb($frm['pays']), 'id') . '
851  </select>
852  </span>
853  </div>
854  <div class="enregistrement">
855  <span class="enregistrementgauche"><label for="portable">' . $GLOBALS['STR_TELEPHONE'] . ' <span class="etoile">*</span>' . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ':</label></span>
856  <span class="enregistrementdroite"><input type="text" class="form-control" id="portable" name="portable" value="'.String::str_form_value(String::html_entity_decode_if_needed(vb($frm['portable']))).'" required /></span>
857  </div>
858  <p class="center" style="margin-top:10px"><input class="btn btn-primary btn-lg" type="submit" value="' . String::str_form_value($GLOBALS["STR_VALIDATE"]) . '" /></p>
859  </fieldset>
860  <p><span class="form_mandatory">(*) ' . $GLOBALS['STR_MANDATORY'] . '</span></p>
861  </form>
862 ';
863  return $output;
864  }
865 }
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
Definition: String.php:154
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
static textEncode($string, $suppr_endline=false, $encode_only_isolated_amperstands=false)
Méthode de compatibilité avec anciennes versions de PEEL utilisant textEncode au lieu de htmlentities...
Definition: String.php:468
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
Definition: fonctions.php:1743
get_captcha_inside_form(&$frm)
get_captcha_inside_form()
Definition: fonctions.php:89
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
Definition: String.php:533
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
Definition: database.php:424
$mode
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(isset($_POST['pays_zone'])) elseif(empty($_SESSION['session_caddie']->zoneId)&&!empty($GLOBALS['site_parameters']['default_delivery_zone_id'])) if(isset($_POST['type'])) elseif(empty($_SESSION['session_caddie']->typeId)&&!empty($GLOBALS['site_parameters']['default_delivery_type_id'])) if(!empty($_POST['code_promo'])) if(!empty($_GET['code_promo'])&&$_GET['code_promo']== 'delete') $form_error_object
get_user_job_options($selected_fonction_name=null)
Definition: fonctions.php:4828
get_specific_field_infos($frm, $form_error_object=null, $form_usage="user", $step=null)
Permet de définir de nouveaux champs dans le formulaire d'inscription / modification d'utilisateur de...
Definition: fonctions.php:5150
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
Definition: fonctions.php:4643
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
Definition: database.php:158
static str_form_value($value, $flags=ENT_COMPAT)
Encode une chaine de caractères pour affichage dans un value="".
Definition: String.php:480
$mandatory_fields
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
get_country_select_options($selected_country_name=null, $selected_country_id=null, $option_value= 'name', $display_inactive_country=false, $allowed_zone_id=null, $preselect_shop_country_if_none_selected=true, $selected_country_lang=null, $allowed_ids=null)
get_country_select_options()
Definition: fonctions.php:1005
get_uploaded_file_infos($field_name, $file, $delete_url, $logo_width=100, $logo_height=100)
Remplit un tableau d'informations pour le template d'upload HTML.
Definition: fonctions.php:3601
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
get_formatted_date($datetime_or_timestamp=null, $mode= 'short', $hour_minute=false)
Afficher une date formatée, en évitant les problèmes liés aux noms de mois sur les serveurs qui ne so...
Definition: format.php:440
$noticemsg
$GLOBALS['page_columns_count']
filtre_javascript($string, $addslashes=true, $allow_escape_single_quote=true, $allow_escape_double_quote=true, $skip_endline=true, $inside_html=true)
Formatte une chaine de caractère pour insertion dans du javascript.
Definition: format.php:237
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
Definition: fonctions.php:94
frmvalide($variable_to_test, $true_value= 'checked="checked"', $false_value="")
Affiche le mot "checked" si la variable est vraie sinon rien.
Definition: format.php:80
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
Definition: String.php:112
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
static nl2br_if_needed($string)
Fonction de compatibilité avec de vieilles versions de PEEL ou du contenu qui vient d'ailleurs...
Definition: String.php:559
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:30:25 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.