redmine_crm 0.0.54 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0e9fa1d47785da85bc39db433d55e0ba8df629e
4
- data.tar.gz: 2efa0ef9d8a1a0e267ba622b098fcac20c68a378
3
+ metadata.gz: afd4e0e67e1d1a6bb522e7736c051c0ccf0495f1
4
+ data.tar.gz: 85b94490ebf04a788428ed6ebf5581d93f8d6723
5
5
  SHA512:
6
- metadata.gz: f74717a3d2fa3e033a32f3c02b1855d3fa4bad61edfe57c23bf2a2dcc36f26954a1e87b65aa31662455b953ac4cb42e2e3252cd6f49be52edd1b0f6815925388
7
- data.tar.gz: 2d242b17ba64c4799e52f07c110b683f3cb61116833384c1bc66571e3a68df9a68f159526de9735234c6b5bba61ebd953351c1a1eed097a1f31d56af5909d6d9
6
+ metadata.gz: 0db2f41a96bdc765da21a0553f9989ea484da52daff6b52922da75feb26d83d9b9c938cb1aca72c42463708190df9e0159caa5671b6753ce665f0c8540b0b40b
7
+ data.tar.gz: 27bb8d96230d724b121cd12125036a40d98bcaf6fbe437eea42eb5ce12faa1df1c3378c7287089310566cef3a728be95df2f33701bc92672ad59c36189e589d7
@@ -0,0 +1,13 @@
1
+ cs:
2
+ label_redmine_crm_settings: Peníze
3
+ label_redmine_crm_money: Peníze
4
+
5
+ label_redmine_crm_disable_taxes: Znemožnit daně
6
+ label_redmine_crm_default_tax: Výchozí hodnota daně
7
+ label_redmine_crm_tax_type: Typ daně
8
+ label_redmine_crm_tax_type_exclusive: Bez daně
9
+ label_redmine_crm_tax_type_inclusive: Včetně daně
10
+ label_redmine_crm_default_currency: Výchozí měna
11
+ label_redmine_crm_major_currencies: Hlavní měny
12
+ label_redmine_crm_thousands_delimiter: Oddělovač tisíců
13
+ label_redmine_crm_decimal_separator: Desetinný oddělovač
@@ -0,0 +1,13 @@
1
+ de:
2
+ label_redmine_crm_settings: Währungseinstellungen
3
+ label_redmine_crm_money: Währung
4
+
5
+ label_redmine_crm_disable_taxes: Steuern deaktiviert
6
+ label_redmine_crm_default_tax: Standard Steuersatz
7
+ label_redmine_crm_tax_type: Steuerart
8
+ label_redmine_crm_tax_type_exclusive: Steuer ausgeschlossen
9
+ label_redmine_crm_tax_type_inclusive: Steuer eingeschlossen
10
+ label_redmine_crm_default_currency: Standard Währung
11
+ label_redmine_crm_major_currencies: Aktive Währungen
12
+ label_redmine_crm_thousands_delimiter: Tausendertrennzeichen
13
+ label_redmine_crm_decimal_separator: Dezimaltrennzeichen
data/doc/CHANGELOG CHANGED
@@ -1,9 +1,16 @@
1
1
  == Redmine CRM gem changelog
2
2
 
3
3
  Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
4
- Copyright (C) 2011-2020 RedmineUP
4
+ Copyright (C) 2011-2021 RedmineUP
5
5
  https://www.redmineup.com/
6
6
 
7
+ == 2021-06-08 v0.0.55
8
+
9
+ * Added Attachment Liquid drop
10
+ * Added section to Checklist Liquid drop
11
+ * Added Czech locale
12
+ * Added German locale
13
+
7
14
  == 2020-08-10 v0.0.54
8
15
 
9
16
  * Fixed new JQuery select2 bug
data/lib/redmine_crm.rb CHANGED
@@ -34,6 +34,7 @@ require 'redmine_crm/liquid/drops/news_drop'
34
34
  require 'redmine_crm/liquid/drops/projects_drop'
35
35
  require 'redmine_crm/liquid/drops/users_drop'
36
36
  require 'redmine_crm/liquid/drops/time_entries_drop'
37
+ require 'redmine_crm/liquid/drops/attachment_drop'
37
38
 
38
39
  require 'redmine_crm/helpers/external_assets_helper'
39
40
  require 'redmine_crm/helpers/form_tag_helper'
@@ -90,7 +90,7 @@ module RedmineCrm
90
90
  #Return all avalible tags for a project or global
91
91
  #Example: Question.available_tags(:project => @project_id )
92
92
  def available_tags(options = {})
93
- project = options[:project]
93
+ projects = [[options[:project]], options[:projects]].flatten.compact
94
94
  limit = options[:limit].to_i.zero? ? 30 : options[:limit].to_i
95
95
  scope = Tag.where({})
96
96
  class_name = quote_string_value(base_class.name)
@@ -98,9 +98,9 @@ module RedmineCrm
98
98
  join << "JOIN #{Tagging.table_name} ON #{Tagging.table_name}.tag_id = #{Tag.table_name}.id "
99
99
  join << "JOIN #{table_name} ON #{table_name}.id = #{Tagging.table_name}.taggable_id
100
100
  AND #{Tagging.table_name}.taggable_type = #{class_name} "
101
- if attribute_names.include?('project_id') && project
101
+ if attribute_names.include?('project_id') && projects.any?
102
102
  join << "JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id"
