Actualizado plugin Redmine Questions 1.0.0 light

This commit is contained in:
Manuel Cillero 2019-03-21 17:52:05 +01:00
parent 27e60f8ec1
commit 5d7889f1c9
140 changed files with 5342 additions and 1430 deletions

View file

@ -1,38 +1,68 @@
requires_redmine_crm(:version_or_higher => '0.0.17')
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2018 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# redmine_questions is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with redmine_questions. If not, see <http://www.gnu.org/licenses/>.
requires_redmine_crm version_or_higher: '0.0.38'
require 'redmine_questions'
QA_VERSION_NUMBER = '1.0.0'
QA_VERSION_TYPE = "Light version"
Redmine::Plugin.register :redmine_questions do
name 'Redmine Q&A plugin'
author 'RedmineCRM'
name "Redmine Q&A plugin (#{QA_VERSION_TYPE})"
author 'RedmineUP'
description 'This is a Q&A plugin for Redmine'
version '0.0.7'
url 'http://www.redminecrm.com/projects/questions'
author_url 'mailto:support@redminecrm.com'
version QA_VERSION_NUMBER
url 'https://www.redmineup.com/pages/plugins/questions'
author_url 'mailto:support@redmineup.com'
requires_redmine :version_or_higher => '2.1.2'
settings :default => {
:sidebar_message => '*Can\'t find the answer you\'re looking for?* Email us at ...'
}, :partial => 'settings/questions'
permission :view_questions, {
:questions => [:index, :autocomplete_for_topic, :topics]
}
requires_redmine :version_or_higher => '2.6'
delete_menu_item(:top_menu, :help)
menu :top_menu, :questions, {:controller => 'questions', :action => 'index'},
:last => true,
:caption => :label_questions,
:if => Proc.new {User.current.allowed_to?({:controller => 'questions', :action => 'index'}, nil, {:global => true})}
menu :top_menu, :questions, {controller: 'questions_sections', action: 'index', project_id: nil},
caption: :label_questions,
if: Proc.new {User.current.allowed_to?({controller: 'questions_sections', action: 'index'}, nil, {global: true})}
Redmine::AccessControl.map do |map|
map.project_module :boards do |map|
map.permission :view_questions, {:questions => [:autocomplete_for_topic, :topics]}
map.permission :vote_messages, {:questions => [:vote]}
map.permission :convert_issues, {:questions => [:convert_issue]}
map.permission :edit_messages_tags, {}
end
menu :project_menu, :questions, {controller: 'questions_sections', action: 'index'},
param: :project_id
project_module :questions do
permission :add_questions, { questions: [:create, :new, :preview, :update_form] }
permission :edit_questions, { questions: [:edit, :update, :preview, :update_form], questions_answers: [:edit, :update, :preview] }, require: :loggedin
permission :edit_own_questions, {questions: [:edit, :update, :preview, :update_form]}, require: :loggedin
permission :add_answers, { questions_answers: [:create, :show, :new, :edit, :update, :preview] }
permission :view_questions, { questions: [:index, :show, :autocomplete_for_subject], questions_sections: [:index] }, read: true
permission :delete_questions, { questions: [:destroy] }, require: :loggedin
permission :delete_answers, { questions_answers: [:destroy] }, require: :loggedin
permission :vote_questions, { questions_votes: [:create] }
permission :accept_answers, { questions_answers: [:update] }, require: :loggedin
permission :comment_question, { questions_comments: [:create] }
permission :edit_question_comments, { questions_comments: [:update, :destroy, :edit] }, require: :loggedin
permission :edit_own_question_comments, { questions_comments: [:update, :destroy, :edit] }, require: :loggedin
permission :manage_sections, { projects: :settings, questions_sections: [:create, :new, :edit, :update] }, require: :loggedin
permission :create_tags, {}
end
activity_provider :questions, default: false, class_name: ['Question', 'QuestionsAnswer']
Redmine::Search.map do |search|
search.register :questions
end
end