From 066a69f743b6606b0e6c0f3cf87c133164e04068 Mon Sep 17 00:00:00 2001 From: Akira Saito Date: Sat, 4 Apr 2015 00:10:00 +0900 Subject: [PATCH] support redmine-3.0 --- app/helpers/application_helper.rb | 12 ++++++++++++ app/views/hooks/_quick_edit_context.html.erb | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 561d1e2..92af536 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,6 +1,18 @@ #coding: utf-8 module ApplicationHelper + def redmine_version() + Redmine::VERSION::MAJOR * 10 + Redmine::VERSION::MINOR + end + + def editable(attribute_name, can) + if redmine_version() >= 30 + return can[:edit] + else + return can[:update] + end + end + def quick_edit_link_to(issue_ids, caption, attribute_name, additional_index, back_url, disabled) target_specifier = build_target_specifier(attribute_name, additional_index) diff --git a/app/views/hooks/_quick_edit_context.html.erb b/app/views/hooks/_quick_edit_context.html.erb index d98f49c..4d40c76 100644 --- a/app/views/hooks/_quick_edit_context.html.erb +++ b/app/views/hooks/_quick_edit_context.html.erb @@ -26,19 +26,19 @@
  • <%= l(:button_quick_edit) %>