/
index.html.php
executable file
·81 lines (75 loc) · 3.29 KB
/
index.html.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/*
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
if ($item = ((isset($event['extra'])) ? $event['extra']['stat'] : false)): ?>
<p>
<?php if (!empty($item['isFailed'])) : ?>
<?php if (isset($item['openDetails']['bounces'])): ?>
<span class="label label-warning" data-toggle="tooltip" title="<?php echo $view['translator']->trans('mautic.email.timeline.event.bounced'); ?>">
<?php echo $view['translator']->trans('mautic.email.timeline.event.bounced'); ?>
</span>
<?php else : ?>
<?php echo $view['translator']->trans('mautic.email.timeline.event.failed'); ?>
<?php endif; ?>
<?php elseif (empty($item['dateRead'])) : ?>
<?php echo $view['translator']->trans('mautic.email.timeline.event.not.read'); ?>
<?php else : ?>
<?php echo $view['translator']->trans(
'mautic.email.timeline.event.'.$event['extra']['type'],
[
'%date%' => $view['date']->toFull($event['timestamp']),
'%interval%' => $view['date']->formatRange($event['timestamp']),
'%sent%' => $view['date']->toFull($item['dateSent']),
]
); ?>
<?php endif; ?>
<?php if (!empty($item['viewedInBrowser'])) : ?>
<?php echo $view['translator']->trans('mautic.email.timeline.event.viewed.in.browser'); ?>
<?php endif; ?>
<?php if (!empty($item['retryCount'])) : ?>
<?php echo $view['translator']->trans(
'mautic.email.timeline.event.retried',
['%count%' => $item['retryCount']]
); ?>
<?php endif; ?>
<?php if (!empty($item['list_name'])) : ?>
<?php echo $view['translator']->trans('mautic.email.timeline.event.list', ['%list%' => $item['list_name']]); ?>
<?php endif; ?>
</p>
<div class="small">
<?php
if (isset($item['openDetails']['bounces'])):
unset($item['openDetails']['bounces']);
endif;
?>
<?php if (!empty($item['openDetails'])): ?>
<h6 class="mt-lg mb-sm"><strong><?php echo $view['translator']->trans('mautic.email.timeline.open_details'); ?></strong></h6>
<?php
$counter = 1;
foreach ($item['openDetails'] as $detail):
if (empty($showMore) && $counter > 5):
$showMore = true;
echo '<div style="display:none">';
endif;
?>
<?php if ($counter > 1): ?><hr/><?php endif; ?>
<strong><?php echo $view['date']->toText($detail['datetime'], 'UTC'); ?></strong><br/><?php echo $view->escape($detail['useragent']); ?>
<?php ++$counter; ?>
<?php endforeach; ?>
<?php
if (!empty($showMore)):
echo '</div>';
echo '<a href="javascript:void(0);" class="text-center small center-block mt-xs" onclick="Mautic.toggleTimelineMoreVisiblity(mQuery(this).prev());">';
echo $view['translator']->trans('mautic.core.more.show');
echo '</a>';
endif;
?>
<?php endif; ?>
</div>
<?php endif; ?>