backlog 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +14 -1
- data/app/controllers/estimates_controller.rb +1 -1
- data/app/controllers/periods_controller.rb +1 -1
- data/app/controllers/tasks_controller.rb +1 -1
- data/app/controllers/works_controller.rb +1 -0
- data/app/models/estimate.rb +2 -1
- data/app/models/task.rb +11 -9
- data/app/models/work.rb +4 -4
- data/app/views/tasks/list_started.rhtml +1 -1
- data/app/views/works/_form.rhtml +2 -2
- data/app/views/works/weekly_work_sheet.rhtml +1 -0
- data/lang/en.yaml +1 -0
- data/lang/no.yaml +1 -0
- data/test/fixtures/estimates.yml +1 -0
- data/test/functional/tasks_controller_test.rb +4 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
-
== 0.10.
|
1
|
+
== 0.10.5 2007-09-25
|
2
|
+
|
3
|
+
=== Fixes
|
4
|
+
|
5
|
+
* Changed so that when specifying a task, only one subtask is created.
|
6
|
+
* Fixed bug in creation of estimates for subtasks.
|
7
|
+
* Corrected list work for period.
|
8
|
+
* Changed to group work done by start time instead of end time.
|
9
|
+
* Fixed bug in listing started subtasks.
|
10
|
+
* Added link to task from edit work view.
|
11
|
+
* Added backlog and super task names in drop down in new work view.
|
12
|
+
* Added edit link in weekly work sheet.
|
13
|
+
|
14
|
+
== 0.10.4 2007-09-24
|
2
15
|
|
3
16
|
=== Features
|
4
17
|
|
@@ -14,7 +14,7 @@ class EstimatesController < ApplicationController
|
|
14
14
|
render :file => "public/500.html", :layout => true, :status => 500
|
15
15
|
return
|
16
16
|
end
|
17
|
-
redirect_to :controller => 'periods', :action => :show, :id => @task.period, :task_id => @task.id
|
17
|
+
redirect_to :controller => 'periods', :action => :show, :id => @task.root_task.period, :task_id => @task.id
|
18
18
|
else
|
19
19
|
@task.errors.add :task, 'Estimate is missing.'
|
20
20
|
render :file => "public/500.html", :layout => true, :status => 500
|
@@ -104,7 +104,7 @@ class PeriodsController < ApplicationController
|
|
104
104
|
|
105
105
|
def list_work
|
106
106
|
@period = Period.find(params[:id])
|
107
|
-
@works =
|
107
|
+
@works = @period.tasks.map {|t| t.works}.flatten.sort_by {|w| w.completed_at}
|
108
108
|
render :template => '/works/list'
|
109
109
|
end
|
110
110
|
|
@@ -274,7 +274,7 @@ class TasksController < ApplicationController
|
|
274
274
|
parent_task = Task.find(params[:id])
|
275
275
|
raise "Task is not open" unless parent_task.active? && (parent_task.period.nil? || parent_task.period.active_or_future?)
|
276
276
|
if parent_task.children.empty?
|
277
|
-
subtask_estimate = (parent_task.todo
|
277
|
+
subtask_estimate = (parent_task.todo).ceil
|
278
278
|
no_of_subtasks = (parent_task.todo / subtask_estimate).to_i
|
279
279
|
subtask_estimate = parent_task.todo / no_of_subtasks
|
280
280
|
(1..no_of_subtasks).each do |index|
|
data/app/models/estimate.rb
CHANGED
data/app/models/task.rb
CHANGED
@@ -52,14 +52,8 @@ class Task < ActiveRecord::Base
|
|
52
52
|
user_clause = " OR user_id = #{current_user.id}"
|
53
53
|
end
|
54
54
|
conditions = "completed_at IS NULL AND (user_id IS NULL#{user_clause})"
|
55
|
-
Work.find(:all, :conditions => conditions).map {|work| work.task}.
|
56
|
-
|
57
|
-
backlog_sort
|
58
|
-
elsif (period_sort = t1.period.end_on <=> t2.period.end_on) != 0
|
59
|
-
period_sort
|
60
|
-
else
|
61
|
-
t1.position <=> t2.position
|
62
|
-
end
|
55
|
+
Work.find(:all, :conditions => conditions).map {|work| work.task}.sort_by do |t|
|
56
|
+
[t.root_task.backlog.name, t.root_task.period.end_on, t.position || 0]
|
63
57
|
end
|
64
58
|
end
|
65
59
|
|
@@ -353,5 +347,13 @@ class Task < ActiveRecord::Base
|
|
353
347
|
end
|
354
348
|
started_works.select {|work| work.user.nil?}.last
|
355
349
|
end
|
356
|
-
|
350
|
+
|
351
|
+
def description_with_parents
|
352
|
+
if parent.nil?
|
353
|
+
"#{backlog.name}: #{description}"
|
354
|
+
else
|
355
|
+
"#{parent.description_with_parents} - #{description}"
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
357
359
|
end
|
data/app/models/work.rb
CHANGED
@@ -28,10 +28,10 @@ class Work < ActiveRecord::Base
|
|
28
28
|
def self.works_for_week(week_no, user = current_user)
|
29
29
|
first = Date.commercial(Date.today.year, week_no, 1)
|
30
30
|
last = first + 7
|
31
|
-
works = find(:all, :conditions => "completed_at BETWEEN '#{first.to_time.iso8601}' AND '#{last.to_time.iso8601}'", :order => '
|
31
|
+
works = find(:all, :conditions => "completed_at IS NOT NULL AND started_at BETWEEN '#{first.to_time.iso8601}' AND '#{last.to_time.iso8601}'", :order => 'started_at')
|
32
32
|
length = 0
|
33
33
|
works_per_day = (0..6).map do |day|
|
34
|
-
works_for_day = works.select {|work| work.
|
34
|
+
works_for_day = works.select {|work| work.started_at.to_date == (first + day) && (work.user_id.nil? || (user && work.user_id == user.id)) }
|
35
35
|
length = [length, works_for_day.length].max
|
36
36
|
works_for_day
|
37
37
|
end
|
@@ -47,12 +47,12 @@ class Work < ActiveRecord::Base
|
|
47
47
|
def self.work_totals_for_week(week_no, user_id = current_user)
|
48
48
|
first = Date.commercial(Date.today.year, week_no, 1)
|
49
49
|
last = first + 7
|
50
|
-
works = find(:all, :conditions => "completed_at BETWEEN '#{first.to_time.iso8601}' AND '#{last.to_time.iso8601}'", :order => '
|
50
|
+
works = find(:all, :conditions => "completed_at IS NOT NULL AND started_at BETWEEN '#{first.to_time.iso8601}' AND '#{last.to_time.iso8601}'", :order => 'started_at')
|
51
51
|
totals_per_backlog = {}
|
52
52
|
Backlog.find(:all).each do |backlog|
|
53
53
|
totals_per_backlog[backlog.id] = [[], []]
|
54
54
|
(0..6).each do |day|
|
55
|
-
works_for_day = works.select {|work| (work.task.backlog == backlog) && (work.
|
55
|
+
works_for_day = works.select {|work| (work.task.backlog == backlog) && (work.started_at.to_date == (first + day)) && (user_id && work.user_id == user_id) }
|
56
56
|
invoice_works_for_day = works_for_day.select {|work| work.invoice? }
|
57
57
|
internal_works_for_day = works_for_day.select {|work| !work.invoice? }
|
58
58
|
|
@@ -47,7 +47,7 @@ function handleEvent(field, event, id) {
|
|
47
47
|
<% end %>
|
48
48
|
<% if task.period != current_period %>
|
49
49
|
<tr><th colspan="6"><%=task.period ? h(task.period.name) : l(:unplanned_tasks)%></th></tr>
|
50
|
-
<%= render :partial => '/tasks/fields_header', :locals => {:backlog => task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
|
50
|
+
<%= render :partial => '/tasks/fields_header', :locals => {:backlog => task.root_task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
|
51
51
|
<% current_period = task.period %>
|
52
52
|
<% end %>
|
53
53
|
<%=render :partial => 'task', :locals => { :task => task, :i => i, :active => true, :highlight_task => (task == @selected_task), :update => :spotlight } %>
|
data/app/views/works/_form.rhtml
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
<p><%=l :task%>:<br/>
|
6
6
|
<% if @work.task %>
|
7
|
-
<h4><%= @work.task.description %></h4></p>
|
7
|
+
<h4><%=link_to @work.task.description, :controller => 'tasks', :action => :edit, :id => @work.task.id %></h4></p>
|
8
8
|
<%= hidden_field 'work', 'task_id' %>
|
9
9
|
<% else %>
|
10
|
-
<%= select 'work', 'task_id', @tasks.map{|task| [task.
|
10
|
+
<%= select 'work', 'task_id', @tasks.map{|task| [task.description_with_parents, task.id]}.sort %></p>
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<% if @work.task.nil? || @work.task.track_times?%>
|
@@ -58,6 +58,7 @@ end %>]
|
|
58
58
|
<%=link_to(h(@work.task.period.name), :controller => 'periods', :action => :show, :id => @work.task.period) if @work.task.period %>
|
59
59
|
<%=link_to(h(@work.task.root_task.backlog.name), :controller => 'backlogs', :action => :show, :id => @work.task.root_task.backlog) %>
|
60
60
|
<%=link_to(h(@work.task.description), :controller => 'periods', :action => :show, :id => @work.task.period, :task_id => @work.task.id) %>
|
61
|
+
<%=link_to(l(:edit), :controller => 'works', :action => :edit, :id => @work.id) %>
|
61
62
|
</td>
|
62
63
|
<% if invoicing %>
|
63
64
|
<td id="invoice_<%=@work.id%>">
|
data/lang/en.yaml
CHANGED
data/lang/no.yaml
CHANGED
data/test/fixtures/estimates.yml
CHANGED
@@ -110,7 +110,10 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_specify
|
113
|
-
post :specify, "id"=>
|
113
|
+
post :specify, "id" => tasks(:another).id.to_s
|
114
|
+
|
115
|
+
after = Task.find(tasks(:another))
|
116
|
+
assert_equal 1, after.children.size
|
114
117
|
end
|
115
118
|
|
116
119
|
def test_specify_passed_period
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: backlog
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.10.
|
7
|
-
date: 2007-09-
|
6
|
+
version: 0.10.5
|
7
|
+
date: 2007-09-25 00:00:00 +02:00
|
8
8
|
summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
|
9
9
|
require_paths:
|
10
10
|
- lib
|