Initial Redmine tooling and local plugin forks
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ControllerContactsDuplicatesHook < Redmine::Hook::ViewListener
|
||||
def controller_contacts_duplicates_merge(context={})
|
||||
context[:duplicate].journal_messages << context[:contact].journal_messages
|
||||
context[:duplicate].helpdesk_tickets << context[:contact].helpdesk_tickets
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class HelperIssuesHook < Redmine::Hook::ViewListener
|
||||
|
||||
def helper_issues_show_detail_after_setting(context={})
|
||||
if context[:detail].prop_key == 'vote'
|
||||
detail = context[:detail]
|
||||
context[:detail].value = HelpdeskTicket.vote_message(detail.value) if detail.value && detail.value.to_s =~ /^\d$/
|
||||
context[:detail].old_value = HelpdeskTicket.vote_message(detail.old_value) if detail.old_value && detail.old_value.to_s =~ /^\d$/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class IssuesControllerHook < Redmine::Hook::ViewListener
|
||||
def controller_issues_new_before_save(context = {})
|
||||
ticket = context[:issue].helpdesk_ticket
|
||||
return if ticket.nil? || ticket.from_address.present? || ticket.customer.nil? || ticket.customer.primary_email.blank?
|
||||
ticket.from_address = ticket.customer.primary_email
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ViewContactsHook < Redmine::Hook::ViewListener
|
||||
render_on :view_contacts_context_menu_before_delete, :partial => "context_menus/helpdesk_contacts"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ViewIssuesHook < Redmine::Hook::ViewListener
|
||||
render_on :view_issues_edit_notes_bottom, :partial => 'issues/send_response'
|
||||
def view_issues_sidebar_issues_bottom(context = {})
|
||||
context[:controller].send(:render_to_string, { :partial => 'issues/helpdesk_reports', :locals => context }) +
|
||||
context[:controller].send(:render_to_string, { :partial => 'issues/helpdesk_customer_profile', :locals => context })
|
||||
end
|
||||
render_on :view_issues_show_details_bottom, :partial => 'issues/ticket_data'
|
||||
render_on :view_issues_form_details_top, :partial => 'issues/ticket_data_form'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
include ContactsHelper
|
||||
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ShowJournalContactHook < Redmine::Hook::ViewListener
|
||||
render_on :view_issues_history_journal_bottom, :partial => "journals/journal_contact"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ViewsLayoutsHook < Redmine::Hook::ViewListener
|
||||
def view_layouts_base_html_head(context={})
|
||||
return stylesheet_link_tag(:helpdesk, :plugin => 'redmine_contacts_helpdesk')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
module RedmineHelpdesk
|
||||
module Hooks
|
||||
class ViewProjectsHook < Redmine::Hook::ViewListener
|
||||
def view_projects_show_sidebar_bottom(context = {})
|
||||
context[:controller].send(:render_to_string, { :partial => 'issues/helpdesk_reports', :locals => context }) +
|
||||
context[:controller].send(:render_to_string, { :partial => 'projects/helpdesk_tickets', :locals => context })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user