backlog 0.22.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,9 +1,21 @@
1
+ == 0.22.1 2008-02-15
2
+
3
+ === Features
4
+
5
+ * Added Excel export of work list for backlog.
6
+
7
+ === Fixes
8
+
9
+ * Fixed so that you are redirected to the originally requested page after a login.
10
+ * Fixed so that the work log nagger stops nagging when you lock the previous week.
11
+ * Fixed so that we get patcxh level updates for rmagick.
12
+
1
13
  == 0.22.0 2008-02-14
2
14
 
3
15
  === Features
4
16
 
5
17
  * Added report for displaying all work records relating to tasks in a backlog for a given time period.
6
- * Aded ability to look at other users weekly work sheets.
18
+ * Added ability to look at other users weekly work sheets.
7
19
  Used in the Work Lock Notification mail.
8
20
 
9
21
  === Fixes
data/Rakefile CHANGED
@@ -32,8 +32,8 @@ Hoe.new("backlog", APP::VERSION) do |p|
32
32
  }
33
33
  p.need_zip = true
34
34
  p.url = 'http://rubyforge.org/projects/backlog/'
35
- p.extra_deps = [['rails', '>= 1.2.4'], ['gruff', '>= 0.2.9'], ['rmagick', '= 1.15.12'],
36
- ['postgres', '>= 0.7.9'], ['slave', '>= 1.2.1']]
35
+ p.extra_deps = [['rails', '= 1.2.4'], ['gruff', '~> 0.2.9'], ['rmagick', '~> 1.15.12'],
36
+ ['postgres', '~> 0.7.9'], ['slave', '~> 1.2.1']]
37
37
  p.rsync_args = "-acv --delete --exclude=wiki*"
38
38
  end
39
39
 
@@ -177,8 +177,13 @@ class BacklogsController < ApplicationController
177
177
  def works
178
178
  backlog = Backlog.find(params[:id])
179
179
  @report_filter = ReportFilter.new(params[:report_filter])
180
- @works = Work.paginate :conditions => ["completed_at BETWEEN ? AND ? AND task_id IN (SELECT id FROM tasks t where t.backlog_id = ?)", @report_filter.start_on, @report_filter.end_on, backlog.id], :page => params[:page]
181
- render :template => '/works/list'
180
+ @report_filter.title = "#{l :hours} for #{backlog.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')}"
181
+ @works = Work.paginate :conditions => ["completed_at BETWEEN ? AND ? AND task_id IN (SELECT id FROM tasks t where t.backlog_id = ?)", @report_filter.start_on, @report_filter.end_on, backlog.id], :page => params[:page], :per_page => @report_filter.page_size
182
+ if params[:export] == 'excel'
183
+ render :template => '/works/list_excel', :layout => false
184
+ else
185
+ render :template => '/works/list'
186
+ end
182
187
  end
183
188
 
184
189
  private
@@ -1,13 +1,22 @@
1
1
  class ReportFilter
2
+ attr_accessor :title
2
3
  attr_reader :start_on
3
4
  attr_reader :end_on
5
+ attr_reader :page_size
4
6
 
5
7
  def initialize(attributes)
6
8
  if attributes
7
9
  attributes = attributes.clone
8
- @start_on = Date.parse attributes.delete(:start_on) || Date.local(2007, 01, 01)
10
+
11
+ start_on_param = attributes.delete(:start_on)
12
+ @start_on = start_on_param && start_on_param.size > 0 ? Date.parse(start_on_param) : Date.civil(2007, 01, 01)
13
+
9
14
  end_on_param = attributes.delete(:end_on)
10
15
  @end_on = end_on_param && end_on_param.size > 0 ? Date.parse(end_on_param) : Date.today
16
+
17
+ page_size_param = attributes.delete(:page_size)
18
+ @page_size = page_size_param.to_i > 0 ? page_size_param.to_i : 1000
19
+
11
20
  raise "Unknown parameters: #{attributes.inspect}" unless attributes.empty?
12
21
  end
13
22
  end
@@ -26,7 +26,8 @@ class WorkLockNagger
26
26
  begin
27
27
  late_work_locks = WorkLock.find(
28
28
  :all,
29
- :conditions => ["end_on < ? and not exists (select id from work_locks wl2 where wl2.user_id = work_locks.user_id and wl2.end_on > work_locks.end_on)", Date.today ])
29
+ :conditions => ["end_on < ? and not exists (select id from work_locks wl2 where wl2.user_id = work_locks.user_id and wl2.end_on > work_locks.end_on)", 1.week.ago.monday ])
30
+
30
31
  late_users = late_work_locks.map{|wl| wl.user}.uniq
31
32
  late_users.each do |u|
32
33
  missing_date = (u.work_locks.last.end_on + 7)
@@ -5,7 +5,7 @@
5
5
  <% end %>
6
6
 
7
7
  <% if @report_filter %>
