OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/cost_reports/index.rhtml

53 lines
1.2 KiB

<% if @custom_error %>
<div class="flash error"><%= @custom_error %></div>
<% end %>
<% @query = CostQuery.new
@query.group_by :issue_id
@query.column :tweek
@query.row :project_id
@query.row :user_id
@walker = @query.walker
@row = @walker.row_first
@column = @walker.column_first %>
<h1>Die sch&ouml;ne Tabelle:</h1>
<%
data = @query.walk(:column_first) do |current, sub|
list = [current.inspect]
list.push(*sub.map { |e| "&gt;#{e}" }) if sub
list
end
%>
<pre><%= data.join "\n" %></pre>
<div style="border-width: 1; background-color: #BBB; padding: 5px">
query chain: <br />
<ul>
<% chain = @query.chain
while chain %>
<li><%= chain.class.to_s %></li>
<% chain = chain.child
end %>
</ul>
<% max = 20 %>
Result (row):
<pre><% @row.recursive_each_with_level do |l, r| %>
<%= "#{'| '*l}#{r.class} (#{r.fields}) # size:#{r.size}" %><% max -=1; break if max <= 0; end %>
...
</pre>
<% max = 20 %>
Result (column):
<pre><% @column.recursive_each_with_level do |l, r| %>
<%= "#{'| '*l}#{r.class} (#{r.fields}) # size:#{r.size}" %><% max -=1; break if max <= 0; end %>
...
</pre>
SQL statement: <br />
<pre><%= @query.sql_statement.to_s %></pre>
</div>