-
Notifications
You must be signed in to change notification settings - Fork 4
/
_disruption.php
13 lines (13 loc) · 1.78 KB
/
_disruption.php
1
2
3
4
5
6
7
8
9
10
11
12
13
<div data-line="<?php echo $disruption->getLigne()->getId() ?>" class="disruption <?php if($disruption->isInFuture()): ?>future<?php endif; ?> <?php if(!$disruption->isPast()): ?><?php echo $disruption->getCurrentColorClass() ?><?php endif; ?>">
<h4><img src="<?php echo $disruption->getLigne()->getImage(); ?>" /> <span><?php if($disruption->isPast()): ?>De <?php echo $disruption->getDateStart()->format("H\hi") ?> à <?php echo $disruption->getDateEnd()->format("H\hi") ?><?php elseif($disruption->isInProgress()): ?>Depuis <?php echo $disruption->getDateStart()->format("H\hi") ?><?php elseif($disruption->isInFuture()): ?>À <?php echo $disruption->getDateStart()->format("H\hi") ?> jusqu'à <?php echo $disruption->getDateEnd()->format("H\hi") ?><?php endif; ?></span> <?php if(strpos($disruption->getId(), 'distruption_id_calculate:') !== false && $disruption->getDateStart() > new DateTime('2024-11-28')): ?><span style="opacity: 0.75; float: right;"> ⚠️</span><?php endif; ?><span><?php if(!$disruption->isInFuture()): ?>⌛ <?php echo $disruption->getDuration()->format("%hh%I"); ?><?php endif; ?></span></h4>
<ul>
<?php if($disruption->getDateEnd() < new DateTime()): ?>
<li><span class="ok"></span> <strong><?php echo $disruption->getDateEnd()->format("H\hi") ?></strong> <span></span> <span><br /><br /></span>Fin de l'incident<p></p></li>
<?php endif; ?>
<?php foreach($disruption->getImpactsOptimized() as $i): ?>
<li><span class="<?php echo $i->getColorClass() ?>"></span> <strong><?php echo $i->getDateStart()->format("H\hi") ?></strong> <span>⌛ <?php echo $i->getDuration()->format("%hh%I"); ?></span><span><br /><br /></span><?php echo $i->getTitle() ?>
<p class="ellips"><?php echo nl2br(preg_replace("/[\n]+$/i", "", $i->getMessagePlainText())) ?></p>
</li>
<?php endforeach; ?>
</ul>
</div>