103
- scope = scope.where("#{table_name}.project_id = ?", project.id)
103
+ scope = scope.where("#{table_name}.project_id IN (%s)", projects.map(&:id).join(','))
104
104
  end
105
105
 
106
106
  if options[:name_like]
@@ -58,7 +58,7 @@ module RedmineCrm
58
58
 
59
59
  end
60
60
 
61
- if self.parent::VERSION::MAJOR < 4
61
+ if ::ActiveRecord::VERSION::MAJOR < 4
62
62
  create_index votes_name_table, [:votable_id, :votable_type, :vote_ip]
63
63
  create_index votes_name_table, [:voter_id, :voter_type, :vote_ip]
64
64
  end
@@ -0,0 +1,49 @@
1
+ module RedmineCrm
2
+ module Liquid
3
+ class AttachmentDrop < ::Liquid::Drop
4
+ delegate :id,
5
+ :filename,
6
+ :title,
7
+ :description,
8
+ :filesize,
9
+ :content_type,
10
+ :digest,
11
+ :downloads,
12
+ :created_on,
13
+ :token,
14
+ :visible?,
15
+ :image?,
16
+ :thumbnailable?,
17
+ :is_text?,
18
+ :readable?,
19
+ to: :@attachment
20
+
21
+ delegate :id, :filename, :filesize, :description, to: :@attachment
22
+
23
+ def initialize(attachment)
24
+ @attachment = attachment
25
+ end
26
+
27
+ def url(options = {})
28
+ Rails.application.routes.url_helpers.download_named_attachment_url(@attachment, { filename: filename,
29
+ host: Setting.host_name,
30
+ protocol: Setting.protocol }.merge(options))
31
+ end
32
+
33
+ def link
34
+ link_to((@attachment.description.blank? ? @attachment.filename : @attachment.description), url)
35
+ end
36
+
37
+ def author
38
+ @author ||= UsersDrop.new @attachment.author
39
+ end
40
+
41
+ def read
42
+ @content ||= if @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte
43
+ File.new(@attachment.diskfile, "rb").read
44
+ end
45
+ @content
46
+ end
47
+ end
48
+ end
49
+ end
@@ -96,15 +96,15 @@ module RedmineCrm
96
96
  end
97
97
 
98
98
  def parent
99
- @parent ||= IssueDrop.new @issue.parent if @issue.parent
99
+ @parent ||= IssueDrop.new @issue.parent if @issue.parent
100
100
  end
101
101
 
102
102
  def project
103
- @project ||= ProjectDrop.new @issue.project if @issue.project
103
+ @project ||= ProjectDrop.new @issue.project if @issue.project
104
104
  end
105
105
 
106
106
  def subtasks
107
- @subtasks ||= IssuesDrop.new @issue.children
107
+ @subtasks ||= IssuesDrop.new @issue.children
108
108
  end
109
109
 
110
110
  def notes
@@ -126,19 +126,20 @@ module RedmineCrm
126
126
  def color
127
127
  @issue.respond_to?(:color) && @issue.color
128
128
  end
129
-
129
+
130
130
  def day_in_state
131
131
  @issue.respond_to?(:day_in_state) && @issue.day_in_state
132
132
  end
133
133
 
134
134
  def checklists
135
- @issue.respond_to?(:checklists) && @issue.checklists.map{|item| {"id_done" => item.is_done, "subject" => item.subject}}
135
+ @issue.respond_to?(:checklists) && @issue.checklists.map do |item|
136
+ { 'id_done' => item.is_done, 'subject' => item.subject, 'is_section' => item.is_section }
137
+ end
136
138
  end
137
139
 
138
140
  def custom_field_values
139
141
  @issue.custom_field_values
140
- end
141
-
142
+ end
142
143
  end
143
144
 
144
145
  class JournalsDrop < ::Liquid::Drop
@@ -170,7 +171,7 @@ module RedmineCrm
170
171
  :notes,
171
172
  :created_on,
172
173
  :private_notes,
173
- :to => :@journal,
174
+ :to => :@journal,
174
175
  allow_nil: true
175
176
 
176
177
  def initialize(journal)
@@ -182,7 +183,7 @@ module RedmineCrm
182
183
  end
183
184
 
184
185
  def issue
185
- @issue ||= IssueDrop.new @journal.issue if @journal.issue
186
+ @issue ||= IssueDrop.new @journal.issue if @journal.issue
186
187
  end
187
188
 
188
189
  end
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = '0.0.54'
2
+ VERSION = '0.0.55'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.54
4
+ version: 0.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineUP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -111,6 +111,8 @@ files:
111
111
  - app/views/redmine_crm/settings.html.erb
112
112
  - bitbucket-pipelines.yml
113
113
  - config/currency_iso.json
114
+ - config/locales/cs.yml
115
+ - config/locales/de.yml
114
116
  - config/locales/en.yml
115
117
  - config/locales/ru.yml
116
118
  - config/routes.rb
@@ -143,6 +145,7 @@ files:
143
145
  - lib/redmine_crm/helpers/tags_helper.rb
144
146
  - lib/redmine_crm/helpers/vote_helper.rb
145
147
  - lib/redmine_crm/hooks/views_layouts_hook.rb
148
+ - lib/redmine_crm/liquid/drops/attachment_drop.rb
146
149
  - lib/redmine_crm/liquid/drops/issues_drop.rb
147
150
  - lib/redmine_crm/liquid/drops/news_drop.rb
148
151
  - lib/redmine_crm/liquid/drops/projects_drop.rb