redmine_crm 0.0.49 → 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: 1d521ac72c4e9d6ba00dd20c9b6bd6d682a294df
4
- data.tar.gz: c307e86b5223bcf0580812bf7c57366c0175ba60
3
+ metadata.gz: c0e9fa1d47785da85bc39db433d55e0ba8df629e
4
+ data.tar.gz: 2efa0ef9d8a1a0e267ba622b098fcac20c68a378
5
5
  SHA512:
6
- metadata.gz: 659cc759af4c3dc2c5219c74c33db83f0e7d9051884a684cb0e86ca2ba91338c5bd7ef989d4ec1b34f91af4eea8d50292c77e87650607a7bf1223a98dd655db6
7
- data.tar.gz: 38a779b4da037c6bfc16dfc63f27698572fece725422659a92db835ead93e0796a0b525ea364a57558abbef0181e0edd089adbea6d4b5b354390df7dba4d27cf
6
+ metadata.gz: f74717a3d2fa3e033a32f3c02b1855d3fa4bad61edfe57c23bf2a2dcc36f26954a1e87b65aa31662455b953ac4cb42e2e3252cd6f49be52edd1b0f6815925388
7
+ data.tar.gz: 2d242b17ba64c4799e52f07c110b683f3cb61116833384c1bc66571e3a68df9a68f159526de9735234c6b5bba61ebd953351c1a1eed097a1f31d56af5909d6d9
@@ -3,7 +3,7 @@
3
3
  <div id="settings">
4
4
  <%= form_tag({ action: 'settings', id: @section[:id] }) do %>
5
5
  <div class="box tabular settings">
6
- <%= render_tabs @section_tabs %>
6
+ <%= render partial: 'money' %>
7
7
  </div>
8
8
  <%= submit_tag l(:button_apply) %>
9
9
  <% end %>
@@ -32,6 +32,8 @@ pipelines:
32
32
  - sed -i "s/'pg'/'pg', '~> 0.18.0'/g" redmine_crm.gemspec
33
33
  - sed -i "s/^end/ spec.add_development_dependency 'minitest', '~> 5.11.3'\nend/g" redmine_crm.gemspec
34
34
  - sed -i "s/^end/ spec.add_development_dependency 'sprockets', '~> 3.5.2'\nend/g" redmine_crm.gemspec
35
+ - sed -i "s/^end/ spec.add_development_dependency 'thor', '~> 0.20.3'\nend/g" redmine_crm.gemspec
36
+ - sed -i "s/'rubyzip'/'rubyzip', '~> 1.3.0'/g" redmine_crm.gemspec
35
37
  - bundle install
36
38
  - bundle exec rake test DB=sqlite
37
39
  - bundle exec rake test DB=mysql
@@ -1,5 +1,5 @@
1
1
  en:
2
- label_redmine_crm_settings: Redmine Crm Settings
2
+ label_redmine_crm_settings: Money Settings
3
3
  label_redmine_crm_money: Money
4
4
 
5
5
  label_redmine_crm_disable_taxes: Disable taxes
@@ -1,5 +1,5 @@
1
1
  ru:
2
- label_redmine_crm_settings: Настройки Redmine Crm
2
+ label_redmine_crm_settings: Настройки валют
3
3
  label_redmine_crm_money: Деньги
4
4
 
5
5
  label_redmine_crm_disable_taxes: Отключить налоги
@@ -1,9 +1,32 @@
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-2019 RedmineUP
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
+
11
+ == 2020-04-07 v0.0.53
12
+
13
+ * Multiselect styles cleanup
14
+ * Added rubyzip dependence
15
+
16
+ == 2019-12-26 v0.0.52
17
+
18
+ * select2 styles cleanup
19
+
20
+ == 2019-12-20 v0.0.51
21
+
22
+ * Changed drafts params
23
+ * Changed Money settings UI
24
+ * Fixed bug with settings access
25
+
26
+ == 2019-11-18 v0.0.50
27
+
28
+ * Fixed bug with settings initialization
29
+
7
30
  == 2019-11-12 v0.0.49
8
31
 
9
32
  * Fixed settings compatibility bug
@@ -78,8 +78,10 @@ module RedmineCrm
78
78
  target
79
79
  end
80
80
 
81
- def drafts(user)
82
- Draft.where(user_id: user.id, target_type: name)
81
+ def drafts(user = nil)
82
+ drafts = Draft.where(target_type: name)
83
+ drafts = drafts.where(user_id: user.id) if user
84
+ drafts
83
85
  end
84
86
  end # ClassMethods
85
87
 
@@ -100,7 +100,7 @@ module RedmineCrm
100
100
  def tagged_with(input, tags, match='all')
101
101
  return input unless input.respond_to?(:select)
102
102
  input = input.values if input.is_a?(Hash)
103
- tag_list = input.is_a?(Array) ? tags.sort : tags.split(',').map(&:strip).sort
103
+ tag_list = tags.is_a?(Array) ? tags.sort : tags.split(',').map(&:strip).sort
104
104
  case match
105
105
  when "all"
106
106
  input.select do |object|
@@ -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
@@ -5,11 +5,8 @@ module RedmineCrm
5
5
  }.freeze
6
6
 
7
7
  class << self
8
- # Initialize settings before using with this method
9
- # @example
10
- # RedmineCrm::Settings.initialize_gem_settings
11
8
  def initialize_gem_settings
12
- return if Setting.respond_to?(:plugin_redmine_crm)
9
+ return if !Object.const_defined?('Setting') || Setting.respond_to?(:plugin_redmine_crm)
13
10
 
14
11
  if Setting.respond_to?(:define_setting)
15
12
  Setting.send(:define_setting, 'plugin_redmine_crm', 'default' => default_settings, 'serialized' => true)
@@ -24,18 +21,23 @@ module RedmineCrm
24
21
  setting.value
25
22
  end)
26
23
  end
24
+ @settings_initialized
27
25
  end
28
26
 
29
27
  # Use apply instead attrs assign because it can rewrite other attributes
30
28
  def apply=(values)
29
+ initialize_gem_settings unless @settings_initialized
30
+
31
31
  Setting.plugin_redmine_crm = Setting.plugin_redmine_crm.merge(values)
32
32
  end
33
33
 
34
34
  def values
35
+ initialize_gem_settings unless @settings_initialized
35
36
  Object.const_defined?('Setting') ? Setting.plugin_redmine_crm : {}
36
37
  end
37
38
 
38
39
  def [](value)
40
+ initialize_gem_settings unless @settings_initialized
39
41
  return Setting.plugin_redmine_crm[value] if Object.const_defined?('Setting')
40
42
 
41
43
  nil
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = '0.0.49'
2
+ VERSION = '0.0.54'
3
3
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency 'rails'
22
22
  spec.add_runtime_dependency 'liquid', '< 2.6.4'
23
+ spec.add_runtime_dependency 'rubyzip'
23
24
 
24
25
  spec.add_development_dependency 'sqlite3'
25
26
  spec.add_development_dependency 'mysql2'
