fat_free_crm 0.11.0 → 0.11.1

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.

Potentially problematic release.


This version of fat_free_crm might be problematic. Click here for more details.

Files changed (212) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +2 -2
  3. data/Gemfile +15 -2
  4. data/Gemfile.lock +34 -14
  5. data/README.md +37 -124
  6. data/app/assets/javascripts/application.js.erb +1 -1
  7. data/app/assets/javascripts/crm.js +22 -1
  8. data/app/assets/javascripts/crm_fields.js +2 -3
  9. data/app/assets/javascripts/jquery-noconflict.js +17 -0
  10. data/app/assets/stylesheets/application.css.erb +1 -0
  11. data/app/assets/stylesheets/common.scss +26 -0
  12. data/app/assets/stylesheets/ffcrm_chosen.scss +1 -1
  13. data/app/controllers/admin/application_controller.rb +1 -1
  14. data/app/controllers/application_controller.rb +0 -8
  15. data/app/controllers/{accounts_controller.rb → entities/accounts_controller.rb} +1 -13
  16. data/app/controllers/{campaigns_controller.rb → entities/campaigns_controller.rb} +1 -13
  17. data/app/controllers/{contacts_controller.rb → entities/contacts_controller.rb} +1 -7
  18. data/app/controllers/{leads_controller.rb → entities/leads_controller.rb} +1 -1
  19. data/app/controllers/{opportunities_controller.rb → entities/opportunities_controller.rb} +1 -7
  20. data/app/controllers/{tasks_controller.rb → entities/tasks_controller.rb} +1 -1
  21. data/app/controllers/{base_controller.rb → entities_controller.rb} +32 -1
  22. data/app/controllers/home_controller.rb +9 -9
  23. data/app/controllers/lists_controller.rb +17 -0
  24. data/app/helpers/admin/tags_helper.rb +1 -1
  25. data/app/helpers/application_helper.rb +14 -14
  26. data/app/helpers/crm_tags_helper.rb +1 -1
  27. data/app/helpers/home_helper.rb +13 -15
  28. data/app/helpers/lists_helper.rb +17 -0
  29. data/app/inputs/date_time_input.rb +17 -0
  30. data/app/inputs/text_input.rb +17 -1
  31. data/app/models/{base → entities}/account.rb +0 -1
  32. data/app/models/{base → entities}/account_contact.rb +0 -0
  33. data/app/models/{base → entities}/account_opportunity.rb +0 -0
  34. data/app/models/{base → entities}/campaign.rb +0 -1
  35. data/app/models/{base → entities}/contact.rb +0 -1
  36. data/app/models/{base → entities}/contact_opportunity.rb +0 -0
  37. data/app/models/{base → entities}/lead.rb +0 -1
  38. data/app/models/{base → entities}/opportunity.rb +0 -1
  39. data/app/models/{base → entities}/task.rb +5 -6
  40. data/app/models/list.rb +17 -0
  41. data/app/models/observers/lead_observer.rb +39 -0
  42. data/app/models/observers/opportunity_observer.rb +54 -0
  43. data/app/models/observers/task_observer.rb +41 -0
  44. data/app/models/polymorphic/address.rb +1 -3
  45. data/app/models/polymorphic/avatar.rb +0 -5
  46. data/app/models/polymorphic/comment.rb +2 -11
  47. data/app/models/polymorphic/email.rb +2 -9
  48. data/app/models/polymorphic/tag.rb +17 -0
  49. data/app/models/polymorphic/tagging.rb +17 -0
  50. data/app/models/users/ability.rb +13 -0
  51. data/app/models/users/user.rb +1 -4
  52. data/app/views/accounts/_account.html.haml +10 -6
  53. data/app/views/accounts/index.html.haml +1 -1
  54. data/app/views/accounts/show.html.haml +6 -24
  55. data/app/views/admin/fields/_field.html.haml +6 -6
  56. data/app/views/admin/tags/_tag.html.haml +2 -2
  57. data/app/views/admin/tags/index.html.haml +1 -1
  58. data/app/views/admin/users/_user.html.haml +3 -3
  59. data/app/views/admin/users/index.html.haml +1 -1
  60. data/app/views/campaigns/_campaign.html.haml +9 -5
  61. data/app/views/campaigns/index.html.haml +1 -1
  62. data/app/views/campaigns/show.html.haml +4 -24
  63. data/app/views/comments/_comment.html.haml +17 -14
  64. data/app/views/comments/_edit.html.haml +1 -1
  65. data/app/views/comments/_new.html.haml +3 -3
  66. data/app/views/contacts/_contact.html.haml +33 -15
  67. data/app/views/contacts/_contacts.html.haml +6 -0
  68. data/app/views/contacts/_sidebar_show.html.haml +1 -1
  69. data/app/views/contacts/index.html.haml +1 -1
  70. data/app/views/contacts/show.html.haml +3 -19
  71. data/app/views/emails/_email.html.haml +24 -21
  72. data/app/views/{base → entities}/_advanced_search.html.haml +0 -0
  73. data/app/views/{base → entities}/_condition_fields.html.haml +0 -0
  74. data/app/views/{base → entities}/_grouping_fields.html.haml +0 -0
  75. data/app/views/{base → entities}/_sort_fields.html.haml +0 -0
  76. data/app/views/{base → entities}/advanced_search.js.rjs +0 -0
  77. data/app/views/entities/contacts.js.rjs +3 -0
  78. data/app/views/entities/leads.js.rjs +3 -0
  79. data/app/views/entities/opportunities.js.rjs +3 -0
  80. data/app/views/entities/versions.js.rjs +3 -0
  81. data/app/views/home/_activity.html.haml +19 -18
  82. data/app/views/home/_events_menu.html.haml +8 -0
  83. data/app/views/home/_options.html.haml +2 -3
  84. data/app/views/home/index.html.haml +1 -1
  85. data/app/views/leads/_lead.html.haml +42 -23
  86. data/app/views/leads/_leads.html.haml +6 -0
  87. data/app/views/leads/_sidebar_show.html.haml +1 -1
  88. data/app/views/leads/index.html.haml +1 -1
  89. data/app/views/leads/show.html.haml +3 -13
  90. data/app/views/opportunities/_opportunities.html.haml +6 -0
  91. data/app/views/opportunities/_opportunity.html.haml +23 -11
  92. data/app/views/opportunities/index.html.haml +1 -1
  93. data/app/views/opportunities/show.html.haml +4 -18
  94. data/app/views/shared/_comment.html.haml +3 -3
  95. data/app/views/shared/_edit_comment.html.haml +1 -1
  96. data/app/views/shared/_recent.html.haml +4 -4
  97. data/app/views/shared/_recently.html.haml +3 -3
  98. data/app/views/shared/_timeline.html.haml +2 -3
  99. data/app/views/tasks/_assigned.html.haml +4 -4
  100. data/app/views/tasks/_completed.html.haml +2 -2
  101. data/app/views/tasks/_pending.html.haml +2 -2
  102. data/app/views/tasks/_related.html.haml +4 -5
  103. data/app/views/tasks/_tasks.html.haml +3 -0
  104. data/app/views/tasks/_title.html.haml +1 -1
  105. data/app/views/tasks/index.html.haml +1 -1
  106. data/app/views/users/_avatar.html.haml +2 -2
  107. data/app/views/versions/_version.html.haml +9 -12
  108. data/app/views/versions/_versions.html.haml +11 -0
  109. data/config/application.rb +3 -2
  110. data/config/environments/development.rb +2 -2
  111. data/config/environments/production.rb +0 -4
  112. data/config/environments/staging.rb +1 -1
  113. data/config/initializers/action_mailer.rb +9 -0
  114. data/config/initializers/paper_trail.rb +80 -0
  115. data/config/initializers/relative_url_root.rb +23 -0
  116. data/config/locales/cz_fat_free_crm.yml +1 -1
  117. data/config/locales/en-US_fat_free_crm.yml +22 -17
  118. data/config/locales/fr_fat_free_crm.yml +349 -134
  119. data/config/routes.rb +144 -140
  120. data/config/settings.default.yml +14 -2
  121. data/db/demo/addresses.yml +2 -2
  122. data/db/demo/emails.yml +2 -2
  123. data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -2
  124. data/db/migrate/20120309070209_add_versions_related.rb +6 -0
  125. data/db/migrate/20120316045804_activities_to_versions.rb +35 -0
  126. data/db/schema.rb +79 -53
  127. data/fat_free_crm.gemspec +8 -4
  128. data/lib/development_tasks/gem.rake +18 -1
  129. data/lib/development_tasks/license.rake +2 -4
  130. data/lib/development_tasks/rdoc.rake +17 -0
  131. data/lib/development_tasks/rspec.rake +17 -0
  132. data/lib/fat_free_crm.rb +20 -14
  133. data/lib/fat_free_crm/core_ext/array.rb +0 -27
  134. data/lib/fat_free_crm/dropbox.rb +11 -1
  135. data/lib/fat_free_crm/engine.rb +21 -3
  136. data/lib/fat_free_crm/gem_dependencies.rb +26 -0
  137. data/lib/fat_free_crm/gem_ext.rb +18 -1
  138. data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +18 -1
  139. data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +17 -0
  140. data/lib/fat_free_crm/gem_ext/rails/engine.rb +17 -0
  141. data/lib/fat_free_crm/gem_ext/rails/text_helper.rb +17 -0
  142. data/lib/fat_free_crm/gem_ext/rake/task.rb +17 -0
  143. data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +18 -1
  144. data/lib/fat_free_crm/plugin_dependencies.rb +23 -5
  145. data/lib/fat_free_crm/renderers.rb +17 -0
  146. data/lib/fat_free_crm/syck_yaml.rb +17 -0
  147. data/lib/fat_free_crm/version.rb +1 -1
  148. data/lib/{country_select → plugins/country_select}/MIT-LICENSE +0 -0
  149. data/lib/{country_select → plugins/country_select}/README +0 -0
  150. data/lib/{country_select → plugins/country_select}/init.rb +0 -0
  151. data/lib/{country_select → plugins/country_select}/install.rb +0 -0
  152. data/lib/{country_select → plugins/country_select}/lib/country_select.rb +0 -0
  153. data/lib/{country_select → plugins/country_select}/uninstall.rb +0 -0
  154. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Gemfile +0 -0
  155. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/README.textile +0 -0
  156. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/ROADMAP.textile +0 -0
  157. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Rakefile +0 -0
  158. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/VERSION +0 -0
  159. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/gravatar_image_tag.gemspec +0 -0
  160. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/init.rb +0 -0
  161. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/lib/gravatar_image_tag.rb +0 -0
  162. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/gravatar_image_tag_spec.rb +0 -0
  163. data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/test_helper.rb +0 -0
  164. data/lib/tasks/demo.rake +32 -29
  165. data/lib/tasks/dropbox.rake +1 -1
  166. data/lib/tasks/fat_free_crm.rake +3 -2
  167. data/lib/tasks/plugins.rake +1 -0
  168. data/spec/controllers/accounts_controller_spec.rb +7 -5
  169. data/spec/controllers/campaigns_controller_spec.rb +11 -9
  170. data/spec/controllers/contacts_controller_spec.rb +7 -5
  171. data/spec/controllers/home_controller_spec.rb +2 -2
  172. data/spec/controllers/leads_controller_spec.rb +7 -5
  173. data/spec/controllers/opportunities_controller_spec.rb +7 -5
  174. data/spec/factories/shared_factories.rb +8 -11
  175. data/spec/lib/dropbox_spec.rb +1 -0
  176. data/spec/models/polymorphic/version_spec.rb +247 -0
  177. data/spec/models/users/user_spec.rb +0 -9
  178. data/spec/spec_helper.rb +4 -0
  179. data/spec/views/home/index.haml_spec.rb +1 -1
  180. data/spec/views/home/index.rjs_spec.rb +4 -4
  181. data/spec/views/tasks/new.rjs_spec.rb +2 -2
  182. data/vendor/assets/javascripts/calendar_date_select/format_french.js +24 -0
  183. metadata +167 -126
  184. data/app/models/observers/activity_observer.rb +0 -84
  185. data/app/models/polymorphic/activity.rb +0 -106
  186. data/app/views/accounts/contacts.js.rjs +0 -3
  187. data/app/views/accounts/opportunities.js.rjs +0 -3
  188. data/app/views/campaigns/leads.js.rjs +0 -3
  189. data/app/views/campaigns/opportunities.js.rjs +0 -3
  190. data/app/views/contacts/opportunities.js.rjs +0 -3
  191. data/app/views/home/_actions_menu.html.haml +0 -8
  192. data/lib/dynamic_form/MIT-LICENSE +0 -20
  193. data/lib/dynamic_form/README +0 -13
  194. data/lib/dynamic_form/Rakefile +0 -10
  195. data/lib/dynamic_form/dynamic_form.gemspec +0 -12
  196. data/lib/dynamic_form/init.rb +0 -2
  197. data/lib/dynamic_form/lib/action_view/helpers/dynamic_form.rb +0 -301
  198. data/lib/dynamic_form/lib/action_view/locale/en-US.yml +0 -8
  199. data/lib/dynamic_form/lib/dynamic_form.rb +0 -6
  200. data/lib/dynamic_form/test/dynamic_form_i18n_test.rb +0 -42
  201. data/lib/dynamic_form/test/dynamic_form_test.rb +0 -370
  202. data/lib/dynamic_form/test/test_helper.rb +0 -10
  203. data/lib/responds_to_parent/MIT-LICENSE +0 -20
  204. data/lib/responds_to_parent/README +0 -47
  205. data/lib/responds_to_parent/Rakefile +0 -22
  206. data/lib/responds_to_parent/init.rb +0 -2
  207. data/lib/responds_to_parent/install.rb +0 -2
  208. data/lib/responds_to_parent/lib/responds_to_parent.rb +0 -70
  209. data/lib/responds_to_parent/test/responds_to_parent_test.rb +0 -11
  210. data/lib/responds_to_parent/test/test_helper.rb +0 -7
  211. data/lib/responds_to_parent/uninstall.rb +0 -2
  212. data/spec/models/polymorphic/activity_spec.rb +0 -303
@@ -4,24 +4,26 @@ require 'fat_free_crm/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'fat_free_crm'
7
- gem.authors = ['Michael Dvorkin', 'Nathan Broadbent', 'Ben Tillman', 'Stephen Kenworthy']
7
+ gem.authors = ['Michael Dvorkin', 'Ben Tillman', 'Nathan Broadbent', 'Stephen Kenworthy']
8
8
  gem.summary = 'Fat Free CRM'
9
9
  gem.description = 'An open source, Ruby on Rails customer relationship management platform'
10
10
  gem.homepage = 'http://fatfreecrm.com'
11
- gem.email = ['mike@fatfreecrm.com', 'nathan@fatfreecrm.com']
11
+ gem.email = ['mike@fatfreecrm.com', 'nathan@fatfreecrm.com', 'warp@fatfreecrm.com']
12
12
  gem.files = `git ls-files`.split("\n")
13
13
  gem.version = FatFreeCRM::VERSION::STRING
14
14
 
15
15
  gem.add_dependency 'rails', '~> 3.2.2'
16
16
  gem.add_dependency 'prototype-rails'
17
17
  gem.add_dependency 'jquery-rails'
18
- gem.add_dependency 'simple_form', '~> 1.5.2'
18
+ gem.add_dependency 'simple_form', '~> 2.0.1'
19
19
  gem.add_dependency 'will_paginate', '~> 3.0.2'
