backlog 0.20.1 → 0.21.0

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,3 +1,15 @@
1
+ == 0.21.0 2008-02-02
2
+
3
+ === Features
4
+
5
+ * Notification of delayed time sheets.
6
+ Backlog is now dependent on the 'slave' gem.
7
+
8
+ === Fixes
9
+
10
+ * Fixed switched users in time sheet monitoring invitation.
11
+ * Filled in week number when notifying subscribers of a time sheet lock.
12
+
1
13
  == 0.20.1 2008-01-29
2
14
 
3
15
  === Fixes
data/Rakefile CHANGED
@@ -32,7 +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'], ['postgres', '>= 0.7.9']]
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']]
36
37
  p.rsync_args = "-av --delete --exclude=wiki*"
37
38
  end
38
39
 
data/app/models/user.rb CHANGED
@@ -9,6 +9,7 @@ class User < Party
9
9
  # even if they follow the defaults since ClassTableInheritanceInRails breaks it.
10
10
  has_and_belongs_to_many :groups, :join_table => "groups_users", :foreign_key => "user_id", :association_foreign_key => 'group_id'
11
11
  has_and_belongs_to_many :work_lock_subscribers, :class_name => 'User', :join_table => "user_work_lock_subscriptions", :foreign_key => "user_id", :association_foreign_key => 'subscriber_user_id'
12
+ has_many :work_locks, :foreign_key => :user_id, :order => :end_on
12
13
 
13
14
  attr_accessor :password_needs_confirmation
14
15
 
@@ -0,0 +1,40 @@
1
+ class WorkLockNagger
2
+ include ActionController::UrlWriter
3
+
4
+ puts "Loading class"
5
+
6
+ def initialize
7
+ puts "Worker initialized"
8
+ end
9
+
10
+ def nag
11
+ puts "Nag called"
12
+ begin
13
+ url = url_for(:host => 'localhost', :port => 3000, :controller => 'works', :action => :weekly_work_sheet_by_work_account)
14
+ rescue Exception => e
15
+ puts e.message
16
+ puts e.backtrace
17
+ end
18
+
19
+ loop do
20
+ puts "Nagging"
21
+ begin
22
+ p late_work_locks = WorkLock.find(
23
+ :all,
24
+ :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 ])
25
+ late_users = late_work_locks.map{|wl| wl.user}.uniq
26
+ late_users.each do |u|
27
+ missing_date = (u.work_locks.last.end_on + 7)
28
+ year = missing_date.year
29
+ week = missing_date.cweek
30
+ WorkLockNotify.deliver_nag(u, week, url + "/#{year}/#{week}")
31
+ end
32
+ rescue Exception => e
33
+ p e
34
+ end
35
+ puts "Nag ends"
36
+ sleep 24.hours
37
+ end
38
+ end
39
+
40
+ end
@@ -10,11 +10,27 @@ class WorkLockNotify < ActionMailer::Base
10
10
  @body["app_url"] = UserSystem::CONFIG[:app_url].to_s
11
11
  @body["name"] = "#{user.first_name} #{user.last_name}"
12
12
  @body["login"] = user.login
13
+ @body["week"] = week
13
14
  @body["lock_user"] = lock_user
14
15
  @body["week_url"] = week_url
15
16
  @body["spreadsheet_url"] = spreadsheet_url
16
17
  end
17
18
 
19
+ def nag(user, week, week_url)
20
+ setup_email(user)
21
+
22
+ # Email header info
23
+ @subject += "Time sheet reminder"
24
+
25
+ # Email body substitutions
26
+ @body["app_name"] = UserSystem::CONFIG[:app_name].to_s
27
+ @body["app_url"] = UserSystem::CONFIG[:app_url].to_s
28
+ @body["name"] = "#{user.first_name} #{user.last_name}"
29
+ @body["login"] = user.login
30
+ @body["week"] = week
31
+ @body["week_url"] = week_url
32
+ end
33
+
18
34
  private
19
35
 
20
36
  def setup_email(user)
@@ -1,6 +1,6 @@
1
- Regarding your account at <%=@app_name %>, <%=@user.name %>:
1
+ Regarding your account at <%=@app_name %>, <%=@monitoring_user.name %>:
2
2
 
3
- <%=@monitoring_user.name%> has invited you to monitor his/her time sheets.
3
+ <%=@user.name%> has invited you to monitor his/her time sheets.
4
4
 
5
5
  Click the link below to start monitoring:
6
6
 
