Quick jump search Dxxxx
This commit is contained in:
parent
3c1dfe62e4
commit
b84f9335c2
@ -23,13 +23,14 @@ module RedmineDmsf
|
||||
include Redmine::Hook
|
||||
|
||||
class ControllerSearchHook < RedmineDmsf::Hooks::Listener
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
def controller_search_quick_jump(context={})
|
||||
if context.is_a?(Hash)
|
||||
question = context[:question]
|
||||
if question.present?
|
||||
if question.match(/^D(\d+)$/) && DmsfFile.visible.find_by(id: $1).exists?
|
||||
return dmsf_file_path(:id => $1)
|
||||
if question.match(/^D(\d+)$/) && DmsfFile.visible.where(id: $1).exists?
|
||||
return dmsf_file_path(id: $1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user