8
- <% form_for :report_filter do |f| %>
8
+ <% form_for :report_filter, :html => {:method => :get} do |f| %>
9
9
  <p><label for="report_filter_start_on"><%=l :start_on%></label>
10
10
  <%=f.text_field 'start_on', :size => 16, :value => @report_filter.start_on ? @report_filter.start_on.strftime('%Y-%m-%d') : nil %>
11
11
  <button id="trigger1">...</button>
@@ -41,6 +41,10 @@
41
41
  timeInterval : 15
42
42
  });
43
43
  //]]></script>
44
+
45
+ <label for="report_filter_page_size"><%=l :paging%></label>
46
+ <%=f.check_box :page_size, {:checked => @report_filter.page_size == 10, :onchange => 'form.submit()'}, 10, nil %>
47
+
44
48
  <%=submit_tag l(:search) %>
45
49
  </p>
46
50
 
@@ -48,6 +52,18 @@
48
52
  <% end %>
49
53
 
50
54
 
55
+
56
+ <table id="summary">
57
+ <tr>
58
+ <th><%=l :total%></th>
59
+ <td><%=@works.inject(BigDecimal('0')){|total, work| total += work.hours}%> <%=l(:hours).downcase%></td>
60
+ <td><%=link_to l(:spreadsheet), {:export => :excel}.update(params) %></td>
61
+ </tr>
62
+ </table>
63
+
64
+
65
+
66
+
51
67
  <table>
52
68
  <tr>
53
69
  <th><%=l :task %></th>
@@ -0,0 +1,103 @@
1
+ <% headers["Content-Type"] = "application/vnd.ms-excel"
2
+ headers["Content-Disposition"] = 'attachment; filename="export.xml"'
3
+ -%>
4
+ <?xml version="1.0"?>
5
+ <?mso-application progid="Excel.Sheet"?>
6
+ <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
7
+ xmlns:o="urn:schemas-microsoft-com:office:office"
8
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
9
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
10
+ xmlns:html="http://www.w3.org/TR/REC-html40">
11
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
12
+ <Author><%=current_user.name%></Author>
13
+ <% if user? %>
14
+ <LastAuthor><%=user.first_name%> <%=user.last_name%></LastAuthor>
15
+ <% end %>
16
+ <LastPrinted>2005-11-14T13:31:53Z</LastPrinted>
17
+ <Created><%=Time.now.iso8601%></Created>
18
+ <LastSaved><%=Time.now.iso8601%></LastSaved>
19
+ <Version>11.5606</Version>
20
+ </DocumentProperties>
21
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
22
+ <WindowHeight>9075</WindowHeight>
23
+ <WindowWidth>12390</WindowWidth>
24
+ <WindowTopX>90</WindowTopX>
25
+ <WindowTopY>45</WindowTopY>
26
+ <ProtectStructure>False</ProtectStructure>
27
+ <ProtectWindows>False</ProtectWindows>
28
+ </ExcelWorkbook>
29
+ <Styles>
30
+ <Style ss:ID="Default" ss:Name="Normal">
31
+ <Alignment ss:Vertical="Top"/>
32
+ <Borders/>
33
+ <Font/>
34
+ <Interior/>
35
+ <NumberFormat/>
36
+ <Protection/>
37
+ </Style>
38
+ <Style ss:ID="title">
39
+ <Font x:Family="Swiss" ss:Size="24" ss:Bold="1"/>
40
+ </Style>
41
+ <Style ss:ID="header">
42
+ <Font x:Family="Swiss" ss:Size="14" ss:Bold="1"/>
43
+ </Style>
44
+ </Styles>
45
+ <Worksheet ss:Name="<%=l(:done)%>">
46
+ <Table ss:ExpandedColumnCount="256" ss:ExpandedRowCount="35" x:FullColumns="1"
47
+ x:FullRows="1">
48
+ <Column ss:AutoFitWidth="1" ss:Width="10cm"/>
49
+ <Column ss:AutoFitWidth="2" ss:Width="4cm"/>
50
+ <Column ss:AutoFitWidth="4" ss:Width="5cm"/>
51
+ <Column ss:AutoFitWidth="5" ss:Width="5cm"/>
52
+ <Column ss:AutoFitWidth="3" ss:Width="1.5cm"/>
53
+ <Row>
54
+ <Cell ss:StyleID="title" ss:MergeAcross="4"><Data ss:Type="String"><%=@report_filter.title%></Data></Cell>
55
+ </Row>
56
+ <Row ss:AutoFitHeight="0" ss:Height="6.5625">
57
+ <Cell ss:MergeAcross="4"><Data ss:Type="String"></Data></Cell>
58
+ </Row>
59
+
60
+ <Row ss:AutoFitHeight="0" ss:Height="19.875">
61
+ <Cell ss:StyleID="header"><Data ss:Type="String">Aktivitet</Data></Cell>
62
+ <Cell ss:StyleID="header"><Data ss:Type="String">Person</Data></Cell>
63
+ <Cell ss:StyleID="header"><Data ss:Type="String">Start</Data></Cell>
64
+ <Cell ss:StyleID="header"><Data ss:Type="String">Stopp</Data></Cell>
65
+ <Cell ss:StyleID="header"><Data ss:Type="String">Timer</Data></Cell>
66
+ </Row>
67
+
68
+ <% for work in @works %>
69
+ <Row>
70
+ <Cell><Data ss:Type="String"><%=[work.task && work.task.description, work.description].compact.join('&#10;') %></Data></Cell>
71
+ <Cell><Data ss:Type="String"><%=work.user && work.user.name %></Data></Cell>
72
+ <Cell><Data ss:Type="Date"><%=work.started_at && work.started_at.strftime('%Y-%m-%d %H:%M:%S') %></Data></Cell>
73
+ <Cell><Data ss:Type="Date"><%=work.completed_at && work.completed_at.strftime('%Y-%m-%d %H:%M:%S') %></Data></Cell>
74
+ <Cell><Data ss:Type="Number"><%=work.hours %> %></Data></Cell>
75
+ </Row>
76
+ <% end %>
77
+
78
+ </Table>
79
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
80
+ <PageSetup>
81
+ <Layout x:Orientation="Landscape"/>
82
+ </PageSetup>
83
+ <FitToPage/>
84
+ <Print>
85
+ <ValidPrinterInfo/>
86
+ <PaperSizeIndex>9</PaperSizeIndex>
87
+ <Scale>97</Scale>
88
+ <HorizontalResolution>600</HorizontalResolution>
89
+ <VerticalResolution>600</VerticalResolution>
90
+ </Print>
91
+ <Selected/>
92
+ <Panes>
93
+ <Pane>
94
+ <Number>3</Number>
95
+ <ActiveRow>3</ActiveRow>
96
+ <ActiveCol>1</ActiveCol>
97
+ </Pane>
98
+ </Panes>
99
+ <ProtectObjects>False</ProtectObjects>
100
+ <ProtectScenarios>False</ProtectScenarios>
101
+ </WorksheetOptions>
102
+ </Worksheet>
103
+ </Workbook>
@@ -98,8 +98,6 @@ require 'version_from_history'
98
98
  require 'user_system'
