backlog 0.35.5 → 0.36.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/Gemfile +19 -0
  2. data/Gemfile~ +4 -0
  3. data/History.txt +25 -0
  4. data/Rakefile +3 -3
  5. data/app/controllers/{application.rb → application_controller.rb} +1 -2
  6. data/app/controllers/backlogs_controller.rb +0 -16
  7. data/app/controllers/search_controller.rb +0 -2
  8. data/app/controllers/user_controller.rb +7 -7
  9. data/app/controllers/work_locks_controller.rb +2 -2
  10. data/app/controllers/works_controller.rb +23 -23
  11. data/app/helpers/application_helper.rb +9 -6
  12. data/app/helpers/backlogs_helper.rb +1 -1
  13. data/app/helpers/periods_helper.rb +1 -1
  14. data/app/models/backlog.rb +13 -10
  15. data/app/models/period.rb +0 -5
  16. data/app/models/sidebar.rb +1 -0
  17. data/app/models/task.rb +4 -10
  18. data/app/models/user.rb +5 -6
  19. data/app/models/user_notify.rb +0 -1
  20. data/app/models/work.rb +20 -25
  21. data/app/models/works_report_filter.rb +4 -4
  22. data/app/views/backlogs/_buttons.rhtml +1 -1
  23. data/app/views/backlogs/_form.rhtml +5 -9
  24. data/app/views/layouts/_left_top.rhtml +0 -1
  25. data/app/views/periods/_form.rhtml +1 -1
  26. data/app/views/search/results.rhtml +1 -12
  27. data/app/views/task_notify/{invite_en.rhtml → invite.en.html.erb} +0 -0
  28. data/app/views/task_notify/{invite_no.rhtml → invite.no.html.erb} +0 -0
  29. data/app/views/tasks/_task.rhtml +49 -50
  30. data/app/views/tasks/edit.rhtml +4 -4
  31. data/app/views/tasks/start_work.rjs +1 -1
  32. data/app/views/user/_edit.rhtml +1 -1
  33. data/app/views/user/change_password.rhtml +1 -1
  34. data/app/views/user/edit.rhtml +4 -4
  35. data/app/views/user/signup.rhtml +2 -2
  36. data/app/views/user_notify/{change_password_en.rhtml → change_password.en.html.erb} +0 -0
  37. data/app/views/user_notify/{change_password_no.rhtml → change_password.no.html.erb} +0 -0
  38. data/app/views/user_notify/{forgot_password_en.rhtml → forgot_password.en.html.erb} +0 -0
  39. data/app/views/user_notify/{forgot_password_no.rhtml → forgot_password.no.html.erb} +0 -0
  40. data/app/views/user_notify/{monitoring_en.rhtml → monitoring.en.html.erb} +0 -0
  41. data/app/views/user_notify/{monitoring_no.rhtml → monitoring.no.html.erb} +0 -0
  42. data/app/views/user_notify/{monitoring_invitation_en.rhtml → monitoring_invitation.en.html.erb} +0 -0
  43. data/app/views/user_notify/{monitoring_invitation_no.rhtml → monitoring_invitation.no.html.erb} +0 -0
  44. data/app/views/user_notify/{signup_en.rhtml → signup.en.html.erb} +0 -0
  45. data/app/views/user_notify/{signup_no.rhtml → signup.no.html.erb} +0 -0
  46. data/app/views/work_lock_notify/{lock_en.rhtml → lock.en.html.erb} +0 -0
  47. data/app/views/work_lock_notify/{lock_no.rhtml → lock.no.html.erb} +0 -0
  48. data/app/views/work_lock_notify/{nag_en.rhtml → nag.en.html.erb} +0 -0
  49. data/app/views/work_lock_notify/{nag_no.rhtml → nag.no.html.erb} +0 -0
  50. data/app/views/works/_form.rhtml +6 -6
  51. data/app/views/works/_new_row.rhtml +6 -6
  52. data/app/views/works/_row.rhtml +2 -2
  53. data/app/views/works/daily_work_sheet.rhtml +1 -1
  54. data/app/views/works/list.rhtml +6 -6
  55. data/app/views/works/list_excel.rhtml +8 -4
  56. data/app/views/works/timeliste.rhtml +14 -14
  57. data/app/views/works/update_row.rjs +1 -1
  58. data/app/views/works/weekly_work_sheet.rhtml +5 -5
  59. data/app/views/works/weekly_work_sheet_details.rhtml +5 -5
  60. data/config/boot.rb +108 -27
  61. data/config/database.yml +3 -26
  62. data/config/environment.rb +4 -12
  63. data/config/environments/development.rb +0 -1
  64. data/config/initializers/jdbc.rb +7 -0
  65. data/config/initializers/mongrel.rb +83 -0
  66. data/config/locales/en.yml +189 -0
  67. data/config/locales/no.yml +192 -0
  68. data/config/preinitializer.rb +20 -0
  69. data/cruise_build.sh +10 -0
  70. data/cruise_config.rb +1 -1
  71. data/db/migrate/20100720124707_merge_work_account_into_backlog.rb +74 -0
  72. data/db/schema.rb +93 -127
  73. data/lib/class_table_inheritance.rb +53 -11
  74. data/lib/tasks/jdbc.rake +8 -0
  75. data/lib/user_system.rb +5 -1
  76. data/public/javascripts/controls.js +76 -79
  77. data/public/javascripts/dragdrop.js +166 -167
  78. data/public/javascripts/effects.js +174 -168
  79. data/public/javascripts/prototype.js +470 -334
  80. data/public/stylesheets/mwrt002.css +6 -6
  81. data/script/dbconsole +3 -0
  82. data/test/fixtures/backlogs.yml +2 -2
  83. data/test/fixtures/work_lock_subscriptions.yml +2 -2
  84. data/test/fixtures/works.yml +6 -6
  85. data/test/functional/absences_controller_test.rb +1 -1
  86. data/test/functional/backlogs_controller_test.rb +4 -4
  87. data/test/functional/customers_controller_test.rb +1 -1
  88. data/test/functional/dashboard_controller_test.rb +1 -1
  89. data/test/functional/estimates_controller_test.rb +1 -1
  90. data/test/functional/groups_controller_test.rb +1 -1
  91. data/test/functional/parties_controller_test.rb +1 -1
  92. data/test/functional/periods_controller_test.rb +1 -1
  93. data/test/functional/public_holidays_controller_test.rb +1 -1
  94. data/test/functional/search_controller_test.rb +1 -1
  95. data/test/functional/task_files_controller_test.rb +1 -1
  96. data/test/functional/tasks_controller_test.rb +6 -6
  97. data/test/functional/user_controller_test.rb +3 -2
  98. data/test/functional/welcome_controller_test.rb +1 -1
  99. data/test/functional/work_locks_controller_test.rb +1 -1
  100. data/test/functional/works_controller_test.rb +11 -11
  101. data/test/test_helper.rb +2 -2
  102. data/test/unit/absence_test.rb +1 -1
  103. data/test/unit/configuration_test.rb +1 -1
  104. data/test/unit/customer_test.rb +1 -1
  105. data/test/unit/estimate_test.rb +1 -1
  106. data/test/unit/group_test.rb +1 -1
  107. data/test/unit/party_test.rb +1 -1
  108. data/test/unit/period_test.rb +1 -1
  109. data/test/unit/public_holiday_test.rb +1 -1
  110. data/test/unit/task_file_test.rb +1 -1
  111. data/test/unit/task_test.rb +1 -1
  112. data/test/unit/user_test.rb +1 -1
  113. data/test/unit/work_lock_subscription_test.rb +1 -1
  114. data/test/unit/work_lock_test.rb +1 -1
  115. data/test/unit/work_test.rb +8 -8
  116. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +3 -3
  117. data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +2 -2
  118. data/vendor/plugins/auto_complete/README +23 -0
  119. data/vendor/plugins/auto_complete/Rakefile +22 -0
  120. data/vendor/plugins/auto_complete/init.rb +2 -0
  121. data/vendor/plugins/auto_complete/lib/auto_complete.rb +47 -0
  122. data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +143 -0
  123. data/vendor/plugins/auto_complete/test/auto_complete_test.rb +67 -0
  124. data/vendor/plugins/backlog_jira/init.rb +4 -0
  125. data/vendor/plugins/backlog_jira/{tasks → lib/tasks}/backlog_jira_tasks.rake +0 -0
  126. data/vendor/plugins/has_history/{tasks → lib/tasks}/has_history_tasks.rake +0 -0
  127. metadata +745 -817
  128. data/#SearchRequest.xml# +0 -3443
  129. data/app/controllers/application.rb~ +0 -207
  130. data/app/controllers/work_accounts_controller.rb +0 -58
  131. data/app/helpers/work_accounts_helper.rb +0 -2
  132. data/app/models/work_account.rb +0 -18
  133. data/app/models/work_lock_subscription.rb +0 -3
  134. data/app/views/work_accounts/_form.rhtml +0 -16
  135. data/app/views/work_accounts/_name_list.rhtml +0 -5
  136. data/app/views/work_accounts/_title.rhtml +0 -5
  137. data/app/views/work_accounts/edit.rhtml +0 -12
  138. data/app/views/work_accounts/list.rhtml +0 -31
  139. data/app/views/work_accounts/new.rhtml +0 -10
  140. data/app/views/work_accounts/show.rhtml +0 -50
  141. data/config/environments/localization_environment.rb +0 -10
  142. data/jira.log +0 -98246
  143. data/lang/en.yaml +0 -147
  144. data/lang/localizations.yaml +0 -2
  145. data/lang/no.yaml +0 -146
  146. data/lib/localization.rb +0 -88
  147. data/test/fixtures/work_accounts.yml +0 -7
  148. data/test/functional/work_accounts_controller_test.rb +0 -94
  149. data/test/unit/localization_test.rb +0 -47
  150. data/test/unit/work_account_test.rb +0 -10
