2019-07-01 16:14:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-09-17 16:50:01 +08:00
|
|
|
module Reports::Docx::DrawMyModuleProtocol
|
2021-05-21 22:35:23 +08:00
|
|
|
def draw_my_module_protocol(my_module)
|
2019-07-01 16:14:16 +08:00
|
|
|
protocol = my_module.protocol
|
|
|
|
|
2022-08-09 19:50:00 +08:00
|
|
|
@docx.p
|
|
|
|
if protocol.name.present?
|
|
|
|
@docx.h4 protocol.name, italic: false
|
|
|
|
else
|
|
|
|
@docx.h4 I18n.t('projects.reports.elements.module.protocol.name'), italic: false
|
|
|
|
end
|
2022-05-30 17:33:56 +08:00
|
|
|
|
2022-08-09 19:50:00 +08:00
|
|
|
if @settings.dig('task', 'protocol', 'description') && protocol.description.present?
|
2022-11-29 15:38:08 +08:00
|
|
|
@docx.p I18n.t('projects.reports.elements.module.protocol.user_time', code: protocol.code,
|
2022-07-20 16:12:38 +08:00
|
|
|
timestamp: I18n.l(protocol.created_at, format: :full)), color: @color[:gray]
|
2022-05-30 17:33:56 +08:00
|
|
|
html = custom_auto_link(protocol.description, team: @report_team)
|
|
|
|
Reports::HtmlToWordConverter.new(@docx, { scinote_url: @scinote_url,
|
|
|
|
link_style: @link_style }).html_to_word_converter(html)
|
|
|
|
@docx.p
|
|
|
|
@docx.p
|
|
|
|
end
|
2019-07-01 16:14:16 +08:00
|
|
|
end
|
|
|
|
end
|