summaryrefslogtreecommitdiffstats
path: root/app/views/timelog
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 12:22:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 12:22:31 +0000
commit8d54d9700746636849bd104f4d18db479492505e (patch)
treea8d9c209a929b2c6a63dbbf2cbc7f717d264ad6f /app/views/timelog
parent7cf2d889d8866226378db250a2c7ec2fc77ef9fc (diff)
downloadredmine-8d54d9700746636849bd104f4d18db479492505e.tar.gz
redmine-8d54d9700746636849bd104f4d18db479492505e.zip
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
Diffstat (limited to 'app/views/timelog')
-rw-r--r--app/views/timelog/details.rhtml51
-rw-r--r--app/views/timelog/edit.rhtml23
2 files changed, 74 insertions, 0 deletions
diff --git a/app/views/timelog/details.rhtml b/app/views/timelog/details.rhtml
new file mode 100644
index 000000000..f85eb0f5a
--- /dev/null
+++ b/app/views/timelog/details.rhtml
@@ -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 %> \ No newline at end of file
diff --git a/app/views/timelog/edit.rhtml b/app/views/timelog/edit.rhtml
new file mode 100644
index 000000000..b826f7be7
--- /dev/null
+++ b/app/views/timelog/edit.rhtml
@@ -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 %> \ No newline at end of file