diff --git a/lib/open_project/journal_formatter/cause.rb b/lib/open_project/journal_formatter/cause.rb index 4040bcd3e61d..77de14d4e41f 100644 --- a/lib/open_project/journal_formatter/cause.rb +++ b/lib/open_project/journal_formatter/cause.rb @@ -73,20 +73,6 @@ def system_update_message(cause) I18n.t("journals.cause_descriptions.system_update.#{cause['feature']}") end - def related_work_package_changed_message(cause, html) - related_work_package = WorkPackage.includes(:project).visible(User.current).find_by(id: cause["work_package_id"]) - - if related_work_package - I18n.t( - "journals.cause_descriptions.#{cause['type']}", - link: html ? link_to_work_package(related_work_package, all_link: true) : "##{related_work_package.id}" - ) - - else - I18n.t("journals.cause_descriptions.unaccessable_work_package_changed") - end - end - def working_days_changed_message(changed_dates) day_changes_messages = changed_dates["working_days"].collect do |day, working| working_day_change_message(day.to_i, working) @@ -108,6 +94,20 @@ def working_date_change_message(date, working) date: I18n.l(Date.parse(date))) end + def related_work_package_changed_message(cause, html) + related_work_package = WorkPackage.includes(:project).visible(User.current).find_by(id: cause["work_package_id"]) + + if related_work_package + I18n.t( + "journals.cause_descriptions.#{cause['type']}", + link: html ? link_to_work_package(related_work_package, all_link: true) : "##{related_work_package.id}" + ) + + else + I18n.t("journals.cause_descriptions.unaccessable_work_package_changed") + end + end + # we need to tell the url_helper that there is not controller to get url_options # so that we can later call link_to def controller