豊福です。
2012年6月16日 17:14 junki <
arimits...@gmail.com>:
> カスタムフィールドに変更があった場合に、直近の変更点(追記箇所)を強調表示して、PDF出力するといったことがしたいです。
>
> ・カスタムフィールドへのtextile記法使用
> ・descriptionのdiff出力
> ・textilized description in pdf
最後の二つは description とだけ書いてありますがカスタムフィールドもですか。
参考になりそうなコードですが、
app/helpers/issues_helper.rb の def show_detail の中で
画面でのdiff出力を作っていて、例えば
if detail.property == 'attr' && detail.prop_key == 'description'
という行を
if detail.property == 'attr' && detail.prop_key == 'description'
|| detail.property == 'cf'
に書き換えてみるとdiffへのリンクが「説明」にだけでなくすべての
変更したカスタムフィールドにも付くようになります。
PDF に textilize して出力しているのは lib/redmine/export/pdf.rb の
def RDMwriteHTMLCell の中なので RDMwriteHTMLCell を呼び出して
いるところを真似ることになるのでしょう。
頑張ってください。(W
---