20
- gem.add_dependency 'paperclip', '~> 2.5.2'
20
+ gem.add_dependency 'paperclip', '~> 2.7.0'
21
21
  gem.add_dependency 'paper_trail'
22
22
  gem.add_dependency 'authlogic', '~> 3.1.0'
23
23
  gem.add_dependency 'acts_as_commentable', '~> 3.0.1'
24
24
  gem.add_dependency 'acts-as-taggable-on', '~> 2.2.1'
25
+ gem.add_dependency 'responds_to_parent'
26
+ gem.add_dependency 'dynamic_form'
25
27
  gem.add_dependency 'haml', '~> 3.1.3'
26
28
  gem.add_dependency 'sass', '~> 3.1.15'
27
29
  gem.add_dependency 'acts_as_list', '~> 0.1.4'
@@ -30,6 +32,7 @@ Gem::Specification.new do |gem|
30
32
  gem.add_dependency 'chosen-rails'
31
33
  gem.add_dependency 'ajax-chosen-rails', '>= 0.1.5'
32
34
  gem.add_dependency 'ransack'
35
+ gem.add_dependency 'cancan'
33
36
 
34
37
  gem.add_development_dependency 'rspec-rails', '~> 2.8.1'
35
38
  gem.add_development_dependency 'capybara'
