Added tracker support
to secify a tracker, use the tracker params. defaults to Bug updated version and description
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
= exception_handler
|
||||
|
||||
Description goes here
|
||||
This plugin allows the Exception Handler Library or any other client application to file new reports via a http post.
|
||||
|
||||
When a new report is received, this plugin will automatically search for an existing report.
|
||||
If there is an existing report, it will be updated; if not, a new report will be filed.
|
||||
|
||||
@@ -22,7 +22,7 @@ module ExceptionhandlerHelper
|
||||
# Checks the database for exisiting reports
|
||||
# @return id report is existing else 0
|
||||
def check_for_existing_report
|
||||
bug_id = Tracker.find_by_name("Bug").id
|
||||
bug_id = tracker.id
|
||||
issues = Project.find_by_name(params[:app]).issues
|
||||
issues.each do |issue|
|
||||
if issue.tracker_id == bug_id
|
||||
@@ -81,7 +81,7 @@ module ExceptionhandlerHelper
|
||||
# @return true if new report was filed
|
||||
def create_new_report
|
||||
issue = Issue.new
|
||||
issue.tracker = Tracker.find_by_name("Bug")
|
||||
issue.tracker = tracker
|
||||
issue.subject = params[:msg]
|
||||
issue.description = params[:description]
|
||||
issue.project = Project.find_by_name(params[:app])
|
||||
@@ -139,4 +139,18 @@ module ExceptionhandlerHelper
|
||||
issue.save
|
||||
end
|
||||
|
||||
# gets the prodived tracker
|
||||
# if it doesnt exist, defualt to Bug
|
||||
def tracker
|
||||
if(params[:tracker]!= nil)
|
||||
if params[:tracker].length > 0
|
||||
t = Tracker.find_by_name(params[:tracker])
|
||||
if(t != nil)
|
||||
return t
|
||||
end
|
||||
end
|
||||
end
|
||||
return Tracker.find_by_name("Bug")
|
||||
end
|
||||
|
||||
end #EOF
|
||||
|
||||
6
init.rb
6
init.rb
@@ -3,8 +3,8 @@ require 'redmine'
|
||||
Redmine::Plugin.register :redmine_exception_handler do
|
||||
name 'Redmine Exception Handler plugin'
|
||||
author 'Rick Barrette <rickbarrette@gmail.com>'
|
||||
description 'This is an Exception Report Handler plugin for Redmine'
|
||||
version '0.0.1'
|
||||
url 'http://example.com/path/to/plugin'
|
||||
description 'An Exception Report Handler plugin for Redmine'
|
||||
version '0.0.2'
|
||||
url 'http://example.com/redmine/exceptionhandler'
|
||||
author_url 'http://rickbarrette.dyndns.org'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user