lib/smile_redmine_my_page.rb
# 2/ Smile specific : REWRITTEN
#
# Returns the additional blocks that are defined by plugin partials
2/ Smile specific : REWRITTEN
Returns the additional blocks that are defined by plugin partials
2 / Smile specific : REWRITTEN Returns the additional blocks that are defined by plugin partials
def additional_blocks_with_time_report_query
          return @@additional_blocks if defined?(@@additional_blocks)
          @@additional_blocks = Dir.glob("#{Redmine::Plugin.directory}/*/app/views/my/blocks/_*.{rhtml,erb}").inject({}) do |h,file|
            name = File.basename(file).split('.').first.gsub(/^_/, '')
            unless (
              name.end_with?('_query_selection') ||
              (name == 'issues') ||
              CORE_BLOCKS.keys.include?(name)
            )
              h[name] = {:label => name.to_sym, :partial => "my/blocks/#{name}"}
            else
              Rails.logger.debug "==>prof additional_blocks_with_time_report_query, overriden by plugin : #{name} partial"
            end
            h
          end
          Rails.logger.debug "==>prof additional_blocks_with_time_report_query #{@@additional_blocks}"
          @@additional_blocks
        end
def additional_blocks_with_time_report_query return @@additional_blocks if defined? ( @@additional_blocks ) @@additional_blocks = Dir . glob ( "#{Redmine::Plugin.directory}/*/app/views/my/blocks/_*.{rhtml,erb}" ) . inject ( { } ) do | h , file | name = File . basename ( file ) . split ( '.' ) . first . gsub ( / ^_ / , '' ) unless ( name . end_with? ( '_query_selection' ) || ( name == 'issues' ) || CORE_BLOCKS . keys . include? ( name ) ) h [ name ] = { :label => name . to_sym , :partial => "my/blocks/#{name}" } else Rails . logger . debug "==>prof additional_blocks_with_time_report_query, overriden by plugin : #{name} partial" end h end Rails . logger . debug "==>prof additional_blocks_with_time_report_query #{@@additional_blocks}" @@additional_blocks end
2/ Smile specific : REWRITTEN
Returns the additional blocks that are defined by plugin partials
2 / Smile specific : REWRITTEN Returns the additional blocks that are defined by plugin partials
################ # Smile specific : partials overriden in plugin ignored # Query selection partials ignored : plugins overrides partial # Core blocks partials ignored : plugins overrides partial