Finished new report generation

This commit is contained in:
2012-02-19 10:01:12 -05:00
parent ba1ab6a450
commit b103654d03
3 changed files with 42 additions and 19 deletions

View File

@@ -27,23 +27,30 @@ class ExceptionhandlerController < ApplicationController
helper :exceptionhandler
include ExceptionhandlerHelper
require 'logger'
def index
# @bug_id = Tracker.find_by_name("Bug").id
# @issues = Project.find_by_name(params[:app]).issues
# @custom_fields = CustomField
log = Logger.new('redmine-exceptionhandler-plugin.txt')
log.level = Logger::DEBUG
log.debug "Loading Index"
if params.size < 8
@output = "<strong> not enough args </strong>"
elsif Project.find_by_name(params[:app]) == nil
@output = "No Project Found"
else
issue_id = check_for_existing_report
if issue_id > 0
# TODO update report
@output = issue_id
else
if file_new_report
@output = "new report filed"
#TODO create new report and save
issue = create_new_report
if issue.valid?
issue.save
@output = "Report filed, Thank You."
else
@output = "Failed to file report"
@output = issue.errors.full_messages
end
end
end