OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add iCalendar sub-level
Mir Bhatia121dfd5ba044
diff --git a/app/controllers/admin/settings/date_format_settings_controller.rb b/app/controllers/admin/settings/date_format_settings_controller.rbindex f0ce87853d2..a2b400b9956 100644--- a/app/controllers/admin/settings/date_format_settings_controller.rb+++ b/app/controllers/admin/settings/date_format_settings_controller.rb@@ -40,10 +40,6 @@ module Admin::Settingst(:label_date_format)end- def show_local_breadcrumb- true- end-privatedef validate_start_of_week_and_first_week_of_year_combinationdiff --git a/app/controllers/admin/settings/icalendar_settings_controller.rb b/app/controllers/admin/settings/icalendar_settings_controller.rbnew file mode 100644index 00000000000..843295ae1d1--- /dev/null+++ b/app/controllers/admin/settings/icalendar_settings_controller.rb@@ -0,0 +1,37 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2023 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 Admin::Settings+ class IcalendarSettingsController < ::Admin::SettingsController+ menu_item :icalendar++ def default_breadcrumb+ t(:label_icalendar)+ end+ end+enddiff --git a/app/controllers/admin/settings/working_days_settings_controller.rb b/app/controllers/admin/settings/working_days_settings_controller.rbindex 43284f31b50..e3f63a9519f 100644--- a/app/controllers/admin/settings/working_days_settings_controller.rb+++ b/app/controllers/admin/settings/working_days_settings_controller.rb@@ -34,10 +34,6 @@ module Admin::Settingst(:label_working_days)end- def show_local_breadcrumb- true- end-def failure_callback(call)@modified_non_working_days = modified_non_working_days_for(call.result)flash[:error] = call.message || I18n.t(:notice_internal_server_error)diff --git a/app/views/admin/settings/general_settings/show.html.erb b/app/views/admin/settings/general_settings/show.html.erbindex ad7182b180a..6569e592380 100644--- a/app/views/admin/settings/general_settings/show.html.erb+++ b/app/views/admin/settings/general_settings/show.html.erb@@ -49,7 +49,6 @@ See COPYRIGHT and LICENSE files for more details.</div><div class="form--field"><%= setting_check_box :cache_formatted_text %></div><div class="form--field"><%= setting_check_box :feeds_enabled, size: 6 %></div>- <div class="form--field"><%= setting_check_box :ical_enabled, size: 6 %></div><div class="form--field"><%= setting_text_field :feeds_limit, size: 6, container_class: '-xslim' %></div><div class="form--field"><%= setting_text_field :work_packages_projects_export_limit, size: 6, container_class: '-xslim' %></div><div class="form--field">diff --git a/app/views/admin/settings/icalendar_settings/show.html.erb b/app/views/admin/settings/icalendar_settings/show.html.erbnew file mode 100644index 00000000000..e78981480ae--- /dev/null+++ b/app/views/admin/settings/icalendar_settings/show.html.erb@@ -0,0 +1,50 @@+<%# -- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2023 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.++++#%>++<%= toolbar title: t(:label_icalendar) %>++<%= styled_form_tag(+ admin_settings_icalendar_path,+ method: :patch,+ class: 'op-icalendar-admin-settings'+ ) do %>++ <section class="form--section">+ <div class="form--field">+ <%= setting_check_box :ical_enabled, size: 6 %>+ <span class="form--field-instructions">+ <%= t('settings.icalendar.enable_subscriptions_text') %>+ <br/>+ <%# <%= static_link_to :display_settings_documentation, label: t('settings.icalendar.note_text') %>+ </span>+ </div>+ </section>++ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>+<% end %>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex 48829f17100..5f14da204f9 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -301,6 +301,12 @@ Redmine::MenuManager.map :admin_menu do |menu|caption: :label_date_format,parent: :calendars_and_dates+ menu.push :icalendar,+ { controller: '/admin/settings/icalendar_settings', action: :show },+ if: Proc.new { User.current.admin? },+ caption: :label_icalendar,+ parent: :calendars_and_dates+menu.push :settings,{ controller: '/admin/settings/general_settings', action: :show },if: Proc.new { User.current.admin? },diff --git a/config/routes.rb b/config/routes.rbindex bc117107683..52c7ecde213 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -403,6 +403,7 @@ OpenProject::Application.routes.draw doresource :working_days, controller: '/admin/settings/working_days_settings', only: %i[show update]resource :users, controller: '/admin/settings/users_settings', only: %i[show update]resource :date_format, controller: '/admin/settings/date_format_settings', only: %i[show update]+ resource :icalendar, controller: '/admin/settings/icalendar_settings', only: %i[show update]# Redirect /settings to general settingsget '/', to: redirect('/admin/settings/general')