Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cc65b0b
fix(redmine 5): modify init.rb; remove require calls
artech-mg Jun 20, 2024
009c2c0
fix(redmine 5): replace around_filter with around_action
artech-mg Jun 20, 2024
f260c3b
fix(redmine 5): replace alias_method_chain with alias_method
artech-mg Jun 20, 2024
77636d3
fix(redmine 5): modify project structure
artech-mg Jun 20, 2024
035ce99
fix(redmine 5): rename module to RedmineAdvancedRoadmap
artech-mg Jun 20, 2024
78523fe
fix(redmine 5): add migration version
artech-mg Jun 20, 2024
bbc995c
fix(redmine 5): replace before_filter with before_action
artech-mg Jun 20, 2024
cd1c1db
fix(redmine 5): migrate to strong parameters
artech-mg Jun 21, 2024
89df2c7
fix(redmine 5): move Magick definition to top of file to prevent Name…
artech-mg Jun 21, 2024
7418902
fix(redmine 5): fix NameErrors related to stacked_mixin
artech-mg Jun 21, 2024
4499978
fix(redmine 5): fix namespace errors related to Gruff
artech-mg Jun 21, 2024
e44836e
fix(redmine 5): increase plugin version
artech-mg Jun 21, 2024
0a47874
fix(redmine 5): fix css hickups
artech-mg Jun 21, 2024
60013bd
fix(redmine 5): replace ActionView::Base.new
artech-mg Jun 21, 2024
9044634
fix(redmine 5): replace render call in calenders_controller_patch
artech-mg Jun 21, 2024
8865bde
fix(redmine 5): fix format specifier
artech-mg Jun 21, 2024
b106dd6
fix(redmine 5): insert milestones tab properly
artech-mg Jun 25, 2024
4d47299
fix(redmine 5): fix gantt crash
artech-mg Jun 27, 2024
5e8cc4a
fix(redmine 5): replace update_attributes with update
artech-mg Jun 27, 2024
a27618f
fix(redmine 5): replace exists with exist
artech-mg Jul 3, 2024
8fa5c6e
fix(redmine 5): add space below total progress bar
artech-mg Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions app/controllers/milestones_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class MilestonesController < ApplicationController
menu_item :roadmap
before_filter :find_project, :only => [:new, :create]
before_filter :find_milestone, :only => [:show, :edit, :update, :destroy]
before_filter :authorize, :except => [:show, :total_graph]
before_action :find_project, :only => [:new, :create]
before_action :find_milestone, :only => [:show, :edit, :update, :destroy]
before_action :authorize, :except => [:show, :total_graph]

helper :custom_fields
helper :projects
Expand Down Expand Up @@ -37,7 +37,7 @@ def new
end

def create
@milestone = @project.milestones.build(params[:milestone])
@milestone = @project.milestones.build(milestone_params)
@milestone.user_id = User.current.id
if request.post? and @milestone.save
if params[:versions]
Expand Down Expand Up @@ -75,7 +75,7 @@ def update
end
end
end
if @milestone.update_attributes(params[:milestone])
if @milestone.update(milestone_params)
versions_to_delete.each do |version|
milestone_version = MilestoneVersion.where("milestone_id = #{@milestone.id} AND version_id = #{version.id}").first
milestone_version.destroy
Expand All @@ -100,7 +100,7 @@ def destroy
end

def total_graph
g = AdvancedRoadmap::Gruff::Pie.new(params[:size] || "500x400")
g = RedmineAdvancedRoadmap::Gruff::Pie.new(params[:size] || "500x400")
g.hide_title = true
g.theme = graph_theme
g.margins = 0
Expand Down Expand Up @@ -149,4 +149,8 @@ def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil)
end
end

def milestone_params
params.require(:milestone).permit(:name, :description, :effective_date)
end