@@ -1,7 +1,7 @@
1
1
  <%=@name %>
2
2
 
3
- <%=@lock_user.name%> har godkjent timeliste for uke <%=@week%>.
3
+ <%=@lock_user.name%> has marked week <%=@week%> as complete.
4
4
 
5
- Klikk linken under for en ukeoversikt:
5
+ Please click on the following link to go to the week overview:
6
6
 
7
- <%=@week_url%>
7
+ <%=@week_url%>
@@ -1,7 +1,7 @@
1
1
  <%=@name %>
2
2
 
3
- <%=@lock_user.name%> has marked week <%=@week%> as complete.
3
+ <%=@lock_user.name%> har godkjent timeliste for uke <%=@week%>.
4
4
 
5
- Please click on the following link to go to the week overview:
5
+ Klikk linken under for en ukeoversikt:
6
6
 
7
- <%=@week_url%>
7
+ <%=@week_url%>
@@ -0,0 +1,6 @@
1
+ <%=@name %>
2
+
3
+ This is to remind you to lock your time sheet for week <%=@week%>.
4
+ Follow the link below to get to your weekly work sheet.
5
+
6
+ <%=@week_url%>
@@ -0,0 +1,7 @@
1
+ <%=@name %>
2
+
3
+ Dette er en påmindelse om å godkjenne timeliste for uke <%=@week%>.
4
+
5
+ Klikk på linken under for ukeoversikten:
6
+
7
+ <%=@week_url%>
@@ -98,3 +98,8 @@ require 'version_from_history'
98
98
  require 'user_system'
99
99
  require 'url_for_fix'
100
100
 
101
+ puts "Starting Work Lock Nagger..."
102
+ gem 'slave'
103
+ require 'slave'
104
+ work_lock_nagger_thread = Slave.object(:async=>true) {WorkLockNagger.new.nag}
105
+ puts "\nWork Lock Nagger started."
data/etc/backlog.conf CHANGED
@@ -1,4 +1,5 @@
1
- # Uncomment the followinf section to override the database connection settings.
1
+ # Uncomment the following line to override the network port to listen on.
2
+ # Default port is 3000.
2
3
 
3
4
  # port: 3000
4
5
 
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.20.1
4
+ version: 0.21.0
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-01-29 00:00:00 +01:00
12
+ date: 2008-02-02 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,15 @@ dependencies:
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.7.9
50
50
  version:
51
+ - !ruby/object:Gem::Dependency
52
+ name: slave
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 1.2.1
59
+ version:
51
60
  - !ruby/object:Gem::Dependency
52
61
  name: hoe
53
62
  version_requirement:
@@ -186,6 +195,8 @@ files:
186
195
  - app/views/user/_password.rhtml
187
196
  - app/views/user/forgot_password.rhtml
188
197
  - app/views/work_lock_notify
198
+ - app/views/work_lock_notify/nag_no.rhtml
199
+ - app/views/work_lock_notify/nag_en.rhtml
189
200
  - app/views/work_lock_notify/lock_en.rhtml
190
201
  - app/views/work_lock_notify/lock_no.rhtml
191
202
  - app/controllers
@@ -223,6 +234,7 @@ files:
223
234
  - app/models
224
235
  - app/models/work_lock_notify.rb
225
236
  - app/models/work.rb
237
+ - app/models/work_lock_nagger.rb
226
238
  - app/models/customer.rb
227
239
  - app/models/period.rb
228
240
  - app/models/task.rb
@@ -598,7 +610,6 @@ files:
598
610
  - config/mime_types.yaml
599
611
  - config/war.rb
600
612
  - config/boot.rb
601
- - config/deploy.rb
602
613
  - cruise_config.rb
603
614
  - db
604
615
  - db/test.db
data/config/deploy.rb DELETED
@@ -1,20 +0,0 @@
1
- set :application, "backlog"
2
- set :repository, "svn://rubyforge.org/var/svn/#{application}/trunk"
3
-
4
- role :app, "sandra"
5
- role :db, "sandra", :primary => true
6
-
7
- set :deploy_to, "/usr/local/#{application}"
8
- set :user, "capistrano"
9
-
10
- set :use_sudo, false
11
-
12
- desc "The spinner task is used by :cold_deploy to start the application up"
13
- task :spinner, :roles => :app do
14
- send(run_method, "/sbin/service #{application} start")
15
- end
16
-
17
- desc "Restart the mongrel server"
18
- task :restart, :roles => :app do
19
- send(run_method, "/sbin/service #{application} restart")
20
- end