@@ -35,7 +35,7 @@
35
35
  :class => :task_time, :maxlength => 5 %>
36
36
  <% end %>
37
37
  <% elsif @task.track_times? && (@task.period.nil? || @task.period.active?) %>
38
- <%=image_link_to_remote 'hammer.png', l(:start_work), {:controller => 'tasks', :action => :start_work, :id => @task.id}, nil, true %>
38
+ <%=image_link_to_remote 'hammer.png', l(:start_work), {:url => {:controller => 'tasks', :action => :start_work, :id => @task.id}}, nil, true %>
39
39
  <% end -%>
40
40
  <% end -%>
41
41
  </div>
@@ -51,14 +51,14 @@
51
51
  <% if @task.loggable? -%>
52
52
  <% unless @task.work_started? -%>
53
53
  <%# form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do -%>
54
- <%=image_link_to_remote('arrow_right.png', l(:move_to_next_period), {:action => :move_task_to_next_period, :id => @task}, nil, true) if @task.backlog.enable_periods? || @task.period_id%>
55
- <%=image_link_to_remote('ernes_stop.png', l(:abort), {:action => :abort_task, :id => @task}, nil, true)%>
54
+ <%=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%>
55
+ <%=image_link_to_remote('ernes_stop.png', l(:abort), {:url => {:action => :abort_task, :id => @task}}, nil, true)%>
56
56
  <%# end -%>
