2014-08-13 Junichi Satoh <junichi@rworks.jp>

* 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
This commit is contained in:
jsatoh 2014-08-13 01:57:55 +00:00
parent 5a2102f26c
commit 05705a62fe
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2014-08-13 Junichi Satoh <junichi@rworks.jp>
* mobile/operation/events.php: Improved to show event comment.
2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
* index.php, operation/agentes/ver_agente.php,

View File

@ -261,6 +261,25 @@ class Events {
if (empty($event["tags"])) {
$event["tags"] = '<i>'.__('N/A').'</i>';
}
$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 = '<i>'.__('N/A').'</i>';
} 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", "<br>", $c['comment']);
$comment .= '<br>' . $c['comment'] . '<br>';
}
}
$event["comments"] = $comment;
echo json_encode(array('correct' => 1, 'event' => $event));
}
@ -486,6 +505,10 @@ class Events {
<th><?php echo __('Tags');?></th>
<td class="cell_event_tags"></td>
</tr>
<tr class="event_comments">
<th><?php echo __('Comments');?></th>
<td class="cell_event_comments"></td>
</tr>
</tbody>
</table>
<?php
@ -828,6 +851,9 @@ class Events {
.html(event[\"group\"]);
$(\"#detail_event_dialog .cell_event_tags\")
.html(event[\"tags\"]);
$(\"#detail_event_dialog .cell_event_comments\")
.html(event[\"comments\"]);
$(\"#detail_event_dialog .cell_agent\")
.html(event[\"agent\"]);