diff --git a/app/controllers/kanban_controller.rb b/app/controllers/kanban_controller.rb index 215c74f..d512d8c 100644 --- a/app/controllers/kanban_controller.rb +++ b/app/controllers/kanban_controller.rb @@ -1,5 +1,7 @@ class KanbanController < ApplicationController - unloadable + if Redmine::VERSION::MAJOR < 4 || (Redmine::VERSION::MAJOR == 4 && Redmine::VERSION::MINOR < 1) + unloadable + end before_action :global_authorize # # Display kanban board @@ -261,7 +263,7 @@ def index # Hide user without issues if Constants::DISPLAY_USER_WITHOUT_ISSUES != 1 then remove_user_without_issues - end + end end private @@ -277,6 +279,7 @@ def discard_session # Store session # def store_params_to_session + session_hash = {} session_hash["updated_within"] = @updated_within session_hash["done_within"] = @done_within @@ -287,7 +290,7 @@ def store_params_to_session session_hash["project_all"] = @project_all session_hash["version_id"] = @version_id session_hash["open_versions"] = @open_versions - session_hash["status_fields"] = @status_fields + session_hash["status_fields"] = @status_fields.to_json session_hash["wip_max"] = @wip_max session_hash["card_size"] = @card_size session_hash["show_ancestors"] = @show_ancestors @@ -365,7 +368,11 @@ def restore_params_from_session # Selected statuses if !session_hash.blank? && params[:status_fields].blank? - @status_fields = session_hash["status_fields"] + if !session_hash["status_fields"].blank? + @status_fields = JSON.parse( session_hash["status_fields"]) + else + @status_fields = "" + end else @status_fields = params[:status_fields] end diff --git a/app/models/constants.rb b/app/models/constants.rb index d512926..baa80ab 100644 --- a/app/models/constants.rb +++ b/app/models/constants.rb @@ -6,13 +6,13 @@ class Constants < ActiveRecord::Base # Limit selection strategy # 0: No Limit # 1: Limited by `SELECT_LIMIT` value - SELECT_LIMIT_STRATEGY = 1; + SELECT_LIMIT_STRATEGY = 0; # Max number of selections SELECT_LIMIT = 250 # Days since upadated date # Please choose "1" "3" "7" "14" "31" "62" "93" "unspecified" - DEFAULT_VALUE_UPDATED_WITHIN = "31" + DEFAULT_VALUE_UPDATED_WITHIN = "62" # Days since closed date # Please choose "1" "3" "7" "14" "31" "62" "93" "unspecified" @@ -57,11 +57,11 @@ class Constants < ActiveRecord::Base # Display comment dialog when issue was dropped # 0: Not display # 1: Display - DISPLAY_COMMENT_DIALOG_WHEN_DROP = 1 + DISPLAY_COMMENT_DIALOG_WHEN_DROP = 0 # Default Card Size # Please choose "normal_days_left" "normal_estimated_hours" "small" - DEFAULT_CARD_SIZE = "normal_days_left" + DEFAULT_CARD_SIZE = "normal_estimated_hours" # Default High Priority issue id # Default is 3 to back compatibility @@ -71,10 +71,9 @@ class Constants < ActiveRecord::Base # Default Normal Priority issue id # Default is 2 to back compatibility # All issues == DEFAULT_HIGH_ DEFAULT_NORMAL_PRIORITY_ISSUE_ID will be seen as normal priority issues - DEFAULT_NORMAL_PRIORITY_ISSUE_ID = 2 - + DEFAULT_NORMAL_PRIORITY_ISSUE_ID = 4 # Default Show ancestors # 0: Not display # 1: Display - DEFAULT_SHOW_ANCESTORS = "1" + DEFAULT_SHOW_ANCESTORS = "1" end diff --git a/app/views/kanban/_normal_card_spent_hours.html.erb b/app/views/kanban/_normal_card_spent_hours.html.erb index 723e2e6..ff22422 100644 --- a/app/views/kanban/_normal_card_spent_hours.html.erb +++ b/app/views/kanban/_normal_card_spent_hours.html.erb @@ -3,13 +3,37 @@ <% if issue.priority_id >= Constants::DEFAULT_HIGH_PRIORITY_ISSUE_ID then %> my-issue-card-high-priority <% elsif issue.priority_id == Constants::DEFAULT_NORMAL_PRIORITY_ISSUE_ID %> my-issue-card <% else %> my-issue-card-low-priority <% end %>">
<%= issue.project.name %>

<%= issue.tracker.name %> #<%= issue.id %>

+ <% if @show_ancestors == "1" then %> <%= render_issue_ancestors(issue) %> <% end %>

<%= issue.subject %>


- -
<%= (issue.spent_hours || 0.0) %><%= I18n.t(:kanban_hours_abbreviation) %>
- -

<% if issue.assigned_to != nil %><%= issue.assigned_to.name %><% else %>Not assigned<% end %>

+ + +
+ +

+ <% if issue.assigned_to.present? %> + <%= issue.assigned_to.name %> + <% else %> + Not assigned + <% end %> +

+ + +
+ +
+ <%= (issue.spent_hours || 0.0) %><%= I18n.t(:kanban_hours_abbreviation) %> + <%= link_to new_time_entry_path(issue_id: issue.id), class: 'icon-only icon-time', title: l(:label_spent_time) do %> + + <% end %> +
+ +
+ (<%= (issue.estimated_hours || 0.0) %><%= I18n.t(:kanban_hours_abbreviation) %>) +
+
+
diff --git a/app/views/kanban/index.html.erb b/app/views/kanban/index.html.erb index f9da8b5..9119405 100644 --- a/app/views/kanban/index.html.erb +++ b/app/views/kanban/index.html.erb @@ -1,19 +1,25 @@ + + +<%= stylesheet_link_tag 'context_menu' %> +<%= javascript_include_tag 'context_menu' %> + + +<%= javascript_include_tag "jquery.floatThead", :plugin => "kanban" %> +<%= javascript_include_tag "hotkeys", :plugin => "kanban" %> +<%= javascript_include_tag "kanban", :plugin => "kanban" %> - -<%= javascript_include_tag "jquery.floatThead", :plugin => "kanban" %> -<%= javascript_include_tag "hotkeys", :plugin => "kanban" %> -<%= javascript_include_tag "kanban", :plugin => "kanban" %> + - <%= stylesheet_link_tag 'kanban', :plugin => 'kanban' %>
<% if @project_id.blank? != true then %> @@ -199,14 +205,13 @@
- +