From 9fac291490dca4a708931244eb0ddb552ad934ba Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sun, 6 Sep 2026 21:30:19 -0400 Subject: [PATCH] removed unused permissions, moved view registration into setup --- init.rb | 26 -------------------------- lib/redmine_qbo_calendar.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/init.rb b/init.rb index 9f02955..b407b3f 100644 --- a/init.rb +++ b/init.rb @@ -30,22 +30,6 @@ Redmine::Plugin.register :redmine_qbo_calendar do raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)' end - project_module :customer_calendar do - permission :view_customer_appointments, - { customer_appointments: [:index, :show] } - - permission :manage_customer_appointments, - { - customer_appointments: [ - :new, - :create, - :edit, - :update, - :destroy - ] - } -end - # Global Permissions permission :view_customer_appointments, { customer_appointments: [:index, :show] }, global: true permission :add_customer_appointments, { customer_appointments: [:new, :create] }, global: true @@ -57,14 +41,4 @@ end end -Rails.configuration.to_prepare do - ApplicationController.prepend_view_path( File.expand_path("app/views", __dir__) ) - - Redmine::Views::MyPage::Block.register( - 'upcoming_appointments', - label: :label_upcoming_appointments, - partial: 'my/blocks/upcoming_appointments' - ) -end - RedmineQboCalendar.setup \ No newline at end of file diff --git a/lib/redmine_qbo_calendar.rb b/lib/redmine_qbo_calendar.rb index 3001bb3..132df36 100644 --- a/lib/redmine_qbo_calendar.rb +++ b/lib/redmine_qbo_calendar.rb @@ -20,5 +20,15 @@ module RedmineQboCalendar RedmineQboCalendar::Hooks::ViewHookListener RedmineQboCalendar::Hooks::CustomerActionsHookListener RedmineQboCalendar::Hooks::CustomerShowHookListener + + Rails.configuration.to_prepare do + ApplicationController.prepend_view_path( File.expand_path("app/views", __dir__) ) + + Redmine::Views::MyPage::Block.register( + 'upcoming_appointments', + label: :label_upcoming_appointments, + partial: 'my/blocks/upcoming_appointments' + ) + end end end \ No newline at end of file