end
2 changes: 0 additions & 2 deletions app/models/milestone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class Milestone < ActiveRecord::Base
validates_length_of :name, :maximum => 60
validates :effective_date, :date => true, :allow_nil => true

attr_accessible :name, :description, :effective_date

def to_s
name
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/hooks/_stylesheet.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= stylesheet_link_tag("advanced_roadmap", :plugin => "advanced_roadmap_v2", :media => "all") %>
<%= stylesheet_link_tag("redmine_advanced_roadmap", :plugin => "redmine_advanced_roadmap_v2", :media => "all") %>
2 changes: 1 addition & 1 deletion app/views/settings/_advanced_roadmap_settings.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- defaults = Redmine::Plugin::registered_plugins[:advanced_roadmap_v2].settings[:default] -%>
<%- defaults = Redmine::Plugin::registered_plugins[:redmine_advanced_roadmap_v2].settings[:default] -%>

<p>
<%= label_tag 'settings[show_due_time]', l(:label_setting_show_due_time) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/versions/_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<%- end -%>

<%- if issues.present? -%>
<%- show_due_time = (Setting.plugin_advanced_roadmap_v2["show_due_time"]) -%>
<%- show_due_time = (Setting.plugin_redmine_advanced_roadmap_v2["show_due_time"]) -%>
<fieldset class="related-issues"><legend><%= l(:label_related_issues) %></legend>
<%= form_tag({}) do %>
<table class="list related-issues">
Expand Down
4 changes: 3 additions & 1 deletion app/views/versions/_total.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%= tag "a", :name => l(:label_total) %>
<h3 class="icon22 icon22-package"><%= l(:label_total) %></h3>
<%= progress_bar([totals[:closed_percent], totals[:completed_percent]], :width => '40em', :legend => ('%0.0f%' % totals[:completed_percent])) %>
<%= progress_bar([totals[:closed_percent], totals[:completed_percent]], :width => '80px', :legend => ('%0.0f%%' % totals[:completed_percent])) %>
<br>
<fieldset><legend><%= l(:label_time_tracking) %></legend>
<table width="100%">
<tr>
Expand Down Expand Up @@ -47,3 +48,4 @@
</tr>
</table>
</fieldset>
<br>
2 changes: 1 addition & 1 deletion db/migrate/001_create_milestones.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateMilestones < ActiveRecord::Migration
class CreateMilestones < ActiveRecord::Migration[5.1]
def self.up
create_table :milestones, :force => true do |t|
t.column :name, :string, :null => false
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/002_create_milestone_versions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateMilestoneVersions < ActiveRecord::Migration
class CreateMilestoneVersions < ActiveRecord::Migration[5.1]
def self.up
create_table :milestone_versions, :force => true do |t|
t.column :milestone_id, :integer, :null => false
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/003_preset_permissions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class PresetPermissions < ActiveRecord::Migration
class PresetPermissions < ActiveRecord::Migration[5.1]
def self.up
role = nil
begin
Expand Down
32 changes: 13 additions & 19 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,25 @@
ActiveSupport::Dependencies.autoload_once_paths.reject!{|x| x =~ /^#{Regexp.escape(File.dirname(__FILE__))}/}
end

require "redmine"
require "rubygems"
require "gravatar"
ApplicationHelper.send(:include, RedmineAdvancedRoadmap::ApplicationHelperPatch)
CalendarsController.send(:include, RedmineAdvancedRoadmap::CalendarsControllerPatch)
Issue.send(:include, RedmineAdvancedRoadmap::IssuePatch)
Journal.send(:include, RedmineAdvancedRoadmap::JournalPatch)
Project.send(:include, RedmineAdvancedRoadmap::ProjectPatch)
ProjectsHelper.send(:include, RedmineAdvancedRoadmap::ProjectsHelperPatch)
Query.send(:include, RedmineAdvancedRoadmap::QueryPatch)
Redmine::Helpers::Gantt.send(:include, RedmineAdvancedRoadmap::RedmineHelpersGanttPatch)
Redmine::I18n.send(:include, RedmineAdvancedRoadmap::RedmineI18nPatch)
Version.send(:include, RedmineAdvancedRoadmap::VersionPatch)
VersionsController.send(:include, RedmineAdvancedRoadmap::VersionsControllerPatch)

ApplicationHelper.send(:include, AdvancedRoadmap::ApplicationHelperPatch)
CalendarsController.send(:include, AdvancedRoadmap::CalendarsControllerPatch)
Issue.send(:include, AdvancedRoadmap::IssuePatch)
Journal.send(:include, AdvancedRoadmap::JournalPatch)
Project.send(:include, AdvancedRoadmap::ProjectPatch)
ProjectsHelper.send(:include, AdvancedRoadmap::ProjectsHelperPatch)
Query.send(:include, AdvancedRoadmap::QueryPatch)
Redmine::Helpers::Gantt.send(:include, AdvancedRoadmap::RedmineHelpersGanttPatch)
Redmine::I18n.send(:include, AdvancedRoadmap::RedmineI18nPatch)
Version.send(:include, AdvancedRoadmap::VersionPatch)
VersionsController.send(:include, AdvancedRoadmap::VersionsControllerPatch)

require_dependency "advanced_roadmap/view_hooks"

Redmine::Plugin.register :advanced_roadmap_v2 do
Redmine::Plugin.register :redmine_advanced_roadmap_v2 do
name "Advanced roadmap & milestones plugin"
url "https://github.com/ekylibre/redmine_advanced_roadmap_v2"
author "Michel LOISELEUR"
author_url "https://github.com/Coren"
description "This is a plugin for Redmine that is used to show more information inside the Roadmap page and implements the milestones featuring."
version "2.4.3"
version "2.5.0"
permission :manage_milestones, {:milestones => [:new, :create, :edit, :update, :destroy]}
requires_redmine :version_or_higher => "2.1.2"

Expand Down
37 changes: 0 additions & 37 deletions lib/advanced_roadmap/gruff/mini/bar.rb

This file was deleted.

82 changes: 0 additions & 82 deletions lib/advanced_roadmap/gruff/mini/legend.rb

This file was deleted.

36 changes: 0 additions & 36 deletions lib/advanced_roadmap/gruff/mini/pie.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/advanced_roadmap/gruff/mini/side_bar.rb

This file was deleted.

20 changes: 0 additions & 20 deletions lib/advanced_roadmap/projects_helper_patch.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_dependency "application_helper"

module AdvancedRoadmap
module RedmineAdvancedRoadmap
module ApplicationHelperPatch
def self.included(base)
base.class_eval do
Expand All @@ -15,9 +15,9 @@ def link_to_milestone(milestone)

def color_by_ratio(ratio)
color = ""
color = Setting.plugin_advanced_roadmap_v2["color_good"] if ratio <= Setting.plugin_advanced_roadmap_v2["ratio_good"].to_f
color = Setting.plugin_advanced_roadmap_v2["color_bad"] if ratio >= Setting.plugin_advanced_roadmap_v2["ratio_bad"].to_f
color = Setting.plugin_advanced_roadmap_v2["color_very_bad"] if ratio >= Setting.plugin_advanced_roadmap_v2["ratio_very_bad"].to_f
color = Setting.plugin_redmine_advanced_roadmap_v2["color_good"] if ratio <= Setting.plugin_redmine_advanced_roadmap_v2["ratio_good"].to_f
color = Setting.plugin_redmine_advanced_roadmap_v2["color_bad"] if ratio >= Setting.plugin_redmine_advanced_roadmap_v2["ratio_bad"].to_f
color = Setting.plugin_redmine_advanced_roadmap_v2["color_very_bad"] if ratio >= Setting.plugin_redmine_advanced_roadmap_v2["ratio_very_bad"].to_f
return(color)
end

Expand Down
Loading