From 952f3d953e6f1e3c27695cb4b5c347e68c1cd174 Mon Sep 17 00:00:00 2001 From: Laurent FABRE Date: Fri, 10 Aug 2018 08:57:07 +0900 Subject: [PATCH] Added the ability to set a custom caption where referencing file details with the {{dmsfd(...)}} macro Example: {{dmsfd(123, File details)}} -> File details --- lib/redmine_dmsf/macros.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine_dmsf/macros.rb b/lib/redmine_dmsf/macros.rb index 1f10d958..31f373a3 100644 --- a/lib/redmine_dmsf/macros.rb +++ b/lib/redmine_dmsf/macros.rb @@ -81,7 +81,7 @@ Redmine::WikiFormatting::Macros.register do raise ArgumentError if args.length < 1 # Requires file id file = DmsfFile.visible.find args[0].strip if User.current && User.current.allowed_to?(:view_dmsf_files, file.project) - return link_to file.title, dmsf_file_path(:id => file) + return link_to(h(args[1] ? args[1] : file.title), dmsf_file_path(:id => file)) else raise l(:notice_not_authorized) end