redmine_crm 0.0.60 → 0.0.61
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 +4 -4
- data/bitbucket-pipelines.yml +1 -0
- data/config/currency_iso.json +1 -1
- data/doc/CHANGELOG +5 -0
- data/lib/redmine_crm/helpers/external_assets_helper.rb +0 -7
- data/lib/redmine_crm/helpers/form_tag_helper.rb +8 -25
- data/lib/redmine_crm/liquid/drops/issues_drop.rb +19 -3
- data/lib/redmine_crm/version.rb +1 -1
- data/test/liquid/filters/base_filter_test.rb +1 -1
- data/test/money_helper_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c71d48ccbfad49844db606ac43e6927c07fbc886770df6f2e2cddcdd95a6081
|
4
|
+
data.tar.gz: de57d13eb0eebdd8b58b095938d5266ee5bcfd043a41fee736cfa5f4e0d4a436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '096a9b92b027b8d5229dd95305a1b63f4a0250266cf50454ff650ea6b16b2255ae9ca2c938bc4b00d09ad7b3c7af11c30535f05a7b7c9e23762d807b04d4611f'
|
7
|
+
data.tar.gz: 4140df48577e1ff647ee18bc7c24347528648bc7de68ffe17c12804256fce43134e16405d5d17eff7b4bdc6d3c53dfeb28514913d1f57d50cf4a42dbce2648ff
|
data/bitbucket-pipelines.yml
CHANGED
@@ -12,6 +12,7 @@ pipelines:
|
|
12
12
|
script:
|
13
13
|
- sed -i "s/'sqlite3'/'sqlite3', '~> 1.3.6'/g" redmine_crm.gemspec
|
14
14
|
- sed -i "s/'mysql2'/'mysql2', '~> 0.4.0'/g" redmine_crm.gemspec
|
15
|
+
- sed -i "s/'rubyzip'/'rubyzip'\n spec.add_runtime_dependency 'loofah', '~>2.19.1'/g" redmine_crm.gemspec
|
15
16
|
- bundle install
|
16
17
|
- bundle exec rake test DB=sqlite
|
17
18
|
- bundle exec rake test DB=postgresql
|
data/config/currency_iso.json
CHANGED
data/doc/CHANGELOG
CHANGED
@@ -4,6 +4,11 @@ Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
|
|
4
4
|
Copyright (C) 2011-2023 RedmineUP
|
5
5
|
https://www.redmineup.com/
|
6
6
|
|
7
|
+
== 2023-09-27 v0.0.61
|
8
|
+
|
9
|
+
* Reverted time picker calendar
|
10
|
+
* Added helper methods for time format
|
11
|
+
|
7
12
|
== 2023-09-20 v0.0.60
|
8
13
|
|
9
14
|
* Fixed SQL injection
|
@@ -16,12 +16,5 @@ module RedmineCrm
|
|
16
16
|
javascript_include_tag('Chart.bundle.min', plugin: GEM_NAME)
|
17
17
|
end
|
18
18
|
|
19
|
-
def timepicker_assets
|
20
|
-
return if @timepicker_tag_included
|
21
|
-
|
22
|
-
@timepicker_tag_included = true
|
23
|
-
javascript_include_tag('timepicker_addon', plugin: GEM_NAME) +
|
24
|
-
stylesheet_link_tag('timepicker_addon', plugin: GEM_NAME)
|
25
|
-
end
|
26
19
|
end
|
27
20
|
end
|
@@ -73,33 +73,16 @@ module RedmineCrm
|
|
73
73
|
javascript_tag("setSelect2Filter('#{type}', #{options.to_json});") unless type.empty?
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
77
|
-
|
78
|
-
|
76
|
+
def format_datetime(time)
|
77
|
+
formated_time = format_time(time, false)
|
78
|
+
formated_date = ::I18n.l(time.to_date, format: '%Y-%m-%d')
|
79
|
+
"#{formated_date} #{formated_time}"
|
79
80
|
end
|
80
81
|
|
81
|
-
def
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
content_for :header_tags do
|
86
|
-
start_of_week = Setting.start_of_week
|
87
|
-
start_of_week = l(:general_first_day_of_week, :default => '1') if start_of_week.blank?
|
88
|
-
start_of_week = start_of_week.to_i % 7
|
82
|
+
def format_datetime_date(time)
|
83
|
+
formated_date = ::I18n.l(time.to_date, format: '%Y-%m-%d')
|
84
|
+
"#{formated_date}"
|
85
|
+
end
|
89
86
|
|
90
|
-
locale_keys = ::I18n.backend.send(:translations)[::I18n.config.locale]
|
91
|
-
time_format = Setting.time_format.blank? ? locale_keys[:time][:formats][:time] : Setting.time_format
|
92
|
-
time_format = time_format.to_s.gsub('%H', 'H').gsub('%I', 'hh').gsub('%M', 'mm').gsub('%p', 'tt')
|
93
|
-
|
94
|
-
date_format = 'yy-mm-dd'
|
95
|
-
tags << javascript_tag(
|
96
|
-
"var dateTimePickerOptions = {dateFormat: '#{date_format}', timeFormat: '#{time_format}', firstDay: #{start_of_week}," +
|
97
|
-
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
|
98
|
-
path_to_image('/images/calendar.png') +
|
99
|
-
"', showButtonPanel: true, controlType: 'select', oneLine: true, };")
|
100
|
-
tags
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
87
|
end
|
105
88
|
end
|
@@ -35,7 +35,6 @@ module RedmineCrm
|
|
35
35
|
|
36
36
|
delegate :id,
|
37
37
|
:subject,
|
38
|
-
:description,
|
39
38
|
:visible?,
|
40
39
|
:closed?,
|
41
40
|
:start_date,
|
@@ -104,6 +103,10 @@ module RedmineCrm
|
|
104
103
|
@project ||= ProjectDrop.new @issue.project if @issue.project
|
105
104
|
end
|
106
105
|
|
106
|
+
def description
|
107
|
+
@description ||= replace_images_urls(@issue.description)
|
108
|
+
end
|
109
|
+
|
107
110
|
def subtasks
|
108
111
|
@subtasks ||= IssuesDrop.new @issue.children
|
109
112
|
end
|
@@ -117,11 +120,11 @@ module RedmineCrm
|
|
117
120
|
end
|
118
121
|
|
119
122
|
def notes
|
120
|
-
@notes ||= @issue.journals.where(
|
123
|
+
@notes ||= @issue.journals.where.not(notes: [nil, '']).order(:created_on).map(&:notes).map { |note| replace_images_urls(note) }
|
121
124
|
end
|
122
125
|
|
123
126
|
def journals
|
124
|
-
@journals ||= JournalsDrop.new
|
127
|
+
@journals ||= JournalsDrop.new(@issue.journals.where.not(notes: nil).find_each { |journal| journal.notes = replace_images_urls(journal.notes) })
|
125
128
|
end
|
126
129
|
|
127
130
|
def tags
|
@@ -155,6 +158,19 @@ module RedmineCrm
|
|
155
158
|
def custom_field_values
|
156
159
|
@issue.custom_field_values
|
157
160
|
end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
def replace_images_urls(text)
|
165
|
+
text.gsub(/\!.*\!/) do |i_name|
|
166
|
+
i_name = i_name.delete('!')
|
167
|
+
i_name_css = i_name.scan(/^\{.*\}/).first.to_s
|
168
|
+
attachment = @issue.attachments.find_by(filename: i_name.gsub(i_name_css, ''))
|
169
|
+
image = AttachmentDrop.new attachment if attachment
|
170
|
+
attach_url = image.try(:url)
|
171
|
+
attach_url ? "!#{i_name_css}#{attach_url}!" : i_name
|
172
|
+
end
|
173
|
+
end
|
158
174
|
end
|
159
175
|
|
160
176
|
class JournalsDrop < ::Liquid::Drop
|
data/lib/redmine_crm/version.rb
CHANGED
data/test/money_helper_test.rb
CHANGED
@@ -5,7 +5,7 @@ class MoneyHelperTest < ActiveSupport::TestCase
|
|
5
5
|
|
6
6
|
def test_price_to_currency
|
7
7
|
assert_equal '$3,265.65', price_to_currency(3265.65, 'USD')
|
8
|
-
assert_equal '3.265,65
|
8
|
+
assert_equal '3.265,65 ₽', price_to_currency(3265.65, 'RUB')
|
9
9
|
assert_equal '3,200.0', price_to_currency(3200, '')
|
10
10
|
assert_equal '3,200.0', price_to_currency(3200, 'Foo')
|
11
11
|
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.
|
4
|
+
version: 0.0.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineUP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|