Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (37 sloc) 1.46 KB
require 'dispatcher'
require 'redmine'
require 'harvestr'
#require 'vendor/plugins/redmine_harvest/lib/harvest'
#require 'vendor/plugins/redmine_harvest/lib/harvest/hooks/harvest_hooks.rb'
require 'harvest'
require 'harvest/hooks/harvest_hooks.rb'
require 'harvest/patches/hash_patch.rb'
unless Rails.env == 'test'
config = YAML::load( "config/harvest.yml"))
Harvest.domain = config["domain"] = config["email"]
Harvest.password = config["password"] =
Redmine::Plugin.register :redmine_harvest do
name 'Redmine Harvest plugin'
author 'Jim Mulholland'
description 'This is a plugin for Redmine to import project timesheet data from Harvest.'
version '0.1.0'
# This plugin contains settings
settings :default => {
'harvest_project_id' => '',
'harvest_user_id' => ''
}, :partial => 'settings/harvest_settings'
# This plugin adds a project module
# It can be enabled/disabled at project level (Project settings -> Modules)
project_module :harvest do
# This permission has to be explicitly given
# It will be listed on the permissions screen
permission :view_harvest, {:harvest_reports => [:index, :show]}
menu :project_menu, :harvest, {:controller => 'harvest_reports', :action => 'index'}, :caption => 'Harvest', :param => :project_id
Dispatcher.to_prepare do
Hash.send(:include, Harvest::Patches::HashPatch) unless Hash < Harvest::Patches::HashPatch