From 45abc8865919693268c4ddc7e90c1ec722267316 Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Wed, 22 Nov 2017 14:21:14 +0100 Subject: [PATCH] #652 Datetime picker has been changed in Redmine. Consequently this is not an issue eny more. --- lib/redmine_dmsf.rb | 1 - .../patches/application_helper_patch.rb | 55 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 lib/redmine_dmsf/patches/application_helper_patch.rb diff --git a/lib/redmine_dmsf.rb b/lib/redmine_dmsf.rb index dc705511..2aa87483 100644 --- a/lib/redmine_dmsf.rb +++ b/lib/redmine_dmsf.rb @@ -32,7 +32,6 @@ require 'redmine_dmsf/patches/project_tabs_extended' require 'redmine_dmsf/patches/user_preference_patch' require 'redmine_dmsf/patches/user_patch' require 'redmine_dmsf/patches/issue_patch' -require 'redmine_dmsf/patches/application_helper_patch' require 'redmine_dmsf/patches/role_patch' if defined?(EasyExtensions) diff --git a/lib/redmine_dmsf/patches/application_helper_patch.rb b/lib/redmine_dmsf/patches/application_helper_patch.rb deleted file mode 100644 index e2dde201..00000000 --- a/lib/redmine_dmsf/patches/application_helper_patch.rb +++ /dev/null @@ -1,55 +0,0 @@ -# encoding: utf-8 -# -# Redmine plugin for Document Management System "Features" -# -# Copyright (C) 2011-17 Karel Pičman -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -require_dependency 'application_helper' - -module RedmineDmsf - module Patches - module ApplicationHelperPatch - def self.included(base) - base.send(:include, InstanceMethods) - base.class_eval do - unloadable - - alias_method_chain :calendar_for, :square_brackets - end - end - - module InstanceMethods - - # If the field_id contains square brackets, jQuery is unable to find the tag by it's ID and therefore the Date - # picker is missing when a DMSF custom filed has got the date format. - def calendar_for_with_square_brackets(field_id) - field_id.gsub! '[', '\\\\\\[' - field_id.gsub! ']', '\\\\\\]' - calendar_for_without_square_brackets field_id - end - - end - end - end -end - -# Apply the patch -Rails.configuration.to_prepare do - unless ApplicationHelper.included_modules.include?(RedmineDmsf::Patches::ApplicationHelperPatch) - ApplicationHelper.send(:include, RedmineDmsf::Patches::ApplicationHelperPatch) - end -end \ No newline at end of file