@@ -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) {
@@ -137,6 +137,7 @@ function buildSelect2Options(options) {
137
137
  result = {
138
138
  placeholder: options['placeholder'] || '',
139
139
  allowClear: !!options['allow_clear'],
140
+ containerCssClass: options['containerCssClass'],
140
141
  minimumInputLength: options['min_input_length'] || 0,
141
142
  templateResult: window[options['format_state']],
142
143
  templateSelection: window[options['format_selection']],
@@ -150,18 +150,26 @@
150
150
  }
151
151
 
152
152
  .select2-container--default .select2-selection--single {
153
- background: #fff url(../images/vcard.png) no-repeat 2px 50%;
154
- border: 1px solid #9EB1C2;
155
- border-radius: 2px;
156
- height: 21px;
153
+ /*background: #fff url(../images/vcard.png) no-repeat 2px 50%;*/
154
+ background-color: #fff;
155
+ height: 24px;
156
+ border: 1px solid #ccc;
157
+ border-radius: 3px;
158
+ }
159
+
160
+ .select2-container--default .select2-selection--single.icon {
161
+ background-position-x: 3px;
157
162
  }
158
163
 
159
164
  .select2-container--default .select2-selection--single .select2-selection__rendered {
160
- padding-left: 21px;
161
- line-height: 18px;
165
+ line-height: 21px;
162
166
  font-size: 11px;
163
167
  }
164
168
 
169
+ .select2-container--default .select2-selection--single.icon .select2-selection__rendered {
170
+ padding-left: 2px
171
+ }
172
+
165
173
  .select2-container--default .select2-selection--single .select2-selection__clear {
166
174
  cursor: pointer;
167
175
  float: right;
@@ -172,7 +180,7 @@
172
180
  color: #999;
173
181
  }
174
182
  .select2-container--default .select2-selection--single .select2-selection__arrow {
175
- height: 20px;
183
+ height: 24px;
176
184
  position: absolute;
177
185
  top: 0px;
178
186
  right: 1px;
@@ -210,8 +218,8 @@
210
218
  }
211
219
  .select2-container--default .select2-selection--multiple {
212
220
  background-color: white;
213
- border: 1px solid #9EB1C2;
214
- border-radius: 2px;
221
+ border: 1px solid #ccc;
222
+ border-radius: 3px;
215
223
  cursor: text;
216
224
  }
217
225
 
@@ -220,7 +228,7 @@
220
228
  box-sizing: border-box;
221
229
  list-style: none;
222
230
  margin: 0;
223
- padding: 0 2px 2px 2px;
231
+ padding: 0 2px 1px 2px;
224
232
  width: 100%;
225
233
  }
226
234
  .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
@@ -235,8 +243,8 @@
235
243
  cursor: pointer;
236
244
  float: right;
237
245
  font-weight: bold;
238
- margin-top: 5px;
239
- margin-right: 10px;
246
+ margin-top: 2px;
247
+ margin-right: 2px;
240
248
  }
241
249
 
242
250
  #sidebar .select2-container--default .select2-selection--multiple .select2-selection__choice,
@@ -245,8 +253,8 @@
245
253
  border-radius: 2px;
246
254
  cursor: default;
247
255
  float: left;
248
- margin-right: 3px;
249
- margin-top: 3px;
256
+ margin-right: 2px;
257
+ margin-top: 2px;
250
258
  padding: 0 3px;
251
259
  }
252
260
  .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
@@ -271,8 +279,8 @@
271
279
  margin-right: auto;
272
280
  }
273
281
  .select2-container--default.select2-container--focus .select2-selection--multiple {
274
- border: solid #aaa 1px;
275
- outline: 0;
282
+ border: 1px solid #5ad;
283
+ outline: none;
276
284
  }
277
285
  .select2-container--default.select2-container--disabled .select2-selection--multiple {
278
286
  background-color: #eee;
@@ -298,6 +306,7 @@
298
306
  outline: 0;
299
307
  box-shadow: none;
300
308
  -webkit-appearance: textfield;
309
+ height: 18px;
301
310
  }
302
311
  .select2-container--default .select2-results > .select2-results__options {
303
312
  max-height: 200px;
@@ -355,12 +364,12 @@
355
364
  border: 0px !important;
356
365
  height: inherit !important;
357
366
  padding: 0px !important;
358
- width: 2em !important;
359
367
  }
360
368
 
361
369
  .filter .select2-container--default .select2-selection--multiple .select2-selection__choice {
370
+ outline: none;
362
371
  border: 0px;
363
- padding: 2px 5px;
372
+ padding: 3px 5px;
364
373
  }
365
374
 
366
375
  /* == Theming ===
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.49
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: 2019-11-12 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
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "<"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.6.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubyzip
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: sqlite3
43
57
  requirement: !ruby/object:Gem::Requirement