57
57
  <% end -%>
58
58
  <% end -%>
59
59
  <% elsif (@task.period.nil? || (not @task.period.passed?)) && @task.leaf? -%>
60
60
  <% form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do -%>
61
- <%=image_link_to_remote('eraser.png', l(:reopen), {:action => :reopen_task, :id => @task}, nil, true) %>
61
+ <%=image_link_to_remote('eraser.png', l(:reopen), {:url => {:action => :reopen_task, :id => @task}}, nil, true) %>
62
62
  <% end -%>
63
63
  <% end -%>
64
64
  </div>
@@ -1 +1 @@
1
- page.replace "task_#{@task.id}", :partial => '/tasks/task', :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => false }
1
+ page.replace "task_#{@task.id}", :partial => '/tasks/task', :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => false, :show_backlog => false }
@@ -22,7 +22,7 @@
22
22
  <% if submit %>
23
23
  <tr>
24
24
  <td colspan="2">
25
- <%= submit_tag user.new_record? ? 'signup' : l(:save), :class => 'two_columns' %>
25
+ <%= submit_tag @user.new_record? ? 'signup' : l(:save), :class => 'two_columns' %>
26
26
  <%= back_or_link_to l(:back), :action => 'list' %>
27
27
  </td>
28
28
  </tr>
@@ -9,7 +9,7 @@
9
9
  Enter your new password in the fields below and click 'Change Password' to have a new password sent to your email inbox.
10
10
 
11
11
  <%= start_form_tag_helper %>
12
- <%= render_partial 'password', :user => @user, :submit => false %>
12
+ <%=render :partial => 'password', :locals => {:submit => false} %>
13
13
  <div class="button-bar">
14
14
  <%= submit_tag 'Change Password' %>
15
15
  <%= link_to 'Cancel', :action => 'welcome' %>
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
 
12
12
  <%= start_form_tag_helper %>
13
- <%= render_partial 'edit', :user => @user, :submit => true %>
13
+ <%=render :partial => 'edit', :locals => {:submit => true} %>
14
14
  </form>
15
15
  </div>
16
16
 
@@ -62,7 +62,7 @@
62
62
  <% for subscriber in @user.work_lock_subscribers %>
63
63
  <tr>
64
64
  <td align="right"><%=detour_to subscriber.name, :action => :edit%></td>
65
- <td align="left"><%=image_link_to_remote 'email.png', "#{l :stop} #{l :monitoring}", {:action => :toggle_work_lock_monitoring, :id => current_user.id, :subscriber_id => subscriber.id}, :id => "work_lock_monitor_icon_#{subscriber.id}"%></td>
65
+ <td align="left"><%=image_link_to_remote 'email.png', "#{l :stop} #{l :monitoring}", {:url => {:action => :toggle_work_lock_monitoring, :id => current_user.id, :subscriber_id => subscriber.id}}, :id => "work_lock_monitor_icon_#{subscriber.id}"%></td>
66
66
  </tr>
67
67
  <% end %>
68
68
  <% end %>
@@ -78,7 +78,7 @@
78
78
  </table>
79
79
  <% else %>
80
80
  <% monitoring = @user.work_lock_subscribers.include? current_user %>
81
- <%=image_link_to_remote "email#{'_grey' unless monitoring}.png", "#{l(monitoring ? :stop : :start)} #{l(:monitoring)}", {:action => :toggle_work_lock_monitoring, :id => @user.id}, {:id => "work_lock_monitor_icon_#{current_user.id}", :style => 'float: right'} %>
81
+ <%=image_link_to_remote "email#{'_grey' unless monitoring}.png", "#{l(monitoring ? :stop : :start)} #{l(:monitoring)}", {:url => {:action => :toggle_work_lock_monitoring, :id => @user.id}}, {:id => "work_lock_monitor_icon_#{current_user.id}", :style => 'float: right'} %>
82
82
  <% end %>
83
83
  </div>
84
84
 
@@ -95,7 +95,7 @@
95
95
  <tr>
96
96
  <td align="right"><%=detour_to subscribee.name, :action => :edit, :id => subscribee.id %></td>
97
97
  <td align="left"><%=image_link_to 'work_account.png', "#{l :work}", {:controller => 'works', :action => :weekly_work_sheet, :user_id => subscribee.id} %></td>
98
- <td align="left"><%=image_link_to_remote 'email.png', "#{l :stop} #{l :monitoring}", {:action => :toggle_work_lock_monitoring, :subscriber_id => current_user.id, :id => subscribee.id}, :id => "work_lock_monitor_icon_#{subscribee.id}"%></td>
98
+ <td align="left"><%=image_link_to_remote 'email.png', "#{l :stop} #{l :monitoring}", {:url => {:action => :toggle_work_lock_monitoring, :subscriber_id => current_user.id, :id => subscribee.id}}, :id => "work_lock_monitor_icon_#{subscribee.id}"%></td>
99
99
  </tr>
100
100
  <% end %>
101
101
  <% end %>
@@ -4,8 +4,8 @@
4
4
 
5
5
  <div class="form-padding">
6
6
  <%= start_form_tag_helper %>
7
- <%= render_partial 'edit', :user => @user, :submit => false %></br>
8
- <%= render_partial 'password', :submit => false %>
7
+ <%= render :partial => 'edit', :locals => {:submit => false} %></br>
8
+ <%= render :partial => 'password', :locals => {:submit => false} %>
9
9
 
10
10
  <div class="button-bar">
11
11
  <%= submit_tag l(:signup) %>
@@ -1,11 +1,11 @@
1
1
  <!--[form:work]-->
2
2
 
3
- <p><%=l :work_account%>:<br/>
4
- <%= select 'work', 'work_account_id', @work_accounts.map{|wa| [wa.name, wa.id]}.sort %>
5
- <% if @work.work_account -%>
6
- <%=image_detour_to('work_account.png', "#{l(:work_account)} #{@work.work_account.name}", {:controller => 'work_accounts', :action => :edit, :id => @work.work_account}, {:class => 'image-submit', :style => 'vertical-align: bottom'}) %>
3
+ <p><%=l :backlog%>:<br/>
4
+ <%= select 'work', 'backlog_id', @backlogs.map{|wa| [wa.name, wa.id]}.sort %>
5
+ <% if @work.backlog -%>
6
+ <%=image_detour_to('work_account.png', "#{l(:backlog)} #{@work.backlog.name}", {:controller => 'backlogs', :action => :edit, :id => @work.backlog}, {:class => 'image-submit', :style => 'vertical-align: bottom'}) %>
7
7
  <% end -%>
8
- <%=detour_to l(:new_work_account), :controller => 'work_accounts', :action => :new %>
8
+ <%=detour_to l(:new_backlog), :controller => 'backlogs', :action => :new %>
9
9
  </p>
10
10
 
11
11
  <p><%=l :task%>:<br/>
@@ -71,7 +71,7 @@
71
71
  <p style="float: left;"><label for="work_hours"><%=l :hours%></label><br/>
72
72
  <%=text_field 'work', 'hours_time', :class => :task_hours, :value => t(@work.hours) %></p>
73
73
 
74
- <p style="float: left;"><br/><%=image_link_to_remote 'refresh.png', l(:refresh), :action => :calculate_hours, :started_at => "' + $('work_started_at').value + '", :completed_at => "' + $('work_completed_at').value + '" %></p>
74
+ <p style="float: left;"><br/><%=image_link_to_remote 'refresh.png', l(:refresh), {:url => {:action => :calculate_hours}, :with => "'started_at=' + $('work_started_at').value + '&completed_at=' + $('work_completed_at').value"} %></p>
75
75
 
76
76
  <% end %>
77
77
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  <tr>
6
6
  <td id="account_cell" valign="bottom">
7
- <%=select :work, :work_account_id, [['', '']] + @work_accounts.map {|wa| [wa.name, wa.id]}, :value => '' %>
7
+ <%=select :work, :backlog_id, [['', '']] + @backlogs.map {|wa| [wa.name, wa.id]}, :value => '' %>
8
8
  </td>
9
9
  <td valign="bottom">
10
10
  <%=text_field_with_auto_complete :work, :description, {:class => :task_description,
@@ -19,13 +19,13 @@
19
19
  e.focus();
20
20
  e.select();
21
21
  } else if(event.keyCode == 13) {
22
- e = $('work_work_account_id');
22
+ e = $('work_backlog_id');
23
23
  if(e.value == '') {
24
24
  e.focus();
25
25
  e.select();
26
26
  return false;
27
27
  }
28
- }"}, :with => "'description=' + $('work_description').value + '&work_account_id=' + $('work_work_account_id').value"
28
+ }"}, :with => "'description=' + $('work_description').value + '&backlog_id=' + $('work_backlog_id').value"
29
29
  %>
30
30
  <br clear="all"/>
31
31
  <% field = 'notes' %>
@@ -72,7 +72,7 @@
72
72
  e.focus();
73
73
  e.select();
74
74
  } else if(event.keyCode == 13) {
75
- e = $('work_work_account_id');
75
+ e = $('work_backlog_id');
76
76
  if(e.value == '') {
77
77
  e.focus();
78
78
  e.select();
@@ -99,7 +99,7 @@
99
99
  e.focus();
100
100
  e.select();
101
101
  } else if(event.keyCode == 13) {
102
- e = $('work_work_account_id');
102
+ e = $('work_backlog_id');
103
103
  if(e.value == '') {
104
104
  e.focus();
105
105
  e.select();
@@ -117,7 +117,7 @@
117
117
  e.focus();
118
118
  e.select();
119
119
  } else if(event.keyCode == 13) {
120
- e = $('work_work_account_id');
120
+ e = $('work_backlog_id');
121
121
  if(e.value == '') {
122
122
  e.focus();
123
123
  e.select();
@@ -1,7 +1,7 @@
1
1
  <tr id="work_<%=@work.id%>" style="border: 1px solid black; vertical-align: top">
2
2
  <td>
3
3
  <% remote_form_for :work, :url => {:action => :update_row, :id => @work.id, :next_field => :description}, :html => {:id => "work_#{@work.id}_form"} do |f|%>
4
- <%=f.select :work_account_id, @work_accounts.map {|wa| [wa.name, wa.id]}, {}, :id => "work_#{@work.id}_work_account_id", :onchange => "new Ajax.Request('/works/update_row/#{@work.id}?next_field=customer_id', {asynchronous:true, evalScripts:true, parameters:Form.serialize(form)})"%>
4
+ <%=f.select :backlog_id, @backlogs.map {|wa| [wa.name, wa.id]}, {}, :id => "work_#{@work.id}_backlog_id", :onchange => "new Ajax.Request('/works/update_row/#{@work.id}?next_field=customer_id', {asynchronous:true, evalScripts:true, parameters:Form.serialize(form)})"%>
5
5
  <% end %>
6
6
  </td>
7
7
  <td>
@@ -81,7 +81,7 @@
81
81
  :onchange => "new Ajax.Request('/works/update_row/#{@work.id}?next_field=task_id', {asynchronous:true, evalScripts:true, parameters:Form.serialize(form)})"%>
82
82
  <% end %>
83
83
  </td>
84
- <td align="right">
84
+ <td align="right" style="width: 6em" nowrap="true">
85
85
  <% remote_form_for :work, :url => {:action => :update_row, :id => @work.id, :next_field => :invoice} do |f|%>
86
86
  <%=text_field_with_auto_complete "work_#{@work.id}", :task_id,
87
87
  {:name => "work[task_id]", :value => @work.task_id, :class => :task_id, :onchange => "new Ajax.Request('/works/update_row/#{@work.id}?next_field=invoice', {asynchronous:true, evalScripts:true, parameters:Form.serialize(form)})"},
@@ -97,7 +97,7 @@
97
97
  //<!--
98
98
  var start_field;
99
99
  <% if last_work.nil? || last_work.completed_at %>
100
- start_field = $('work_work_account_id');
100
+ start_field = $('work_backlog_id');
101
101
  <% else %>
102
102
  start_field = $('work_<%=last_work.id%>_completed_at_time');
103
103
  <% end %>
@@ -9,10 +9,10 @@
9
9
  <table>
10
10
  <tr>
11
11
  <td coslpan="3">
12
- <label for="report_filter_work_account_id"><%=l :work_account%></label>
12
+ <label for="report_filter_backlog_id"><%=l :backlog%></label>
13
13
  </td>
14
14
  <td>
15
- <%=f.select :work_account_id, [[l(:all), nil]] + @work_accounts.map{|wa|[wa.name, wa.id]}, {}, {:onchange => 'form.submit()'} %>
15
+ <%=f.select :backlog_id, [[l(:all), nil]] + @backlogs.map{|wa|[wa.name, wa.id]}, {}, {:onchange => 'form.submit()'} %>
16
16
  </td>
17
17
  </tr>
18
18
  <tr>
@@ -101,7 +101,7 @@
101
101
  <tr>
102
102
  <th><%=l :user %></th>
103
103
  <th><%=l :done %></th>
104
- <th><%=l :work_account %></th>
104
+ <th><%=l :backlog %></th>
105
105
  <th><%=l :description %></th>
106
106
  <th><%=l :invoice %></th>
107
107
  <th><%=l :started_at %></th>
@@ -112,7 +112,7 @@
112
112
  <tr>
113
113
  <td valign="top"><%=work.user && work.user.login %></td>
114
114
  <td align="right" valign="top"><%='%.2f' % work.hours %></td>
115
- <td valign="top"><%=work.work_account.name %></td>
115
+ <td valign="top"><%=work.backlog.name %></td>
116
116
  <%if work.task
117
117
  link = "Task: #{work.task.description} <br/>"
118
118
  else
@@ -121,7 +121,7 @@
121
121
  link += h(work.description)
122
122
  %>
123
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>
124
- <td><%=work.invoice ? l(:yes) : '' %></td>
124
+ <td><%=work.invoice ? t(:yes) : '' %></td>
125
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
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>
127
127
  <tr>
@@ -138,7 +138,7 @@
138
138
  <% if @period %>
139
139
  <%=back_or_link_to l(:back), :controller => 'periods', :action => :show, :id => @period %>
140
140
  <% else %>
141
- <%=back_or_link_to l(:back), :controller => 'work_accounts', :action => :show, :id => @work_account %>
141
+ <%=back_or_link_to l(:back), :controller => 'backlogs', :action => :show, :id => @backlog %>
142
142
  <% end %>
143
143
 
144
144
  </div>
@@ -36,6 +36,9 @@
36
36
  <Style ss:ID="header">
37
37
  <Font x:Family="Swiss" ss:Size="14" ss:Bold="1"/>
38
38
  </Style>
39
+ <Style ss:ID="LongDateFormat">
40
+ <NumberFormat ss:Format="dd/mm/yy\ h:mm;@"/>
41
+ </Style>
39
42
  </Styles>
40
43
  <Worksheet ss:Name="<%=l(:done)%>">
41
44
  <Table ss:ExpandedColumnCount="256" x:FullColumns="1"
@@ -56,7 +59,7 @@
56
59
  </Row>
57
60
 
58
61
  <Row ss:AutoFitHeight="0" ss:Height="19.875">
59
- <Cell ss:StyleID="header"><Data ss:Type="String"><%=l :work_account%></Data></Cell>
62
+ <Cell ss:StyleID="header"><Data ss:Type="String"><%=l :backlog%></Data></Cell>
60
63
  <Cell ss:StyleID="header"><Data ss:Type="String"><%=l :user%></Data></Cell>
61
64
  <Cell ss:StyleID="header"><Data ss:Type="String"><%=l :task%></Data></Cell>
62
65
  <Cell ss:StyleID="header"><Data ss:Type="String"><%=l :description%></Data></Cell>
@@ -68,16 +71,17 @@
68
71
 
69
72
  <% for work in @works %>
70
73
  <Row>
71
- <Cell><Data ss:Type="String"><%=work.work_account.name %></Data></Cell>
74
+ <Cell><Data ss:Type="String"><%=work.backlog.name %></Data></Cell>
72
75
  <Cell><Data ss:Type="String"><%=work.user && work.user.name %></Data></Cell>
73
76
  <Cell><Data ss:Type="String"><%=work.task && work.task.description %></Data></Cell>
74
77
  <Cell><Data ss:Type="String"><%=work.description %></Data></Cell>
75
78
  <Cell><Data ss:Type="Number"><%=work.hours %></Data></Cell>
76
79
  <Cell><Data ss:Type="String"><%=work.invoice? ? 'Ja' : 'Nei' %></Data></Cell>
77
- <Cell><Data ss:Type="DateTime"><%=work.start_time ? work.started_on.at(work.start_time).strftime('%Y-%m-%dT%H:%M:%S') : work.started_on.strftime('%Y-%m-%d') %></Data></Cell>
80
+ <Cell ss:StyleID="LongDateFormat"><Data ss:Type="DateTime"><%=work.start_time ? work.started_on.at(work.start_time).strftime('%Y-%m-%dT%H:%M:%S') : work.started_on.strftime('%Y-%m-%d') %></Data></Cell>
78
81
  <% if work.completed_at %>
79
- <Cell><Data ss:Type="DateTime"><%=work.completed_at.strftime('%Y-%m-%dT%H:%M:%S') %></Data></Cell>
82
+ <Cell ss:StyleID="LongDateFormat"><Data ss:Type="DateTime"><%=work.completed_at.strftime('%Y-%m-%dT%H:%M:%S') %></Data></Cell>
80
83
  <% end %>
84
+
81
85
  </Row>
82
86
 
83
87
  <% end %>
@@ -450,12 +450,12 @@
450
450
  <Cell ss:StyleID="s37"><Data ss:Type="String">Merknad</Data></Cell>
451
451
  </Row>
452
452
 
453
- <% for work_account_id in @work_totals_per_work_account.keys %>
454
- <% invoice_works_per_day = @work_totals_per_work_account[work_account_id][0]%>
453
+ <% for backlog_id in @work_totals_per_backlog.keys %>
454
+ <% invoice_works_per_day = @work_totals_per_backlog[backlog_id][0]%>
455
455
  <% if invoice_works_per_day.find{|total| total > 0} %>
456
456
  <Row>
457
- <Cell ss:StyleID="s24"><Data ss:Type="String"><%=WorkAccount.find(work_account_id).invoice_code %></Data></Cell>
458
- <Cell ss:StyleID="s25"><Data ss:Type="String"><%=WorkAccount.find(work_account_id).name %></Data></Cell>
457
+ <Cell ss:StyleID="s24"><Data ss:Type="String"><%=Backlog.find(backlog_id).invoice_code %></Data></Cell>
458
+ <Cell ss:StyleID="s25"><Data ss:Type="String"><%=Backlog.find(backlog_id).name %></Data></Cell>
459
459
  <Cell ss:StyleID="s25"><Data ss:Type="String"> X</Data></Cell>
460
460
  <Cell ss:StyleID="s25"/>
461
461
  <Cell ss:StyleID="s25"/>
@@ -469,11 +469,11 @@
469
469
  </Row>
470
470
  <% end %>
471
471
 
472
- <% internal_works_per_day = @work_totals_per_work_account[work_account_id][1]%>
472
+ <% internal_works_per_day = @work_totals_per_backlog[backlog_id][1]%>
473
473
  <% if internal_works_per_day.find{|total| total > 0} %>
474
474
  <Row>
475
- <Cell ss:StyleID="s24"><Data ss:Type="String"><%=WorkAccount.find(work_account_id).invoice_code%></Data></Cell>
476
- <Cell ss:StyleID="s25"><Data ss:Type="String"><%=WorkAccount.find(work_account_id).name %></Data></Cell>
475
+ <Cell ss:StyleID="s24"><Data ss:Type="String"><%=Backlog.find(backlog_id).invoice_code%></Data></Cell>
476
+ <Cell ss:StyleID="s25"><Data ss:Type="String"><%=Backlog.find(backlog_id).name %></Data></Cell>
477
477
  <Cell ss:StyleID="s25"/>
478
478
  <Cell ss:StyleID="s25"/>
479
479
  <Cell ss:StyleID="s25"/>
@@ -528,25 +528,25 @@
528
528
  <Cell ss:StyleID="s46"/>
529
529
  <Cell ss:StyleID="s46"/>
530
530
  <Cell ss:StyleID="s46"
531
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
531
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
532
532
  ss:Type="String"></Data></Cell>
533
533
  <Cell ss:StyleID="s46"
534
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
534
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
535
535
  ss:Type="String"></Data></Cell>
536
536
  <Cell ss:StyleID="s46"
537
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
537
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
538
538
  ss:Type="String"></Data></Cell>
539
539
  <Cell ss:StyleID="s46"
540
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
540
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
541
541
  ss:Type="String"></Data></Cell>
542
542
  <Cell ss:StyleID="s46"
543
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
543
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
544
544
  ss:Type="String"></Data></Cell>
545
545
  <Cell ss:StyleID="s46"
546
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
546
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
547
547
  ss:Type="String"></Data></Cell>
548
548
  <Cell ss:StyleID="s46"
549
- ss:Formula="=IF(SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_work_account.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
549
+ ss:Formula="=IF(SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),SUM(R[-<%=@work_totals_per_backlog.size*2+2%>]C:R[-1]C),&quot;&quot;)"><Data
550
550
  ss:Type="String"></Data></Cell>
551
551
  <Cell ss:StyleID="s47"/>
552
552
  </Row>
@@ -1,7 +1,7 @@
1
1
  display_notice(page)
2
2
  if @work && @work.errors.empty?
3
3
  page.replace "work_#{@work.id}_task_description", ''
4
- page.replace "work_#{@work.id}", :partial => 'row', :object => @work
4
+ page.replace "work_#{@work.id}", :partial => 'row', :object => @work, :locals => {:next_row_id => nil}
5
5
  page["work_#{@work.id}_#{@next_field}"].select
6
6
  page["work_#{@work.id}_#{@next_field}"].focus
7
7
  else
@@ -7,7 +7,7 @@
7
7
 
8
8
  <table border="1">
9
9
  <tr>
10
- <th><%=l :work_account %></th>
10
+ <th><%=l :backlog %></th>
11
11
  <% [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each_with_index do |day, i| %>
12
12
  <th align="center"><%=detour_to "#{l(day)} #{week_date(i+1)}", :action => :daily_work_sheet, :id => (@first_date + i).strftime('%Y-%m-%d'), :user_id => (@user != current_user ? @user : nil) %></th>
13
13
  <% end %>
@@ -30,21 +30,21 @@
30
30
 
31
31
  <% week_totals = Hash.new(0) %>
32
32
  <% day_totals = Array.new(7, 0) %>
33
- <% for work_account, totals in @work_accounts %>
33
+ <% for backlog, totals in @backlogs %>
34
34
  <tr>
35
35
  <td valign="top">
36
- <%=detour_to(h(work_account.name), :controller => 'work_accounts', :action => :show, :id => work_account.id) %>
36
+ <%=detour_to(h(backlog.name), :controller => 'backlogs', :action => :show, :id => backlog.id) %>
37
37
  </td>
38
38
  <% totals.each_with_index do |total, day| %>
39
39
  <% if total %>
40
40
  <% day_totals[day] += total %>
41
- <% week_totals[work_account] += total %>
41
+ <% week_totals[backlog] += total %>
42
42
  <td align="right" valign="top"><%=t(total)%></td>
43
43
  <% else %>
44
44
  <td/>
45
45
  <% end %>
46
46
  <% end %>
47
- <td align="right"><%=t(week_totals[work_account])%></td>
47
+ <td align="right"><%=t(week_totals[backlog])%></td>
48
48
  </tr>
49
49
  <% end %>
50
50
  <tr>
@@ -1,8 +1,8 @@
1
1
  <% @page_title = l(:weekly_work_sheet) + (@period ? " for #{@period}" : '') + (user? ? " for #{user.login}" : '')%>
2
2
 
3
3
  <div id="spotlight">
4
- <% track_times = @rows.find {|r| r.find {|w| w && w.work_account.track_times?}} %>
5
- <% invoicing = @rows.find {|r| r.find {|w| w && w.work_account.enable_invoicing?}} %>
4
+ <% track_times = @rows.find {|r| r.find {|w| w && w.backlog.track_times?}} %>
5
+ <% invoicing = @rows.find {|r| r.find {|w| w && w.backlog.enable_invoicing?}} %>
6
6
  <% columns = 2 + (track_times ? 1 : 0) + (invoicing ? 1 : 0) %>
7
7
 
8
8
  <h1>Work for week <%=@week%><%=user? ? " for #{user.login}" : ''%></h1>
@@ -18,7 +18,7 @@
18
18
  </tr>
19
19
  <tr>
20
20
  <% (1..7).each do %>
21
- <th><%=l :work_account %></th>
21
+ <th><%=l :backlog %></th>
22
22
  <% if invoicing %>
23
23
  <th><%=l :invoice_short %></th>
24
24
  <% end %>
@@ -51,13 +51,13 @@
51
51
  <!--
52
52
  <%=detour_to(h(@work.task.period.name), :controller => 'periods', :action => :show, :id => @work.task.period) if @work.task && @work.task.period %>
53
53
  -->
54
- <%=detour_to(h(@work.work_account.name), :controller => 'work_accounts', :action => :show, :id => @work.work_account_id) %>
54
+ <%=detour_to(h(@work.backlog.name), :controller => 'backlogs', :action => :show, :id => @work.backlog_id) %>
55
55
  </td>
56
56
  <% if invoicing %>
57
57
  <td id="invoice_<%=@work.id%>" valign="top">
58
58
  <% form_id = "work_#{@work.id}_invoice_form" %>
59
59
  <% field_id = "work_#{@work.id}_invoice" %>
60
- <%=check_box(:work, :invoice, :id => field_id, :name => field_id, :onchange => "new Ajax.Updater('invoice_#{@work}', '#{url_for(:action => :set_work_invoice, :id => @work)}' + '?value=' + this.checked);", :disabled => @lock) if @work.work_account.enable_invoicing? %>
60
+ <%=check_box(:work, :invoice, :id => field_id, :name => field_id, :onchange => "new Ajax.Updater('invoice_#{@work}', '#{url_for(:action => :set_work_invoice, :id => @work)}' + '?value=' + this.checked);", :disabled => @lock) if @work.backlog.enable_invoicing? %>
61
61
  </td>
62
62
  <% end %>
63
63
  <% if track_times %>