From f929b156517573d7c30531888dcefa30fc44cbef Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 6 Mar 2014 19:06:14 +0000 Subject: [PATCH] Object comment snippet now fits the other components --- .../scripts/show/components/comments.phtml | 95 ++++++++----------- 1 file changed, 39 insertions(+), 56 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index 2be2f49f8..c142d7e5d 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -1,6 +1,5 @@ getHelper('CommandForm'); $data = array('host' => $object->host_name); @@ -8,59 +7,43 @@ if ($object->service_description) { $data['service'] = $object->service_description; } -?> -
- -
-
- - - comments)): ?> - - - - - comments as $comment): ?> - - - - - -
No comments
-
- comment_internal_id; +$list = array(); +foreach ($object->comments as $comment) { - echo $cf->iconSubmitForm( - 'img/icons/remove.png', - 'Remove comment', - 'btn-small', - 'removecomment', - $deleteData - ); - ?> -
- escape($comment->comment_author); ?>, comment_type; ?> - (format()->timeSince($comment->comment_timestamp); ?>) -
- escape($comment->comment_data); ?> -
-
-
-
+ // Ticket hook sample + $text = $this->tickets ? preg_replace_callback( + $this->tickets->getPattern(), + array($this->tickets, 'createLink'), + $this->escape($comment->comment_data) + ) : $this->escape($comment->comment_data); + + $deleteData = $data; + $deleteData['commentid'] = $object->comment_internal_id; + + $iconForm = $cf->iconSubmitForm( + 'img/icons/remove.png', + 'Remove comment', + 'btn-small', + 'removecomment', + $deleteData + ); + + $list[] = sprintf( + "
%s [%s] %s (%s): %s\n", + //'', + '' . $this->icon('remove_petrol.png') . '' . $iconForm, // Test + $this->escape($comment->comment_author), + $this->timeSince($comment->comment_timestamp), + $comment->comment_type, + $text + ); +} + +?> + + translate('Comments') ?> + + icon('comment_petrol.png') ?> translate('Add comment') ?> + + +