From 2bf7a3fc138d39edfd0de7f7619eba432c378fbc Mon Sep 17 00:00:00 2001 From: Ric Emery Date: Wed, 21 Nov 2012 12:08:39 -0700 Subject: [PATCH 1/5] Add trackers name to the Sprints view --- app/models/sprints_tasks.rb | 4 ++-- app/views/adsprints/_task.html.erb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/sprints_tasks.rb b/app/models/sprints_tasks.rb index b2f9bbd..0cc6e87 100644 --- a/app/models/sprints_tasks.rb +++ b/app/models/sprints_tasks.rb @@ -37,7 +37,7 @@ def self.get_tasks_by_sprint(project, sprint) cond << sprint end end - SprintsTasks.find(:all, :order => SprintsTasks::ORDER, :conditions => cond, :joins => :status, :include => :assigned_to).each{|task| tasks << task} + SprintsTasks.find(:all, :select => 'issues.*, trackers.name AS t_name', :order => SprintsTasks::ORDER, :conditions => cond, :joins => :status, :joins => "left join issue_statuses on issue_statuses.id = status_id left join trackers on trackers.id = tracker_id", :include => :assigned_to).each{|task| tasks << task} return tasks end @@ -74,4 +74,4 @@ def update_and_position!(params) self.init_journal(User.current) update_attributes attribs 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..dd49f24 100644 --- a/app/views/adsprints/_task.html.erb +++ b/app/views/adsprints/_task.html.erb @@ -1,7 +1,8 @@
#<%= link_to task.id, :controller => 'issues', :action => 'show', :id => task %>
+
<%=h task.t_name %> - 
<%=h task.subject %>
<%=h task.estimated_hours || l(:label_sprints_placeholder_estimated) %>
<%=h task.assigned_to %>
-
\ No newline at end of file + From 2fe8c22e3efc286ec8452c1394396f3ebe63a731 Mon Sep 17 00:00:00 2001 From: Ric Emery Date: Wed, 5 Dec 2012 14:13:13 -0700 Subject: [PATCH 2/5] Add trackers to description in Tasks view --- app/models/sprints_tasks.rb | 4 ++-- app/views/adtasks/_task.html.erb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/sprints_tasks.rb b/app/models/sprints_tasks.rb index 0cc6e87..a6ef6e4 100644 --- a/app/models/sprints_tasks.rb +++ b/app/models/sprints_tasks.rb @@ -21,8 +21,8 @@ def self.get_tasks_by_status(project, status, sprint, user) user = User.current.id if user == 'current' cond << user end - SprintsTasks.find(:all, :select => 'issues.*, sum(hours) as spent', :order => SprintsTasks::ORDER, :conditions => cond, :group => "issues.id", - :joins => [:status], :joins => "left join time_entries ON time_entries.issue_id = issues.id", :include => [:assigned_to]).each{|task| tasks << task} + SprintsTasks.find(:all, :select => 'issues.*, sum(hours) as spent, trackers.name AS t_name', :order => SprintsTasks::ORDER, :conditions => cond, :group => "issues.id", + :joins => [:status], :joins => "left join time_entries ON time_entries.issue_id = issues.id left join trackers on trackers.id = tracker_id", :include => [:assigned_to]).each{|task| tasks << task} return tasks end diff --git a/app/views/adtasks/_task.html.erb b/app/views/adtasks/_task.html.erb index 04bb66e..e820b56 100644 --- a/app/views/adtasks/_task.html.erb +++ b/app/views/adtasks/_task.html.erb @@ -1,6 +1,7 @@
#<%= link_to task.id, :controller => 'issues', :action => 'show', :id => task %>
+
<%=h task.t_name %> - 
<%=h task.subject %>
@@ -21,4 +22,4 @@
h
<%=h task.spent || '0' %>
-
\ No newline at end of file + From 3cc4bf355f8530a69874667d17190a7e57a98353 Mon Sep 17 00:00:00 2001 From: Ric Emery Date: Thu, 6 Dec 2012 06:08:55 -0700 Subject: [PATCH 3/5] Add read only permissions Add read only permissions. These permissions are a bit odd in that they still allow some seemingly write operations to the user. But the write operations are ignored. Preventing the attempted writes will require more changes to the Java script. --- init.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.rb b/init.rb index 8451fbd..6b74e08 100644 --- a/init.rb +++ b/init.rb @@ -22,7 +22,9 @@ project_module :scrum do permission :sprints, {:adsprints => [:list], :adtaskinl => [:update, :inplace, :create, :tooltip], :adsprintinl => [:create, :inplace]} + permission :sprints_readonly, {:adsprints => [:list]} permission :sprints_tasks, {:adtasks => [:list], :adtaskinl => [:update, :inplace, :tooltip, :spent]} + permission :sprints_tasks_readonly, {:adtasks => [:list]} permission :burndown_charts, {:adburndown => [:show]} end From a751069b5549c929d8a5b512f8e7b4c83e56f875 Mon Sep 17 00:00:00 2001 From: Ric Emery Date: Thu, 6 Dec 2012 06:09:27 -0700 Subject: [PATCH 4/5] Ignore .iml --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0c37ed9..6d5fab8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -.svn \ No newline at end of file +.svn +*.iml From edf1d3017335d264163409b20d880144c542e586 Mon Sep 17 00:00:00 2001 From: Ric Emery Date: Mon, 31 Dec 2012 09:07:49 -0700 Subject: [PATCH 5/5] Fix burndown.. Apply patch from https://github.com/iRessources/AgileDwarf/issues/36 --- assets/javascripts/burndown.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/javascripts/burndown.js b/assets/javascripts/burndown.js index 9d03f1f..c1021c6 100644 --- a/assets/javascripts/burndown.js +++ b/assets/javascripts/burndown.js @@ -45,7 +45,7 @@ var Burndown = function ($) { if (!tasks.hasOwnProperty(id)) continue; - tasks[id].created_on = Date.fromMysql(tasks[id].created_on); + tasks[id].sprints_tasks.created_on = Date.fromMysql(tasks[id].sprints_tasks.created_on); } // loop through changes for (i = 0, len = changes.length; i < len; ) @@ -59,7 +59,7 @@ var Burndown = function ($) { if (!tasks.hasOwnProperty(id)) continue; - var task = tasks[id]; + var task = tasks[id].sprints_tasks; // delete tasks, that was created after current date if (task.created_on > dateTime) delete tasks[id]; @@ -76,9 +76,9 @@ var Burndown = function ($) while (dateTime == changeDate) { if (changes[i].prop_key == 'done_ratio') - tasks[changes[i].issueId].done_ratio = changes[i].value; + tasks[changes[i].issueId].sprints_tasks.done_ratio = changes[i].value; else - tasks[changes[i].issueId].estimated_hours = changes[i].value; + tasks[changes[i].issueId].sprints_tasks.estimated_hours = changes[i].value; // next change i++; if (i >= len) @@ -209,4 +209,4 @@ var Burndown = function ($) }); return obj; -}(jQuery); \ No newline at end of file +}(jQuery);