Commit 8200eb8d authored by N. Peraldi's avatar N. Peraldi
Browse files

Merge branch 'master' into 17-integration-html-page-d-accueil

# Conflicts:
#	style.css
#	tribe-events/tribe-events.css
parents 31fa9823 bd56efac
......@@ -115,7 +115,7 @@ $max_member_numero = ($page * $maxMembersPerPage);
?>
<div class="wrap adullact-no-height-padding">
<main id="main" class="site-main" role="main">
<div id="adullact-sort-buttons">
<div class="adullact-line">
<div id="adullact-sort-by-type-buttons">
<ul class="adullact-member-list">
<?php
......
......@@ -6,6 +6,8 @@
*/
//variables pour le mail
define("SUBJECT_ADULLACT", "Nouvelle demande de renouvellement d'adhésion");
define("SUBJECT_ERROR_MAIL", "Une erreur est survenue lors d'un envoi de mail récupéré sur le formulaire d'adhésion.");
define("MESSAGE_ERROR_MAIL", "Lorsqu'un utilisateur a validé le formulaire d'adhésion, le mail de confirmation n'a pas été envoyé à cet utilisateur. Une erreur est survenue, veuillez consulter les logs pour en savoir plus.");
define("SUBJECT_USER", "Confirmation de demande de renouvellement d'adhésion");
$bonjourUser = "Bonjour,";
......@@ -142,7 +144,9 @@ function sendAdhesionMail($tab, $trash, $replacements)
}
}
$emailUser = trim($tab["mailUser"]);
$header = "Content-type: text/html; charset=utf-8 \r\n";
$header = "Content-type: text/html; charset=utf-8\r\n";
$header .= "Content-Transfer-Encoding: 8bit\r\n";
$logMessage = "\n";
$messageAdullact = "Nouvelle requête pour le formulaire d'adhésion : <br><table>";
......@@ -154,11 +158,26 @@ function sendAdhesionMail($tab, $trash, $replacements)
$logMessage = $logMessage . $key . " : " . $value . "\n";
}
if (mail($emailUser, SUBJECT_USER, TEXT_MAIL_USER, $header)) {
mail(MAIL_CIBLE_ADULLACT, SUBJECT_ADULLACT, $messageAdullact, $header);
writeInLog("Nouvelle demande", $logMessage);
//on tente d'envoyer le mail à l'utilisateur
if (wp_mail($emailUser, html_entity_decode(SUBJECT_USER, ENT_QUOTES, 'UTF-8'), TEXT_MAIL_USER, $header)) {
writeInLog("Nouvelle demande", $logMessage, MEMBERSHIP_LOGS_DIRECTORY);
//si ça fonctionne, on envoie un mail positif à l'Adullact.
if (!wp_mail(MAIL_CIBLE_ADULLACT, html_entity_decode(SUBJECT_ADULLACT, ENT_QUOTES, 'UTF-8'), $messageAdullact, $header)) {
//on envoie le mail à l'adullact mais si ça échoue, on écrit dans les logs.
$entire_error = "Adresse mail : " . MAIL_CIBLE_ADULLACT . "\n";
$entire_error .= "Headers du mail : " . $header . "\n";
$entire_error .= "Sujet mail : " . SUBJECT_ADULLACT . "\n";
$entire_error .= "Message mail : " . $messageAdullact . "\n";
writeInLog("Erreur lors de l'envoi de mail à l'Adullact", $entire_error, MEMBERSHIP_LOGS_DIRECTORY);
}
} else {
writeInLog("Erreur de l'envoi mail.", "Header : \n" . $header . "\nInfos :" . $logMessage);
//l'envoi à l'utilisateur n'a visiblement pas fonctionné. On tente donc d'envoyer un mail négatif à l'Adullact et on l'écrit dans les logs.
if (!wp_mail(MAIL_CIBLE_ADULLACT, html_entity_decode(SUBJECT_ERROR_MAIL, ENT_QUOTES, 'UTF-8'), MESSAGE_ERROR_MAIL, $header)) {
//si l'envoi de mail à l'Adullact ne fonctionne pas non plus, on signale les deux erreurs.
writeInLog("Erreur lors de l'envoi de mail à" . $emailUser, "Header : \n" . $header . "\nSujet : " . SUBJECT_USER . "\nInfos :" . $logMessage, MEMBERSHIP_LOGS_DIRECTORY);
writeInLog("Erreur lors de l'envoi de mail à L'Adullact", "Header : \n" . $header . "\nSujet : " . SUBJECT_ERROR_MAIL . "\nInfos :" . MESSAGE_ERROR_MAIL, MEMBERSHIP_LOGS_DIRECTORY);
}
}
}
......@@ -166,15 +185,15 @@ function sendAdhesionMail($tab, $trash, $replacements)
* Utile pour écrire un quelconque message dans les logs
* @param string $intitule
* @param string $text
* @param string $filePath : chemin d'accès au fichier de log
*/
function writeInLog($intitule, $text)
function writeInLog($intitule, $text, $filePath)
{
//fonction qui écrit dans les logs.
date_default_timezone_set('Europe/Paris');
$date = date("d-m-Y");
$hour = date("H:i:s");
$filePath = MEMBERSHIP_LOGS_DIRECTORY;
$beforeMessage = "\n--------------\nLe " . $date . ", à " . $hour . ", \n" . $intitule . " : \n";
$finalMessage = $beforeMessage . $text;
$fichier = fopen($filePath, "a");
......
......@@ -245,16 +245,10 @@ input[type="search"] {
margin-bottom: 1em;
}
/*************************************************************/
/*Liste des adhérents*/
/*************************************************************/
#adullact-sort-buttons {
display: flex;
flex-direction: row;
}
.adullact-members-list {
display: flex;
flex-direction: row;
......@@ -536,7 +530,8 @@ article .entry-footer {
}
.entry-header a {
padding: 3px 6px 3px 3px;
padding: 3px;
padding-right: 6px;
}
/*************************************************************/
......
......@@ -11,79 +11,79 @@
*
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
if (!defined('ABSPATH')) {
die('-1');
}
$events_label_singular = tribe_get_event_label_singular();
$events_label_plural = tribe_get_event_label_plural();
$events_label_plural = tribe_get_event_label_plural();
$event_id = get_the_ID();
?>
function get_nombre_inscriptions()
{
$event_id = get_the_ID();
$event_meta = rtec_get_event_meta($event_id);
if($event_meta['num_registered']>1){
echo '<div class="tribe-events-event-cost rtec-custom-limit rtec-red"><span>' . $event_meta['num_registered'] . ' inscrits</span></div>';
}
else{
echo '<div class="tribe-events-event-cost rtec-custom-limit rtec-red"><span>' . $event_meta['num_registered'] . ' inscrit</span></div>';
}
}
?>
<div id="tribe-events-content" class="tribe-events-single">
<p class="tribe-events-back">
<a href="<?php echo esc_url(tribe_get_events_link()); ?>"> <?php printf('&laquo; ' . esc_html_x('All %s', '%s Events plural label', 'the-events-calendar'), $events_label_plural); ?></a>
</p>
<p class="tribe-events-back">
<a href="<?php echo esc_url( tribe_get_events_link() ); ?>"> <?php printf( '&laquo; ' . esc_html_x( 'All %s', '%s Events plural label', 'the-events-calendar' ), $events_label_plural ); ?></a>
</p>
<!-- Notices -->
<?php tribe_the_notices() ?>
<?php the_title( '<h1 class="tribe-events-single-event-title">', '</h1>' ); ?>
<div class="tribe-events-schedule tribe-clearfix">
<?php echo tribe_events_event_schedule_details( $event_id, '<h2>', '</h2>' ); ?>
<?php if ( tribe_get_cost() ) : ?>
<span class="tribe-events-cost"><?php echo tribe_get_cost( null, true ) ?></span>
<?php endif; ?>
</div>
<!-- Notices -->
<?php tribe_the_notices() ?>
<!-- Event header -->
<div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>>
<!-- Navigation -->
<nav class="tribe-events-nav-pagination" aria-label="<?php printf( esc_html__( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?>">
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>&laquo;</span> %title%' ) ?></li>
<li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>&raquo;</span>' ) ?></li>
</ul>
<!-- .tribe-events-sub-nav -->
</nav>
</div>
<!-- #tribe-events-header -->
<?php the_title('<h1 class="tribe-events-single-event-title">', '</h1>'); ?>
<div class="tribe-events-schedule tribe-clearfix">
<div class="adullact-spaced-line">
<?php echo tribe_events_event_schedule_details($event_id, '<h2>', '</h2>'); ?>
<?php get_nombre_inscriptions(); ?>
</div>
<?php if (tribe_get_cost()) : ?>
<span class="tribe-events-cost"><?php echo tribe_get_cost(null, true) ?></span>
<?php endif; ?>
</div>
<?php while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Event featured image, but exclude link -->
<?php echo tribe_event_featured_image( $event_id, 'full', false ); ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Event featured image, but exclude link -->
<?php echo tribe_event_featured_image($event_id, 'full', false); ?>
<!-- Event meta -->
<?php do_action( 'tribe_events_single_event_before_the_meta' ) ?>
<?php tribe_get_template_part( 'modules/meta' ); ?>
<?php do_action( 'tribe_events_single_event_after_the_meta' ) ?>
<!-- Event meta -->
<?php do_action('tribe_events_single_event_before_the_meta') ?>
<?php tribe_get_template_part('modules/meta'); ?>
<?php do_action('tribe_events_single_event_after_the_meta') ?>
<!-- Event content -->
<?php do_action( 'tribe_events_single_event_before_the_content' ) ?>
<?php do_action('tribe_events_single_event_before_the_content') ?>
<div class="tribe-events-single-event-description tribe-events-content">
<?php the_content(); ?>
</div>
<!-- .tribe-events-single-event-description -->
</div> <!-- #post-x -->
<?php if ( get_post_type() == Tribe__Events__Main::POSTTYPE && tribe_get_option( 'showComments', false ) ) comments_template() ?>
<?php endwhile; ?>
</div> <!-- #post-x -->
<?php if (get_post_type() == Tribe__Events__Main::POSTTYPE && tribe_get_option('showComments', false)) comments_template() ?>
<?php endwhile; ?>
<!-- Event footer -->
<div id="tribe-events-footer">
<!-- Navigation -->
<nav class="tribe-events-nav-pagination" aria-label="<?php printf( esc_html__( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?>">
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>&laquo;</span> %title%' ) ?></li>
<li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>&raquo;</span>' ) ?></li>
</ul>
<!-- .tribe-events-sub-nav -->
</nav>
</div>
<!-- #tribe-events-footer -->
<!-- Event footer -->
<div id="tribe-events-footer">
<!-- Navigation -->
<nav class="tribe-events-nav-pagination"
aria-label="<?php printf(esc_html__('%s Navigation', 'the-events-calendar'), $events_label_singular); ?>">
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link('<span>&laquo;</span> %title%') ?></li>
<li class="tribe-events-nav-next"><?php tribe_the_next_event_link('%title% <span>&raquo;</span>') ?></li>
</ul>
<!-- .tribe-events-sub-nav -->
</nav>
</div>
<!-- #tribe-events-footer -->
</div><!-- #tribe-events-content -->
\ No newline at end of file
/*"Aucun résultat : on cache car inutile*/
.tribe-events-notices {
display: none;
.tribe-events-notices{
display:none;
}
#tribe-events-pg-template, .tribe-events-pg-template {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment