From dd40dcdf97b06460d099f585c7c1276d18a86f02 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 4 Jan 2012 14:38:54 +0100 Subject: [PATCH] Fix #154 : short history of record are missing authors of actions --- lib/classes/record/preview.class.php | 8 +++++++- templates/web/prod/preview/short_history.html | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/classes/record/preview.class.php b/lib/classes/record/preview.class.php index 53cd339888..330e9e0edf 100644 --- a/lib/classes/record/preview.class.php +++ b/lib/classes/record/preview.class.php @@ -375,8 +375,14 @@ class record_preview extends record_adapter $tab[$hour][$site][$action] = array(); if (!isset($tab[$hour][$site][$action][$row['usr_id']])) + { $tab[$hour][$site][$action][$row['usr_id']] = - array('final' => array(), 'comment' => array()); + array( + 'final' => array() + , 'comment' => array() + , 'user' => \User_Adapter::getInstance($row['usr_id'], $appbox) + ); + } if (!in_array($row['final'], $tab[$hour][$site][$action][$row['usr_id']]['final'])) $tab[$hour][$site][$action][$row['usr_id']]['final'][] = diff --git a/templates/web/prod/preview/short_history.html b/templates/web/prod/preview/short_history.html index 2292814be0..5386068f8f 100644 --- a/templates/web/prod/preview/short_history.html +++ b/templates/web/prod/preview/short_history.html @@ -3,7 +3,7 @@ {% for hour, sites in record.get_short_history() %} {% for site, actions in sites %} {% for action, users in actions %} - {% for current_user, done in users %} + {% for done in users %}
@@ -55,9 +55,9 @@ {% endif %} {% if user.ACL().has_right_on_base(record.get_base_id(), 'canreport') %} - {% set user_infos = user.getInfos(current_user) %} - {% if current_user != session.get_usr_id() and user_infos %} - {% trans %}report:: par {{user_infos}}{% endtrans %} + {% if done['user'].get_id() != session.get_usr_id() %} + {% set user_infos = done['user'].get_display_name() %} + {% trans %}report:: par {{ user_infos }}{% endtrans %} {% endif %} {% endif %}