-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
55 lines (40 loc) · 2.32 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#require_dependency 'redmine_gamification_playlyfe'
#developed with big help form
#https://jkraemer.net/2015/11/how-to-create-a-redmine-plugin
#http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Extending-the-application-menu
#https://github.com/edavis10/redmine_kanban
require 'redmine'
# Patches to the Redmine core.
ActionDispatch::Callbacks.to_prepare do
require_dependency 'issue'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless Issue.included_modules.include? Gamification::IssuePatch
Issue.send(:include, Gamification::IssuePatch)
end
unless Journal.included_modules.include? Gamification::JournalPatch
Journal.send(:include, Gamification::JournalPatch)
end
unless User.included_modules.include? Gamification::UserPatch
User.send(:include, Gamification::UserPatch)
end
end
Redmine::Plugin.register :redmine_gamification_playlyfe do
name 'Plugin for gamification using Playlyfe service'
url 'https://github.com/foton/redmine_gamification_playlyfe'
author_url 'https://github.com/foton'
author 'Foton'
description "This is a plugin for Redmine, which let you link users, actions and events in Redmine to Playlyfe game.
You set your game (rules, actions, rewards ...) at Playlyfe and setup Redmine to use it's actions.
So adding comment or closing issue can be rewarded."
version '1.0.0'
requires_redmine version_or_higher: '3.1.1'
#permission :redmine_gamification_plugin, {:redmine_gamification_plugin => [:project]}, :public => true
menu :top_menu, :redmine_gamification_playlyfe, {controller: 'gamification', action: 'index'}, :caption => "gamification.menu_title".to_sym
# menu :project_menu, :project_gamification, {controller: 'gamification', action: 'project'}, caption: 'Status', param: :project_id
#permission :view_scores, { :gamification => [:index, :leaderboards, :my] }, :require => :loggedin
#permission :view_scores_of_others, { :gamification => [:player] }, :require => :loggedin
#permission :direct_play_action, { :gamification => [:actions, :play_action] }, :require => :loggedin
#permission :configure, { :gamification => [:configuration, :configuration_update] }, :require => :loggedin
settings partial: 'settings/redmine_gamification_playlyfe', default: {}
end