mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Resource Management Engine Boilerplate
This commit is contained in:
@@ -198,6 +198,11 @@ PATH
|
||||
openproject-reporting (1.0.0)
|
||||
costs
|
||||
|
||||
PATH
|
||||
remote: modules/resource_management
|
||||
specs:
|
||||
openproject-resource_management (1.0.0)
|
||||
|
||||
PATH
|
||||
remote: modules/storages
|
||||
specs:
|
||||
@@ -1690,6 +1695,7 @@ DEPENDENCIES
|
||||
openproject-primer_view_components (~> 0.84.5)
|
||||
openproject-recaptcha!
|
||||
openproject-reporting!
|
||||
openproject-resource_management!
|
||||
openproject-storages!
|
||||
openproject-team_planner!
|
||||
openproject-token (~> 8.8.2)
|
||||
@@ -2072,6 +2078,7 @@ CHECKSUMS
|
||||
openproject-primer_view_components (0.84.5) sha256=307ad2135cfb283b2d1da354e545bd3e3f1dda43158f020c89ff4641e441fe86
|
||||
openproject-recaptcha (1.0.0)
|
||||
openproject-reporting (1.0.0)
|
||||
openproject-resource_management (1.0.0)
|
||||
openproject-storages (1.0.0)
|
||||
openproject-team_planner (1.0.0)
|
||||
openproject-token (8.8.2) sha256=081cbff7269d92a82fa1d63e9e09c87b70d47d7aefadcbb80d1e7368bc2cf096
|
||||
|
||||
@@ -39,6 +39,7 @@ group :opf_plugins do
|
||||
gem 'openproject-team_planner', path: 'modules/team_planner'
|
||||
gem 'openproject-gantt', path: 'modules/gantt'
|
||||
gem 'openproject-calendar', path: 'modules/calendar'
|
||||
gem 'openproject-resource_management', path: 'modules/resource_management'
|
||||
gem 'openproject-storages', path: 'modules/storages'
|
||||
gem 'openproject-wikis', path: 'modules/wikis'
|
||||
gem 'openproject-documents', path: 'modules/documents'
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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 ::ResourceManagement
|
||||
class BaseController < ::ApplicationController
|
||||
end
|
||||
end
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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 ::ResourceManagement
|
||||
class ResourcePlannersController < BaseController
|
||||
before_action :find_project_by_project_id
|
||||
|
||||
# TODO: Temporary
|
||||
no_authorization_required!(*%i[index show overview new edit create update destroy toggle_public])
|
||||
|
||||
def index; end
|
||||
def show; end
|
||||
def new; end
|
||||
def edit; end
|
||||
def create; end
|
||||
def update; end
|
||||
def toggle_public; end
|
||||
def destroy; end
|
||||
end
|
||||
end
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<pre>
|
||||
<%= @project.pretty_inspect %>
|
||||
</pre>
|
||||
@@ -0,0 +1,20 @@
|
||||
en:
|
||||
plugin_openproject_resource_management:
|
||||
name: "OpenProject Resource Management"
|
||||
description: "Provides resource management and capacity planning."
|
||||
|
||||
project_module_resource_management: "Resource management"
|
||||
permission_view_resource_planners: "View resource planners"
|
||||
permission_view_resource_planners_explanation: >
|
||||
Allows users to access resource planners. It allows them to create and
|
||||
manage their own resource planners and view public resource planners. It
|
||||
does not allow users to view resource planners created by other users that
|
||||
are not shared publicly.
|
||||
permission_manage_public_resource_planners: "Manage public resource planners"
|
||||
permission_manage_public_resource_planners_explanation: >
|
||||
Allows users to create and manage public resource planners. It allows them
|
||||
to view, create, manage and publish their own resource planners. It does not
|
||||
allow users to view resource planners created by other users that are not
|
||||
shared publicly.
|
||||
|
||||
label_resource_management: "Resource planning"
|
||||
@@ -0,0 +1,47 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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.
|
||||
#++
|
||||
|
||||
Rails.application.routes.draw do
|
||||
# resources :resource_management,
|
||||
# controller: "resource_management/resource_management",
|
||||
# only: %i[] do
|
||||
# collection do
|
||||
# get "/", to: "resource_management/resource_management#overview", as: :overview
|
||||
# end
|
||||
# end
|
||||
|
||||
scope "projects/:project_id", as: "project" do
|
||||
resources :resource_planners, controller: "resource_management/resource_planners", as: :resource_planner do
|
||||
member do
|
||||
post :toggle_public
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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 ResourceManagement
|
||||
require "open_project/resource_management/engine"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,90 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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.
|
||||
#++
|
||||
|
||||
require "open_project/plugins"
|
||||
|
||||
module OpenProject::ResourceManagement
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name :openproject_resource_management
|
||||
|
||||
include OpenProject::Plugins::ActsAsOpEngine
|
||||
|
||||
initializer "openproject-resource_management.feature_decisions" do
|
||||
OpenProject::FeatureDecisions.add :resource_management
|
||||
end
|
||||
|
||||
register "openproject-resource_management",
|
||||
author_url: "https://www.openproject.org",
|
||||
bundled: true,
|
||||
settings: {} do
|
||||
project_module :resource_management do
|
||||
permission :view_resource_planners,
|
||||
{ "resource_management/resource_planners": %i[index show overview] },
|
||||
permissible_on: :project
|
||||
|
||||
permission :manage_public_resource_planners,
|
||||
{ "resource_management/resource_planners": %i[index show new create edit update destroy] },
|
||||
permissible_on: :project,
|
||||
dependencies: %i[view_resource_planners]
|
||||
end
|
||||
|
||||
# TODO: Add those menus when global overview will be implemented
|
||||
# should_render_global_menu_item = Proc.new do
|
||||
# (User.current.logged? || !Setting.login_required?) &&
|
||||
# User.current.allowed_in_any_project?(:view_resources) &&
|
||||
# OpenProject::FeatureDecisions.resource_management_active?
|
||||
# end
|
||||
|
||||
# menu :global_menu,
|
||||
# :resource_management,
|
||||
# { controller: "/resource_management/resource_management", action: :overview },
|
||||
# caption: :label_resource_management,
|
||||
# after: :calendar_view,
|
||||
# icon: "people",
|
||||
# if: should_render_global_menu_item
|
||||
|
||||
# menu :top_menu,
|
||||
# :resource_management,
|
||||
# { controller: "/resource_management/resource_management", action: :overview },
|
||||
# context: :modules,
|
||||
# caption: :label_resource_management,
|
||||
# after: :calendar_view,
|
||||
# icon: "people",
|
||||
# if: should_render_global_menu_item
|
||||
|
||||
menu :project_menu,
|
||||
:resource_management,
|
||||
{ controller: "/resource_management/resource_planners", action: :index },
|
||||
caption: :label_resource_management,
|
||||
after: :work_packages,
|
||||
icon: "people"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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.
|
||||
#++
|
||||
|
||||
require "open_project/resource_management"
|
||||
@@ -0,0 +1,42 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 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.
|
||||
#++
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "openproject-resource_management"
|
||||
s.version = "1.0.0"
|
||||
s.authors = "OpenProject GmbH"
|
||||
s.email = "info@openproject.com"
|
||||
s.summary = "OpenProject Resource Management"
|
||||
s.description = "Provides resource management and capacity planning abilities."
|
||||
s.license = "GPLv3"
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"]
|
||||
s.metadata["rubygems_mfa_required"] = "true"
|
||||
end
|
||||
Reference in New Issue
Block a user