deecay / redmine_pivot_table

This Redmine plugin allows you to generate pivot table for issue analysis.
MIT License
52 stars 38 forks source link

Compatibility with RedmineUP Helpdesk plugin (Redmine 3.4x) #52

Open alterdaemon opened 5 years ago

alterdaemon commented 5 years ago

You need to add the following line:

    elsif c.name.to_s == "helpdesk_ticket"
      formatted_issue[c.caption] = ""

in /plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb

after

issues.each{|i|
  formatted_issue = {}
  @query.available_columns.each{|c|
    if c.name.to_s == "id"
      formatted_issue["ID"] = column_content(c, i)

Also I had no luck with the date conversion so I had to revert to the previous code:

  if column_content(c, i).to_s != ""
  # formatted_issue[c.caption+"(U)"] = Date.strptime(column_content(c, i), strpformat).strftime("%Y-W%U") # org
  formatted_issue[c.caption+"(U)"] = Date.parse(column_content(c, i)).strftime("%Y-W%U") # working
  # formatted_issue[c.caption+"(U)"] = Date.strptime(column_content(c, i),I18n.t(:"date.formats.default", {:locale => I18n.locale })).strftime("%Y-W%U")
deecay commented 5 years ago

Hi,

What kind of error do you see now? I do not want to use plugin-specific string such as "helpdesk_ticket". I will try to do something more robust.

alterdaemon commented 5 years ago

I understand but I needed a quick fix. The problem lies in a quite complex column rendered by helpdesk plugin which contains image, link and html

\redmine_contacts_helpdesk\lib\redmine_helpdesk\patches\queries_helper_patch.rb

     elsif column.name.eql?(:helpdesk_ticket) && issue.customer && issue.is_a?(Issue)
        contact_tag(issue.customer, :size => "32", :type => "avatar", :class => "avatar") +
        content_tag(:div,
          content_tag(:p, link_to(issue.subject, issue_path(issue)), :class => 'ticket-name') +
          content_tag(:p, content_tag(:small, issue.description.gsub("(\n|\r)", "").strip.truncate(100)), :class => "ticket-description") +
          content_tag(:p, "#{content_tag('span', '', :class => "icon #{helpdesk_ticket_source_icon(issue.helpdesk_ticket)}", :title => l(:label_note_type_email))} #{l(:label_helpdesk_from)}: #{contact_tag(issue.customer, :type => "plain")}, ".html_safe + l(:label_updated_time, time_tag(issue.helpdesk_ticket.last_message_date)).html_safe, :class => "contact-info"),
        :class => 'ticket-data')

I am not able to recreate the error now but it was complaining about helpdesk_ticket icon tag.

lublasco commented 5 years ago

Hi, it would be great if this compatibility "pivot table - redmineup helpdesk" could be achieved. This plugin is a great idea but I can't use it in my application due to this incompatibility.

Also I couldn't make them work together with the patches indicated by @dgutkowsky

Thanks in advance!

ashrafalzyoud commented 3 years ago

im same problem are any one find the soultion??? @deecay @dgutkowsky @lublasco @miloja

ashrafalzyoud commented 3 years ago

ActionView::Template::Error (undefined method `link_to_deal' for #<#:0x00007fe534a6f218>): 55: <% if @table == "activity" %> 56: data = <%= raw parse_events(@events).to_json %>; 57: <% else %> 58: data = <%= raw parse_issues(@issues).to_json %>; 59: <% end %> 60: 61: var dateFormat = $.pivotUtilities.derivers.dateFormat;

plugins/redmine_contacts/lib/redmine_contacts/patches/compatibility/application_helper_patch.rb:44:in block in format_object_with_contact' plugins/redmine_contacts/lib/redmine_contacts/patches/compatibility/application_helper_patch.rb:43:inmap' plugins/redmine_contacts/lib/redmine_contacts/patches/compatibility/application_helper_patch.rb:43:in format_object_with_contact' plugins/redmine_contacts_invoices/lib/redmine_invoices/patches/application_helper_patch.rb:37:informat_object_with_invoices' plugins/redmine_people/lib/redmine_people/patches/application_helper_patch.rb:67:in format_object_with_people' app/helpers/queries_helper.rb:250:incolumn_value' plugins/redmine_contacts/lib/redmine_contacts/patches/queries_helper_patch.rb:66:in column_value_with_contacts' plugins/redmineup_tags/lib/redmineup_tags/patches/queries_helper_patch.rb:43:incolumn_value_with_tags' plugins/redmine_checklists/lib/redmine_checklists/patches/queries_helper_patch.rb:51:in column_value_with_checklists' plugins/redmine_contacts_invoices/lib/redmine_invoices/patches/queries_helper_patch.rb:41:incolumn_value_with_invoices' plugins/redmine_finance/lib/redmine_finance/patches/queries_helper_patch.rb:48:in column_value_with_finance' plugins/redmine_people/lib/redmine_people/patches/queries_helper_patch.rb:71:incolumn_value_with_people' plugins/redmine_products/lib/redmine_products/patches/queries_helper_patch.rb:55:in column_value_with_products' app/helpers/queries_helper.rb:218:incolumn_content' plugins/redmine_contacts_helpdesk/lib/redmine_helpdesk/patches/queries_helper_patch.rb:50:in column_content_with_helpdesk' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:81:inblock (2 levels) in parse_issues' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:78:in each' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:78:inblock in parse_issues' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:76:in each' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:76:inparse_issues' plugins/redmine_pivot_table/app/views/pivottables/index.html.erb:58:in _plugins_redmine_pivot_table_app_views_pivottables_index_html_erb__3035146999886158181_47313198832540' lib/redmine/sudo_mode.rb:65:insudo_mode'