Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ twig:
globals:
photo_storage: '@AppBundle\CFP\PhotoStorage'
global_menu_event_label: '%env(AFUP_GLOBAL_MENU_EVENT_LABEL)%'
planning_timezone: !php/const AppBundle\Event\Model\Planning::TIMEZONE
form_themes: ['form_theme.html.twig']
default_path: "%kernel.project_dir%/templates"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function __invoke(Request $request, AdminEventSelection $eventSelection):
'events' => $this->calendarEvents($sessions),
'resources' => $this->calendarResources($event),
],
'timezone' => Planning::TIMEZONE,
]);
}

Expand Down
12 changes: 10 additions & 2 deletions sources/AppBundle/Event/Talk/ExportGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace AppBundle\Event\Talk;

use AppBundle\Event\Model\Event;
use AppBundle\Event\Model\Planning;
use AppBundle\Event\Model\Repository\TalkRepository;
use AppBundle\Event\Model\Speaker;
use AppBundle\Event\Model\Talk;
Expand Down Expand Up @@ -56,6 +57,8 @@ public function exportJoindIn(Event $event, \SplFileObject $toFile): void

$toFile->fputcsv(['Title','Description','Speaker','Date','Time','Type'], escape: '\\');

$timezone = new \DateTimeZone(Planning::TIMEZONE);

foreach ($talkAggregates as $talkAggregate) {

// Gestion de la description
Expand All @@ -72,6 +75,11 @@ public function exportJoindIn(Event $event, \SplFileObject $toFile): void
}
$speakers = implode(',', $speakers);

// Gestion des horaires : stockés en timestamp, ils sont exportés dans la
// timezone de l'événement et non dans celle du serveur.
$start = $talkAggregate->planning?->getStart();
$start = $start === null ? null : \DateTimeImmutable::createFromInterface($start)->setTimezone($timezone);

// Gestion du type de conférence
if ($talkAggregate->planning?->getIsKeynote()) {
$type = 'Keynote';
Expand All @@ -85,8 +93,8 @@ public function exportJoindIn(Event $event, \SplFileObject $toFile): void
$talkAggregate->talk->getTitle(),
$abstract,
$speakers,
$talkAggregate->planning?->getStart()?->format('Y-m-d'),
$talkAggregate->planning?->getStart()?->format('H:i'),
$start?->format('Y-m-d'),
$start?->format('H:i'),
$type,
], escape: '\\');
}
Expand Down
4 changes: 2 additions & 2 deletions templates/blog/program.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<h4>{{ talk.talk.title|raw }}</h4>
{% if talk.planning is not null and event.isPlanningDisplayable %}
<span class="salle">{{ talk.room.name }}</span>
{{ talk.planning.start|date('d/m/Y') }}
{{ talk.planning.start|date('d/m/Y', planning_timezone) }}
<strong>
{{ talk.planning.start|date('H:i') }}-{{ talk.planning.end|date('H:i') }}
{{ talk.planning.start|date('H:i', planning_timezone) }}-{{ talk.planning.end|date('H:i', planning_timezone) }}
</strong>
- Niveau : {{ talk.talk.skillTranslationKey|trans }}
{% if talk.talk.languageCode %}- {{ talk.talk.languageLabel }}{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions templates/blog/talk.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
{% if talks_info.event.isPlanningDisplayable %}
<td width="20%" style="vertical-align: middle; text-align: center">
{{ talks_info.room.name }}<br />
{{ talks_info.planning.start|date('d/m/Y') }}<br />
{{ talks_info.planning.start|date('H:i') }}-{{ talks_info.planning.end|date('H:i') }}
{{ talks_info.planning.start|date('d/m/Y', planning_timezone) }}<br />
{{ talks_info.planning.start|date('H:i', planning_timezone) }}-{{ talks_info.planning.end|date('H:i', planning_timezone) }}
</td>
{% endif %}
</tr>
Expand Down
4 changes: 2 additions & 2 deletions templates/event/session/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
<br/>

{% if session.planning %}
<em>{{ session.planning.start|date("d/m/Y", timezone) }}</em> /
{{ session.planning.start|date("H:i", timezone) }} - {{ session.planning.end|date("H:i", timezone) }} / {{ session.room ? session.room.name }}
<em>{{ session.planning.start|date("d/m/Y", planning_timezone) }}</em> /
{{ session.planning.start|date("H:i", planning_timezone) }} - {{ session.planning.end|date("H:i", planning_timezone) }} / {{ session.room ? session.room.name }}
{% else %}
<span class="ui yellow label">non planifié</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/event/speaker/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<i>
{% if talk_info.planning %}
{% if talk_info.room %}({{ talk_info.room.name }}){% endif %}
({{ talk_info.planning.start|format_datetime('full', 'short') }})
({{ talk_info.planning.start|format_datetime('full', 'short', timezone=planning_timezone) }})
{% else %}
(salle et dates de passage à venir)
{% endif %}
Expand Down
Loading