backlog 0.33.0 → 0.33.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ == 0.33.1 2008-05-28
2
+
3
+ === Fixes
4
+
5
+ * Added Work Account column to the work report.
6
+ * Changed work report to list times with 2 decimals and be right-aligned.
7
+ * Fixed missing response when updating an existing row in the daily work sheet.
8
+ * Fixed wrong date in the works excel export.
9
+ * Fixed typo in the header of the works list and excel export.
10
+ * Fixed filtering on works list and excel export to use work record start date instead of completetion date.
11
+ * Fixed bug where a display of a weekly work sheet for a non-existing user would produce an application error.
12
+
1
13
  == 0.33.0 2008-05-09
2
14
 
3
15
  == Features
@@ -242,8 +242,8 @@ class TasksController < ApplicationController
242
242
  'work[task_id]' => @task.id,
243
243
  'work[started_on]' => started_work.started_on.to_s,
244
244
  'work[start_time]' => started_work.start_time.to_s,
245
- 'work[completed_at]' => [next_quarter, started_work.started_on.at(started_work.start_time)].max.iso8601,
246
- 'work[hours]' => "%0.2f" % ((next_quarter - started_work.started_on.at(started_work.start_time)).to_f / 3600),
245
+ 'work[completed_at]' => [next_quarter, started_work.started_on.at(started_work.start_time || TimeOfDay.new(0, 0))].max.iso8601,
246
+ 'work[hours]' => "%0.2f" % ((next_quarter - started_work.started_on.at(started_work.start_time || TimeOfDay.new(0, 0))).to_f / 3600),
247
247
  'estimate[todo]' => @task.todo
248
248
  })
249
249
  else
@@ -15,13 +15,13 @@ class WorksController < ApplicationController
15
15
  :redirect_to => { :action => :list }
16
16
 
17
17
  def list
18
- work_account_name = (params[:work_account_id] && WorkAccount.find(params[:work_account_id]).name) || 'all accoutns'
18
+ work_account_name = (params[:work_account_id] && WorkAccount.find(params[:work_account_id]).name) || l(:all_accounts)
19
19
  @report_filter = WorksReportFilter.new(params[:report_filter])
20
20
  @report_filter.title = "#{l :hours} for #{work_account_name} #{@report_filter.start_on && @report_filter.start_on.strftime('%Y-%m-%d - ')}#{@report_filter.end_on && @report_filter.end_on.strftime('%Y-%m-%d')}"
21
21
  @period = params[:id] && Period.find(params[:id])
22
- @works = Work.paginate :conditions => ["completed_at BETWEEN ? AND ? #{'AND work_account_id = ?' if @report_filter.work_account_id} #{@report_filter.invoice.nil? ? '' : 'AND invoice = ?'} #{@report_filter.user_id.nil? ? '' : 'AND user_id = ?'}", @report_filter.start_on, @report_filter.end_on + 1, @report_filter.work_account_id, @report_filter.invoice, @report_filter.user_id].compact,
23
- :page => params[:page], :per_page => @report_filter.page_size,
24
- :order => 'started_on, start_time, completed_at'
22
+ @works = Work.paginate :conditions => ["started_on BETWEEN ? AND ? #{'AND work_account_id = ?' if @report_filter.work_account_id} #{@report_filter.invoice.nil? ? '' : 'AND invoice = ?'} #{@report_filter.user_id.nil? ? '' : 'AND user_id = ?'}", @report_filter.start_on, @report_filter.end_on, @report_filter.work_account_id, @report_filter.invoice, @report_filter.user_id].compact,
23
+ :page => params[:page], :per_page => @report_filter.page_size,
24
+ :order => 'started_on, start_time, completed_at'
25
25
  @work_accounts = WorkAccount.find(:all, :order => :name)
26
26
  @users = User.find(:all, :order => 'first_name, last_name')
27
27
  if params[:export] == 'excel'
@@ -198,7 +198,16 @@ class WorksController < ApplicationController
198
198
  @date = (params[:id] && Date.parse(params[:id])) || Date.today
199
199
  @year = @date.year
200
200
  @week = @date.cweek
201
- @user = (params[:user_id] && User.find(params[:user_id])) || current_user
201
+ if params[:user_id]
202
+ @user = User.find_by_id(params[:user_id])
203
+ if @user.nil?
204
+ flash[:notice] = l(:cannot_find_user, params[:user_id])
205
+ back_or_redirect_to '/'
206
+ return
207
+ end
208
+ else
209
+ @user = current_user
210
+ end
202
211
  @periods = []
203
212
  @works = Work.find_work_for_day(@date, @user)
204
213
  @customers = Customer.find(:all, :order => :name)
