diff --git a/app/controllers/adsprints_controller.rb b/app/controllers/adsprints_controller.rb index 20a0dec..073edad 100644 --- a/app/controllers/adsprints_controller.rb +++ b/app/controllers/adsprints_controller.rb @@ -11,7 +11,7 @@ def list @project.assignable_users.each{|u| @assignables[u.id] = u.firstname + ' ' + u.lastname} @project_id = @project.id @plugin_path = File.join(Redmine::Utils.relative_url_root, 'plugin_assets', 'AgileDwarf') - @closed_status = Setting.plugin_AgileDwarf[:stclosed].to_i + @closed_status = Setting.plugin_AgileDwarf["stclosed"].to_i end private @@ -20,4 +20,4 @@ def find_project # @project variable must be set before calling the authorize filter @project = Project.find(params[:project_id]) end -end \ No newline at end of file +end diff --git a/app/controllers/adtaskinl_controller.rb b/app/controllers/adtaskinl_controller.rb index bd1dc8a..71b7bfa 100644 --- a/app/controllers/adtaskinl_controller.rb +++ b/app/controllers/adtaskinl_controller.rb @@ -23,7 +23,7 @@ def update def create attribs = params.select{|k,v| k != 'id' and SprintsTasks.column_names.include? k } attribs = Hash[*attribs.flatten] - attribs['tracker_id'] = attribs['tracker_id'] || Setting.plugin_AgileDwarf[:tracker] + attribs['tracker_id'] = attribs['tracker_id'] || Setting.plugin_AgileDwarf['tracker'] attribs['author_id'] = User.current.id task = SprintsTasks.new(attribs) begin @@ -50,7 +50,7 @@ def tooltip end def spent - spenttime = TimeEntry.new({:hours => params[:hours], :activity_id => Setting.plugin_AgileDwarf[:activity], :user => User.current, :project => @project, :spent_on => Date.today, + spenttime = TimeEntry.new({:hours => params[:hours], :activity_id => Setting.plugin_AgileDwarf["activity"], :user => User.current, :project => @project, :spent_on => Date.today, :issue_id => params[:id]}) begin spenttime.save! @@ -97,4 +97,4 @@ def find_project # @project variable must be set before calling the authorize filter @project = Project.find(params[:project_id]) end -end \ No newline at end of file +end diff --git a/app/controllers/adtasks_controller.rb b/app/controllers/adtasks_controller.rb index 3293b11..f95811c 100644 --- a/app/controllers/adtasks_controller.rb +++ b/app/controllers/adtasks_controller.rb @@ -25,11 +25,10 @@ def list user = nil if @user == 'all' @plugin_path = File.join(Redmine::Utils.relative_url_root, 'plugin_assets', 'AgileDwarf') - status_ids = [] - colcount = Setting.plugin_AgileDwarf[:stcolumncount].to_i + colcount = Setting.plugin_AgileDwarf['stcolumncount'].to_i for i in 1 .. colcount - status_ids << Setting.plugin_AgileDwarf[('stcolumn' + i.to_s).to_sym].to_i + status_ids << Setting.plugin_AgileDwarf[('stcolumn' + i.to_s)].to_i end @statuses = {} IssueStatus.find_all_by_id(status_ids).each {|x| @statuses[x.id] = x.name} @@ -45,4 +44,4 @@ def find_project # @project variable must be set before calling the authorize filter @project = Project.find(params[:project_id]) end -end \ No newline at end of file +end diff --git a/app/views/adsprints/_task.html.erb b/app/views/adsprints/_task.html.erb index 955101b..c33662d 100644 --- a/app/views/adsprints/_task.html.erb +++ b/app/views/adsprints/_task.html.erb @@ -1,7 +1,7 @@ -
<%= content_tag(:label, l(:label_settings_tracker)) %> - <%= select_tag("settings[tracker]", options_from_collection_for_select(Tracker.all, :id, :name, Setting.plugin_AgileDwarf[:tracker].to_i)) %> + <%= select_tag("settings[tracker]", options_from_collection_for_select(Tracker.all, :id, :name, Setting.plugin_AgileDwarf['tracker'].to_i)) %>
<%= content_tag(:label, l(:label_settings_activity)) %> - <%= select_tag("settings[activity]", options_from_collection_for_select(TimeEntryActivity.all, :id, :name, Setting.plugin_AgileDwarf[:activity].to_i)) %> + <%= select_tag("settings[activity]", options_from_collection_for_select(TimeEntryActivity.all, :id, :name, Setting.plugin_AgileDwarf['activity'].to_i)) %>
<%= content_tag(:label, l(:label_settings_closedstatus)) %> - <%= select_tag("settings[stclosed]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stclosed].to_i)) %> + <%= select_tag("settings[stclosed]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stclosed'].to_i)) %>
<%= content_tag(:label, l(:label_settings_columncount)) %> - <%= select_tag("settings[stcolumncount]", options_for_select([2, 3, 4, 5], Setting.plugin_AgileDwarf[:stcolumncount].to_i)) %> + <%= select_tag("settings[stcolumncount]", options_for_select([2, 3, 4, 5], Setting.plugin_AgileDwarf['stcolumncount'].to_i)) %>
<%= content_tag(:label, l(:label_settings_column1status)) %> - <%= select_tag("settings[stcolumn1]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn1].to_i)) %> + <%= select_tag("settings[stcolumn1]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn1'].to_i)) %>
<%= content_tag(:label, l(:label_settings_column2status)) %> - <%= select_tag("settings[stcolumn2]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn2].to_i)) %> + <%= select_tag("settings[stcolumn2]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn2'].to_i)) %>
<%= content_tag(:label, l(:label_settings_column3status)) %> - <%= select_tag("settings[stcolumn3]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn3].to_i)) %> + <%= select_tag("settings[stcolumn3]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn3'].to_i)) %>
<%= content_tag(:label, l(:label_settings_column4status)) %> - <%= select_tag("settings[stcolumn4]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn4].to_i)) %> + <%= select_tag("settings[stcolumn4]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn4'].to_i)) %>
<%= content_tag(:label, l(:label_settings_column5status)) %> - <%= select_tag("settings[stcolumn5]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn5].to_i)) %> + <%= select_tag("settings[stcolumn5]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn5'].to_i)) %>
-