backlog 0.35.5 → 0.36.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +19 -0
- data/Gemfile~ +4 -0
- data/History.txt +25 -0
- data/Rakefile +3 -3
- data/app/controllers/{application.rb → application_controller.rb} +1 -2
- data/app/controllers/backlogs_controller.rb +0 -16
- data/app/controllers/search_controller.rb +0 -2
- data/app/controllers/user_controller.rb +7 -7
- data/app/controllers/work_locks_controller.rb +2 -2
- data/app/controllers/works_controller.rb +23 -23
- data/app/helpers/application_helper.rb +9 -6
- data/app/helpers/backlogs_helper.rb +1 -1
- data/app/helpers/periods_helper.rb +1 -1
- data/app/models/backlog.rb +13 -10
- data/app/models/period.rb +0 -5
- data/app/models/sidebar.rb +1 -0
- data/app/models/task.rb +4 -10
- data/app/models/user.rb +5 -6
- data/app/models/user_notify.rb +0 -1
- data/app/models/work.rb +20 -25
- data/app/models/works_report_filter.rb +4 -4
- data/app/views/backlogs/_buttons.rhtml +1 -1
- data/app/views/backlogs/_form.rhtml +5 -9
- data/app/views/layouts/_left_top.rhtml +0 -1
- data/app/views/periods/_form.rhtml +1 -1
- data/app/views/search/results.rhtml +1 -12
- data/app/views/task_notify/{invite_en.rhtml → invite.en.html.erb} +0 -0
- data/app/views/task_notify/{invite_no.rhtml → invite.no.html.erb} +0 -0
- data/app/views/tasks/_task.rhtml +49 -50
- data/app/views/tasks/edit.rhtml +4 -4
- data/app/views/tasks/start_work.rjs +1 -1
- data/app/views/user/_edit.rhtml +1 -1
- data/app/views/user/change_password.rhtml +1 -1
- data/app/views/user/edit.rhtml +4 -4
- data/app/views/user/signup.rhtml +2 -2
- data/app/views/user_notify/{change_password_en.rhtml → change_password.en.html.erb} +0 -0
- data/app/views/user_notify/{change_password_no.rhtml → change_password.no.html.erb} +0 -0
- data/app/views/user_notify/{forgot_password_en.rhtml → forgot_password.en.html.erb} +0 -0
- data/app/views/user_notify/{forgot_password_no.rhtml → forgot_password.no.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_en.rhtml → monitoring.en.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_no.rhtml → monitoring.no.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_invitation_en.rhtml → monitoring_invitation.en.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_invitation_no.rhtml → monitoring_invitation.no.html.erb} +0 -0
- data/app/views/user_notify/{signup_en.rhtml → signup.en.html.erb} +0 -0
- data/app/views/user_notify/{signup_no.rhtml → signup.no.html.erb} +0 -0
- data/app/views/work_lock_notify/{lock_en.rhtml → lock.en.html.erb} +0 -0
- data/app/views/work_lock_notify/{lock_no.rhtml → lock.no.html.erb} +0 -0
- data/app/views/work_lock_notify/{nag_en.rhtml → nag.en.html.erb} +0 -0
- data/app/views/work_lock_notify/{nag_no.rhtml → nag.no.html.erb} +0 -0
- data/app/views/works/_form.rhtml +6 -6
- data/app/views/works/_new_row.rhtml +6 -6
- data/app/views/works/_row.rhtml +2 -2
- data/app/views/works/daily_work_sheet.rhtml +1 -1
- data/app/views/works/list.rhtml +6 -6
- data/app/views/works/list_excel.rhtml +8 -4
- data/app/views/works/timeliste.rhtml +14 -14
- data/app/views/works/update_row.rjs +1 -1
- data/app/views/works/weekly_work_sheet.rhtml +5 -5
- data/app/views/works/weekly_work_sheet_details.rhtml +5 -5
- data/config/boot.rb +108 -27
- data/config/database.yml +3 -26
- data/config/environment.rb +4 -12
- data/config/environments/development.rb +0 -1
- data/config/initializers/jdbc.rb +7 -0
- data/config/initializers/mongrel.rb +83 -0
- data/config/locales/en.yml +189 -0
- data/config/locales/no.yml +192 -0
- data/config/preinitializer.rb +20 -0
- data/cruise_build.sh +10 -0
- data/cruise_config.rb +1 -1
- data/db/migrate/20100720124707_merge_work_account_into_backlog.rb +74 -0
- data/db/schema.rb +93 -127
- data/lib/class_table_inheritance.rb +53 -11
- data/lib/tasks/jdbc.rake +8 -0
- data/lib/user_system.rb +5 -1
- data/public/javascripts/controls.js +76 -79
- data/public/javascripts/dragdrop.js +166 -167
- data/public/javascripts/effects.js +174 -168
- data/public/javascripts/prototype.js +470 -334
- data/public/stylesheets/mwrt002.css +6 -6
- data/script/dbconsole +3 -0
- data/test/fixtures/backlogs.yml +2 -2
- data/test/fixtures/work_lock_subscriptions.yml +2 -2
- data/test/fixtures/works.yml +6 -6
- data/test/functional/absences_controller_test.rb +1 -1
- data/test/functional/backlogs_controller_test.rb +4 -4
- data/test/functional/customers_controller_test.rb +1 -1
- data/test/functional/dashboard_controller_test.rb +1 -1
- data/test/functional/estimates_controller_test.rb +1 -1
- data/test/functional/groups_controller_test.rb +1 -1
- data/test/functional/parties_controller_test.rb +1 -1
- data/test/functional/periods_controller_test.rb +1 -1
- data/test/functional/public_holidays_controller_test.rb +1 -1
- data/test/functional/search_controller_test.rb +1 -1
- data/test/functional/task_files_controller_test.rb +1 -1
- data/test/functional/tasks_controller_test.rb +6 -6
- data/test/functional/user_controller_test.rb +3 -2
- data/test/functional/welcome_controller_test.rb +1 -1
- data/test/functional/work_locks_controller_test.rb +1 -1
- data/test/functional/works_controller_test.rb +11 -11
- data/test/test_helper.rb +2 -2
- data/test/unit/absence_test.rb +1 -1
- data/test/unit/configuration_test.rb +1 -1
- data/test/unit/customer_test.rb +1 -1
- data/test/unit/estimate_test.rb +1 -1
- data/test/unit/group_test.rb +1 -1
- data/test/unit/party_test.rb +1 -1
- data/test/unit/period_test.rb +1 -1
- data/test/unit/public_holiday_test.rb +1 -1
- data/test/unit/task_file_test.rb +1 -1
- data/test/unit/task_test.rb +1 -1
- data/test/unit/user_test.rb +1 -1
- data/test/unit/work_lock_subscription_test.rb +1 -1
- data/test/unit/work_lock_test.rb +1 -1
- data/test/unit/work_test.rb +8 -8
- data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +3 -3
- data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +2 -2
- data/vendor/plugins/auto_complete/README +23 -0
- data/vendor/plugins/auto_complete/Rakefile +22 -0
- data/vendor/plugins/auto_complete/init.rb +2 -0
- data/vendor/plugins/auto_complete/lib/auto_complete.rb +47 -0
- data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +143 -0
- data/vendor/plugins/auto_complete/test/auto_complete_test.rb +67 -0
- data/vendor/plugins/backlog_jira/init.rb +4 -0
- data/vendor/plugins/backlog_jira/{tasks → lib/tasks}/backlog_jira_tasks.rake +0 -0
- data/vendor/plugins/has_history/{tasks → lib/tasks}/has_history_tasks.rake +0 -0
- metadata +745 -817
- data/#SearchRequest.xml# +0 -3443
- data/app/controllers/application.rb~ +0 -207
- data/app/controllers/work_accounts_controller.rb +0 -58
- data/app/helpers/work_accounts_helper.rb +0 -2
- data/app/models/work_account.rb +0 -18
- data/app/models/work_lock_subscription.rb +0 -3
- data/app/views/work_accounts/_form.rhtml +0 -16
- data/app/views/work_accounts/_name_list.rhtml +0 -5
- data/app/views/work_accounts/_title.rhtml +0 -5
- data/app/views/work_accounts/edit.rhtml +0 -12
- data/app/views/work_accounts/list.rhtml +0 -31
- data/app/views/work_accounts/new.rhtml +0 -10
- data/app/views/work_accounts/show.rhtml +0 -50
- data/config/environments/localization_environment.rb +0 -10
- data/jira.log +0 -98246
- data/lang/en.yaml +0 -147
- data/lang/localizations.yaml +0 -2
- data/lang/no.yaml +0 -146
- data/lib/localization.rb +0 -88
- data/test/fixtures/work_accounts.yml +0 -7
- data/test/functional/work_accounts_controller_test.rb +0 -94
- data/test/unit/localization_test.rb +0 -47
- data/test/unit/work_account_test.rb +0 -10
data/app/models/period.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class Period < ActiveRecord::Base
|
2
|
-
include Localization
|
3
2
|
extend UserSystem
|
4
3
|
include UserSystem
|
5
4
|
|
@@ -158,10 +157,6 @@ class Period < ActiveRecord::Base
|
|
158
157
|
not backlogs.find {|backlog| backlog.track_todo?}.nil?
|
159
158
|
end
|
160
159
|
|
161
|
-
def track_work?
|
162
|
-
not backlogs.find {|backlog| backlog.work_account}.nil?
|
163
|
-
end
|
164
|
-
|
165
160
|
def track_times?
|
166
161
|
not backlogs.find {|backlog| backlog.track_times?}.nil?
|
167
162
|
end
|
data/app/models/sidebar.rb
CHANGED
data/app/models/task.rb
CHANGED
@@ -13,7 +13,6 @@ class Task < ActiveRecord::Base
|
|
13
13
|
belongs_to :period
|
14
14
|
belongs_to :ancestor_task, :class_name => 'Task', :foreign_key => 'previous_task_id'
|
15
15
|
belongs_to :customer
|
16
|
-
belongs_to :work_account
|
17
16
|
has_many :descendant_tasks, :class_name => 'Task', :foreign_key => 'previous_task_id', :dependent => :destroy
|
18
17
|
has_many :estimates, :order => 'created_at', :dependent => :destroy
|
19
18
|
has_many :works, :order => 'completed_at', :dependent => :destroy
|
@@ -284,11 +283,11 @@ class Task < ActiveRecord::Base
|
|
284
283
|
end
|
285
284
|
|
286
285
|
def track_done?
|
287
|
-
|
286
|
+
backlog.track_done?
|
288
287
|
end
|
289
|
-
|
288
|
+
|
290
289
|
def track_times?
|
291
|
-
|
290
|
+
backlog.try :track_times?
|
292
291
|
end
|
293
292
|
|
294
293
|
def track_todo?
|
@@ -321,11 +320,6 @@ class Task < ActiveRecord::Base
|
|
321
320
|
old_backlog || root_task.old_backlog
|
322
321
|
end
|
323
322
|
|
324
|
-
alias_method :old_work_account, :work_account
|
325
|
-
def work_account
|
326
|
-
self.old_work_account || (parent ? parent.work_account : backlog.work_account)
|
327
|
-
end
|
328
|
-
|
329
323
|
def depth
|
330
324
|
root_task = self
|
331
325
|
depth = 0
|
@@ -386,7 +380,7 @@ class Task < ActiveRecord::Base
|
|
386
380
|
end
|
387
381
|
|
388
382
|
new_work.user = current_user
|
389
|
-
new_work.
|
383
|
+
new_work.backlog_id = backlog.id
|
390
384
|
new_work.save!
|
391
385
|
works << new_work
|
392
386
|
end
|
data/app/models/user.rb
CHANGED
@@ -39,7 +39,7 @@ class User < Party
|
|
39
39
|
validates_length_of :role, :allow_nil => true, :maximum => 40
|
40
40
|
|
41
41
|
validates_length_of :security_token, :allow_nil => true, :maximum => 40
|
42
|
-
validates_inclusion_of :deleted, :in => [true, false], :allow_nil => true, :message =>
|
42
|
+
validates_inclusion_of :deleted, :in => [true, false], :allow_nil => true, :message => I18n.translate('activerecord.errors.messages')[:blank]
|
43
43
|
|
44
44
|
def initialize(attributes = nil)
|
45
45
|
super
|
@@ -61,12 +61,11 @@ class User < Party
|
|
61
61
|
# not the regular authenticate call)
|
62
62
|
logger.info "Attempting authorization of #{id} with #{token}"
|
63
63
|
u = find(:first, :conditions => ["id = ? AND security_token = ?", id, token])
|
64
|
-
if u
|
65
|
-
logger.info "
|
66
|
-
|
67
|
-
logger.info "Not authenticated" if u.nil?
|
64
|
+
if u.nil? || u.token_expired?
|
65
|
+
logger.info "Not authenticated"
|
66
|
+
return nil
|
68
67
|
end
|
69
|
-
|
68
|
+
logger.info "Authenticated by token: #{u.inspect}"
|
70
69
|
u.update_attribute :verified, true
|
71
70
|
return u
|
72
71
|
end
|
data/app/models/user_notify.rb
CHANGED
data/app/models/work.rb
CHANGED
@@ -4,11 +4,11 @@ class Work < ActiveRecord::Base
|
|
4
4
|
|
5
5
|
belongs_to :task
|
6
6
|
belongs_to :user
|
7
|
-
belongs_to :
|
7
|
+
belongs_to :backlog
|
8
8
|
belongs_to :customer
|
9
9
|
|
10
10
|
validates_associated :task
|
11
|
-
validates_presence_of :
|
11
|
+
validates_presence_of :backlog
|
12
12
|
validates_presence_of :started_on
|
13
13
|
validates_presence_of :start_time, :if => :track_times?
|
14
14
|
|
@@ -17,13 +17,8 @@ class Work < ActiveRecord::Base
|
|
17
17
|
self.invoice = true if self.invoice.nil?
|
18
18
|
end
|
19
19
|
|
20
|
-
alias_method :old_work_account, :work_account
|
21
|
-
def work_account
|
22
|
-
self.old_work_account || (task && task.work_account)
|
23
|
-
end
|
24
|
-
|
25
20
|
def track_times?
|
26
|
-
|
21
|
+
backlog && backlog.track_times?
|
27
22
|
end
|
28
23
|
|
29
24
|
# Return an array with an array of works per day:
|
@@ -49,23 +44,23 @@ class Work < ActiveRecord::Base
|
|
49
44
|
|
50
45
|
# Return a hash with work accounts as keys an array of work hours totals per day as values:
|
51
46
|
# {
|
52
|
-
# <#
|
53
|
-
# <#
|
54
|
-
# <#
|
47
|
+
# <#Backlog#1> => [ 8, 7, 9, 12, 4, nil, nil],
|
48
|
+
# <#Backlog#2> => [nil, 1, nil, nil, 4, nil, nil],
|
49
|
+
# <#Backlog#3> => [nil, nil, nil, nil, nil, 4, 3],
|
55
50
|
# ]
|
56
|
-
def self.
|
51
|
+
def self.works_for_week_by_backlog(year, week_no, user = current_user)
|
57
52
|
first_date = Date.commercial(year, week_no, 1)
|
58
53
|
last_date = first_date + 6
|
59
54
|
works = find(:all, :conditions => "user_id #{user ? " = #{user.id}" : "IS NULL"} AND started_on BETWEEN '#{first_date}' AND '#{last_date}'", :order => 'completed_at, started_on, start_time')
|
60
55
|
result = {}
|
61
56
|
works.each do |work|
|
62
57
|
day_of_week = work.started_on.cwday - 1
|
63
|
-
result[work.
|
64
|
-
result[work.
|
65
|
-
result[work.
|
58
|
+
result[work.backlog] ||= []
|
59
|
+
result[work.backlog][day_of_week] ||= BigDecimal('0')
|
60
|
+
result[work.backlog][day_of_week] += work.hours
|
66
61
|
end
|
67
|
-
result.values.each {|
|
68
|
-
result.values.each {|
|
62
|
+
result.values.each {|backlog_totals| backlog_totals[6] ||= nil}
|
63
|
+
result.values.each {|backlog_totals| (0..6).each {|i| backlog_totals[i] = nil if backlog_totals[i] == 0}}
|
69
64
|
result
|
70
65
|
end
|
71
66
|
|
@@ -78,24 +73,24 @@ class Work < ActiveRecord::Base
|
|
78
73
|
first = Date.commercial(year, week_no, 1)
|
79
74
|
last = first + 6
|
80
75
|
works = find(:all, :conditions => "completed_at IS NOT NULL AND started_on BETWEEN '#{first}' AND '#{last}'", :order => 'started_on, start_time, completed_at')
|
81
|
-
|
82
|
-
works.map{|w| w.
|
83
|
-
|
76
|
+
totals_per_backlog = {}
|
77
|
+
works.map{|w| w.backlog}.uniq.each do |backlog|
|
78
|
+
totals_per_backlog[backlog.id] = [[], []]
|
84
79
|
(0..6).each do |day|
|
85
|
-
works_for_day = works.select {|work| (work.
|
80
|
+
works_for_day = works.select {|work| (work.backlog == backlog) && (work.started_on == (first + day)) && ((user.nil? && work.user_id.nil?) || (user && work.user_id == user.id)) }
|
86
81
|
invoice_works_for_day = works_for_day.select {|work| work.invoice? }
|
87
82
|
internal_works_for_day = works_for_day.select {|work| !work.invoice? }
|
88
83
|
|
89
84
|
invoice_day_total = invoice_works_for_day.reduce(BigDecimal('0')){|total, work| total += work.hours}
|
90
85
|
internal_day_total = internal_works_for_day.reduce(BigDecimal('0')){|total, work| total += work.hours}
|
91
|
-
|
92
|
-
|
86
|
+
totals_per_backlog[backlog.id][0] << invoice_day_total
|
87
|
+
totals_per_backlog[backlog.id][1] << internal_day_total
|
93
88
|
end
|
94
89
|
end
|
95
|
-
|
90
|
+
totals_per_backlog.reject! do |backlog_id, day_totals|
|
96
91
|
!day_totals[0].find{|day_total| day_total > 0} && !day_totals[1].find{|day_total| day_total > 0}
|
97
92
|
end
|
98
|
-
|
93
|
+
totals_per_backlog
|
99
94
|
end
|
100
95
|
|
101
96
|
def self.find_work_for_day(date, user = current_user)
|
@@ -1,18 +1,18 @@
|
|
1
1
|
class WorksReportFilter < ReportFilter
|
2
|
-
attr_reader :
|
2
|
+
attr_reader :backlog_id
|
3
3
|
attr_reader :invoice
|
4
4
|
attr_reader :user_id
|
5
5
|
|
6
6
|
def initialize(attributes)
|
7
|
-
@
|
7
|
+
@backlog_id = nil
|
8
8
|
@invoice = nil
|
9
9
|
@user_id = nil
|
10
10
|
|
11
11
|
if attributes
|
12
12
|
attributes = attributes.clone
|
13
13
|
|
14
|
-
|
15
|
-
@
|
14
|
+
backlog_id_param = attributes.delete(:backlog_id)
|
15
|
+
@backlog_id = backlog_id_param.to_i if backlog_id_param && backlog_id_param.size > 0
|
16
16
|
|
17
17
|
invoice_param = attributes.delete(:invoice)
|
18
18
|
@invoice = invoice_param == 'true' if invoice_param && invoice_param.size > 0
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<%=image_link_to 'arrow_up.png', l(:backlogs), :action => :list %>
|
2
2
|
<%=image_detour_to('clipboard.png', l(:edit), :controller => 'backlogs', :action => :edit, :id => @backlog) unless controller.action_name == 'edit' %>
|
3
|
-
<%=image_detour_to('hammer.png', l(:work), :controller => '
|
3
|
+
<%=image_detour_to('hammer.png', l(:work), :controller => 'works', :action => :list, :report_filter => {:backlog_id => @backlog.id}) %>
|
4
4
|
<%=detour_to(image_tag(url_for("add.png"), :alt => l(:add_task), :title => l(:add_task), :class => 'image-submit'), :controller => 'tasks', :action => 'new', :task => {:backlog_id => @backlog.id} ) %>
|
@@ -6,6 +6,11 @@
|
|
6
6
|
|
7
7
|
<h3>Options</h3>
|
8
8
|
|
9
|
+
<p>
|
10
|
+
<%= check_box 'backlog', 'track_times' %>
|
11
|
+
<label for="backlog_track_times"><%=l :track_times%></label>
|
12
|
+
</p>
|
13
|
+
|
9
14
|
<p>
|
10
15
|
<%= check_box 'backlog', 'track_todo' %>
|
11
16
|
<label for="backlog_track_todo"><%=l :track_todo%></label>
|
@@ -31,15 +36,6 @@
|
|
31
36
|
<label for="backlog_enable_users"><%=l :enable_users%></label>
|
32
37
|
</p>
|
33
38
|
|
34
|
-
<p>
|
35
|
-
<label for="backlog_work_account"><%=l :work_account%></label><br/>
|
36
|
-
<%=select 'backlog', 'work_account_id', [['', '']] + @work_accounts.map {|wa| [wa.name, wa.id]}.sort %>
|
37
|
-
<% if @backlog.work_account %>
|
38
|
-
<%=image_detour_to('work_account.png', "#{l(:work_account)} #{@backlog.work_account.name}", {:controller => 'work_accounts', :action => :edit, :id => @backlog.work_account}, {:class => 'image-submit', :style => 'vertical-align: bottom'}) %>
|
39
|
-
<% end %>
|
40
|
-
<%=detour_to l(:new_work_account), :controller => 'work_accounts', :action => :new %>
|
41
|
-
</p>
|
42
|
-
|
43
39
|
<!--[eoform:task]-->
|
44
40
|
|
45
41
|
|
@@ -6,7 +6,6 @@
|
|
6
6
|
|
7
7
|
<% if user? %>
|
8
8
|
| <%= link_to l(:backlogs), :controller => 'backlogs', :action => :list %>
|
9
|
-
| <%= link_to l(:work_accounts), :controller => 'work_accounts', :action => :list %>
|
10
9
|
| <%= link_to l(:log_out), :controller => 'user', :action => :logout %>
|
11
10
|
<% else %>
|
12
11
|
| <%= detour_to l(:log_in), :controller => 'user', :action => :login %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= select 'period', 'party_id', (@period.party ? [] : [['', '']]) + @parties.map{|party| [party.name, party.id]}, {}, :onchange => "form.action = '#{url_for :action => :new}'; form.submit();" %>
|
8
8
|
<% else %>
|
9
9
|
<label for="period_party_id"><%=l @period.party.class.name.downcase.to_s%></label>:
|
10
|
-
<%= hidden_field 'period', 'party_id' %><%=detour_to h(@period.party.name), :controller => @period.party.type.
|
10
|
+
<%= hidden_field 'period', 'party_id' %><%=detour_to h(@period.party.name), :controller => @period.party.type.to_s.downcase.pluralize, :action => :edit, :id => @period.party%>
|
11
11
|
<% end %>
|
12
12
|
<% if @period.party %>
|
13
13
|
<%=image_detour_to(@period.party.icon, "#{l(@period.party.to_sym)} #{@period.party.name}", :controller => @period.party.controller, :action => :edit, :id => @period.party) %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% @page_title = l(:search_results_for, @search) %>
|
1
|
+
<% @page_title = l(:search_results_for, :query => @search) %>
|
2
2
|
|
3
3
|
<div id="lfeature">
|
4
4
|
<div class="btitle">
|
@@ -11,17 +11,6 @@
|
|
11
11
|
</ul>
|
12
12
|
</div>
|
13
13
|
|
14
|
-
<div id="rfeature">
|
15
|
-
<div class="btitle">
|
16
|
-
<h4><%=l(:work_accounts) %></h4>
|
17
|
-
</div>
|
18
|
-
<ul>
|
19
|
-
<% @work_accounts.each do |work_account| %>
|
20
|
-
<li><%=link_to work_account.name, :controller => 'work_accounts', :action => :edit, :id => work_account%></li>
|
21
|
-
<% end %>
|
22
|
-
</ul>
|
23
|
-
</div>
|
24
|
-
|
25
14
|
<div id="lfeature">
|
26
15
|
<div class="btitle">
|
27
16
|
<h4><%=l(:tasks) %></h4>
|
File without changes
|
File without changes
|
data/app/views/tasks/_task.rhtml
CHANGED
@@ -1,26 +1,25 @@
|
|
1
|
-
|
2
|
-
<li id="task_<%=@task.id%>"<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (@task.period.nil? || @task.period.active_or_future?) && (not @task.work_started?) %><%=' class="highlight"' if highlight_task %><%=' style="display: none"' if hidden %>>
|
1
|
+
<li id="task_<%=task.id%>"<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (task.period.nil? || task.period.active_or_future?) && (not task.work_started?) %><%=' class="highlight"' if highlight_task %><%=' style="display: none"' if hidden %>>
|
3
2
|
<div style="float: left" style="border: 0px">
|
4
|
-
<% if
|
5
|
-
<% form_tag({:controller => 'tasks', :action => :specify, :id =>
|
6
|
-
<%=image_button_to('add.png', l(:specify), {:controller => 'tasks', :action => :specify, :id =>
|
7
|
-
:style => "margin-left: #{
|
3
|
+
<% if task.enable_subtasks? && active && (task.period.nil? || task.period.active_or_future?) %>
|
4
|
+
<% form_tag({:controller => 'tasks', :action => :specify, :id => task}) do %>
|
5
|
+
<%=image_button_to('add.png', l(:specify), {:controller => 'tasks', :action => :specify, :id => task.id},
|
6
|
+
:style => "margin-left: #{task.depth * 2}em") %>
|
8
7
|
<% end %>
|
9
8
|
<% else %>
|
10
9
|
<%=image_tag 'blank.png', :class => 'image-submit', :style => "margin-left: 0em; padding: 0px" %>
|
11
10
|
<% end %>
|
12
11
|
</div>
|
13
12
|
<div style="float: left" style="border: 3px solid red">
|
14
|
-
<%=resolution_image(
|
13
|
+
<%=resolution_image(task.resolution) if task.finished_at %>
|
15
14
|
</div>
|
16
|
-
<div id="task_
|
17
|
-
<%=detour_to "##{
|
15
|
+
<div id="task_<%=task.id%>_id" class="task_id">
|
16
|
+
<%=detour_to "##{task.id}", :controller => 'tasks', :action => :edit, :id => task.id, :style => 'border: 0px; margin: 0px; padding: 0px' if task.position || task.depth == 0 %>
|
18
17
|
</div>
|
19
|
-
<div id="task_
|
20
|
-
<b><%=h(
|
18
|
+
<div id="task_<%=task.id%>_description" class="task_description">
|
19
|
+
<b><%=h(task.description)%></b>
|
21
20
|
<% if show_backlog %>
|
22
21
|
<br/>
|
23
|
-
<%=l :backlog%>: <%=detour_to(h(
|
22
|
+
<%=l :backlog%>: <%=detour_to(h(task.backlog.name), :controller => 'backlogs', :action => :show, :id => task.backlog) %>
|
24
23
|
<% end %>
|
25
24
|
</div>
|
26
25
|
|
@@ -28,15 +27,15 @@
|
|
28
27
|
|
29
28
|
<div style="float: right" style="border: 1px solid black">
|
30
29
|
<div class="task_start">
|
31
|
-
<% if active &&
|
32
|
-
<% if
|
33
|
-
<% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id =>
|
30
|
+
<% if active && task.loggable? -%>
|
31
|
+
<% if task.work_started? -%>
|
32
|
+
<% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => task.started_work}) do |f| %>
|
34
33
|
<%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
|
35
|
-
<%=f.text_field 'start_time', :id => "work_#{
|
34
|
+
<%=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
35
|
:class => :task_time, :maxlength => 5 %>
|
37
36
|
<% end %>
|
38
|
-
<% elsif
|
39
|
-
<%=image_link_to_remote 'hammer.png', l(:start_work), with_detour({:controller => 'tasks', :action => :start_work, :id =>
|
37
|
+
<% elsif task.track_times? && (task.period_id.nil? || task.period.active?) %>
|
38
|
+
<%=image_link_to_remote 'hammer.png', l(:start_work), {:url => with_detour({:controller => 'tasks', :action => :start_work, :id => task.id})}, nil, true %>
|
40
39
|
<% else -%>
|
41
40
|
|
42
41
|
<% end -%>
|
@@ -45,65 +44,65 @@
|
|
45
44
|
<% end -%>
|
46
45
|
</div>
|
47
46
|
<div class="task_end_work">
|
48
|
-
<% if active &&
|
49
|
-
<% form_tag({:controller => 'works', :action => 'update', :id =>
|
50
|
-
<%= image_detour_to('ernes_stop.png', l(:end_work), {:controller => 'tasks', :action => :end_work, :id =>
|
47
|
+
<% if active && task.loggable? && task.work_started? -%>
|
48
|
+
<% form_tag({:controller => 'works', :action => 'update', :id => task.started_work}) do %>
|
49
|
+
<%= image_detour_to('ernes_stop.png', l(:end_work), {:controller => 'tasks', :action => :end_work, :id => task.id}, nil, true) %>
|
51
50
|
<% end -%>
|
52
51
|
<% else %>
|
53
52
|
|
54
53
|
<% end -%>
|
55
54
|
</div>
|
56
|
-
<div class="task_done" align="<%=active &&
|
57
|
-
<% if
|
58
|
-
<% if
|
59
|
-
<% unless
|
60
|
-
<% form_tag({:controller => 'works', :action => (
|
61
|
-
<%=hidden_field('work', 'task_id', :value =>
|
55
|
+
<div class="task_done" align="<%=active && task.loggable? && task.track_done? ? 'left' : 'right'%>">
|
56
|
+
<% if task.track_done? || task.total_done != 0 %>
|
57
|
+
<% if task.loggable? || task.finished_at -%>
|
58
|
+
<% unless !task.track_done? || task.track_times? || task.work_started? || task.finished_at -%>
|
59
|
+
<% form_tag({:controller => 'works', :action => (task.work_started? ? :edit : :create), :id => task.started_work}) do %>
|
60
|
+
<%=hidden_field('work', 'task_id', :value => task.id)%>
|
62
61
|
<%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
|
63
|
-
<%=text_field 'work', 'hours', :tabindex => i+1, :id => "#{
|
62
|
+
<%=text_field 'work', 'hours', :tabindex => i+1, :id => "#{task.id}_done",
|
64
63
|
:class => :task_hours, :maxlength => 4,
|
65
64
|
:ondblclick => "form.elements[1].style.display = 'inline';this.style.display = 'none'" -%>
|
66
65
|
<% end -%>
|
67
66
|
<% end -%>
|
68
|
-
<%=t
|
67
|
+
<%=t task.total_done if task.total_done != 0%>
|
69
68
|
<% end -%>
|
70
69
|
<% end -%>
|
71
70
|
</div>
|
72
71
|
<div class="task_todo">
|
73
|
-
<% if active &&
|
74
|
-
<% if
|
75
|
-
<% if
|
76
|
-
<% remote_form_for(:estimate, :url => {:action => :update_task_estimate, :id =>
|
77
|
-
<%=f.text_field :todo, :tabindex => i+2, :id => "task_#{
|
72
|
+
<% if active && task.loggable? -%>
|
73
|
+
<% if task.track_todo? -%>
|
74
|
+
<% if task.period.nil? || task.period.active_or_future? -%>
|
75
|
+
<% remote_form_for(:estimate, :url => {:action => :update_task_estimate, :id => task}) do |f| -%>
|
76
|
+
<%=f.text_field :todo, :tabindex => i+2, :id => "task_#{task.id}_todo", :value => task.todo, :class => :task_hours, :maxlength => 4 %>
|
78
77
|
<% end -%>
|
79
78
|
<% else -%>
|
80
|
-
|
79
|
+
<%=task.todo %>
|
81
80
|
<% end -%>
|
82
81
|
<% else %>
|
83
|
-
<% if
|
84
|
-
<%=image_link_to_remote('checkmark.png', l(:complete), {:action => :finish_task, :id =>
|
82
|
+
<% if !task.work_started? && (task.period.nil? || task.period.active?) %>
|
83
|
+
<%=image_link_to_remote('checkmark.png', l(:complete), {:url => {:action => :finish_task, :id => task}}, nil, true)%>
|
85
84
|
<% end -%>
|
86
85
|
<% end -%>
|
87
86
|
<% end -%>
|
88
87
|
</div>
|
89
88
|
<div class="task_buttons">
|
90
|
-
<% if
|
91
|
-
<% if
|
92
|
-
<% unless
|
93
|
-
<% if
|
94
|
-
<% if
|
95
|
-
<%=image_link_to_remote('grab.png', l(:release_task), with_detour({:controller => 'tasks', :action => :release, :id =>
|
89
|
+
<% if task.active? -%>
|
90
|
+
<% if task.loggable? -%>
|
91
|
+
<% unless task.work_started? -%>
|
92
|
+
<% if task.backlog.enable_users? %>
|
93
|
+
<% if task.users.include?(current_user) %>
|
94
|
+
<%=image_link_to_remote('grab.png', l(:release_task), {:url => with_detour({:controller => 'tasks', :action => :release, :id => task})}, nil, true)%>
|
96
95
|
<% else %>
|
97
|
-
<%=image_link_to_remote('grab_gray.png', "#{l:grab_task} #{" (#{l :not_grabbed})" if
|
96
|
+
<%=image_link_to_remote('grab_gray.png', "#{l:grab_task} #{" (#{l :not_grabbed})" if task.users.empty?}", {:url => with_detour({:controller => 'tasks', :action => :grab, :id => task})}, nil, true)%>
|
98
97
|
<% end %>
|
99
98
|
<% end %>
|
100
|
-
<%=image_link_to_remote('arrow_right.png', l(:move_to_next_period), {:action => :move_task_to_next_period, :id =>
|
101
|
-
<%=image_link_to_remote('ernes_stop.png', l(:abort), {:action => :abort_task, :id =>
|
99
|
+
<%=image_link_to_remote('arrow_right.png', l(:move_to_next_period), {:url => {:action => :move_task_to_next_period, :id => task}}, nil, true) if task.backlog.enable_periods? || task.period_id%>
|
100
|
+
<%=image_link_to_remote('ernes_stop.png', l(:abort), {:url => {:action => :abort_task, :id => task}}, nil, true)%>
|
102
101
|
<% end -%>
|
103
102
|
<% end -%>
|
104
|
-
<% elsif (
|
105
|
-
<% form_tag({:controller => 'tasks', :action => 'update', :id =>
|
106
|
-
<%=image_link_to_remote('eraser.png', l(:reopen), {:action => :reopen_task, :id =>
|
103
|
+
<% elsif (task.period.nil? || (not task.period.passed?)) && task.leaf? -%>
|
104
|
+
<% form_tag({:controller => 'tasks', :action => 'update', :id => task}) do -%>
|
105
|
+
<%=image_link_to_remote('eraser.png', l(:reopen), {:url => {:action => :reopen_task, :id => task}}, nil, true) %>
|
107
106
|
<% end -%>
|
108
107
|
<% end -%>
|
109
108
|
</div>
|
@@ -112,6 +111,6 @@
|
|
112
111
|
</li>
|
113
112
|
|
114
113
|
<% for subtask in task.children %>
|
115
|
-
<%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active, :highlight_task => subtask == @selected_task, :update => update } if (active && subtask.active?) || (!active && subtask.completed?) %>
|
114
|
+
<%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active, :hidden => false, :show_backlog => false, :highlight_task => subtask == @selected_task, :update => update } if (active && subtask.active?) || (!active && subtask.completed?) %>
|
116
115
|
<% i += 1 %>
|
117
116
|
<% end %>
|