@@ -274,14 +283,14 @@ class WorksController < ApplicationController
274
283
  if (search_id = params[:work][:task_id].to_i) > 0
275
284
  @tasks += Task.find(:all,
276
285
  :conditions => [ "id = ? OR id BETWEEN ? AND ?",
277
- search_id, search_id * 10, ((search_id+1) * 10 -1) ],
286
+ search_id, search_id * 10, ((search_id+1) * 10 -1) ],
278
287
  :order => 'id',
279
288
  :limit => 10)
280
289
  end
281
290
 
282
291
 
283
292
  @tasks += Task.find(:all,
284
- :conditions => [ "finished_at IS NULL AND LOWER(description) LIKE ?",
293
+ :conditions => [ "finished_at IS NULL AND LOWER(description) LIKE ?",
285
294
  '%' + params[:work][:task_id].downcase + '%' ],
286
295
  :order => 'description ASC',
287
296
  :limit => 10)
data/app/models/task.rb CHANGED
@@ -404,7 +404,7 @@ class Task < ActiveRecord::Base
404
404
  end
405
405
 
406
406
  def started_work
407
- started_works = works.select {|work| work.completed_at.nil?}
407
+ started_works = works.select {|work| work.start_time && work.completed_at.nil?}
408
408
  if current_user
409
409
  started_by_user = started_works.select {|work| work.user == current_user}.last
410
410
  return started_by_user if started_by_user
@@ -28,11 +28,12 @@
28
28
 
29
29
  <div style="float: right" style="border: 1px solid black">
30
30
  <div class="task_start">
31
+ &nbsp;
31
32
  <% if active && @task.loggable? -%>
32
33
  <% if @task.work_started? -%>
33
34
  <% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => @task.started_work}) do |f| %>
34
35
  <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
35
- <%=f.text_field 'start_time', :id => "work_#{@task.started_work.id}_start_time", :tabindex => i+1, :value => @task.started_work.start_time.strftime('%H:%M'),
36
+ <%=f.text_field 'start_time', :id => "work_#{@task.started_work.id}_start_time", :tabindex => i+1, :value => (@task.started_work.start_time ? @task.started_work.start_time.strftime('%H:%M') : ''),
36
37
  :class => :task_time, :maxlength => 5 %>
37
38
  <% end %>
38
39
  <% elsif @task.track_times? && (@task.period_id.nil? || @task.period.active?) %>
@@ -31,7 +31,7 @@
31
31
  <% if @task.work_started? -%>
32
32
  <% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => @task.started_work}) do |f| %>
33
33
  <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
34
- <%=l :started_at%> <%=f.text_field 'start_time', :id => "work_#{@task.started_work.id}_start_time", :value => @task.started_work.started_at.strftime('%H:%M'),
34
+ <%=l :started_at%> <%=f.text_field 'start_time', :id => "work_#{@task.started_work.id}_start_time", :value => @task.started_work.started_at ? @task.started_work.started_at.strftime('%H:%M') : '',
35
35
  :class => :task_time, :maxlength => 5 %>
36
36
  <% end %>
37
37
  <% elsif @task.track_times? && (@task.period_id.nil? || @task.period.active?) %>
@@ -101,6 +101,7 @@
101
101
  <tr>
102
102
  <th><%=l :user %></th>
103
103
  <th><%=l :done %></th>
104
+ <th><%=l :work_account %></th>
104
105
  <th><%=l :description %></th>
105
106
  <th><%=l :invoice %></th>
106
107
  <th><%=l :started_at %></th>
@@ -110,7 +111,8 @@
110
111
  <% for work in @works %>
111
112
  <tr>
112
113
  <td valign="top"><%=work.user && work.user.login %></td>
113
- <td valign="top"><%=work.hours %></td>
114
+ <td align="right" valign="top"><%='%.2f' % work.hours %></td>
115
+ <td valign="top"><%=work.work_account.name %></td>
114
116
  <%if work.task
115
117
  link = "Task: #{work.task.description} <br/>"
116
118
  else
@@ -118,10 +120,10 @@
118
120
  end
119
121
  link += h(work.description)
120
122
  %>
121
- <td><%= link_to link, :controller => 'works', :action => 'daily_work_sheet', :id => work.started_on.strftime("%Y-%m-%d") %></td>
123
+ <td valign="top"><%=detour_to link, :controller => 'works', :action => 'daily_work_sheet', :id => work.started_on.strftime("%Y-%m-%d"), :user_id => work.user_id %></td>
122
124
  <td><%=work.invoice ? l(:yes) : '' %></td>
