mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-04 04:40:43 -04:00
removed unused permissions, moved view registration into setup
This commit is contained in:
1 parent
8448c06b10
commit
9fac291490
2 files changed
+10
-26
No files matched your search
@@ -30,22 +30,6 @@ Redmine::Plugin.register :redmine_qbo_calendar do
|
|||||||
raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)'
|
raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)'
|
||||||
end
|
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
|
# Global Permissions
|
||||||
permission :view_customer_appointments, { customer_appointments: [:index, :show] }, global: true
|
permission :view_customer_appointments, { customer_appointments: [:index, :show] }, global: true
|
||||||
permission :add_customer_appointments, { customer_appointments: [:new, :create] }, global: true
|
permission :add_customer_appointments, { customer_appointments: [:new, :create] }, global: true
|
||||||
@@ -57,14 +41,4 @@ end
|
|||||||
|
|
||||||
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
|
RedmineQboCalendar.setup
|
||||||
@@ -20,5 +20,15 @@ module RedmineQboCalendar
|
|||||||
RedmineQboCalendar::Hooks::ViewHookListener
|
RedmineQboCalendar::Hooks::ViewHookListener
|
||||||
RedmineQboCalendar::Hooks::CustomerActionsHookListener
|
RedmineQboCalendar::Hooks::CustomerActionsHookListener
|
||||||
RedmineQboCalendar::Hooks::CustomerShowHookListener
|
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
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user