99
99
  require 'url_for_fix'
100
100
 
101
- puts "Starting Work Lock Nagger..."
102
101
  gem 'slave'
103
102
  require 'slave'
104
103
  work_lock_nagger_thread = Slave.object(:async=>true) {WorkLockNagger.new.nag}
105
- puts "\nWork Lock Nagger started."
data/lang/en.yaml CHANGED
@@ -102,6 +102,7 @@ task: Task
102
102
  tasks: Tasks
103
103
  thursday: Thursday
104
104
  todo: Todo
105
+ total: Total
105
106
  totals: Totals
106
107
  track_todo: Estimates
107
108
  track_done: Track work done
data/lang/no.yaml CHANGED
@@ -101,6 +101,7 @@ task: Oppgave
101
101
  tasks: Oppgaver
102
102
  thursday: Torsdag
103
103
  todo: Igjen
104
+ total: Totalt
104
105
  totals: Totalt
105
106
  track_todo: Estimater
106
107
  track_done: Spor utført arbeid
data/lib/user_system.rb CHANGED
@@ -13,7 +13,7 @@ module UserSystem
13
13
  end
14
14
  session[:user_id] = nil
15
15
  Thread.current[:user] = nil
16
- store_detour_from_params
16
+ store_detour(params)
17
17
  access_denied
18
18
  return false
19
19
  end
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.22.0
4
+ version: 0.22.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-02-14 00:00:00 +01:00
12
+ date: 2008-02-15 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -17,7 +17,7 @@ dependencies:
17
17
  version_requirement:
18
18
  version_requirements: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ">="
20
+ - - "="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.2.4
23
23
  version:
@@ -26,7 +26,7 @@ dependencies:
26
26
  version_requirement:
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ">="
29
+ - - ~>
30
30
  - !ruby/object:Gem::Version
31
31
  version: 0.2.9
32
32
  version:
@@ -35,7 +35,7 @@ dependencies:
35
35
  version_requirement:
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "="
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.15.12
41
41
  version:
@@ -44,7 +44,7 @@ dependencies:
44
44
  version_requirement:
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
47
+ - - ~>
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.7.9
50
50
  version:
@@ -53,7 +53,7 @@ dependencies:
53
53
  version_requirement:
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ">="
56
+ - - ~>
57
57
  - !ruby/object:Gem::Version
58
58
  version: 1.2.1
59
59
  version:
@@ -148,6 +148,7 @@ files:
148
148
  - app/views/works/update_row.rjs
149
149
  - app/views/works/list.rhtml
150
150
  - app/views/works/_row.rhtml
151
+ - app/views/works/list_excel.rhtml
151
152
  - app/views/works/_buttons.rhtml
152
153
  - app/views/works/timeliste.rhtml
153
154
  - app/views/works/_description_list.rhtml