123
- <td><%=work.started_at && work.started_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
124
- <td valign="top"><%=work.completed_at && work.completed_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
125
+ <td valign="top"><%=(work.started_at && work.started_at.strftime('%Y-%m-%d %H:%M:%S')) || work.started_on.strftime('%Y-%m-%d') %></td>
126
+ <td valign="top"><%=(work.completed_at && work.completed_at.strftime('%Y-%m-%d %H:%M:%S')) || work.started_on.strftime('%Y-%m-%d') %></td>
125
127
  <tr>
126
128
  <% end %>
127
129
  <tr>
@@ -77,8 +77,8 @@
77
77
  <Cell><Data ss:Type="String"><%=work.description %></Data></Cell>
78
78
  <Cell><Data ss:Type="Number"><%=work.hours %></Data></Cell>
79
79
  <Cell><Data ss:Type="String"><%=work.invoice? ? 'Ja' : 'Nei' %></Data></Cell>
80
- <Cell ss:StyleID="DateTime"><Data ss:Type="Number"><%=BigDecimal((work.started_on - Date.new(1899, 12, 31)).to_s) + (work.start_time ? (BigDecimal(work.start_time.hour.to_s) + BigDecimal(work.start_time.minute.to_s)/60) / 24 : 0) %></Data></Cell>
81
- <Cell ss:StyleID="DateTime"><Data ss:Type="Number"><%=work.completed_at && (BigDecimal((work.completed_at.to_datetime - DateTime.parse('1899-12-31T00:00:00+02:00')).to_f.to_s))%></Data></Cell>
80
+ <Cell ss:StyleID="DateTime"><Data ss:Type="Number"><%=(BigDecimal((work.started_on - Date.new(1899, 12, 30)).to_s) + (work.start_time ? (BigDecimal(work.start_time.hour.to_s) + BigDecimal(work.start_time.minute.to_s)/60) / 24 : 0)).truncate(6) %></Data></Cell>
81
+ <Cell ss:StyleID="DateTime"><Data ss:Type="Number"><%=work.completed_at && (BigDecimal((work.completed_at.to_datetime - DateTime.parse('1899-12-30T00:00:00+02:00')).to_f.to_s))%></Data></Cell>
82
82
  </Row>
83
83
  <% end %>
84
84
 
@@ -12,6 +12,6 @@ if @day_total
12
12
  page.replace_html "hours_total", "#{t @day_total}"
13
13
  end
14
14
 
15
- if @new_work
15
+ if @new_work && @new_work.started_at
16
16
  page["work_start_time"].value = @new_work.started_at.strftime('%H:%M')
17
17
  end
data/lang/en.yaml CHANGED
@@ -7,12 +7,14 @@ account: Account
7
7
  active: Active
8
8
  administration: Administration
9
9
  all: All
10
+ all_accounts: all accounts
10
11
  assigned_to: Assigned to
11
12
  back: Back
12
13
  backlog: Backlog
13
14
  backlog_description: Task list with ordering and status tracking
14
15
  backlogs: Backlogs
15
16
  burn_down_chart: Burn Down Chart
17
+ cannot_find_user: Cannot find user %s
16
18
  change_password: Change Password
17
19
  complete: Complete
18
20
  completed: Completed
data/lang/no.yaml CHANGED
@@ -7,12 +7,14 @@ account: Konto
7
7
  active: Aktiv
8
8
  administration: Administrasjon
9
9
  all: All
10
+ all_accounts: alle konti
10
11
  assigned_to: Tilordnet
11
12
  back: Tilbake
12
13
  backlog: Oppgaveliste
13
14
  backlog_description: Oppgaveliste med sortering og statussporing
14
15
  backlogs: Oppgavelister
15
16
  burn_down_chart: Fremdriftsgraf
17
+ cannot_find_user: Kan ikke finne bruker %s
16
18
  change_password: Bytt Passord
17
19
  complete: Fullfør
18
20
  completed: Fullført
@@ -43,7 +43,7 @@ class WorksControllerTest < Test::Unit::TestCase
43
43
  assert_template 'list'
44
44
 
45
45
  assert_not_nil assigns(:works)
46
- assert_equal 4, assigns(:works).size
46
+ assert_equal 5, assigns(:works).size
47
47
  end
48
48
 
49
49
  def test_list_excel
@@ -53,7 +53,7 @@ class WorksControllerTest < Test::Unit::TestCase
53
53
  assert_template 'list_excel'
54
54
 
55
55
  assert_not_nil assigns(:works)
56
- assert_equal 4, assigns(:works).size
56
+ assert_equal 5, assigns(:works).size
57
57
  end
58
58
 
59
59
  def test_show
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.33.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-23 00:00:00 +02:00
12
+ date: 2008-07-15 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency