Create (empty) team planner module

This commit is contained in:
Henriette Darge
2021-11-17 13:38:13 +01:00
parent 408786c40e
commit 1fd7acaaa5
11 changed files with 144 additions and 0 deletions
+6
View File
@@ -160,6 +160,11 @@ PATH
openproject-reporting (1.0.0)
costs
PATH
remote: modules/team_planner
specs:
openproject-team_planner (1.0.0)
PATH
remote: modules/two_factor_authentication
specs:
@@ -1060,6 +1065,7 @@ DEPENDENCIES
openproject-pdf_export!
openproject-recaptcha!
openproject-reporting!
openproject-team_planner!
openproject-token (~> 2.2.0)
openproject-translations!
openproject-two_factor_authentication!
+1
View File
@@ -44,6 +44,7 @@ group :opf_plugins do
gem 'openproject-boards', path: 'modules/boards'
gem 'overviews', path: 'modules/overviews'
gem 'budgets', path: 'modules/budgets'
gem 'openproject-team_planner', path: 'modules/team_planner'
gem 'openproject-bim', path: 'modules/bim'
end
@@ -0,0 +1,4 @@
module ::TeamPlanner
class BaseController < ::ApplicationController
end
end
@@ -0,0 +1,28 @@
module ::TeamPlanner
class TeamPlannerController < BaseController
before_action :find_optional_project
before_action :authorize
# The team planner permission alone does not suffice
# to view work packages
before_action :authorize_work_package_permission
menu_item :team_planner_view
def index
render layout: 'angular/angular'
end
current_menu_item :index do
:team_planner_view
end
private
def authorize_work_package_permission
unless current_user.allowed_to?(:view_work_packages, @project, global: @project.nil?)
deny_access
end
end
end
end
@@ -0,0 +1 @@
<% html_title(t('team_planner.label_team_planner')) -%>
@@ -0,0 +1,7 @@
# English strings go here
en:
permission_view_team_planner: "View team planner"
project_module_team_planner_view: "Team planner"
team_planner:
label_team_planner: "Team planner"
+6
View File
@@ -0,0 +1,6 @@
OpenProject::Application.routes.draw do
#scope 'projects/:project_id', as: 'project' do
# get '/team_planner(/*state)', to: 'team_planner/team_planner#index'
#end
get '/projects/:project_id/team_planner', to: 'team_planner/team_planner#index'
end
@@ -0,0 +1,33 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++
module OpenProject
module TeamPlanner
require 'open_project/team_planner/engine'
end
end
@@ -0,0 +1,44 @@
# OpenProject Team Planner module
#
# Copyright (C) 2021 OpenProject GmbH
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module OpenProject::TeamPlanner
class Engine < ::Rails::Engine
engine_name :openproject_team_planner
include OpenProject::Plugins::ActsAsOpEngine
register 'openproject-team_planner',
author_url: 'https://www.openproject.org',
bundled: true,
settings: {},
name: 'OpenProject Team Planner' do
project_module :team_planner_view, dependencies: :work_package_tracking, order: 60 do
permission :view_team_planner, 'team_planner/team_planner': %i[index], dependencies: :view_work_packages
end
menu :project_menu,
:team_planner_view,
{ controller: '/team_planner/team_planner', action: :index },
caption: :'team_planner.label_team_planner',
after: :backlogs,
icon: 'icon2 icon-calendar'
end
end
end
@@ -0,0 +1 @@
require 'open_project/team_planner'
@@ -0,0 +1,13 @@
# encoding: UTF-8
Gem::Specification.new do |s|
s.name = 'openproject-team_planner'
s.version = '1.0.0'
s.authors = 'OpenProject GmbH'
s.email = 'info@openproject.com'
s.summary = 'OpenProject Team Planner'
s.description = 'Provides team planner views'
s.license = 'GPLv3'
s.files = Dir['{app,config,db,lib}/**/*']
end