report_users_issues_projects_links.diff

Jérôme BATAILLE, 2012-01-13 15:42

Download (1.57 KB)

View differences:

app/views/time_entry_reports/_report_criteria.rhtml (copie de travail)
13 13
<%
14 14
    #Criterias header columns
15 15
-%>
16
  <%= '<td></td>' * level %><td><%= h(format_criteria_value(criterias[level], value)) %></td><%= '<td></td>' * (criterias.size - level - 1) %>
16
  <%= '<td></td>' * level %><td><%= h(format_criteria_value(criterias[level], value, true)) %></td><%= '<td></td>' * (criterias.size - level - 1) %>
17 17
<%
18 18

  
19 19
    total = 0
app/helpers/timelog_helper.rb (copie de travail)
147 147
    export
148 148
  end
149 149

  
150
  def format_criteria_value(criteria, value)
150
  def format_criteria_value(criteria, value, links=false)
151 151
    if value.blank?
152 152
      l(:label_none)
153 153
    elsif k = @available_criterias[criteria][:klass]
154 154
      obj = k.find_by_id(value.to_i)
155 155
      if obj.is_a?(Issue)
156
        obj.visible? ? "#{obj.tracker} ##{obj.id}: #{obj.subject}" : "##{obj.id}"
157
      elsif obj.is_a?(User)
158
        return link_to(h(obj.to_s), obj)
156
        obj.visible? ? "#{obj.tracker} #{( links ? link_to("##{obj.id}", issue_path(obj.id)) : "##{obj.id}" )}: #{h(obj.subject)}".html_safe : "##{obj.id}"
157
      elsif links && (obj.is_a?(User) || obj.is_a?(Project))
158
        link_to(h(obj.to_s), obj)
159 159
      else
160 160
        obj
161 161
      end