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)
cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
cond.add(["#{Journal.table_name}.journalized_type = 'Issue' AND #{Journal.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
cond.add("#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> ''")
# cond.add("#{JournalDetail.table_name}.prop_key = 'status_id' OR datalength(#{Journal.table_name}.notes) <> 0")
@events += Journal.find(:all, :include => [{:issue => :project}, :details, :user], :conditions => cond.conditions)
end
......
end
@events.sort! {|x,y| x.start_date <=> y.start_date }
#convert dates in events from times to dates
for i in 0 .. @events.length-1 do
@events[i].start_date = time_to_date(@events[i].start_date)
@events[i].due_date = time_to_date(@events[i].due_date)
end
if params[:format]=='pdf'
@options_for_rfpdf ||= {}
@options_for_rfpdf[:file_name] = "#{@project.identifier}-gantt.pdf"
......
@selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
end
end
def time_to_date(timeval)
if timeval
Date.parse(timeval.strftime('%Y/%m/%d'))
else
timeval
end
end
end
app/controllers/repositories_controller.rb (working copy)
# root entries
@entries = @repository.entries('', @rev)
# latest changesets
@changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC")
@changesets = @repository.changesets.find(:all, :limit => 10) #, :order => "committed_on DESC")
show_error_not_found unless @entries || @changesets.any?
end
app/models/repository/subversion.rb (working copy)
def changesets_for_path(path)
revisions = scm.revisions(path)
revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC") : []
revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier)) : []
end
# Returns a path relative to the url of the repository
app/views/common/_calendar.rhtml (working copy)
<%= "<th>#{day.cweek}</th>" if day.cwday == calendar.first_wday %>
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>">
<p class="day-num"><%= day.day %></p>
<% calendar.events_on(day).each do |i| %>
<% #calendar.events.each do |i| %>
<% if i.is_a? Issue %>
<div class="tooltip">
<%= if day == i.start_date && day == i.due_date
<%= if day == calendar.time_to_date(i.start_date) && day == calendar.time_to_date(i.due_date)
image_tag('arrow_bw.png')
elsif day == i.start_date
elsif day == calendar.time_to_date(i.start_date)
image_tag('arrow_from.png')
elsif day == i.due_date
image_tag('arrow_to.png')
elsif day == calendar.time_to_date(i.due_date)
image_tag('arrow_to.png')
end %>
<%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_issue i %>: <%= h(truncate(i.subject, 30)) %>
app/views/projects/calendar.rhtml (working copy)
<h2><%= "#{month_name(@month)} #{@year}" %></h2>
<table width="100%">
<tr><td align="left">
<%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
config/environments/development.rb (working copy)
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
require 'ruby-debug'
lib/redmine/helpers/calendar.rb (working copy)
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'date'
module Redmine
module Helpers
......
end
end
def time_to_date(timeval)
if timeval
Date.parse(timeval.strftime('%Y/%m/%d'))
else
timeval
end
end
# Sets calendar events
def events=(events)
@events = events
@ending_events_by_days = @events.group_by {|event| event.due_date}
@starting_events_by_days = @events.group_by {|event| event.start_date}
# events.due_date, events.start_date are times.
# 'day' (below) is a date, so need to convert time to date to allow matching
@ending_events_by_days = @events.group_by {|event| time_to_date(event.due_date)}
@starting_events_by_days = @events.group_by {|event| time_to_date(event.start_date)}
end
# Returns events for the given day
(2-2/2)