Skip to content

Instantly share code, notes, and snippets.

View gist:230198
ideal = [ 178.0,168.111111111,158.222222222,148.333333333,138.444444444,128.555555556,118.666666667,108.777777778,98.8888888889,89.0,79.1111111111,69.2222222222,59.3333333333,49.4444444444,39.5555555556,29.6666666667,19.7777777778,9.88888888889,0.0 ];
hours = [ 178.00,148.00,148.00,129.00,122.00,114.00,114.00,77.00,74.00,74.00,58.00,58.00,58.00,26.00,26.00,26.00,26.00,26.00,26.00 ];
storypoints = [ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ];
// jqplot currently can't handle series that have all the
// same datapoints
p = storypoints[0];
bug = true;
for (i in storypoints) {
if (storypoints[i] != p) {
View gist:230191
jQuery("#treegrid2").jqGrid({
treeGrid: true,
treeGridModel : 'adjacency',
ExpandColumn : 'itid',
datatype: "json",
url: '/3/iteration/62/taskboard/json/',
mtype: "POST",
colNames: ["id","Rank", "ID", "Name", "State", "Size/Hours", "To do", "Owner", "Failures" ],
colModel:[
{name:'id',index:'id', width:1,hidden:true,key:true},
View gist:338137
require 'redmine'
require 'dispatcher'
Dispatcher.to_prepare do
require_dependency 'version'
end
require_dependency 'backlogs_layout_hooks'
View gist:338107
module BacklogsPlugin
module Hooks
class LayoutHook < Redmine::Hook::ViewListener
def view_issues_sidebar_queries_bottom(context={ })
links = ''
project = context[:project]
project_id = project.id
Sprint.open_sprints(project).each { |sprint|
# links += link_to(sprint.name, {
View gist:338110
class Sprint < Version
named_scope :open_sprints, lambda { |project|
{
:order => 'start_date ASC, effective_date ASC',
:conditions => [ "status = 'open' and project_id = ?", project.id ]
}
}
def stories
View gist:428533
require 'rubygems'
require 'prawn'
require 'prawn/measurement_extensions'
require 'net/http'
require 'rexml/document'
require 'yaml'
module CardsHelper
#include Redmine::I18n
View gist:440306
<%= link_to("##{tag}",
{:controller => "tagging", :action => "index", :project_id => project.identifier, :tags => tag},
{:style => "visibility: visible", :class => "tag", :rel => count}) %>
View init.rb
Dispatcher.to_prepare do
require_dependency 'version'
require_dependency 'issue'
require_dependency 'issue_relation'
require_dependency 'version'
require_dependency 'project'
Issue::SAFE_ATTRIBUTES << "story_points" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "remaining_hours" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "position" if Issue.const_defined? "SAFE_ATTRIBUTES"
View gist:497661
ActiveRecord::UnknownAttributeError (unknown attribute: backlogs_task_color):
app/controllers/my_controller.rb:58:in `account'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
View gist:547736
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| tracker_id | int(11) | NO | MUL | 0 | |
| project_id | int(11) | NO | MUL | 0 | |
| subject | varchar(255) | NO | | | |
| description | text | YES | | NULL | |
| due_date | date | YES | | NULL | |
| category_id | int(11) | YES | MUL | NULL | |