徒然さめざめ

思ったことを思ったときに思ったように

スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

Redmineのプラグイン ゴンペルたんをいじってみた

トラッカー選択(複数選択未対応)と日数制限解除(0|無入力時に発動) の差分。


ごんぺるたんのパッチ


diff -ru gompertan_plugin/app/controllers/gompertan_controller.rb gompertan_plugin_fix/app/controllers/gompertan_controller.rb
--- gompertan_plugin/app/controllers/gompertan_controller.rb 2009-04-20 01:11:24.000000000 +0900
+++ gompertan_plugin_fix/app/controllers/gompertan_controller.rb 2011-01-19 11:50:26.000000000 +0900
@@ -27,13 +27,15 @@

def graph_gompeltz
days = Setting.plugin_gompertan_plugin['show_days'].to_i
+ days = (Date.today - TimeEntry.earilest_date_for_project(@projecr)).to_i if days.zero?
+ tracker = Setting.plugin_gompertan_plugin['show_trackers'].to_i || 1
date_from = Date.today - days + 1
cond = @project.project_condition(true)
-
+ cond << "AND tracker_id = #{tracker}"
issues_new_by_date ||= Issue.count(:all, :conditions => ["(#{cond}) AND start_date BETWEEN ? AND ?", date_from, Date.today+1], :group => "start_date", :include => :project, :order => "start_date" )
issues_close_by_date ||= Issue.count(:all, :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=? AND #{Issue.table_name}.updated_on BETWEEN ? AND ?", true, date_from, Date.today+1], :group => "#{Issue.table_name}.updated_on", :include => [:project, :status ], :order => "#{Issue.table_name}.updated_on" )

- issues_open_now ||= Issue.count(:all, :include => [:project, :status ], :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=? ", false])
+ issues_open_now ||= Issue.count(:all, :include => [:project, :status ], :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
issues_total_now ||= Issue.count(:all, :include => [:project ], :conditions => ["(#{cond}) "])

issues_new = [0] * days
diff -ru gompertan_plugin/app/views/settings/_gompertan_settings.rhtml gompertan_plugin_fix/app/views/settings/_gompertan_settings.rhtml
--- gompertan_plugin/app/views/settings/_gompertan_settings.rhtml 2010-09-14 22:57:36.000000000 +0900
+++ gompertan_plugin_fix/app/views/settings/_gompertan_settings.rhtml 2011-01-19 11:50:26.000000000 +0900
@@ -1,4 +1,5 @@
<p><label><%=l(:gompertan_graph_show_days)%></label><%= text_field_tag 'settings[show_days]', @settings['show_days'] %></p>
+<p><label><%=l(:gompertan_graph_show_trackers)%></label><%= select_tag 'settings[show_trackers]', options_for_select(Tracker.all.collect{|t| [t.name, t.id]}, @settings['show_trackers'].to_i) %></p>
<p><label><%=l(:gompertan_graph_show_cwday)%></label>
<%= check_box_tag 'settings[show_cwday1]',1, @settings['show_cwday1'] %><%=l('date.day_names')[1]%>&nbsp;
<%= check_box_tag 'settings[show_cwday2]',1, @settings['show_cwday2'] %><%=l('date.day_names')[2]%>&nbsp;
diff -ru gompertan_plugin/config/locales/en.yml gompertan_plugin_fix/config/locales/en.yml
--- gompertan_plugin/config/locales/en.yml 2010-09-13 13:30:24.000000000 +0900
+++ gompertan_plugin_fix/config/locales/en.yml 2011-01-19 11:50:26.000000000 +0900
@@ -8,4 +8,5 @@
gompertan_graph_issues_open: Alive Issues(rough)
gompertan_graph_issues_close: Closed Issues(rough)
gompertan_graph_show_days: Period
+ gompertan_graph_show_trackers: Tracker
gompertan_graph_show_cwday: day of the week
diff -ru gompertan_plugin/config/locales/ja.yml gompertan_plugin_fix/config/locales/ja.yml
--- gompertan_plugin/config/locales/ja.yml 2010-09-13 13:30:36.000000000 +0900
+++ gompertan_plugin_fix/config/locales/ja.yml 2011-01-19 11:50:26.000000000 +0900
@@ -8,4 +8,5 @@
gompertan_graph_issues_open: 残存チケット(近似)
gompertan_graph_issues_close: 完了チケット(近似)
gompertan_graph_show_days: グラフを表示する日数
+ gompertan_graph_show_trackers: グラフを表示するトラッカー
gompertan_graph_show_cwday: グラフを表示する曜日
スポンサーサイト

コメント

コメントの投稿


管理者にだけ表示を許可する

トラックバック

トラックバック URL
http://fmkt.blog65.fc2.com/tb.php/169-971faa2b
この記事にトラックバックする(FC2ブログユーザー)

FC2Ad

上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。