Object comment snippet now fits the other components

This commit is contained in:
Thomas Gelf 2014-03-06 19:06:14 +00:00
parent ef71f22b7f
commit f929b15651
1 changed files with 39 additions and 56 deletions

View File

@ -1,6 +1,5 @@
<?php <?php
/** @var Zend_View_Helper_CommandForm $cf */
$cf = $this->getHelper('CommandForm'); $cf = $this->getHelper('CommandForm');
$data = array('host' => $object->host_name); $data = array('host' => $object->host_name);
@ -8,59 +7,43 @@ if ($object->service_description) {
$data['service'] = $object->service_description; $data['service'] = $object->service_description;
} }
?> $list = array();
<div> foreach ($object->comments as $comment) {
<div class="panel-heading">
<div class="panel-hostname">
Comments
<?php
?>
<div class="pull-right">
<a rel="tooltip" title="Add a comment" href="<?= $this->href('monitoring/command/addComment', $data) ?>" class="btn-common btn-small button"><?=
$this->img('img/icons/comment.png')
?></a>
<a rel="tooltip" title="Send custom notification" href="<?= $this->href('monitoring/command/sendCustomNotification', $data
) ?>" class="btn-common btn-small button">
<?= $this->img('img/icons/notification.png') ?>
</a>
</div>
</div>
</div>
<hr class="separator" />
<div class="panel-body">
<table class="table table-condensed table-detail">
<tbody>
<?php if (empty($object->comments)): ?>
<tr>
<td>No comments</td>
</tr>
<?php endif; ?>
<?php foreach ($object->comments as $comment): ?>
<tr>
<td>
<div class="pull-right">
<?php
$deleteData = $data;
$deleteData['commentid'] = $comment->comment_internal_id;
echo $cf->iconSubmitForm( // Ticket hook sample
'img/icons/remove.png', $text = $this->tickets ? preg_replace_callback(
'Remove comment', $this->tickets->getPattern(),
'btn-small', array($this->tickets, 'createLink'),
'removecomment', $this->escape($comment->comment_data)
$deleteData ) : $this->escape($comment->comment_data);
);
?> $deleteData = $data;
</div> $deleteData['commentid'] = $object->comment_internal_id;
<?= $this->escape($comment->comment_author); ?>, <?= $comment->comment_type; ?>
(<?= $this->format()->timeSince($comment->comment_timestamp); ?>) $iconForm = $cf->iconSubmitForm(
<div class="small-row"> 'img/icons/remove.png',
<?= $this->escape($comment->comment_data); ?> 'Remove comment',
</div> 'btn-small',
</td> 'removecomment',
</tr> $deleteData
<?php endforeach; ?> );
</tbody>
</table> $list[] = sprintf(
</div> "<br />%s [%s] %s (%s): %s\n",
</div> //'<input type="submit" value="x" style="width: 2em" />',
'<a href="#">' . $this->icon('remove_petrol.png') . '</a>' . $iconForm, // Test
$this->escape($comment->comment_author),
$this->timeSince($comment->comment_timestamp),
$comment->comment_type,
$text
);
}
?>
<tr>
<th><?= $this->translate('Comments') ?></th>
<td>
<a href="<?= $this->href('monitoring/command/addComment', $data) ?>"><?= $this->icon('comment_petrol.png') ?> <?= $this->translate('Add comment') ?></a>
<?= implode('', $list) ?>
</td>
</tr>