@@ -79,7 +79,10 @@ def report
79
79
80
80
respond_to do |format |
81
81
format . html { render :layout => !request . xhr? }
82
- format . csv { send_data ( report_to_csv ( @report ) , :type => 'text/csv; header=present' , :filename => 'timelog.csv' ) }
82
+ format . csv do
83
+ send_data ( report_to_csv ( @report ) , :type => 'text/csv; header=present' ,
84
+ :filename => 'timelog.csv' )
85
+ end
83
86
end
84
87
end
85
88
@@ -92,19 +95,25 @@ def show
92
95
end
93
96
94
97
def new
95
- @time_entry ||= TimeEntry . new ( :project => @project , :issue => @issue , :author => User . current , :spent_on => User . current . today )
98
+ @time_entry ||=
99
+ TimeEntry . new ( :project => @project , :issue => @issue ,
100
+ :author => User . current , :spent_on => User . current . today )
96
101
@time_entry . safe_attributes = params [ :time_entry ]
97
102
end
98
103
99
104
def create
100
- @time_entry ||= TimeEntry . new ( :project => @project , :issue => @issue , :author => User . current , :user => User . current , :spent_on => User . current . today )
105
+ @time_entry ||=
106
+ TimeEntry . new ( :project => @project , :issue => @issue ,
107
+ :author => User . current , :user => User . current ,
108
+ :spent_on => User . current . today )
101
109
@time_entry . safe_attributes = params [ :time_entry ]
102
110
if @time_entry . project && !User . current . allowed_to? ( :log_time , @time_entry . project )
103
111
render_403
104
112
return
105
113
end
106
114
107
- call_hook ( :controller_timelog_edit_before_save , { :params => params , :time_entry => @time_entry } )
115
+ call_hook ( :controller_timelog_edit_before_save ,
116
+ { :params => params , :time_entry => @time_entry } )
108
117
109
118
if @time_entry . save
110
119
respond_to do |format |
@@ -131,7 +140,9 @@ def create
131
140
redirect_back_or_default project_time_entries_path ( @time_entry . project )
132
141
end
133
142
}
134
- format . api { render :action => 'show' , :status => :created , :location => time_entry_url ( @time_entry ) }
143
+ format . api do
144
+ render :action => 'show' , :status => :created , :location => time_entry_url ( @time_entry )
145
+ end
135
146
end
136
147
else
137
148
respond_to do |format |
@@ -147,7 +158,8 @@ def edit
147
158
148
159
def update
149
160
@time_entry . safe_attributes = params [ :time_entry ]
150
- call_hook ( :controller_timelog_edit_before_save , { :params => params , :time_entry => @time_entry } )
161
+ call_hook ( :controller_timelog_edit_before_save ,
162
+ { :params => params , :time_entry => @time_entry } )
151
163
152
164
if @time_entry . save
153
165
respond_to do |format |
@@ -189,7 +201,10 @@ def bulk_update
189
201
@time_entries . each do |time_entry |
190
202
time_entry . reload
191
203
time_entry . safe_attributes = attributes
192
- call_hook ( :controller_time_entries_bulk_edit_before_save , { :params => params , :time_entry => time_entry } )
204
+ call_hook (
205
+ :controller_time_entries_bulk_edit_before_save ,
206
+ { :params => params , :time_entry => time_entry }
207
+ )
193
208
if time_entry . save
194
209
saved_time_entries << time_entry
195
210
else
0 commit comments