Project

General

Profile

RedMine and Sql Server 2005 » redminePatch.patch

Patch against rev1684 for Sql Server 2005. - Chris Taylor, 2008-07-22 20:29

View differences:

app/controllers/projects_controller.rb (working copy)
250 250
      cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
251 251
      cond.add(["#{Journal.table_name}.journalized_type = 'Issue' AND #{Journal.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
252 252
      cond.add("#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> ''")
253
#     cond.add("#{JournalDetail.table_name}.prop_key = 'status_id' OR datalength(#{Journal.table_name}.notes) <> 0") 
253 254
      @events += Journal.find(:all, :include => [{:issue => :project}, :details, :user], :conditions => cond.conditions)
254 255
    end
255 256
    
......
396 397
    end
397 398
    @events.sort! {|x,y| x.start_date <=> y.start_date }
398 399
    
400
    #convert dates in events from times to dates
401
    for i in 0 .. @events.length-1 do
402
      @events[i].start_date = time_to_date(@events[i].start_date)
403
      @events[i].due_date = time_to_date(@events[i].due_date)
404
    end 
405
    
399 406
    if params[:format]=='pdf'
400 407
      @options_for_rfpdf ||= {}
401 408
      @options_for_rfpdf[:file_name] = "#{@project.identifier}-gantt.pdf"
......
434 441
      @selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
435 442
    end
436 443
  end
444
  
445
  def time_to_date(timeval)
446
    if timeval
447
      Date.parse(timeval.strftime('%Y/%m/%d')) 
448
    else
449
      timeval
450
    end
451
  end
452
  
437 453
end
app/controllers/repositories_controller.rb (working copy)
56 56
    # root entries
57 57
    @entries = @repository.entries('', @rev)    
58 58
    # latest changesets
59
    @changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC")
59
    @changesets = @repository.changesets.find(:all, :limit => 10) #, :order => "committed_on DESC")
60 60
    show_error_not_found unless @entries || @changesets.any?
61 61
  end
62 62
  
app/models/repository/subversion.rb (working copy)
32 32

  
33 33
  def changesets_for_path(path)
34 34
    revisions = scm.revisions(path)
35
    revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC") : []
35
    revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier)) : []
36 36
  end
37 37
  
38 38
  # Returns a path relative to the url of the repository
app/views/common/_calendar.rhtml (working copy)
9 9
<%= "<th>#{day.cweek}</th>" if day.cwday == calendar.first_wday %>
10 10
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>">
11 11
<p class="day-num"><%= day.day %></p>	
12

  
12 13
<% calendar.events_on(day).each do |i| %>
14
<% #calendar.events.each do |i| %>
15

  
13 16
  <% if i.is_a? Issue %>
14 17
  <div class="tooltip">
15
  <%= if day == i.start_date && day == i.due_date
18
  <%= if day == calendar.time_to_date(i.start_date) && day == calendar.time_to_date(i.due_date)
16 19
        image_tag('arrow_bw.png')
17
      elsif day == i.start_date
20
      elsif day == calendar.time_to_date(i.start_date)
18 21
        image_tag('arrow_from.png') 
19
      elsif day == i.due_date
20
		image_tag('arrow_to.png') 
22
      elsif day == calendar.time_to_date(i.due_date)
23
	image_tag('arrow_to.png') 
21 24
      end %>
22 25
  <%= h("#{i.project} -") unless @project && @project == i.project %>
23 26
  <%= link_to_issue i %>: <%= h(truncate(i.subject, 30)) %>
app/views/projects/calendar.rhtml (working copy)
1 1
<h2><%= "#{month_name(@month)} #{@year}" %></h2>
2

  
3 2
<table width="100%">
4 3
<tr><td align="left">
5 4
    <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), 
config/environments/development.rb (working copy)
14 14

  
15 15
# Don't care if the mailer can't send
16 16
config.action_mailer.raise_delivery_errors = false
17

  
18
require 'ruby-debug'
lib/redmine/helpers/calendar.rb (working copy)
14 14
# You should have received a copy of the GNU General Public License
15 15
# along with this program; if not, write to the Free Software
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17
require 'date'
17 18

  
18 19
module Redmine
19 20
  module Helpers
......
45 46
        end
46 47
      end
47 48
      
49
      def time_to_date(timeval)
50
        if timeval
51
          Date.parse(timeval.strftime('%Y/%m/%d')) 
52
        else
53
          timeval
54
        end
55
      end
48 56
      # Sets calendar events
49 57
      def events=(events)
50 58
        @events = events
51
        @ending_events_by_days = @events.group_by {|event| event.due_date}
52
        @starting_events_by_days = @events.group_by {|event| event.start_date}
59
        # events.due_date, events.start_date are times. 
60
        # 'day' (below) is a date, so need to convert time to date to allow matching
61
        @ending_events_by_days = @events.group_by {|event| time_to_date(event.due_date)}
62
        @starting_events_by_days = @events.group_by {|event| time_to_date(event.start_date)}
53 63
      end
54 64
      
55 65
      # Returns events for the given day
(2-2/2)