From 05705a62fe9b10edf3a508513ab93140b3ecb743 Mon Sep 17 00:00:00 2001 From: jsatoh Date: Wed, 13 Aug 2014 01:57:55 +0000 Subject: [PATCH] 2014-08-13 Junichi Satoh * mobile/operation/events.php: Improved to show event comment. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10411 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/mobile/operation/events.php | 26 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c63374166f..7b237cb62a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2014-08-13 Junichi Satoh + + * mobile/operation/events.php: Improved to show event comment. + 2014-08-12 Miguel de Dios * index.php, operation/agentes/ver_agente.php, diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index abc1994236..a070c3c389 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -261,6 +261,25 @@ class Events { if (empty($event["tags"])) { $event["tags"] = ''.__('N/A').''; } + + $event_comments = db_get_value('user_comment', 'tevento', 'id_evento', $id_event); + $event_comments_array = array(); + $event_comments_array = json_decode($event_comments, true); + // Support for new format only. + if (empty($event_comments_array)) { + $comment = ''.__('N/A').''; + } else { + $comment = ''; + $event_comments_array = array_reverse($event_comments_array); + foreach($event_comments_array as $c) { + $comment .= date ($system->getConfig("date_format"), $c['utimestamp']) . ' (' . $c['id_user'] . ')'; + $c['comment'] = io_safe_output($c['comment']); + $c['comment'] = str_replace("\n", "
", $c['comment']); + $comment .= '
' . $c['comment'] . '
'; + } + } + + $event["comments"] = $comment; echo json_encode(array('correct' => 1, 'event' => $event)); } @@ -486,6 +505,10 @@ class Events { + + + +