Simple time tracking functionality added. Time can be logged at issue or project level.
There's no aggregation reports for now, it's just possible to see all time entries for a project or an issue. A new "activities" enumeration is added. Permission for a role to log time must be set (new "Time tracking" section in role permissions screen). git-svn-id: http://redmine.rubyforge.org/svn/trunk@368 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? @issue.fixed_version.name : "-" %></td>
|
||||
<td></td><td></td>
|
||||
<td><b><%=l(:label_spent_time)%> :</b></td>
|
||||
<td><%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<% n = 0
|
||||
@@ -51,6 +52,7 @@ end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit' %>
|
||||
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
|
||||
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<h2><%=l(:label_report_plural)%></h2>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:label_query_new), {:controller => 'projects', :action => 'add_query', :id => @project}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
@@ -11,6 +12,16 @@
|
||||
<li><%= link_to query.name, :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => query %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="splitcontentright">
|
||||
<% if @total_hours %>
|
||||
<h3 class="textright"><%= l(:label_spent_time) %>:
|
||||
<%= link_to(lwr(:label_f_hour, @total_hours), {:controller => 'timelog', :action => 'details', :project_id => @project}, :class => 'icon icon-time') %>
|
||||
</h3>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<h3><%=l(:field_tracker)%> <%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time' %>
|
||||
</div>
|
||||
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<h3><%= link_to(@project.name, {:action => 'details', :project_id => @project}) if @project %>
|
||||
<%= "/ " + link_to("#{@issue.tracker.name} ##{@issue.id}", {:action => 'details', :issue_id => @issue }) + ": #{h(@issue.subject)}" if @issue %></h3>
|
||||
|
||||
<h3 class="textright"><%= l(:label_total) %>: <%= lwr(:label_f_hour, @total_hours) %></h3>
|
||||
|
||||
<% unless @entries.empty? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<%= sort_header_tag('spent_on', :caption => l(:label_date)) %>
|
||||
<%= sort_header_tag('user_id', :caption => l(:label_member)) %>
|
||||
<%= sort_header_tag('activity_id', :caption => l(:label_activity)) %>
|
||||
<%= sort_header_tag('issue_id', :caption => l(:label_issue)) %>
|
||||
<th><%= l(:label_comment) %></th>
|
||||
<%= sort_header_tag('hours', :caption => l(:field_hours)) %>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @entries.each do |entry| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td align="center"><%= format_date(entry.spent_on) %></td>
|
||||
<td align="center"><%= entry.user.name %></td>
|
||||
<td align="center"><%= entry.activity.name %></td>
|
||||
<td align="center">
|
||||
<% if entry.issue %>
|
||||
<div class="tooltip">
|
||||
<%= link_to "#{entry.issue.tracker.name} ##{entry.issue.id}", {:action => 'details', :issue_id => entry.issue } %>
|
||||
<span class="tip">
|
||||
<%= render :partial => "issues/tooltip", :locals => { :issue => entry.issue }%>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%=h entry.comment %></td>
|
||||
<td align="center"><strong><%= entry.hours %></strong></td>
|
||||
<td align="center"><%= link_to_if_authorized(l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => entry}, :class => "icon icon-edit") if entry.user_id == @owner_id %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbdoy>
|
||||
</table>
|
||||
|
||||
<div class="contextual">
|
||||
<%= l(:label_export_to) %>
|
||||
<%= link_to 'CSV', params.update(:export => 'csv'), :class => 'icon icon-csv' %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,23 @@
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :time_entry, @time_entry, :url => {:action => 'edit', :project_id => @time_entry.project} do |f| %>
|
||||
<%= error_messages_for 'time_entry' %>
|
||||
|
||||
<div class="box">
|
||||
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
|
||||
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
||||
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
|
||||
<p><%= f.text_field :comment, :size => 100 %></p>
|
||||
<p><%= f.select :activity_id, (@activities.collect {|p| [p.name, p.id]}), :required => true %></p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'calendar/calendar' %>
|
||||
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||||
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||||
<%= stylesheet_link_tag 'calendar' %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user