X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4b33f145c7966710e537531261e04d2596159049..dae06193b54961d551abd7a35e079431a6759006:/redmine/redmine_publications/lib/issue_publication_hook.rb
diff --git a/redmine/redmine_publications/lib/issue_publication_hook.rb b/redmine/redmine_publications/lib/issue_publication_hook.rb
index 4cfc3ba5..9c972339 100644
--- a/redmine/redmine_publications/lib/issue_publication_hook.rb
+++ b/redmine/redmine_publications/lib/issue_publication_hook.rb
@@ -1,15 +1,21 @@
# Provides a link to the document on the platform
class IssuesPublicationHook < Redmine::Hook::ViewListener
+
def view_issues_show_details_bottom(context)
- result = "
Source File(s): | "
- names = context[:issue].source_files.map {|name| "" + name + ""}
- result << names.join(', ')
- result + " |
"
+ # 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)
- pub_field = context[:params][:issue_source_files]
- context[:issue].source_files = pub_field
+ 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'