e9_crm 0.1.26 → 0.1.27
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/e9_crm/base_controller.rb +1 -1
- data/app/controllers/e9_crm/campaigns_controller.rb +1 -1
- data/app/controllers/e9_crm/leads_controller.rb +0 -1
- data/app/controllers/e9_crm/page_views_controller.rb +57 -8
- data/app/controllers/e9_crm/resources_controller.rb +1 -0
- data/app/controllers/e9_crm/visits_controller.rb +60 -0
- data/app/helpers/e9_crm/contacts_helper.rb +2 -9
- data/app/helpers/e9_crm/page_views_helper.rb +45 -0
- data/app/models/campaign.rb +23 -23
- data/app/models/contact.rb +17 -4
- data/app/models/page_view.rb +3 -20
- data/app/models/tracking_cookie.rb +16 -0
- data/app/views/e9_crm/affiliate_campaigns/_form_inner.html.haml +2 -1
- data/app/views/e9_crm/campaigns/_reports_table.html.haml +3 -3
- data/app/views/e9_crm/campaigns/_table.html.haml +1 -1
- data/app/views/e9_crm/campaigns/reports.js.erb +1 -1
- data/app/views/e9_crm/contacts/_sidebar_email_form.html.haml +7 -5
- data/app/views/e9_crm/contacts/index.html.haml +1 -1
- data/app/views/e9_crm/contacts/show.html.haml +1 -0
- data/app/views/e9_crm/dated_costs/index.html.haml +1 -3
- data/app/views/e9_crm/deals/_leads_table.html.haml +3 -0
- data/app/views/e9_crm/deals/_table.html.haml +3 -0
- data/app/views/e9_crm/deals/leads.js.erb +1 -1
- data/app/views/e9_crm/deals/show.html.haml +14 -5
- data/app/views/e9_crm/page_views/_header.html.haml +15 -0
- data/app/views/e9_crm/page_views/_table.html.haml +6 -6
- data/app/views/e9_crm/resources/index.html.haml +0 -3
- data/app/views/e9_crm/resources/index.js.erb +1 -1
- data/app/views/e9_crm/sales_campaigns/_form_inner.html.haml +2 -1
- data/app/views/e9_crm/visits/_header.html.haml +3 -0
- data/app/views/e9_crm/visits/_table.html.haml +27 -0
- data/config/locales/e9.en.yml +19 -12
- data/config/routes.rb +8 -16
- data/e9_crm.gemspec +0 -8
- data/lib/e9_crm/controller.rb +27 -12
- data/lib/e9_crm/model.rb +6 -5
- data/lib/e9_crm/rack/email_campaign_auto_completer.rb +29 -0
- data/lib/e9_crm/rails_extensions.rb +0 -33
- data/lib/e9_crm/tracking_controller.rb +3 -5
- data/lib/e9_crm/version.rb +1 -1
- data/lib/e9_crm.rb +7 -5
- metadata +48 -165
- data/app/controllers/e9_crm/email_templates.controller.rb +0 -46
- data/app/models/email_template.rb +0 -27
- data/app/views/e9_crm/email_templates/_form_inner.html.haml +0 -12
- data/app/views/e9_crm/email_templates/_header.html.haml +0 -7
- data/app/views/e9_crm/email_templates/select.html.haml +0 -5
- data/lib/e9_crm/email.rb +0 -18
metadata
CHANGED
@@ -1,167 +1,54 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: e9_crm
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.27
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.26
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Travis Cox
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: rails
|
17
|
-
prerelease: false
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
|
-
requirements:
|
21
|
-
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 3.0.0
|
24
|
-
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: inherited_resources
|
28
|
-
prerelease: false
|
29
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
|
-
requirements:
|
32
|
-
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 1.1.2
|
35
|
-
type: :runtime
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: has_scope
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: "0"
|
46
|
-
type: :runtime
|
47
|
-
version_requirements: *id003
|
48
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-07 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
49
15
|
name: money
|
50
|
-
|
51
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &21696240 !ruby/object:Gem::Requirement
|
52
17
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
57
22
|
type: :runtime
|
58
|
-
version_requirements: *id004
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: e9_rails
|
61
23
|
prerelease: false
|
62
|
-
|
63
|
-
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: "0"
|
68
|
-
type: :runtime
|
69
|
-
version_requirements: *id005
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: e9_tags
|
72
|
-
prerelease: false
|
73
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: "0"
|
79
|
-
type: :runtime
|
80
|
-
version_requirements: *id006
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: e9_attributes
|
83
|
-
prerelease: false
|
84
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: "0"
|
90
|
-
type: :runtime
|
91
|
-
version_requirements: *id007
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: will_paginate
|
94
|
-
prerelease: false
|
95
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
96
|
-
none: false
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: "0"
|
101
|
-
type: :runtime
|
102
|
-
version_requirements: *id008
|
103
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *21696240
|
25
|
+
- !ruby/object:Gem::Dependency
|
104
26
|
name: kramdown
|
105
|
-
|
106
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
27
|
+
requirement: &21695620 !ruby/object:Gem::Requirement
|
107
28
|
none: false
|
108
|
-
requirements:
|
29
|
+
requirements:
|
109
30
|
- - ~>
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version:
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.13'
|
112
33
|
type: :runtime
|
113
|
-
version_requirements: *id009
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: state_machine
|
116
34
|
prerelease: false
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
=========================
|
130
|
-
|
131
|
-
To use, add as a gem and install by running:
|
132
|
-
|
133
|
-
rails g e9_crm:install
|
134
|
-
|
135
|
-
Then modify the installed initializer as per your app, including
|
136
|
-
the controller module in your desired controllers, with the final
|
137
|
-
result looking something like this:
|
138
|
-
|
139
|
-
require 'e9_crm'
|
140
|
-
|
141
|
-
User.send :include, E9Crm::Backend::ActiveRecord
|
142
|
-
|
143
|
-
Rails.configuration.after_initialize do
|
144
|
-
[
|
145
|
-
MyFirstTrackedController,
|
146
|
-
MySecondTrackedController
|
147
|
-
].each {|c| c.send(:include, E9Crm::TrackingController) }
|
148
|
-
end
|
149
|
-
|
150
|
-
NOTE: A few assumptions are made:
|
151
|
-
---------------------------------
|
152
|
-
|
153
|
-
1. Your app has a "User" model
|
154
|
-
2. Your app has a controller method #current_user to return the
|
155
|
-
currently logged in user.
|
156
|
-
|
35
|
+
version_requirements: *21695620
|
36
|
+
description: ! "*NOTE his plugin requires the private e9_base CMS gem and WILL NOT
|
37
|
+
WORK without it.*\n\nCRM Plugin for the e9 CMS\n=========================\n\nTo
|
38
|
+
use, add as a gem and install by running:\n\n rails g e9_crm:install\n\nThen
|
39
|
+
modify the installed initializer as per your app, including\nthe controller module
|
40
|
+
in your desired controllers, with the final\nresult looking something like this:\n\n
|
41
|
+
\ require 'e9_crm'\n\n User.send :include, E9Crm::Backend::ActiveRecord\n\n
|
42
|
+
\ Rails.configuration.after_initialize do\n [\n MyFirstTrackedController,\n
|
43
|
+
\ MySecondTrackedController\n ].each {|c| c.send(:include, E9Crm::TrackingController)
|
44
|
+
}\n end\n\nNOTE: A few assumptions are made:\n---------------------------------\n\n1.
|
45
|
+
\ Your app has a \"User\" model\n2. Your app has a controller method #current_user
|
46
|
+
to return the\n currently logged in user.\n"
|
157
47
|
email: travis@e9digital.com
|
158
48
|
executables: []
|
159
|
-
|
160
49
|
extensions: []
|
161
|
-
|
162
50
|
extra_rdoc_files: []
|
163
|
-
|
164
|
-
files:
|
51
|
+
files:
|
165
52
|
- .gitignore
|
166
53
|
- Gemfile
|
167
54
|
- README.md
|
@@ -179,13 +66,13 @@ files:
|
|
179
66
|
- app/controllers/e9_crm/dated_costs_controller.rb
|
180
67
|
- app/controllers/e9_crm/deals_controller.rb
|
181
68
|
- app/controllers/e9_crm/email_campaigns_controller.rb
|
182
|
-
- app/controllers/e9_crm/email_templates.controller.rb
|
183
69
|
- app/controllers/e9_crm/leads_controller.rb
|
184
70
|
- app/controllers/e9_crm/offers_controller.rb
|
185
71
|
- app/controllers/e9_crm/page_views_controller.rb
|
186
72
|
- app/controllers/e9_crm/resources_controller.rb
|
187
73
|
- app/controllers/e9_crm/sales_campaigns_controller.rb
|
188
74
|
- app/controllers/e9_crm/users_controller.rb
|
75
|
+
- app/controllers/e9_crm/visits_controller.rb
|
189
76
|
- app/helpers/e9_crm/base_helper.rb
|
190
77
|
- app/helpers/e9_crm/campaign_groups_helper.rb
|
191
78
|
- app/helpers/e9_crm/campaigns_helper.rb
|
@@ -208,7 +95,6 @@ files:
|
|
208
95
|
- app/models/dated_cost.rb
|
209
96
|
- app/models/deal.rb
|
210
97
|
- app/models/email_campaign.rb
|
211
|
-
- app/models/email_template.rb
|
212
98
|
- app/models/no_campaign.rb
|
213
99
|
- app/models/offer.rb
|
214
100
|
- app/models/page_view.rb
|
@@ -273,9 +159,6 @@ files:
|
|
273
159
|
- app/views/e9_crm/deals/offer_form.html.haml
|
274
160
|
- app/views/e9_crm/deals/show.html.haml
|
275
161
|
- app/views/e9_crm/email_campaigns/_form_inner.html.haml
|
276
|
-
- app/views/e9_crm/email_templates/_form_inner.html.haml
|
277
|
-
- app/views/e9_crm/email_templates/_header.html.haml
|
278
|
-
- app/views/e9_crm/email_templates/select.html.haml
|
279
162
|
- app/views/e9_crm/file_download_offers/_form.html.haml
|
280
163
|
- app/views/e9_crm/file_download_offers/_form_inner.html.haml
|
281
164
|
- app/views/e9_crm/leads/_form.html.haml
|
@@ -286,6 +169,7 @@ files:
|
|
286
169
|
- app/views/e9_crm/offers/_offer.html.haml
|
287
170
|
- app/views/e9_crm/offers/_public_offer.html.haml
|
288
171
|
- app/views/e9_crm/offers/show.html.haml
|
172
|
+
- app/views/e9_crm/page_views/_header.html.haml
|
289
173
|
- app/views/e9_crm/page_views/_table.html.haml
|
290
174
|
- app/views/e9_crm/resources/_form.html.haml
|
291
175
|
- app/views/e9_crm/resources/_form_inner.html.haml
|
@@ -300,6 +184,8 @@ files:
|
|
300
184
|
- app/views/e9_crm/resources/show.html.haml
|
301
185
|
- app/views/e9_crm/resources/update.js.erb
|
302
186
|
- app/views/e9_crm/sales_campaigns/_form_inner.html.haml
|
187
|
+
- app/views/e9_crm/visits/_header.html.haml
|
188
|
+
- app/views/e9_crm/visits/_table.html.haml
|
303
189
|
- app/views/record_attributes/_user.html.haml
|
304
190
|
- config/initializers/inflections.rb
|
305
191
|
- config/locales/e9.en.yml
|
@@ -309,11 +195,11 @@ files:
|
|
309
195
|
- lib/e9_crm.rb
|
310
196
|
- lib/e9_crm/controller.rb
|
311
197
|
- lib/e9_crm/e9_extensions.rb
|
312
|
-
- lib/e9_crm/email.rb
|
313
198
|
- lib/e9_crm/model.rb
|
314
199
|
- lib/e9_crm/rack/company_auto_completer.rb
|
315
200
|
- lib/e9_crm/rack/contact_auto_completer.rb
|
316
201
|
- lib/e9_crm/rack/email_availability_checker.rb
|
202
|
+
- lib/e9_crm/rack/email_campaign_auto_completer.rb
|
317
203
|
- lib/e9_crm/rails_extensions.rb
|
318
204
|
- lib/e9_crm/system_emails_controller.rb
|
319
205
|
- lib/e9_crm/tracking_controller.rb
|
@@ -326,31 +212,28 @@ files:
|
|
326
212
|
- test/functional/home_controller_test.rb
|
327
213
|
homepage: http://www.e9digital.com
|
328
214
|
licenses: []
|
329
|
-
|
330
215
|
post_install_message:
|
331
216
|
rdoc_options: []
|
332
|
-
|
333
|
-
require_paths:
|
217
|
+
require_paths:
|
334
218
|
- lib
|
335
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
219
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
336
220
|
none: false
|
337
|
-
requirements:
|
338
|
-
- -
|
339
|
-
- !ruby/object:Gem::Version
|
340
|
-
version:
|
341
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
|
+
requirements:
|
222
|
+
- - ! '>='
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: '0'
|
225
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
342
226
|
none: false
|
343
|
-
requirements:
|
344
|
-
- -
|
345
|
-
- !ruby/object:Gem::Version
|
346
|
-
version:
|
227
|
+
requirements:
|
228
|
+
- - ! '>='
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
347
231
|
requirements: []
|
348
|
-
|
349
232
|
rubyforge_project: e9_crm
|
350
233
|
rubygems_version: 1.8.10
|
351
234
|
signing_key:
|
352
235
|
specification_version: 3
|
353
236
|
summary: CRM engine plugin for the e9 CMS
|
354
|
-
test_files:
|
237
|
+
test_files:
|
355
238
|
- test/functional/e9_crm/campaign_types_controller_test.rb
|
356
239
|
- test/functional/home_controller_test.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
class E9Crm::EmailTemplatesController < E9Crm::ResourcesController
|
2
|
-
defaults
|
3
|
-
include E9Rails::Controllers::Orderable
|
4
|
-
self.should_paginate_index = false
|
5
|
-
|
6
|
-
filter_access_to :select, :require => :read, :context => :admin
|
7
|
-
|
8
|
-
before_filter :handle_unacceptable_mimetype, :only => :show
|
9
|
-
|
10
|
-
respond_to :json, :only => :show
|
11
|
-
respond_to :html, :except => :show
|
12
|
-
|
13
|
-
def select
|
14
|
-
index!
|
15
|
-
end
|
16
|
-
|
17
|
-
def show
|
18
|
-
unless params[:contact_id] =~ /\d+/ && @contact = Contact.find_by_id(params[:contact_id])
|
19
|
-
head :status => 404
|
20
|
-
else
|
21
|
-
object = resource
|
22
|
-
object.contact = @contact
|
23
|
-
object.recipient = params[:user_id] =~ /\d+/ && @contact.users.find_by_id(params[:user_id]) || @contact.primary_user
|
24
|
-
|
25
|
-
render :json => object
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
protected
|
30
|
-
|
31
|
-
def collection
|
32
|
-
@email_templates ||= end_of_association_chain.order(:name).all
|
33
|
-
end
|
34
|
-
|
35
|
-
def default_ordered_on
|
36
|
-
'name'
|
37
|
-
end
|
38
|
-
|
39
|
-
def default_ordered_dir
|
40
|
-
'ASC'
|
41
|
-
end
|
42
|
-
|
43
|
-
def determine_template
|
44
|
-
request.xhr? ? false : super
|
45
|
-
end
|
46
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# An "Email" that isn't intended to be sent, but rather as a prototype
|
2
|
-
# for other Emails to be generated from.
|
3
|
-
#
|
4
|
-
class EmailTemplate < Email
|
5
|
-
# TODO the email class hierarchy needs a major refactoring, it's backwards and convoluted
|
6
|
-
before_save :generate_html_body_from_text_body
|
7
|
-
|
8
|
-
validates :from_email, :email => { :allow_blank => true }
|
9
|
-
|
10
|
-
def as_json(options = {})
|
11
|
-
{}.tap do |hash|
|
12
|
-
hash[:to] = recipient.email
|
13
|
-
hash[:reply_to] = reply_email
|
14
|
-
hash[:from] = from_email
|
15
|
-
hash[:subject] = render(:subject)
|
16
|
-
hash[:html_body] = render(:html_body)
|
17
|
-
hash[:text_body] = render(:text_body)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
protected
|
22
|
-
|
23
|
-
def ensure_body_field_presence
|
24
|
-
self.html_body = self.html_body.presence || ''
|
25
|
-
self.text_body = self.text_body.presence || ''
|
26
|
-
end
|
27
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
= form_tag email_templates_path, :class => "email-template-sel", :method => :get do
|
2
|
-
= hidden_field_tag "contact_id", params[:contact_id]
|
3
|
-
= hidden_field_tag "user_id", params[:user_id]
|
4
|
-
= select_tag "id", options_for_select(collection.map {|e| [e.name, e.id] })
|
5
|
-
= submit_tag e9_t(:select_submit), :name => nil
|
data/lib/e9_crm/email.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module E9Crm
|
2
|
-
module Email
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
included do
|
6
|
-
attr_accessor :contact
|
7
|
-
|
8
|
-
def locals_with_contact
|
9
|
-
default_locals.merge({
|
10
|
-
:contact => @contact || recipient.try(:contact)
|
11
|
-
})
|
12
|
-
end
|
13
|
-
|
14
|
-
alias :default_locals :this_locals
|
15
|
-
alias :this_locals :locals_with_contact
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|