]> source.dussan.org Git - redmine.git/commitdiff
remove trailing white-spaces from app/controllers/time_entry_reports_controller.rb.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 31 Aug 2011 08:43:13 +0000 (08:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 31 Aug 2011 08:43:13 +0000 (08:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6868 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/time_entry_reports_controller.rb

index dd02ff8ff341ba7913226b8442c1fac15fa1d3f6..467598d2adc659102de8b768b937e9ef3e1055df 100644 (file)
@@ -16,16 +16,16 @@ class TimeEntryReportsController < ApplicationController
     @criterias = @criterias.select{|criteria| @available_criterias.has_key? criteria}
     @criterias.uniq!
     @criterias = @criterias[0,3]
-    
+
     @columns = (params[:columns] && %w(year month week day).include?(params[:columns])) ? params[:columns] : 'month'
-    
+
     retrieve_date_range
-    
+
     unless @criterias.empty?
       sql_select = @criterias.collect{|criteria| @available_criterias[criteria][:sql] + " AS " + criteria}.join(', ')
       sql_group_by = @criterias.collect{|criteria| @available_criterias[criteria][:sql]}.join(', ')
       sql_condition = ''
-      
+
       if @project.nil?
         sql_condition = Project.allowed_to_condition(User.current, :view_time_entries)
       elsif @issue.nil?
@@ -41,9 +41,9 @@ class TimeEntryReportsController < ApplicationController
       sql << " (%s) AND" % sql_condition
       sql << " (spent_on BETWEEN '%s' AND '%s')" % [ActiveRecord::Base.connection.quoted_date(@from), ActiveRecord::Base.connection.quoted_date(@to)]
       sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek, spent_on"
-      
+
       @hours = ActiveRecord::Base.connection.select_all(sql)
-      
+
       @hours.each do |row|
         case @columns
         when 'year'
@@ -56,9 +56,9 @@ class TimeEntryReportsController < ApplicationController
           row['day'] = "#{row['spent_on']}"
         end
       end
-      
+
       @total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
-      
+
       @periods = []
       # Date#at_beginning_of_ not supported in Rails 1.2.x
       date_from = @from.to_time
@@ -80,13 +80,13 @@ class TimeEntryReportsController < ApplicationController
         end
       end
     end
-    
+
     respond_to do |format|
       format.html { render :layout => !request.xhr? }
       format.csv  { send_data(report_to_csv(@criterias, @periods, @hours), :type => 'text/csv; header=present', :filename => 'timelog.csv') }
     end
   end
-  
+
   private
 
   # TODO: duplicated in TimelogController
@@ -141,7 +141,7 @@ class TimeEntryReportsController < ApplicationController
     else
       # default
     end
-    
+
     @from, @to = @to, @from if @from && @to && @from > @to
     @from ||= (TimeEntry.earilest_date_for_project(@project) || Date.today)
     @to   ||= (TimeEntry.latest_date_for_project(@project) || Date.today)
@@ -170,7 +170,7 @@ class TimeEntryReportsController < ApplicationController
                                          :klass => Issue,
                                          :label => :label_issue}
                            }
-    
+
     # Add list and boolean custom fields as available criterias
     custom_fields = (@project.nil? ? IssueCustomField.for_all : @project.all_issue_custom_fields)
     custom_fields.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
@@ -178,7 +178,7 @@ class TimeEntryReportsController < ApplicationController
                                              :format => cf.field_format,
                                              :label => cf.name}
     end if @project
-    
+
     # Add list and boolean time entry custom fields
     TimeEntryCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
       @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'TimeEntry' AND c.customized_id = #{TimeEntry.table_name}.id)",