14 if (!defined(
'IN_PEEL')) {
25 $result[
'menu_items'][
'users_sales'][
$GLOBALS[
'wwwroot_in_admin'] .
'/modules/webmail/administrer/webmail_send.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_WEBMAIL_SEND"];
26 $result[
'menu_items'][
'users_sales'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/webmail/administrer/list_mails_send.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_SENT_EMAILS"];
27 $result[
'menu_items'][
'users_sales'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/webmail/administrer/list_mails.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_LIST_EMAILS"];
40 $sql_formulaire =
'SELECT *
42 WHERE id_user="' . intval(
vn($params[
'id_utilisateur'])) .
'" AND ' .
get_filter_site_cond(
'webmail', null,
true) .
'
43 ORDER BY date DESC, heure DESC';
44 $Links_formulaire =
new Multipage($sql_formulaire,
'affiche_liste_mail_annonce',
'*');
46 $Links_formulaire->HeaderTitlesArray = $HeaderTitlesArray;
47 $result_formulaire = $Links_formulaire->Query();
50 <table class="full_width">
52 <td class="entete" colspan="2">'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_LIST_IN_SITE_CONTACT_FORM'].
'</td>
56 <table id="tablesForm" style="width:100%;">
57 ' . $Links_formulaire->getHeaderRow();
59 if (empty($result_formulaire)) {
60 $output .=
'<tr><td colspan="4" class="center"><b>'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_NO_EMAIL_FOUND'].
'</b></td></tr>';
62 foreach($result_formulaire as $formulaire) {
64 <td class="center">' .
vb($formulaire[
'titre']) .
'</td>
65 <td class="center">' .
vb($formulaire[
'message']) .
'</td>
66 <td class="center">' .
vb($formulaire[
'date']) .
' ' .
vb($formulaire[
'heure']) .
'</td>
67 <td class="center">' .
vb($formulaire[
'ip']) .
'</td>
76 <td colspan="2">' . $Links_formulaire->GetMultipage() .
'</td>
93 if (!empty(
$frm[
'id_utilisateur'])) {
95 FROM peel_utilisateurs
99 $user_id = $row_account[
'id_utilisateur'];
100 $user_email = $row_account[
'email'];
101 $user_gender = $row_account[
'civilite'];
102 $user_name = $row_account[
'nom_famille'];
103 $user_first_name = $row_account[
'prenom'];
104 $user_login = $row_account[
'pseudo'];
105 $user_password = $row_account[
'mot_passe'];
113 if ($row_mail[
'read'] ==
'NO') {
114 query(
"UPDATE `peel_webmail`
119 $user_id = $row_mail[
'id_user'];
120 $user_email = $row_mail[
'email'];
121 $user_name = $row_mail[
'nom'] ;
122 $user_first_name = $row_mail[
'prenom'] ;
124 if (!empty($user_id)) {
127 FROM peel_utilisateurs
128 WHERE id_utilisateur='" . intval($user_id) .
"' AND " .
get_filter_site_cond(
'utilisateurs') .
"") ;
130 $user_gender = $row_account[
'civilite'];
131 $user_login = $row_account[
'pseudo'];
132 $user_password = $row_account[
'mot_passe'];
136 FROM peel_utilisateurs
140 $users_email_array[] = $users_email[
'email'];
142 $user_email = implode(
';', $users_email_array);
144 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/webmailAdmin_form.tpl');
145 $GLOBALS[
'js_ready_content_array'][] =
'
146 $("#signature_template_options").change(function () {
147 form_template_content_add("signature_template_options", "signature", "message", "' .
$GLOBALS[
'wwwroot'] .
'");
149 $("#template").change(function () {
150 form_template_content_add("template", "message", "message", "' .
$GLOBALS[
'wwwroot'] .
'");
151 form_template_content_add("template", "subject", "title", "' .
$GLOBALS[
'wwwroot'] .
'");
152 form_template_content_add("template", "lang", "lang", "' .
$GLOBALS[
'wwwroot'] .
'");
155 if (!empty(
$frm[
'id_utilisateur'])) {
156 $tpl->assign(
'edit_href',
$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . intval(
vn(
$frm[
'id_utilisateur'])));
158 $tpl->assign(
'id_utilisateur', intval(
vn(
$frm[
'id_utilisateur'])));
159 $tpl->assign(
'user_gender',
vb($user_gender));
160 $tpl->assign(
'user_name',
vb($user_name));
161 $tpl->assign(
'user_first_name',
vb($user_first_name));
162 $tpl->assign(
'user_email',
vb($user_email));
163 $tpl->assign(
'my_email',
$_SESSION[
'session_utilisateur'][
'email']);
165 if (!empty(
$frm[
'id_utilisateur'])) {
166 $tpl->assign(
'by_lang_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'id_cat'])?
'id_cat=' . $_GET[
'id_cat'] .
'&':
'') .
'lang_mail=\'+lang_mail+\'&id_utilisateur=' . intval(
vn(
$frm[
'id_utilisateur'])) .
'\'');
167 $tpl->assign(
'ctl_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'lang_mail'])?
'lang_mail=' . $_GET[
'lang_mail'] .
'&':
'') .
'id_cat=\'+cat_id+\'&id_utilisateur=' . intval(
vn(
$frm[
'id_utilisateur'])) .
'\'');
169 $tpl->assign(
'by_lang_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'id_cat'])?
'id_cat=' . $_GET[
'id_cat'] .
'&':
'') .
'lang_mail=\'+lang_mail+\'&id_webmail=' . intval(
vn(
$frm[
'id_webmail'])) .
'\'');
170 $tpl->assign(
'ctl_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'lang_mail'])?
'lang_mail=' . $_GET[
'lang_mail'] .
'&':
'') .
'id_cat=\'+cat_id+\'&id_webmail=' . intval(
vn(
$frm[
'id_webmail'])) .
'\'');
174 foreach (
$frm[
'user_ids'] as $user_id) {
176 $user_ids .=
'&user_ids[]=' . $user_id;
178 $tpl->assign(
'by_lang_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'id_cat'])?
'id_cat=' . $_GET[
'id_cat'] .
'&':
'') .
'lang_mail=\'+lang_mail+\'' . $user_ids .
'\'');
179 $tpl->assign(
'ctl_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'lang_mail'])?
'lang_mail=' . $_GET[
'lang_mail'] .
'&':
'') .
'id_cat=\'+cat_id+\'' . $user_ids .
'\'');
181 $tpl->assign(
'by_lang_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'id_cat'])?
'id_cat=' . $_GET[
'id_cat'] .
'&':
'') .
'lang_mail=\'+lang_mail');
182 $tpl->assign(
'ctl_href',
'\'' .
get_current_url(
false) .
'?' . (!empty($_GET[
'email_all_hash'])?
'email_all_hash=' . $_GET[
'email_all_hash'] .
'&':
'') . (!empty($_GET[
'lang_mail'])?
'lang_mail=' . $_GET[
'lang_mail'] .
'&':
'') .
'id_cat=\'+cat_id');
184 if (!empty($row_mail)) {
185 $tpl->assign(
'row_mail', array(
186 'email' => $row_mail[
'email'],
187 'titre' => $row_mail[
'titre'],
188 'message' => $row_mail[
'message']
193 $tpl->assign(
'email_templates_href',
$GLOBALS[
'administrer_url'] .
'/email-templates.php');
194 $tpl->assign(
'email_templates_admin_href',
$GLOBALS[
'administrer_url'] .
'/administrer/email-templates.php');
196 $sql =
'SELECT tc.id, tc.name_' .
$_SESSION[
'session_langue'] .
' AS name, tc.site_id
197 FROM peel_email_template_cat tc
198 INNER JOIN peel_email_template t ON t.id_cat=tc.id AND t.active="TRUE" AND ' .
get_filter_site_cond(
'email_template',
't') .
'
205 'value' => intval(
vn($row_categories[
'id'])),
206 'issel' => !empty(
$frm[
'id_cat']) &&
$frm[
'id_cat'] == $row_categories[
'id'],
215 FROM peel_email_template
218 $default_signature_id = $default_signature[
'id'];
221 $default_signature_id = null;
225 $langs_array =
$GLOBALS[
'admin_lang_codes'];
226 foreach ($langs_array as $lng) {
228 'issel' => !empty(
$frm[
'lang_mail']) &&
$frm[
'lang_mail'] == $lng
230 if(!empty(
$frm[
'lang_mail']) &&
$frm[
'lang_mail'] == $lng) {
231 $tpl->assign(
'selected_lang', $lng);
235 if (!empty($_GET[
'email_all_hash']) && !empty($_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']])) {
236 $tpl->assign(
'is_multidestinataire',
true);
237 $tpl->assign(
'multidestinataire_txt', sprintf(
'%s destinataire(s) sélectionné(s)', $_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']]));
239 $tpl->assign(
'is_multidestinataire',
false);
240 $tpl->assign(
'is_destinataire',
true);
243 $tpl->assign(
'is_multidestinataire',
false);
244 $tpl->assign(
'is_destinataire',
false);
245 $tpl->assign(
'user_id', intval(
vn($user_id)));
247 $tpl->assign(
'nom_famille',
vb($_SESSION[
'session_utilisateur'][
'nom_famille']));
248 $tpl->assign(
'prenom',
vb($_SESSION[
'session_utilisateur'][
'prenom']));
250 $tpl->assign(
'HTTP_HOST',
$GLOBALS[
'_SERVER'][
'HTTP_HOST']);
251 $tpl->assign(
'sites_href',
$GLOBALS[
'administrer_url'] .
'/sites.php');
252 if((isset($_SESSION[
'request_from_send_email_all'][$_GET[
'email_all_hash']]))){
253 $tpl->assign(
'count_email_all_hash', $_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']]);
254 $tpl->assign(
'request_email_all_hash', $_SESSION[
'request_from_send_email_all'][$_GET[
'email_all_hash']]);
255 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SEND_EMAIL_TO_N_USERS', sprintf(
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SEND_EMAIL_TO_N_USERS'], $_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']]));
257 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
259 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_CLIENT_INFORMATION',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_CLIENT_INFORMATION']);
260 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EDIT_USER',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EDIT_USER']);
262 $tpl->assign(
'STR_UNAVAILABLE',
$GLOBALS[
'STR_UNAVAILABLE']);
263 $tpl->assign(
'STR_ADMIN_NAME',
$GLOBALS[
'STR_ADMIN_NAME']);
264 $tpl->assign(
'STR_FIRST_NAME',
$GLOBALS[
'STR_FIRST_NAME']);
266 $tpl->assign(
'STR_UNAVAILABLE',
$GLOBALS[
'STR_UNAVAILABLE']);
267 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_ANSWER_EMAIL_SENT_BY',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_ANSWER_EMAIL_SENT_BY']);
268 $tpl->assign(
'STR_ADMIN_SUBJECT',
$GLOBALS[
'STR_ADMIN_SUBJECT']);
270 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_ADD_NAME',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_ADD_NAME']);
271 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_TEMPLATES',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_TEMPLATES']);
272 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EXPLAIN_TEMPLATES',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EXPLAIN_TEMPLATES']);
273 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EXPLAIN_TAGS',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EXPLAIN_TAGS']);
274 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_CHOOSE_LANG',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_CHOOSE_LANG']);
275 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_CHOOSE_CATEGORY',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_CHOOSE_CATEGORY']);
276 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_CHOSSE_TEMPLATE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_CHOSSE_TEMPLATE']);
277 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_FORM_TITLE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_FORM_TITLE']);
278 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_FIELD',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_FIELD']);
279 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENTS',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENTS']);
280 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENT_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENT_EMAIL']);
281 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENT_EMAIL_EXPLAIN',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_RECIPIENT_EMAIL_EXPLAIN']);
282 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE']);
283 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_NONE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_NONE']);
284 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_UNDEFINED_SERVICE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_UNDEFINED_SERVICE']);
285 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_CLIENT_SERVICE',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_CLIENT_SERVICE']);
286 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_SALES',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_SALES']);
287 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_ACCOUNTING',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_ACCOUNTING']);
288 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_SEO',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_SEO']);
289 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_TECHNICAL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_TECHNICAL']);
290 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_COMMUNICATION',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_COMMUNICATION']);
291 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_MARKETING',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_MARKETING']);
292 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_DIRECTION',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_DIRECTION']);
293 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_EXTERNAL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SIGNATURE_EXTERNAL']);
294 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SENDER_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SENDER_EMAIL']);
295 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_WEBMASTER_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_WEBMASTER_EMAIL']);
296 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_ORDER_MANAGEMENT_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_ORDER_MANAGEMENT_EMAIL']);
297 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_CLIENT_SERVICE_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_CLIENT_SERVICE_EMAIL']);
298 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_EXPLAIN',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_EXPLAIN']);
299 $tpl->assign(
'STR_MODULE_WEBMAIL_ADMIN_SEND_EMAIL',
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_SEND_EMAIL']);
321 $custom_template_tags = array();
323 if (empty(
$frm[
'destination_mail']) && empty(
$_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']])) {
324 return $tplEngine->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_ERR_SENT_NO_EMAIL"]))->fetch();
326 $mail_subject =
vb(
$frm[
'subject']);
328 $mail_content =
vb(
$frm[
'message']) .
"\r\n" .
vb(
$frm[
'signature']);
329 $template_id =
vn(
$frm[
'template']);
330 if (!empty(
$frm[
'email_from']) && !empty(
$GLOBALS[
'site_parameters'][
$frm[
'email_from']])) {
332 $email_from =
$GLOBALS[
'site_parameters'][$frm[
'email_from']];
333 }
elseif(!empty($frm[
'email_from']) && $frm[
'email_from'] ==
'my_email') {
335 $email_from =
$_SESSION[
'session_utilisateur'][
'email'];
337 $email_from =
$GLOBALS[
'site_parameters'][
'email_webmaster'];
339 if(!empty($template_id)) {
341 $this_data =
'template_' .
vn($template_id);
347 $this_data =
'NO_TEMPLATE';
349 $this_comment = $frm[
'message'];
351 if (!empty($frm[
'submit_send_email_all'])) {
353 program_cron_email(
$_SESSION[
'request_from_send_email_all'][$_GET[
'email_all_hash']], $mail_content, $mail_subject,
$_SESSION[
'session_utilisateur'][
'email'], null, $frm[
'lang'], $custom_template_tags);
354 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_MSG_WILL_SEND_BY_CRON_OK"]))->fetch();
355 unset(
$_SESSION[
'request_from_send_email_all'][$_GET[
'email_all_hash']]);
358 tracert_history_admin(intval(
vn($frm[
'id_utilisateur'])),
'SEND_EMAIL', $this_data, $this_comment, $raison,
$_SESSION[
'count_from_send_email_all'][$_GET[
'email_all_hash']] .
' destinataires');
360 $destination_mail_array = explode(
';', $frm[
'destination_mail']);
361 foreach($destination_mail_array as $this_destination_mail) {
364 FROM peel_utilisateurs
368 $user_template_tags = array();
369 if (!empty($user_infos)) {
370 $user_template_tags[
'CIVILITE'] = $user_infos[
'civilite'];
371 $user_template_tags[
'PRENOM'] = $user_infos[
'prenom'];
372 $user_template_tags[
'NOM_FAMILLE'] = $user_infos[
'nom_famille'];
373 $user_template_tags[
'PSEUDO'] = $user_infos[
'pseudo'];
374 $user_template_tags[
'SOCIETE'] = $user_infos[
'societe'];
375 $user_template_tags[
'TELEPHONE'] = $user_infos[
'telephone'];
376 $user_template_tags[
'EMAIL'] = $user_infos[
'email'];
377 if (count($destination_mail_array) == 1) {
379 $frm[
'id_utilisateur'] = $user_infos[
'id_utilisateur'];
382 $mail_sended =
send_email($this_destination_mail, $mail_subject, $mail_content, $template_id, array_merge($custom_template_tags, $user_template_tags) , null, $email_from,
true,
false,
true,
$_SESSION[
'session_utilisateur'][
'email'], null);
384 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_MSG_SENT_OK'], $this_destination_mail)))->fetch();
386 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_ERR_SENT'], $this_destination_mail)))->fetch();
389 tracert_history_admin(intval(
vn($frm[
'id_utilisateur'])),
'SEND_EMAIL', $this_data, $this_comment, $raison, $frm[
'destination_mail']);
406 if (!empty($recherche)) {
407 if (!empty($recherche[
'date'])) {
410 if (!empty($recherche[
'admin'])) {
413 if (!empty($recherche[
'template'])) {
417 $sql =
'SELECT ac.*, u_admins.nom_famille AS admin_nom, u_admins.prenom AS admin_prenom, u_users.nom_famille AS user_nom, u_users.prenom AS user_prenom, u_users.pseudo AS user_login
418 FROM peel_admins_actions ac
419 INNER JOIN peel_utilisateurs u_admins ON u_admins.id_utilisateur = ac.id_user AND ' .
get_filter_site_cond(
'utilisateurs',
'u_admins') .
'
420 LEFT JOIN peel_utilisateurs u_users ON u_users.id_utilisateur = ac.id_membre AND ' .
get_filter_site_cond(
'utilisateurs',
'u_users') .
'
421 WHERE ac.action="SEND_EMAIL" ' . (!empty($sql_cond)? implode(
' ', $sql_cond):
'') .
' AND ' .
get_filter_site_cond(
'admins_actions',
'ac') .
'
422 ORDER BY ac.date DESC';
424 $HeaderTitlesArray = array(
$GLOBALS[
"STR_ADMIN_ADMINISTRATOR"],
$GLOBALS[
'STR_DATE'],
$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_EMAIL_SENT"],
$GLOBALS[
"STR_ADMIN_EMAIL_TEMPLATE"],
$GLOBALS[
"STR_ADMIN_USER"]);
425 $Links->HeaderTitlesArray = $HeaderTitlesArray;
429 <table class="affiche_list_send_mail">
431 <td class="entete" colspan="2">'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_LIST_TITLE'].
'</td>
434 <th>'.
$GLOBALS[
'STR_ADMIN_DATE'].
'' .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
436 <input type="text" name="date" class="form-control datepicker" value="' .
String::str_form_value(
vb(($recherche[
'date']))) .
'" style="width:110px" />
437 <input type="hidden" name="mode" value="search" />
441 <th>' .
$GLOBALS[
'STR_ADMIN_ADMINISTRATOR'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
443 <select name="admin" class="form-control">
444 <option value="">' .
$GLOBALS[
'STR_CHOOSE'] .
'...</option>';
446 $sql =
'SELECT id_utilisateur, nom_famille , prenom
447 FROM peel_utilisateurs
449 ORDER BY id_utilisateur ASC';
451 while ($admins_array =
fetch_assoc($result_admins)) {
453 <option value="' . intval(
vn($admins_array[
'id_utilisateur'])) .
'" ' .
frmvalide(!empty($recherche[
'admin']) && $recherche[
'admin'] == $admins_array[
'id_utilisateur'],
' selected="selected"') .
'>' .
vb($admins_array[
'prenom']) .
' ' .
vb($admins_array[
'nom_famille']) .
'</option>';
460 <th>' .$GLOBALS[
'STR_ADMIN_EMAIL_TEMPLATE'].
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
462 <select name="template" id="template" class="form-control">
468 <td colspan="2" class="center">
469 <input type="submit" value="'.$GLOBALS[
'STR_SEARCH'].
'" class="btn btn-primary" />
474 <table class="main_table">
476 <td>' .
$Links->GetMultipage() .
'</td>
480 <div class="table-responsive">
481 <table class="table">
482 ' .
$Links->getHeaderRow();
486 <tr><td colspan="5" class="left"><div class="alert alert-warning">'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_NO_EMAIL_SENT_FOUND'].
'</div></td></tr>';
488 foreach(
$result as $mails_send_array) {
490 $send_email_list = explode(
',', $mails_send_array[
'raison']);
491 $nb_send_email_list = count($send_email_list);
492 if ($nb_send_email_list > 1) {
493 $multi_send_texte =
'<i style="color:red;">Envoi multiple</i><br />';
496 $multi_send_texte =
'';
500 ' . $mails_send_array[
"admin_prenom"] .
' ' . $mails_send_array[
"admin_nom"] .
'
505 <td class="center">';
507 if (!empty($template_infos) && $mails_send_array[
'remarque'] == $template_infos[
'text']) {
508 $email_sended_infos =
'<b>Template</b> : <br />' . $multi_send_texte . $template_infos[
"name"] . ($template_infos[
'text'] !=
String::strip_tags($template_infos[
'text'])?
' (HTML)':
'');
510 $email_sended_infos = $multi_send_texte . $mails_send_array[
'remarque'];
512 $output .= $email_sended_infos .
'
514 <td class="center">';
515 if (!empty($template_infos)) {
516 $output .=
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_BASE_TEMPLATE_USED'] .
' ' .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':<br />' . $template_infos[
'technical_code'] .
' - ' .
String::strtoupper($template_infos[
'lang']);
518 $output .= $mails_send_array[
"data"];
523 <td class="center">';
525 if ($nb_send_email_list > 1) {
526 $output .= sprintf(
$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_EMAIL_SENT_TO_N_CLIENTS'], $nb_send_email_list);
527 }
elseif (!empty($mails_send_array[
'id_membre'])) {
528 $output .=
'<b><a href="' .
$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . intval($mails_send_array[
'id_membre']) .
'">' . $mails_send_array[
"user_prenom"] .
' ' . $mails_send_array[
"user_nom"] .
'</a></b><br />' . $mails_send_array[
"user_login"];
530 $output .= (!empty($mails_send_array[
'raison'])?$mails_send_array[
'raison']:
$GLOBALS[
'STR_INFORMATION_NOT_AVAILABLE']);
546 <td>' .
$Links->GetMultipage() .
'</td>
569 if (!empty($recherche)) {
571 if (!empty($recherche[
'date']) && $recherche[
'date'] !=
'any') {
575 if (!empty($recherche[
'nom'])) {
579 if (!empty($recherche[
'email'])) {
583 $sql =
"SELECT w.*, u.pseudo AS login
585 LEFT JOIN peel_utilisateurs u ON u.id_utilisateur = w.id_user AND " .
get_filter_site_cond(
'utilisateurs',
'u') .
"
586 WHERE " .
get_filter_site_cond(
'webmail',
'w',
true) .
" " . (!empty($sql_cond)?
' AND ' . implode(
' AND ', $sql_cond):
'') .
"
587 ORDER BY w.Date DESC, w.Heure DESC";
589 $HeaderTitlesArray = array(
' ',
$GLOBALS[
'STR_ADMIN_TITLE'],
$GLOBALS[
'STR_LAST_NAME'].
'/'.
$GLOBALS[
'STR_FIRST_NAME'].
'/'.
$GLOBALS[
'STR_DATE'], $GLOBALS[
'STR_MESSAGE'],
'IP', $GLOBALS[
"STR_ADMIN_WEBSITE"]);
590 $Links->HeaderTitlesArray = $HeaderTitlesArray;
595 <table class="full_width">
597 <td class="entete" colspan="2">'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_RECEIVED_LIST_TITLE'].
'</td>
602 <input type="hidden" name="mode" value="search" />
606 <th>' . $GLOBALS[
'STR_DATE'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
608 <select name="date" class="form-control">';
610 $row_affdate =
query(
"SELECT count(*) AS this_count, `Read`, `Date`
613 GROUP BY `Date`, `Read`
614 ORDER BY `Date` DESC ");
615 while ($row_row_affdate =
fetch_assoc($row_affdate)) {
616 if (empty($messages_count[$row_row_affdate[
'Date']])) {
617 $messages_count[$row_row_affdate[
'Date']] = 0;
618 $messages_not_read[$row_row_affdate[
'Date']] = 0;
620 $messages_count[$row_row_affdate[
'Date']] += $row_row_affdate[
'this_count'];
621 if ($row_row_affdate[
'Read'] ==
'NO') {
622 $messages_not_read[$row_row_affdate[
'Date']] += $row_row_affdate[
'this_count'];
627 if (!empty($messages_count)) {
628 foreach ($messages_count AS $this_date => $this_messages_count) {
632 if ($messages_not_read[$this_date] > 0) {
633 $style =
' style="color:#FF0000"';
639 if ($messages_not_read[$this_date] > 0) {
640 $style =
' style="color:#FF0000"';
645 <option value="' . date(
'Y-m-d') .
'" ' .
frmvalide(!empty($recherche[
'date']) && $recherche[
'date'] == date(
'Y-m-d'),
' selected="selected"') .
' ' . $style .
'>Aujourd\'hui</option>
646 <option value="any" ' .
frmvalide(!empty($recherche[
'date']) && $recherche[
'date'] ==
'any',
' selected="selected"') .
'>Toutes dates</option>';
650 $output .=
'<option value="' .
String::str_form_value(
vb($this_date)) .
'" ' .
frmvalide(!empty($recherche[
'date']) && $recherche[
'date'] == $this_date ,
' selected="selected"') .
' ' . $style .
'>' . $jour .
"/" . $mois .
"/" . $annee .
' ' . $GLOBALS[
'day_of_week'][date(
'w', strtotime($this_date))];
651 if ($this_date == date(
'Y-m-d')) {
652 $output .=
' ('.$GLOBALS[
'strToday'].
')';
653 }
elseif ($this_date == date(
'Y-m-d', time() - 24 * 3600)) {
654 $output .=
' ('.$GLOBALS[
'strYesterday'].
')';
656 if ($this_messages_count - $messages_not_read[$this_date] > 0) {
657 $output .=
' ' . ($this_messages_count - $messages_not_read[$this_date]) .
' lu';
658 if (($this_messages_count - $messages_not_read[$this_date]) > 1) {
662 if ($messages_not_read[$this_date] > 0) {
663 if ($this_messages_count - $messages_not_read[$this_date] > 0) {
666 $output .=
' ' . $messages_not_read[$this_date] .
' A LIRE';
678 <th>' . $GLOBALS[
'STR_ADMIN_NAME'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
679 <td><input class="form-control" type="text" name="nom" value="' .
String::str_form_value(
vb($recherche[
'nom'])) .
'" /></td>
682 <th>' . $GLOBALS[
'STR_EMAIL'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</th>
683 <td><input class="form-control" type="email" name="email" value="' .
String::str_form_value(
vb($recherche[
'email'])) .
'" /></td>
688 <input type="submit" value="'.$GLOBALS[
'STR_SEARCH'].
'" class="btn btn-primary" />
694 <div class="table-responsive" style="margin-top:10px">
695 <input type="hidden" name="mode" value="change_state_mail" />
696 <table id="tablesForm" class="table">
697 ' .
$Links->getHeaderRow();
700 $output .=
'<tr><td colspan="6" class="center"><b>'.$GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_NO_EMAIL_FOUND'].
'</b></td></tr>';
702 $read_title_array = array(
'NO' => $GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_TO_ANSWER'],
'READ' => $GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_READ'],
'SEND' => $GLOBALS[
'STR_MODULE_WEBMAIL_ADMIN_ANSWERED']);
706 <td class="center" style="width:5px;">
707 <input name="form_delete[]" type="checkbox" value="' . intval(
vn($message[
'id'])) .
'" id="cbx_' . intval(
vn($message[
'id'])) .
'" />
709 <td class="center" style="width:15%">
710 <b>' .
String::strtoupper(
vb($message[
'titre'])) .
'</b><br /><span style="color:' . ($message[
'read'] ==
'NO'?
'Red':($message[
'read'] ==
'SEND'?
'Green':
'Black')) .
'">[' . $read_title_array[$message[
'read']] .
']</span><br /><br /><a style="' . ($message[
'read'] ==
'NO'?
'font-size:13px; color:Red':($message[
'read'] ==
'SEND'?
'color:Green':
'color:Black')) .
'" href="' . $GLOBALS[
'wwwroot_in_admin'] .
'/modules/webmail/administrer/webmail_send.php?id_webmail=' . intval(
vn($message[
'id'])) .
'">' . sprintf(($message[
'read'] ==
'SEND'?$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_ANSWER_AGAIN"]:$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_ANSWER_TO"]), $message[
'email']) .
'</a>
712 <td class="center" style="width:15%">
713 '.$GLOBALS[
"STR_ADMIN_NAME"].$GLOBALS[
'STR_BEFORE_TWO_POINTS'].
': <b>' . ucfirst(
vb($message[
'nom'])) .
'</b><br />'.$GLOBALS[
"STR_FIRST_NAME"].$GLOBALS[
'STR_BEFORE_TWO_POINTS'].
': <b>' . ucfirst(
vb($message[
'prenom'])) .
'</b><br />'.$GLOBALS[
"STR_TELEPHONE"].$GLOBALS[
'STR_BEFORE_TWO_POINTS'].
': <b>' .
vb($message[
'telephone']) .
'</b><br />'.$GLOBALS[
"STR_DATE"].$GLOBALS[
'STR_BEFORE_TWO_POINTS'].
': <b>' .
vb($message[
'date']) .
' ' .
vb($message[
'heure']) .
'</b><br />' . (intval(
vn($message[
'id_user'])) != 0?
'<a href="' . $GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . intval(
vn($message[
'id_user'])) .
'" style="color:Grey;">'.$GLOBALS[
"STR_CUSTOMER"].
' # ' . intval(
vn($message[
'id_user'])) .
'<br />'.$GLOBALS[
"STR_ADMIN_LOGIN"].
' : <b>' .
vb($message[
'login']) .
'</b>':
'') .
'
715 <td class="center" style="width:35%">
716 <font color="' . (($message[
'read'] ==
'NO')?
'Red':
'Black') .
'">' .
String::nl2br_if_needed(
String::str_shorten_words(
String::strip_tags(trim($message[
'message'])), 60,
' ',
true)) .
'</font>' . ($message[
'id_user'] == 0 && $message[
'read'] ==
'SEND'?
'<p><a href="list_admin_actions.php?action_cat=SEND_EMAIL&search=' .
vb($message[
'email']) .
'&type=1">Voir message(s) envoyé(s) par nous à ' .
vb($message[
'email']) .
'</a></p>':
'') .
'
718 <td class="center" style="width:15%">
719 ' .
vb($message[
'ip']) .
'
721 <td class="center" style="width:15%">
732 <input type="button" value="'.$GLOBALS[
"STR_ADMIN_CHECK_ALL"].
'" onclick="if (markAllRows(\'tablesForm\')) return false;" class="btn btn-info" />
733 <input type="button" value="'.$GLOBALS[
"STR_ADMIN_UNCHECK_ALL"].
'" onclick="if (unMarkAllRows(\'tablesForm\')) return false;" class="btn btn-info" />
734 <input type="submit" value="'.$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_MARK_AS_READ"].
'" class="btn btn-primary" name="mail_is_read" />
735 <input type="submit" value="'.$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_MARK_AS_NOT_READ"].
'" class="btn btn-primary" name="mail_is_not_read" />
737 <div class="center">' .
$Links->GetMultipage() .
'</div>
756 if (!empty(
$frm) && !empty(
$frm[
'form_delete'])) {
757 if (!empty(
$frm[
'mail_is_not_read'])) {
758 foreach($_POST[
'form_delete'] as $this_post => $this_value) {
759 query(
'UPDATE `peel_webmail`
761 WHERE `id`="' . intval(
vn($this_value)) .
'" AND `read`!="NO" AND ' .
get_filter_site_cond(
'webmail', null,
true));
762 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_MSG_STATUS_NOT_READ_OK"], intval(
vn($this_value)))))->fetch();
765 foreach($_POST[
'form_delete'] as $this_post => $this_value) {
766 query(
'UPDATE `peel_webmail`
768 WHERE `id`="' . intval(
vn($this_value)) .
'" AND `read`="NO" AND ' .
get_filter_site_cond(
'webmail', null,
true));
769 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_MODULE_WEBMAIL_ADMIN_MSG_STATUS_READ_OK"], intval(
vn($this_value)))))->fetch();
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
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']
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
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(!defined('IN_PEEL')) $GLOBALS['page_types_array']
real_escape_string($value)
real_escape_string()
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
static str_shorten_words($string, $length_limit=100, $separator=" ", $force_shorten_if_special_content=false, $add_separator_instead_of_cutting=true)
On rajoute des espaces à l'intérieur des mots trop longs => à utiliser pour éviter de casser une mise...
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.
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.
affiche_form_send_mail($frm, $return_mode=false, &$form_error_object=null)
Affiche le formulaire d'envoi d'email.
static str_form_value($value, $flags=ENT_COMPAT)
Encode une chaine de caractères pour affichage dans un value="".
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))
if(!defined('IN_PEEL')) send_email($to, $mail_subject= '', $mail_content= '', $template_technical_code=null, $template_tags=null, $format=null, $sender=null, $html_add_structure=true, $html_correct_conformity=false, $html_convert_url_to_links=true, $reply_to=null, $attached_files_infos_array=null, $lang=null, $additional_infos_array=array(), $attachment_not_sent_by_email=false)
Envoi d'un email à un utilisateur.
tracert_history_admin($member_id, $action, $data, $remarque=null, $raison=null)
Inscrit les différentes actions administrateur Liste des $actions possibles : 'SEARCH_USER', 'ADD_FILTER', 'EDIT_FILTER', 'DEL_FILTER', 'EDIT_AD', 'SUP_AD', 'EDIT_VOTE', 'SUP_DETAILS', 'EDIT_PROFIL', 'SUP_FORUM', 'ACTIVATE_COMPTE', 'NOTES_RECUES', 'NOTES_DONNEES', 'NOTE_PROFIL', 'AUTRE', 'SEND_EMAIL', 'CREATE_ORDER', 'EDIT_ORDER', 'SUP_ORDER', 'PHONE_EMITTED', 'EVENT', 'PHONE_RECEIVED'.
fetch_assoc($query_result)
fetch_assoc()
update_state_mail($frm)
Fonction permettant de mettre à jour l'état d'un courrier lu ou non.
webmail_hook_list_user_mail($params)
Fonction affichant la liste d'emails sur le compte utilisateur.
if(!function_exists('affiche_liste_produits_acommander')) if(!function_exists('affiche_liste_articles')) get_email_template_options($option_id_nature= 'id', $category_id=null, $lang=null, $value_select=null, $get_signature=null)
Fonction affichant la liste d'emails sur le compte utilisateur.
getTextAndTitleFromEmailTemplateLang($template_technical_code, $template_lang, $template_technical_id=null)
getTextAndTitleFromEmailTemplateLang()
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
affiche_list_send_mail($recherche, $return_mode=false)
Affiche la liste des emails envoyer.
if(!defined('IN_PEEL')) webmail_hook_admin_menu_items($params)
Renvoie les éléments de menu affichables.
affiche_list_receveid_mail($recherche, $return_mode=false)
Affiche la affiche la liste des emails reçus.
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
static nl2br_if_needed($string)
Fonction de compatibilité avec de vieilles versions de PEEL ou du contenu qui vient d'ailleurs...
get_site_info($array)
get_site_info()
send_mail_admin($frm)
Fonction de traitement d'envoi d'email.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']