X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d940e6b2345b50ffbd50bbe5f508f6d4ff4e0054..bb4a4d16d15e4ac5dc01f6776f4fb3ca595b4706:/redmine/redmine_publications/lib/issue_publication_hook.rb?ds=sidebyside diff --git a/redmine/redmine_publications/lib/issue_publication_hook.rb b/redmine/redmine_publications/lib/issue_publication_hook.rb deleted file mode 100644 index 9c972339..00000000 --- a/redmine/redmine_publications/lib/issue_publication_hook.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Provides a link to the document on the platform -class IssuesPublicationHook < Redmine::Hook::ViewListener - - def view_issues_show_details_bottom(context) - # TODO: złapać wyjątek konwersji - if context[:issue].tracker_id == Setting.plugin_redmine_publications['tracker'].to_i - result = "Publication(s):" - names = context[:issue].publication_names {|name| "" + name + ""} - result << names.join(', ') - result << "" - end - end - - def controller_issues_edit_before_save(context) - if context[:issue].tracker_id == Setting.plugin_redmine_publications['tracker'].to_i - pub_field = context[:params][:publications] - context[:issue].publication_names = pub_field.split(',').map { |n| n.strip } - end - end - - render_on :view_issues_form_details_bottom, :partial => 'issue_form_pub' -end