Commit 48985aff authored by Morten Knutsen's avatar Morten Knutsen Committed by root

Added uncommited changes

parent a92513e6
# English strings go here for Rails i18n
en:
label_url: Url
label_rt: "RT Ticket"
require 'redmine'
Redmine::Plugin.register :redmine_url_custom_field do
name 'Url Custom Field'
author 'Eric Davis'
description 'Adds a URL custom field format'
version '0.0.0'
Redmine::Plugin.register :redmine_rt_custom_field do
name 'RT Custom Field'
author 'Morten Knutsen'
description 'Adds a RT custom field format'
version '0.0.2'
requires_redmine :version_or_higher => '0.9.0'
end
class UrlCustomFieldFormat < Redmine::CustomFieldFormat
class RTCustomFieldFormat < Redmine::CustomFieldFormat
include ActionView::Helpers::TextHelper
include ActionView::Helpers::TagHelper
def format_as_url(value)
auto_link h(value)
def format_as_rt_ticket(value)
ActionController::Base.helpers.link_to('#' + value, "https://rt.uninett.no/Ticket/Display.html?id="+ value, :target => 'blank')
end
def escape_html?
......@@ -22,10 +22,10 @@ class UrlCustomFieldFormat < Redmine::CustomFieldFormat
end
def edit_as
"text"
"string"
end
end
Redmine::CustomFieldFormat.map do |fields|
fields.register UrlCustomFieldFormat.new('url', :label => :label_url, :order => 8)
fields.register RTCustomFieldFormat.new('rt_ticket', :label => :label_rt, :order => 8)
end
# English strings go here
my_label: "My label"
label_rt: "RT Ticket"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment