Index: app/controllers/projects_controller.rb =================================================================== --- app/controllers/projects_controller.rb (revision 1684) +++ app/controllers/projects_controller.rb (working copy) @@ -250,6 +250,7 @@ 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 @@ -396,6 +397,12 @@ 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" @@ -434,4 +441,13 @@ @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 Index: app/controllers/repositories_controller.rb =================================================================== --- app/controllers/repositories_controller.rb (revision 1684) +++ app/controllers/repositories_controller.rb (working copy) @@ -56,7 +56,7 @@ # 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 Index: app/models/repository/subversion.rb =================================================================== --- app/models/repository/subversion.rb (revision 1684) +++ app/models/repository/subversion.rb (working copy) @@ -32,7 +32,7 @@ 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 Index: app/views/common/_calendar.rhtml =================================================================== --- app/views/common/_calendar.rhtml (revision 1684) +++ app/views/common/_calendar.rhtml (working copy) @@ -9,15 +9,18 @@ <%= "#{day.cweek}" if day.cwday == calendar.first_wday %>

<%= day.day %>

+ <% calendar.events_on(day).each do |i| %> +<% #calendar.events.each do |i| %> + <% if i.is_a? Issue %>
- <%= 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)) %> Index: app/views/projects/calendar.rhtml =================================================================== --- app/views/projects/calendar.rhtml (revision 1684) +++ app/views/projects/calendar.rhtml (working copy) @@ -1,5 +1,4 @@

<%= "#{month_name(@month)} #{@year}" %>

-
<%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), Index: config/environments/development.rb =================================================================== --- config/environments/development.rb (revision 1684) +++ config/environments/development.rb (working copy) @@ -14,3 +14,5 @@ # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false + +require 'ruby-debug' \ No newline at end of file Index: lib/redmine/helpers/calendar.rb =================================================================== --- lib/redmine/helpers/calendar.rb (revision 1684) +++ lib/redmine/helpers/calendar.rb (working copy) @@ -14,6 +14,7 @@ # 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 @@ -45,11 +46,20 @@ 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