@@ -40,6 +43,7 @@ Gem::Specification.new do |gem|
40
43
  gem.add_development_dependency 'database_cleaner'
41
44
  gem.add_development_dependency 'fuubar'
42
45
  gem.add_development_dependency 'factory_girl', '~> 2.6.1'
46
+ gem.add_development_dependency 'factory_girl_rails', '~> 1.7.0'
43
47
  end
44
48
 
45
49
 
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  require 'rubygems/package_task'
2
19
 
3
20
  Bundler::GemHelper.install_tasks
@@ -5,4 +22,4 @@ Bundler::GemHelper.install_tasks
5
22
  gemspec = eval(File.read('fat_free_crm.gemspec'))
6
23
  Gem::PackageTask.new(gemspec) do |p|
7
24
  p.gem_spec = gemspec
8
- end
25
+ end
@@ -21,10 +21,8 @@
21
21
 
22
22
  namespace :license do
23
23
  FILES = {:ruby => [
24
- "app/helpers/**/*.rb",
25
- "app/models/**/*.rb",
26
- "app/controllers/**/*.rb",
27
- "lib/tasks/**/*.rake",
24
+ "app/**/*.rb",
25
+ "lib/**/*.rake",
28
26
  "lib/fat_free_crm/**/*.rb",
29
27
  "lib/fat_free_crm.rb",
30
28
  "config/settings.default.yml",
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  begin
2
19
  require 'rdoc/task'
3
20
  rescue LoadError
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  if defined?(RSpec)
2
19
  require 'rspec/core/rake_task'
3
20
 
@@ -15,18 +15,33 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  #------------------------------------------------------------------------------
17
17
 
18
- # Use the Syck YAML parser
19
- require 'fat_free_crm/syck_yaml'
18
+ module FatFreeCRM
19
+ class << self
20
+ # Return either Application or Engine,
21
+ # depending on how Fat Free CRM has been loaded
22
+ def application
23
+ defined?(FatFreeCRM::Engine) ? Engine : Application
24
+ end
20
25
 
21
- require "fat_free_crm/gem_dependencies"
22
- require "fat_free_crm/gem_ext"
23
- require "fat_free_crm/plugin_dependencies"
26
+ def root
27
+ application.root
28
+ end
29
+ end
30
+ end
24
31
 
25
32
  # Load Fat Free CRM as a Rails Engine, unless running as a Rails Application
26
33
  unless defined?(FatFreeCRM::Application)
27
34
  require 'fat_free_crm/engine'
28
35
  end
29
36
 
37
+ # Our settings.yml structure requires the Syck YAML parser
38
+ require 'fat_free_crm/syck_yaml'
39
+
40
+ # Require gem dependencies, monkey patches, and vendored plugins (in lib)
41
+ require "fat_free_crm/gem_dependencies"
42
+ require "fat_free_crm/gem_ext"
43
+ require "fat_free_crm/plugin_dependencies"
44
+
30
45
  require "fat_free_crm/version"
31
46
  require "fat_free_crm/core_ext"
32
47
  require "fat_free_crm/exceptions"
@@ -41,12 +56,3 @@ require "fat_free_crm/tabs"
41
56
  require "fat_free_crm/callback"
42
57
  require "fat_free_crm/dropbox" if defined?(::Rake)
43
58
  require "fat_free_crm/plugin"
44
-
45
-
46
- module FatFreeCRM
47
- # Return the root path of either the Application or the Engine,
48
- # depending on how Fat Free CRM is loaded
49
- def self.root
50
- (defined?(FatFreeCRM::Engine) ? Engine : Application).root
51
- end
52
- end
@@ -17,32 +17,6 @@
17
17
 
18
18
  require "csv"
19
19
  class Array
20
- # NOTE: in ActiveRecord 2.x #visible_to was mixed into class
21
- # ActiveRecord::NamedScope::Scope but with AREL scope it must be Array.
22
- #
23
- # The following is used to filter out user activities based on activity
24
- # subject's permissions. For example:
25
- #
26
- # @current_user = User.find(1)
27
- # @activities = Activity.latest.execpt(:viewed).visible_to(@current_user)
28
- #
29
- # Note that we can't use named scope for the Activity since the join table
30
- # name is based on subject type, which is polymorphic.
31
- #----------------------------------------------------------------------------
32
- def visible_to(user)
33
- delete_if do |item|
34
- is_private = false
35
- if item.is_a?(Activity)
36
- subject = item.subject || Version.with_item_keys(item.subject_type, item.subject_id).last.reify
37
- if subject.respond_to?(:access) # NOTE: Tasks don't have :access as of yet.
38
- is_private = subject.user_id != user.id && subject.assigned_to != user.id &&
39
- (subject.access == "Private" || (subject.access == "Shared" && !subject.permissions.map(&:user_id).include?(user.id)))
40
- end
41
- end
42
- is_private
43
- end
44
- end
45
-
46
20
  # XLS export. Based on to_xls Rails plugin by Ary Djmal
47
21
  # https://github.com/arydjmal/to_xls
48
22
  #----------------------------------------------------------------------------
@@ -92,4 +66,3 @@ class Array
92
66
  end
93
67
  end
94
68
  end
95
-
@@ -42,6 +42,7 @@ module FatFreeCRM
42
42
  process(uid, email)
43
43
  archive(uid)
44
44
  end
45
+ expunge!
45
46
  ensure
46
47
  log "messages processed: #{@archived + @discarded}, archived: #{@archived}, discarded: #{@discarded}."
47
48
  disconnect!
@@ -121,6 +122,15 @@ module FatFreeCRM
121
122
  end
122
123
  end
123
124
 
125
+ #------------------------------------------------------------------------------
126
+ def expunge!
127
+ if @imap
128
+ # Sends a EXPUNGE command to permanently remove from the currently selected mailbox
129
+ # all messages that have the Deleted flag set.
130
+ @imap.expunge
131
+ end
132
+ end
133
+
124
134
  # Connects to the imap server with the loaded settings
125
135
  #------------------------------------------------------------------------------
126
136
  def connect!(options = {})
@@ -392,7 +402,7 @@ module FatFreeCRM
392
402
  # Notify users with the results of the operations (feedback from dropbox)
393
403
  #--------------------------------------------------------------------------------------
394
404
  def notify(email, mediator_links)
395
- ack_email = Notifier.create_dropbox_ack_notification(@sender, @settings[:address], email, mediator_links)
405
+ ack_email = Notifier.create_dropbox_notification(@sender, @settings[:address], email, mediator_links)
396
406
  Notifier.deliver(ack_email)
397
407
  end
398
408
 
@@ -1,9 +1,27 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  module FatFreeCRM
2
19
  class Engine < ::Rails::Engine
3
- config.autoload_paths += Dir[root.join("app/models/**")]
20
+ config.autoload_paths += Dir[root.join("app/models/**")] +
21
+ Dir[root.join("app/controllers/entities")]
4
22
 
5
23
  config.to_prepare do
6
- ActiveRecord::Base.observers = :activity_observer
24
+ ActiveRecord::Base.observers = :lead_observer, :opportunity_observer, :task_observer
7
25
  end
8
26
  end
9
- end
27
+ end
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  require 'rails/all'
2
19
  require 'jquery-rails'
3
20
  require 'prototype-rails'
@@ -6,6 +23,8 @@ require 'sass'
6
23
  require 'acts_as_commentable'
7
24
  require 'acts_as_list'
8
25
  require 'acts-as-taggable-on'
26
+ require 'responds_to_parent'
27
+ require 'dynamic_form'
9
28
  require 'paperclip'
10
29
  require 'simple_form'
11
30
  require 'will_paginate'
@@ -14,3 +33,10 @@ require 'chosen-rails'
14
33
  require 'ajax-chosen-rails'
15
34
  require 'ransack'
16
35
  require 'paper_trail'
36
+ require 'cancan'
37
+
38
+ # Load redcloth if available (for textile markup in emails)
39
+ begin
40
+ require 'redcloth'
41
+ rescue LoadError
42
+ end
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  require "fat_free_crm/gem_ext/rails/text_helper"
2
19
  require "fat_free_crm/gem_ext/active_record/schema_dumper"
3
20
  require "fat_free_crm/gem_ext/active_support/buffered_logger"
@@ -5,4 +22,4 @@ require "fat_free_crm/gem_ext/active_model/serializers/xml/serializer/attribute"
5
22
  require "fat_free_crm/gem_ext/action_controller/base"
6
23
  require "fat_free_crm/gem_ext/authlogic/session/cookies"
7
24
  require "fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper"
8
- require "fat_free_crm/gem_ext/rake/task" if defined?(Rake)
25
+ require "fat_free_crm/gem_ext/rake/task" if defined?(Rake)
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  #
2
19
  # Override SchemaDumper so that it ignores custom fields when generating db/schema.rb
3
20
  #
@@ -19,4 +36,4 @@ unless ENV['INCLUDE_CUSTOM_FIELDS']
19
36
  alias_method_chain :initialize, :ignored_custom_fields
20
37
  end
21
38
  end
22
- end
39
+ end
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  require 'action_controller'
2
19
  require 'authlogic'
3
20
 
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  # Override engine views so that plugin views have higher priority.
2
19
  Rails::Engine.initializers.detect{|i| i.name == :add_view_paths }.
3
20
  instance_variable_set("@block", Proc.new {
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  module ActionView
2
19
  module Helpers #:nodoc:
3
20
  module TextHelper
@@ -1,3 +1,20 @@
1
+ # Fat Free CRM
2
+ # Copyright (C) 2008-2011 by Michael Dvorkin
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU Affero General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU Affero General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Affero General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ #------------------------------------------------------------------------------
17
+
1
18
  module Rake
2
19
  Task.class_eval do
3
20
  # Removes a Rake task