summaryrefslogtreecommitdiffstats
path: root/modules/monitoring/application/views/scripts/downtime/show.phtml
blob: 4db03cbaea2df1096a731b31e1ff77d2f21b97c0 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<div class="controls">
    <?php if (! $this->compact): ?>
        <?= $this->tabs; ?>
    <?php endif ?>

    <table>
      <tr> <?= $this->render('partials/downtime/downtime-header.phtml'); ?> </tr>
    </table>
</div>
<div class="content"><h2><?= $this->translate('Details') ?></h2>
  <table class="name-value-table">
    <tbody>
      <tr>
        <th>
            <?= $this->isService ? $this->translate('Service') : $this->translate('Host') ?>
        </th>
        <td data-base-target="_next">
          <?php if ($this->isService): ?>
          <?php
              $link = $this->link()->service(
                   $downtime->service_description,
                   $downtime->service_display_name,
                   $downtime->host_name,
                   $downtime->host_display_name
              );
              $icon = $this->icon('service', $this->translate('Service'));
           ?>
          <?php else: ?>
          <?php
              $icon = $this->icon('host', $this->translate('Host'));
              $link = $this->link()->host($downtime->host_name, $downtime->host_display_name)
          ?>
          <?php endif ?>
          <?= $icon ?>
          <?= $link ?>
        </td>
      </tr>
      <tr title="<?= $this->translate('The name of the person who scheduled this downtime'); ?>">
        <th><?= $this->translate('Author') ?></th>
        <td><?= $this->icon('user', $this->translate('User')) ?> <?= $this->escape($this->downtime->author_name) ?></td>
      </tr>
      <tr title="<?= $this->translate('Date and time this downtime was entered'); ?>">
          <th><?= $this->translate('Entry Time') ?></th>
          <td><?= $this->formatDateTime($this->downtime->entry_time) ?></td>
      </tr>
      <tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
        <th><?= $this->translate('Comment') ?></th>
        <td><?= $this->nl2br($this->createTicketLinks($this->markdown($downtime->comment))) ?></td>
      </tr>
    </tbody>
  </table>

  <h2> <?= $this->translate('Duration') ?> </h2>

  <table class="name-value-table">
    <tbody>
      <tr class="newsection">
        <th><?= $this->escape(
            $this->downtime->is_flexible ?
            $this->translate('Flexible') : $this->translate('Fixed')
          );  ?>
            <?= $this->icon('info-circled', $this->downtime->is_flexible ?
                $this->translate('Flexible downtimes have a hard start and end time,'
                    . ' but also an additional restriction on the duration in which '
                    . ' the host or service may actually be down.') :
                $this->translate('Fixed downtimes have a static start and end time.')) ?>
        </th>
        <td>
            <?php if ($downtime->is_flexible): ?>
                <?php if ($downtime->is_in_effect): ?>
                    <?= sprintf(
                        $isService
                            ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
                            : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
                        $this->formatDate($downtime->start),
                        $this->formatTime($downtime->start),
                        $this->formatDuration($downtime->duration),
                        $this->formatDate($downtime->end),
                        $this->formatTime($downtime->end)
                    ) ?>
                <?php else: ?>
                    <?= sprintf(
                        $isService
                            ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
                            : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
                        $this->formatDateTime($downtime->scheduled_start),
                        $this->formatDateTime($downtime->scheduled_end),
                        $this->formatDuration($downtime->duration)
                    ) ?>
                <?php endif ?>
            <?php else: ?>
                <?php if ($downtime->is_in_effect): ?>
                    <?= sprintf(
                        $isService
                            ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
                            : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
                        $this->formatDate($downtime->start),
                        $this->formatTime($downtime->start),
                        $this->formatDate($downtime->end),
                        $this->formatTime($downtime->end)
                    ) ?>
                <?php else: ?>
                    <?= sprintf(
                        $isService
                            ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
                            : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
                        $this->formatDate($downtime->start),
                        $this->formatTime($downtime->start),
                        $this->formatDate($downtime->end),
                        $this->formatTime($downtime->end)
                    ) ?>
                <?php endif ?>
            <?php endif ?>
        </td>
      </tr>
      <tr title="<?= $this->translate('The date/time the scheduled downtime is'
              . ' supposed to start. If this is a flexible (non-fixed) downtime, '
              . 'this refers to the earliest possible time that the downtime'
              . ' can start'); ?>">
        <th><?= $this->translate('Scheduled start') ?></th>
        <td><?= $this->formatDateTime($this->downtime->scheduled_start) ?></td>
      </tr>
      <tr title="<?= $this->translate('The date/time the scheduled downtime is '
              . 'supposed to end. If this is a flexible (non-fixed) downtime, '
              . 'this refers to the last possible time that the downtime can '
              . 'start'); ?>">
        <th><?= $this->translate('Scheduled end') ?></th>
        <td><?= $this->formatDateTime($this->downtime->scheduled_end) ?></td>
      </tr>
      <?php if ($this->downtime->is_flexible): ?>
        <tr title="<?= $this->translate('Indicates the number of seconds that the '
                . 'scheduled downtime should last. This is usually only needed if'
                . ' this is a flexible downtime, which can start at a variable '
                . 'time, but lasts for the specified duration'); ?>">
          <th tit><?= $this->translate('Duration') ?></th>
          <td><?= $this->formatDuration($this->downtime->duration) ?></td>
        </tr>
        <tr title="<?= $this->translate('he date/time the scheduled downtime was'
                . ' actually started'); ?>">
           <th><?= $this->translate('Actual start time') ?></th>
           <td><?= $this->formatDateTime($downtime->start) ?></td>
         </tr>
         <tr title="<?= $this->translate('The date/time the scheduled downtime '
                 . 'actually ended'); ?>">
           <th><?= $this->translate('Actual end time') ?></th>
           <td><?= $this->formatDateTime($downtime->end) ?></td>
         </tr>
      <?php endif; ?>

      <tr class="newsection">
        <th><?= $this->translate('In effect') ?></th>
        <td>
        <?= $this->escape(
            $this->downtime->is_in_effect ?
            $this->translate('Yes') : $this->translate('No')
          );
        ?>
        </td>
      </tr>

      <?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
      <tr class="newsection">
        <th><?= $this->translate('Commands') ?></th>
        <td>
          <?= $delDowntimeForm ?>
        </td>
      </tr>
      <?php endif ?>
    </tbody>
  </table>

</div>