redmine_crm 0.0.53 → 0.0.54

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: 4ab38758127d9a2e2509bc8e9ff1ec80a9f1352d
4
- data.tar.gz: 3f3cc66ccf665ce4a2499c559062e66f84e13256
3
+ metadata.gz: c0e9fa1d47785da85bc39db433d55e0ba8df629e
4
+ data.tar.gz: 2efa0ef9d8a1a0e267ba622b098fcac20c68a378
5
5
  SHA512:
6
- metadata.gz: 015402b86d6d3b211a755bfdf1123d7aa4324cddab8f53721fa724d4e2fd012f06c71aa455965ff6dc5cd897efb0709c18794215fe59c18e493520508fc685af
7
- data.tar.gz: f8c17428036c110cc3c25812a319a6bc59b06ce97cf57ef81cabba99d1cd834ad27f10aff6bb536d73f355263626dcf7bb18a9dba262415b27cdad9fe88ba0dd
6
+ metadata.gz: f74717a3d2fa3e033a32f3c02b1855d3fa4bad61edfe57c23bf2a2dcc36f26954a1e87b65aa31662455b953ac4cb42e2e3252cd6f49be52edd1b0f6815925388
7
+ data.tar.gz: 2d242b17ba64c4799e52f07c110b683f3cb61116833384c1bc66571e3a68df9a68f159526de9735234c6b5bba61ebd953351c1a1eed097a1f31d56af5909d6d9
@@ -4,6 +4,10 @@ Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
4
4
  Copyright (C) 2011-2020 RedmineUP
5
5
  https://www.redmineup.com/
6
6
 
7
+ == 2020-08-10 v0.0.54
8
+
9
+ * Fixed new JQuery select2 bug
10
+
7
11
  == 2020-04-07 v0.0.53
8
12
 
9
13
  * Multiselect styles cleanup
@@ -36,7 +36,7 @@ module RedmineCrm
36
36
 
37
37
  def md5(input)
38
38
  Digest::MD5.hexdigest(input) unless input.blank?
39
- end
39
+ end
40
40
 
41
41
  # example:
42
42
  # {{ "http:://www.example.com?key=hello world" | encode }}
@@ -87,8 +87,8 @@ module RedmineCrm
87
87
  to_number(input).floor.to_i
88
88
  end
89
89
 
90
- def currency(input, currency_code = 'USD')
91
- price_to_currency(input, currency_code, :converted => false)
90
+ def currency(input, currency_code = nil)
91
+ price_to_currency(input, currency_code || container_currency, :converted => false)
92
92
  end
93
93
 
94
94
  def call_method(input, method_name)
@@ -121,6 +121,30 @@ module RedmineCrm
121
121
  end
122
122
  end
123
123
 
124
+ def multi_line(input)
125
+ input.to_s.gsub("\n", '<br/>').html_safe
126
+ end
127
+
128
+ def concat(input, *args)
129
+ result = input.to_s
130
+ args.flatten.each { |a| result << a.to_s }
131
+ result
132
+ end
133
+
134
+ # right justify and padd a string
135
+ def rjust(input, integer, padstr = '')
136
+ input.to_s.rjust(integer, padstr)
137
+ end
138
+
139
+ # left justify and padd a string
140
+ def ljust(input, integer, padstr = '')
141
+ input.to_s.ljust(integer, padstr)
142
+ end
143
+
144
+ def textile(input)
145
+ ::RedCloth3.new(input).to_html
146
+ end
147
+
124
148
  protected
125
149
 
126
150
  # Convert an array of properties ('key:value') into a hash
@@ -210,6 +234,14 @@ module RedmineCrm
210
234
  end
211
235
  end
212
236
  end
237
+
238
+ def container
239
+ @container ||= @context.registers[:container]
240
+ end
241
+
242
+ def container_currency
243
+ container.currency if container.respond_to?(:currency)
244
+ end
213
245
  end
214
246
  ::Liquid::Template.register_filter(RedmineCrm::Liquid::Filters::Base)
215
247
  end
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = '0.0.53'
2
+ VERSION = '0.0.54'
3
3
  end
@@ -80,11 +80,11 @@ function findSelectTagInRowBy(field) {
80
80
  };
81
81
 
82
82
  function rowHasSelectTag(field) {
83
- return findInRowBy(field, '.values select.value').size() > 0;
83
+ return findInRowBy(field, '.values select.value').length > 0;
84
84
  };
85
85
 
86
86
  function rowHasSelect2(field) {
87
- return findInRowBy(field, '.values .select2').size() > 0;
87
+ return findInRowBy(field, '.values .select2').length > 0;
88
88
  };
89
89
 
90
90
  function findInRowBy(field, selector) {
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.53
4
+ version: 0.0.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineUP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-07 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails