Mercurial > hg > soundsoftware-site
comparison app/controllers/issues_controller.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children | a1bdbf8a87d5 |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
60 | 60 |
61 if @query.valid? | 61 if @query.valid? |
62 case params[:format] | 62 case params[:format] |
63 when 'csv', 'pdf' | 63 when 'csv', 'pdf' |
64 @limit = Setting.issues_export_limit.to_i | 64 @limit = Setting.issues_export_limit.to_i |
65 if params[:columns] == 'all' | |
66 @query.column_names = @query.available_inline_columns.map(&:name) | |
67 end | |
65 when 'atom' | 68 when 'atom' |
66 @limit = Setting.feeds_limit.to_i | 69 @limit = Setting.feeds_limit.to_i |
67 when 'xml', 'json' | 70 when 'xml', 'json' |
68 @offset, @limit = api_offset_and_limit | 71 @offset, @limit = api_offset_and_limit |
72 @query.column_names = %w(author) | |
69 else | 73 else |
70 @limit = per_page_option | 74 @limit = per_page_option |
71 end | 75 end |
72 | 76 |
73 @issue_count = @query.issue_count | 77 @issue_count = @query.issue_count |
295 redirect_back_or_default _project_issues_path(@project) | 299 redirect_back_or_default _project_issues_path(@project) |
296 end | 300 end |
297 else | 301 else |
298 @saved_issues = @issues | 302 @saved_issues = @issues |
299 @unsaved_issues = unsaved_issues | 303 @unsaved_issues = unsaved_issues |
300 @issues = Issue.visible.find_all_by_id(@unsaved_issues.map(&:id)) | 304 @issues = Issue.visible.where(:id => @unsaved_issues.map(&:id)).all |
301 bulk_edit | 305 bulk_edit |
302 render :action => 'bulk_edit' | 306 render :action => 'bulk_edit' |
303 end | 307 end |
304 end | 308 end |
305 | 309 |
308 if @hours > 0 | 312 if @hours > 0 |
309 case params[:todo] | 313 case params[:todo] |
310 when 'destroy' | 314 when 'destroy' |
311 # nothing to do | 315 # nothing to do |
312 when 'nullify' | 316 when 'nullify' |
313 TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues]) | 317 TimeEntry.where(['issue_id IN (?)', @issues]).update_all('issue_id = NULL') |
314 when 'reassign' | 318 when 'reassign' |
315 reassign_to = @project.issues.find_by_id(params[:reassign_to_id]) | 319 reassign_to = @project.issues.find_by_id(params[:reassign_to_id]) |
316 if reassign_to.nil? | 320 if reassign_to.nil? |
317 flash.now[:error] = l(:error_issue_not_found_in_project) | 321 flash.now[:error] = l(:error_issue_not_found_in_project) |
318 return | 322 return |
319 else | 323 else |
320 TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues]) | 324 TimeEntry.where(['issue_id IN (?)', @issues]). |
325 update_all("issue_id = #{reassign_to.id}") | |
321 end | 326 end |
322 else | 327 else |
323 # display the destroy form if it's a user request | 328 # display the destroy form if it's a user request |
324 return unless api_request? | 329 return unless api_request? |
325 end | 330 end |
425 @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date? | 430 @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date? |
426 @issue.safe_attributes = params[:issue] | 431 @issue.safe_attributes = params[:issue] |
427 | 432 |
428 @priorities = IssuePriority.active | 433 @priorities = IssuePriority.active |
429 @allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?) | 434 @allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?) |
430 @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq | 435 @available_watchers = @issue.watcher_users |
436 if @issue.project.users.count <= 20 | |
437 @available_watchers = (@available_watchers + @issue.project.users.sort).uniq | |
438 end | |
431 end | 439 end |
432 | 440 |
433 def check_for_default_issue_status | 441 def check_for_default_issue_status |
434 if IssueStatus.default.nil? | 442 if IssueStatus.default.nil? |
435 render_error l(:error_no_default_issue_status) | 443 render_error l(:error_no_default_issue_status) |