-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.rb
28 lines (21 loc) · 1.19 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'redmine'
Rails.configuration.to_prepare do
require_dependency 'issue'
unless Issue.included_modules.include? TimeTracker::IssuePatch
Issue.send :include, TimeTracker::IssuePatch
end
unless TimeEntry.included_modules.include? TimeTracker::TimeEntryPatch
TimeEntry.send :include, TimeTracker::TimeEntryPatch
end
end
Redmine::Plugin.register :redmine_time_tracker do
name 'Redmine Time Tracker plugin'
author 'BadrIT'
description 'This is a plugin for Redmine'
version '0.0.1'
url 'http://example.com/path/to/plugin'
author_url 'http://www.badrit.com'
menu :top_menu, :log_time, {:controller => 'timelog', :action => 'new' }, :caption => 'Log time', :if => Proc.new { User.current.logged? }
menu :top_menu, :time_details, {:controller => 'timelog', :action => 'report', :criterias=>['member', 'issue'], :columns=>'day', :period=>'current_week', :user_id=>''}, :caption => 'Time details', :require => :loggedin, :if => Proc.new { !(User.current.projects.blank?) }
menu :top_menu, :time_chart, {:controller => 'time_tracker', :action => 'charts', 'op[spent_on]' => 'w', 'f[]' => 'spent_on'}, :caption => 'Time charts', :if => Proc.new { User.current.logged? }
end