fat_free_crm 0.11.4 → 0.12.0

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 (451) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +2 -1
  3. data/.travis.yml +10 -17
  4. data/CHANGELOG +57 -4
  5. data/CONTRIBUTORS +6 -4
  6. data/Gemfile +24 -21
  7. data/Gemfile.lock +142 -111
  8. data/Guardfile +11 -31
  9. data/MIT-LICENSE +21 -0
  10. data/README.md +30 -39
  11. data/app/assets/javascripts/admin/fields.js.coffee +5 -18
  12. data/app/assets/javascripts/application.js.erb +3 -14
  13. data/app/assets/javascripts/crm.js +3 -15
  14. data/app/assets/javascripts/crm_chosen.js.coffee +21 -4
  15. data/app/assets/javascripts/crm_classes.js +3 -15
  16. data/app/assets/javascripts/crm_fields.js +3 -15
  17. data/app/assets/javascripts/crm_loginout.js +3 -15
  18. data/app/assets/javascripts/crm_textarea_autocomplete.js +3 -15
  19. data/app/assets/javascripts/datepicker.js.coffee +5 -0
  20. data/app/assets/javascripts/format_buttons.js.coffee +5 -0
  21. data/app/assets/javascripts/groups.js.coffee +5 -0
  22. data/app/assets/javascripts/jquery-noconflict.js +3 -15
  23. data/app/assets/javascripts/lists.js.coffee +6 -0
  24. data/app/assets/javascripts/search.js.coffee +5 -0
  25. data/app/assets/stylesheets/admin/fields.css.scss +10 -0
  26. data/app/assets/stylesheets/advanced_search.css.scss +5 -0
  27. data/app/assets/stylesheets/application.css.erb +3 -14
  28. data/app/assets/stylesheets/base.scss +3 -15
  29. data/app/assets/stylesheets/common.scss +3 -15
  30. data/app/assets/stylesheets/ffcrm_chosen.scss +5 -0
  31. data/app/assets/stylesheets/fields.scss +5 -0
  32. data/app/assets/stylesheets/format_buttons.css.scss +5 -0
  33. data/app/assets/stylesheets/groups.css.scss +5 -0
  34. data/app/assets/stylesheets/header.scss +3 -15
  35. data/app/assets/stylesheets/index_headers.css.scss +5 -0
  36. data/app/assets/stylesheets/lists.css.scss +5 -0
  37. data/app/assets/stylesheets/print.css.scss +3 -15
  38. data/app/assets/stylesheets/rails.scss +4 -16
  39. data/app/assets/stylesheets/safari.scss +3 -15
  40. data/app/assets/stylesheets/textarea_autocomplete.scss +5 -0
  41. data/app/controllers/admin/application_controller.rb +3 -15
  42. data/app/controllers/admin/field_groups_controller.rb +3 -15
  43. data/app/controllers/admin/fields_controller.rb +3 -15
  44. data/app/controllers/admin/groups_controller.rb +3 -15
  45. data/app/controllers/admin/plugins_controller.rb +3 -15
  46. data/app/controllers/admin/settings_controller.rb +3 -15
  47. data/app/controllers/admin/tags_controller.rb +3 -15
  48. data/app/controllers/admin/users_controller.rb +3 -15
  49. data/app/controllers/application_controller.rb +3 -15
  50. data/app/controllers/authentications_controller.rb +3 -15
  51. data/app/controllers/comments_controller.rb +6 -16
  52. data/app/controllers/emails_controller.rb +3 -15
  53. data/app/controllers/entities/accounts_controller.rb +4 -15
  54. data/app/controllers/entities/campaigns_controller.rb +4 -15
  55. data/app/controllers/entities/contacts_controller.rb +4 -15
  56. data/app/controllers/entities/leads_controller.rb +4 -15
  57. data/app/controllers/entities/opportunities_controller.rb +6 -16
  58. data/app/controllers/entities_controller.rb +3 -15
  59. data/app/controllers/home_controller.rb +3 -15
  60. data/app/controllers/lists_controller.rb +3 -15
  61. data/app/controllers/passwords_controller.rb +3 -15
  62. data/app/controllers/tasks_controller.rb +5 -16
  63. data/app/controllers/users_controller.rb +3 -15
  64. data/app/helpers/accounts_helper.rb +7 -17
  65. data/app/helpers/addresses_helper.rb +3 -15
  66. data/app/helpers/admin/application_helper.rb +3 -15
  67. data/app/helpers/admin/field_groups_helper.rb +3 -15
  68. data/app/helpers/admin/fields_helper.rb +3 -15
  69. data/app/helpers/admin/plugins_helper.rb +3 -15
  70. data/app/helpers/admin/settings_helper.rb +3 -15
  71. data/app/helpers/admin/tags_helper.rb +3 -15
  72. data/app/helpers/admin/users_helper.rb +3 -15
  73. data/app/helpers/application_helper.rb +12 -18
  74. data/app/helpers/authentications_helper.rb +3 -15
  75. data/app/helpers/campaigns_helper.rb +3 -15
  76. data/app/helpers/comments_helper.rb +3 -15
  77. data/app/helpers/contacts_helper.rb +3 -15
  78. data/app/helpers/emails_helper.rb +3 -15
  79. data/app/helpers/fields_helper.rb +3 -15
  80. data/app/helpers/groups_helper.rb +5 -0
  81. data/app/helpers/home_helper.rb +3 -15
  82. data/app/helpers/leads_helper.rb +3 -15
  83. data/app/helpers/lists_helper.rb +3 -15
  84. data/app/helpers/opportunities_helper.rb +3 -15
  85. data/app/helpers/passwords_helper.rb +3 -15
  86. data/app/helpers/tags_helper.rb +3 -15
  87. data/app/helpers/tasks_helper.rb +3 -15
  88. data/app/helpers/users_helper.rb +3 -15
  89. data/app/helpers/versions_helper.rb +3 -15
  90. data/app/inputs/{datepair_input.rb → date_pair_input.rb} +10 -21
  91. data/app/inputs/date_time_input.rb +13 -15
  92. data/app/inputs/datetime_pair_input.rb +26 -0
  93. data/app/inputs/text_input.rb +5 -15
  94. data/app/mailers/dropbox_mailer.rb +3 -15
  95. data/app/mailers/subscription_mailer.rb +9 -16
  96. data/app/mailers/user_mailer.rb +3 -15
  97. data/app/models/entities/account.rb +7 -17
  98. data/app/models/entities/account_contact.rb +6 -17
  99. data/app/models/entities/account_opportunity.rb +5 -15
  100. data/app/models/entities/campaign.rb +5 -15
  101. data/app/models/entities/contact.rb +15 -25
  102. data/app/models/entities/contact_opportunity.rb +5 -15
  103. data/app/models/entities/lead.rb +6 -16
  104. data/app/models/entities/opportunity.rb +6 -16
  105. data/app/models/fields/core_field.rb +5 -16
  106. data/app/models/fields/custom_field.rb +6 -16
  107. data/app/models/fields/custom_field_date_pair.rb +6 -21
  108. data/app/models/fields/custom_field_datetime_pair.rb +5 -19
  109. data/app/models/fields/custom_field_pair.rb +6 -16
  110. data/app/models/fields/field.rb +6 -17
  111. data/app/models/fields/field_group.rb +7 -17
  112. data/app/models/list.rb +4 -15
  113. data/app/models/observers/entity_observer.rb +5 -0
  114. data/app/models/observers/lead_observer.rb +3 -15
  115. data/app/models/observers/opportunity_observer.rb +3 -15
  116. data/app/models/observers/task_observer.rb +3 -15
  117. data/app/models/polymorphic/address.rb +5 -16
  118. data/app/models/polymorphic/avatar.rb +5 -16
  119. data/app/models/polymorphic/comment.rb +5 -15
  120. data/app/models/polymorphic/email.rb +5 -15
  121. data/app/models/polymorphic/tag.rb +6 -16
  122. data/app/models/polymorphic/tagging.rb +4 -15
  123. data/app/models/polymorphic/task.rb +6 -16
  124. data/app/models/setting.rb +5 -23
  125. data/app/models/users/ability.rb +9 -2
  126. data/app/models/users/authentication.rb +5 -16
  127. data/app/models/users/group.rb +7 -0
  128. data/app/models/users/permission.rb +5 -16
  129. data/app/models/users/preference.rb +4 -15
  130. data/app/models/users/user.rb +10 -19
  131. data/app/views/admin/fields/index.html.haml +2 -0
  132. data/app/views/comments/_edit.html.haml +0 -1
  133. data/app/views/comments/_new.html.haml +0 -1
  134. data/app/views/contacts/_contacts.html.haml +1 -1
  135. data/app/views/contacts/_sidebar_show.html.haml +19 -0
  136. data/app/views/contacts/_top_section.html.haml +3 -2
  137. data/app/views/entities/_search.html.haml +4 -3
  138. data/app/views/entities/contacts.js.rjs +1 -1
  139. data/app/views/entities/leads.js.rjs +1 -1
  140. data/app/views/entities/opportunities.js.rjs +1 -1
  141. data/app/views/fields/_edit_custom_field_group.html.haml +1 -1
  142. data/app/views/home/_task.html.haml +3 -1
  143. data/app/views/layouts/_footer.html.haml +1 -1
  144. data/app/views/leads/_leads.html.haml +1 -1
  145. data/app/views/leads/_sidebar_show.html.haml +7 -0
  146. data/app/views/leads/_top_section.html.haml +3 -2
  147. data/app/views/lists/_sidebar.html.haml +5 -5
  148. data/app/views/opportunities/_opportunities.html.haml +1 -1
  149. data/app/views/versions/_versions.html.haml +1 -1
  150. data/config/application.rb +11 -3
  151. data/config/boot.rb +5 -1
  152. data/config/deploy.example.rb +5 -0
  153. data/config/environment.rb +5 -0
  154. data/config/environments/development.rb +5 -0
  155. data/config/environments/production.rb +5 -0
  156. data/config/environments/staging.rb +5 -0
  157. data/config/environments/test.rb +6 -1
  158. data/config/initializers/action_mailer.rb +5 -0
  159. data/config/initializers/authlogic.rb +5 -0
  160. data/config/initializers/constants.rb +5 -0
  161. data/config/initializers/gravatar.rb +5 -0
  162. data/config/initializers/locale.rb +3 -15
  163. data/config/initializers/mime_types.rb +5 -0
  164. data/config/initializers/paginate_arrays.rb +5 -0
  165. data/config/initializers/paper_trail.rb +5 -0
  166. data/config/initializers/ransack.rb +6 -1
  167. data/config/initializers/relative_url_root.rb +3 -15
  168. data/config/initializers/sass.rb +5 -0
  169. data/config/initializers/secret_token.rb +6 -1
  170. data/config/initializers/simple_form.rb +5 -0
  171. data/config/initializers/views.rb +5 -0
  172. data/config/locales/de_fat_free_crm.yml +125 -7
  173. data/config/locales/en-US_fat_free_crm.yml +7 -2
  174. data/config/locales/th.rb +5 -0
  175. data/config/routes.rb +5 -0
  176. data/config/settings.default.yml +10 -18
  177. data/config/unicorn.rb +5 -0
  178. data/fat_free_crm.gemspec +6 -4
  179. data/lib/development_tasks/gem.rake +3 -15
  180. data/lib/development_tasks/license.rake +12 -32
  181. data/lib/development_tasks/rdoc.rake +3 -15
  182. data/lib/development_tasks/rspec.rake +3 -15
  183. data/lib/fat_free_crm.rb +6 -16
  184. data/lib/fat_free_crm/callback.rb +3 -15
  185. data/lib/fat_free_crm/comment_extensions.rb +5 -0
  186. data/lib/fat_free_crm/core_ext.rb +3 -15
  187. data/lib/fat_free_crm/core_ext/nil.rb +3 -15
  188. data/lib/fat_free_crm/core_ext/string.rb +3 -15
  189. data/lib/fat_free_crm/custom_fields.rb +12 -0
  190. data/lib/fat_free_crm/engine.rb +3 -15
  191. data/lib/fat_free_crm/errors.rb +3 -15
  192. data/lib/fat_free_crm/exceptions.rb +3 -15
  193. data/lib/fat_free_crm/export_csv.rb +35 -0
  194. data/lib/fat_free_crm/exportable.rb +3 -15
  195. data/lib/fat_free_crm/fields.rb +5 -17
  196. data/lib/fat_free_crm/gem_dependencies.rb +3 -15
  197. data/lib/fat_free_crm/gem_ext.rb +3 -15
  198. data/lib/fat_free_crm/gem_ext/action_controller/base.rb +3 -15
  199. data/lib/fat_free_crm/gem_ext/active_model/serializers/xml/serializer/attribute.rb +3 -15
  200. data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +3 -15
  201. data/lib/fat_free_crm/gem_ext/active_support/buffered_logger.rb +3 -15
  202. data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +3 -15
  203. data/lib/fat_free_crm/gem_ext/rails/engine.rb +3 -15
  204. data/lib/fat_free_crm/gem_ext/rails/text_helper.rb +3 -15
  205. data/lib/fat_free_crm/gem_ext/rake/task.rb +3 -15
  206. data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +3 -15
  207. data/lib/fat_free_crm/i18n.rb +3 -15
  208. data/lib/fat_free_crm/load_settings.rb +20 -0
  209. data/lib/fat_free_crm/mail_processor/base.rb +20 -18
  210. data/lib/fat_free_crm/mail_processor/comment_replies.rb +3 -15
  211. data/lib/fat_free_crm/mail_processor/dropbox.rb +4 -16
  212. data/lib/fat_free_crm/permissions.rb +3 -15
  213. data/lib/fat_free_crm/plugin.rb +3 -15
  214. data/lib/fat_free_crm/plugin_dependencies.rb +3 -15
  215. data/lib/fat_free_crm/renderers.rb +6 -25
  216. data/lib/fat_free_crm/sortable.rb +3 -15
  217. data/lib/fat_free_crm/tabs.rb +3 -15
  218. data/lib/fat_free_crm/version.rb +5 -17
  219. data/lib/fat_free_crm/view_factory.rb +3 -15
  220. data/lib/missing_translation_detector.rb +50 -0
  221. data/lib/tasks/db/migrate.rake +3 -15
  222. data/lib/tasks/db/schema.rake +3 -15
  223. data/lib/tasks/ffcrm/comment_replies.rake +3 -15
  224. data/lib/tasks/ffcrm/config.rake +28 -16
  225. data/lib/tasks/ffcrm/demo.rake +3 -15
  226. data/lib/tasks/ffcrm/dropbox.rake +3 -15
  227. data/lib/tasks/ffcrm/missing_translations.rake +33 -0
  228. data/lib/tasks/ffcrm/settings.rake +3 -15
  229. data/lib/tasks/ffcrm/setup.rake +15 -24
  230. data/lib/tasks/ffcrm/update_data.rake +3 -15
  231. data/spec/controllers/admin/groups_controller_spec.rb +5 -0
  232. data/spec/controllers/admin/users_controller_spec.rb +5 -0
  233. data/spec/controllers/applications_controller_spec.rb +5 -0
  234. data/spec/controllers/authentications_controller_spec.rb +5 -0
  235. data/spec/controllers/comments_controller_spec.rb +5 -0
  236. data/spec/controllers/emails_controller_spec.rb +5 -0
  237. data/spec/controllers/entities/accounts_controller_spec.rb +5 -0
  238. data/spec/controllers/entities/campaigns_controller_spec.rb +5 -0
  239. data/spec/controllers/entities/contacts_controller_spec.rb +5 -0
  240. data/spec/controllers/entities/leads_controller_spec.rb +5 -0
  241. data/spec/controllers/entities/opportunities_controller_spec.rb +5 -0
  242. data/spec/controllers/entities_controller_spec.rb +5 -0
  243. data/spec/controllers/home_controller_spec.rb +5 -0
  244. data/spec/controllers/lists_controller_spec.rb +5 -0
  245. data/spec/controllers/passwords_controller_spec.rb +5 -0
  246. data/spec/controllers/tasks_controller_spec.rb +7 -6
  247. data/spec/controllers/users_controller_spec.rb +5 -0
  248. data/spec/factories/account_factories.rb +5 -0
  249. data/spec/factories/campaign_factories.rb +6 -1
  250. data/spec/factories/contact_factories.rb +6 -1
  251. data/spec/factories/field_factories.rb +6 -1
  252. data/spec/factories/lead_factories.rb +6 -1
  253. data/spec/factories/list_factories.rb +6 -1
  254. data/spec/factories/opportunity_factories.rb +16 -5
  255. data/spec/factories/sequences.rb +7 -1
  256. data/spec/factories/setting_factories.rb +6 -1
  257. data/spec/factories/shared_factories.rb +5 -0
  258. data/spec/factories/subscription_factories.rb +5 -0
  259. data/spec/factories/tag_factories.rb +6 -1
  260. data/spec/factories/task_factories.rb +6 -1
  261. data/spec/factories/user_factories.rb +5 -0
  262. data/spec/features/acceptance_helper.rb +9 -0
  263. data/spec/{acceptance → features}/accounts_spec.rb +14 -9
  264. data/spec/{acceptance → features}/admin/groups_spec.rb +5 -0
  265. data/spec/{acceptance → features}/admin/users_spec.rb +9 -4
  266. data/spec/{acceptance → features}/campaigns_spec.rb +14 -16
  267. data/spec/{acceptance → features}/contacts_spec.rb +13 -16
  268. data/spec/{acceptance → features}/dashboard_spec.rb +5 -0
  269. data/spec/{acceptance → features}/leads_spec.rb +11 -12
  270. data/spec/{acceptance → features}/opportunities_overview_spec.rb +5 -0
  271. data/spec/{acceptance → features}/opportunities_spec.rb +14 -16
  272. data/spec/features/support/browser.rb +18 -0
  273. data/spec/{acceptance → features}/support/headless.rb +5 -3
  274. data/spec/{acceptance → features}/support/helpers.rb +6 -1
  275. data/spec/features/support/maintain_sessions.rb +10 -0
  276. data/spec/{acceptance → features}/support/paths.rb +9 -4
  277. data/spec/{acceptance → features}/support/selector_helpers.rb +6 -1
  278. data/spec/{acceptance → features}/tasks_spec.rb +7 -5
  279. data/spec/helpers/accounts_helper_spec.rb +5 -0
  280. data/spec/helpers/admin/field_groups_helper_spec.rb +5 -0
  281. data/spec/helpers/admin/plugins_helper_spec.rb +5 -0
  282. data/spec/helpers/admin/settings_helper_spec.rb +5 -0
  283. data/spec/helpers/admin/users_helper_spec.rb +5 -0
  284. data/spec/helpers/application_helper_spec.rb +5 -0
  285. data/spec/helpers/authentications_helper_spec.rb +5 -0
  286. data/spec/helpers/campaigns_helper_spec.rb +5 -0
  287. data/spec/helpers/comments_helper_spec.rb +5 -0
  288. data/spec/helpers/contacts_helper_spec.rb +5 -0
  289. data/spec/helpers/emails_helper_spec.rb +5 -0
  290. data/spec/helpers/fields_helper_spec.rb +5 -0
  291. data/spec/helpers/groups_helper_spec.rb +6 -1
  292. data/spec/helpers/home_helper_spec.rb +5 -0
  293. data/spec/helpers/leads_helper_spec.rb +5 -0
  294. data/spec/helpers/lists_helper_spec.rb +6 -1
  295. data/spec/helpers/opportunities_helper_spec.rb +5 -0
  296. data/spec/helpers/passwords_helper_spec.rb +5 -0
  297. data/spec/helpers/tasks_helper_spec.rb +5 -0
  298. data/spec/helpers/users_helper_spec.rb +5 -0
  299. data/spec/lib/comment_extensions_spec.rb +5 -0
  300. data/spec/lib/core_ext/string_spec.rb +5 -0
  301. data/spec/lib/errors_spec.rb +5 -0
  302. data/spec/lib/fields_spec.rb +5 -0
  303. data/spec/lib/mail_processor/base_spec.rb +5 -0
  304. data/spec/lib/mail_processor/comment_replies_spec.rb +5 -0
  305. data/spec/lib/mail_processor/dropbox_spec.rb +5 -0
  306. data/spec/lib/mail_processor/sample_emails/dropbox.rb +5 -0
  307. data/spec/lib/permissions_spec.rb +5 -0
  308. data/spec/lib/view_factory_spec.rb +5 -0
  309. data/spec/mailers/subscription_mailer_spec.rb +19 -1
  310. data/spec/mailers/user_mailer_spec.rb +6 -1
  311. data/spec/models/entities/account_contact_spec.rb +5 -0
  312. data/spec/models/entities/account_opportunity_spec.rb +5 -0
  313. data/spec/models/entities/account_spec.rb +6 -1
  314. data/spec/models/entities/campaign_spec.rb +5 -0
  315. data/spec/models/entities/contact_opportunity_spec.rb +5 -0
  316. data/spec/models/entities/contact_spec.rb +5 -0
  317. data/spec/models/entities/lead_spec.rb +5 -0
  318. data/spec/models/entities/opportunity_spec.rb +15 -2
  319. data/spec/models/fields/custom_field_date_pair_spec.rb +3 -15
  320. data/spec/models/fields/custom_field_pair_spec.rb +3 -15
  321. data/spec/models/fields/custom_field_spec.rb +5 -0
  322. data/spec/models/fields/field_group_spec.rb +5 -0
  323. data/spec/models/fields/field_spec.rb +5 -0
  324. data/spec/models/list_spec.rb +5 -0
  325. data/spec/models/observers/entity_observer_spec.rb +5 -0
  326. data/spec/models/polymorphic/address_spec.rb +5 -0
  327. data/spec/models/polymorphic/avatar_spec.rb +5 -0
  328. data/spec/models/polymorphic/comment_spec.rb +5 -0
  329. data/spec/models/polymorphic/email_spec.rb +5 -0
  330. data/spec/models/polymorphic/task_spec.rb +5 -0
  331. data/spec/models/polymorphic/version_spec.rb +26 -22
  332. data/spec/models/setting_spec.rb +5 -0
  333. data/spec/models/users/authentication_spec.rb +5 -0
  334. data/spec/models/users/group_spec.rb +6 -1
  335. data/spec/models/users/permission_spec.rb +5 -0
  336. data/spec/models/users/preference_spec.rb +5 -0
  337. data/spec/models/users/user_spec.rb +6 -1
  338. data/spec/routing/accounts_routing_spec.rb +5 -0
  339. data/spec/routing/admin/users_routing_spec.rb +5 -0
  340. data/spec/routing/campaigns_routing_spec.rb +5 -0
  341. data/spec/routing/comments_routing_spec.rb +5 -0
  342. data/spec/routing/contacts_routing_spec.rb +5 -0
  343. data/spec/routing/emails_routing_spec.rb +5 -0
  344. data/spec/routing/leads_routing_spec.rb +5 -0
  345. data/spec/routing/opportunities_routing_spec.rb +5 -0
  346. data/spec/routing/tasks_routing_spec.rb +5 -0
  347. data/spec/routing/users_routing_spec.rb +5 -0
  348. data/spec/shared/controllers.rb +8 -3
  349. data/spec/shared/models.rb +110 -105
  350. data/spec/spec_helper.rb +40 -22
  351. data/spec/support/assert_select.rb +5 -0
  352. data/spec/support/auth_macros.rb +5 -0
  353. data/spec/support/macros.rb +5 -0
  354. data/spec/support/mail_processor_mocks.rb +5 -0
  355. data/spec/support/rjs_support.rb +6 -1
  356. data/spec/support/uploaded_file.rb +5 -0
  357. data/spec/views/accounts/_edit.haml_spec.rb +5 -0
  358. data/spec/views/accounts/_new.haml_spec.rb +5 -0
  359. data/spec/views/accounts/create.rjs_spec.rb +5 -0
  360. data/spec/views/accounts/destroy.rjs_spec.rb +5 -0
  361. data/spec/views/accounts/edit.rjs_spec.rb +5 -0
  362. data/spec/views/accounts/index.haml_spec.rb +5 -0
  363. data/spec/views/accounts/index.rjs_spec.rb +5 -0
  364. data/spec/views/accounts/new.rjs_spec.rb +5 -0
  365. data/spec/views/accounts/show.haml_spec.rb +5 -0
  366. data/spec/views/accounts/update.rjs_spec.rb +5 -0
  367. data/spec/views/admin/users/_create.haml_spec.rb +5 -0
  368. data/spec/views/admin/users/create.rjs_spec.rb +5 -0
  369. data/spec/views/admin/users/destroy.rjs_spec.rb +5 -0
  370. data/spec/views/admin/users/edit.rjs_spec.rb +5 -0
  371. data/spec/views/admin/users/index.haml_spec.rb +5 -0
  372. data/spec/views/admin/users/index.rjs_spec.rb +5 -0
  373. data/spec/views/admin/users/new.rjs_spec.rb +5 -0
  374. data/spec/views/admin/users/reactivate.rjs_spec.rb +5 -0
  375. data/spec/views/admin/users/show.haml_spec.rb +5 -0
  376. data/spec/views/admin/users/suspend.rjs_spec.rb +5 -0
  377. data/spec/views/admin/users/update.rjs_spec.rb +5 -0
  378. data/spec/views/application/auto_complete.haml_spec.rb +5 -0
  379. data/spec/views/authentications/new.haml_spec.rb +5 -0
  380. data/spec/views/campaigns/_edit.haml_spec.rb +8 -2
  381. data/spec/views/campaigns/_new.haml_spec.rb +5 -0
  382. data/spec/views/campaigns/create.rjs_spec.rb +5 -0
  383. data/spec/views/campaigns/destroy.rjs_spec.rb +5 -0
  384. data/spec/views/campaigns/edit.rjs_spec.rb +5 -0
  385. data/spec/views/campaigns/index.haml_spec.rb +5 -0
  386. data/spec/views/campaigns/index.rjs_spec.rb +5 -0
  387. data/spec/views/campaigns/new.rjs_spec.rb +5 -0
  388. data/spec/views/campaigns/show.haml_spec.rb +5 -0
  389. data/spec/views/campaigns/update.rjs_spec.rb +5 -0
  390. data/spec/views/comments/new.rjs_spec.rb +5 -0
  391. data/spec/views/contacts/_edit.haml_spec.rb +5 -0
  392. data/spec/views/contacts/_new.haml_spec.rb +5 -0
  393. data/spec/views/contacts/create.rjs_spec.rb +5 -0
  394. data/spec/views/contacts/destroy.rjs_spec.rb +5 -0
  395. data/spec/views/contacts/edit.rjs_spec.rb +5 -0
  396. data/spec/views/contacts/index.haml_spec.rb +5 -0
  397. data/spec/views/contacts/index.rjs_spec.rb +5 -0
  398. data/spec/views/contacts/new.rjs_spec.rb +5 -0
  399. data/spec/views/contacts/show.haml_spec.rb +5 -0
  400. data/spec/views/contacts/update.rjs_spec.rb +5 -0
  401. data/spec/views/home/index.haml_spec.rb +5 -0
  402. data/spec/views/home/index.rjs_spec.rb +5 -0
  403. data/spec/views/home/options.rjs_spec.rb +5 -0
  404. data/spec/views/leads/_convert.haml_spec.rb +5 -0
  405. data/spec/views/leads/_edit.haml_spec.rb +5 -0
  406. data/spec/views/leads/_new.haml_spec.rb +5 -0
  407. data/spec/views/leads/_sidebar_show.haml_spec.rb +5 -0
  408. data/spec/views/leads/convert.rjs_spec.rb +5 -0
  409. data/spec/views/leads/create.rjs_spec.rb +5 -0
  410. data/spec/views/leads/destroy.rjs_spec.rb +5 -0
  411. data/spec/views/leads/edit.rjs_spec.rb +5 -0
  412. data/spec/views/leads/index.haml_spec.rb +5 -0
  413. data/spec/views/leads/index.rjs_spec.rb +5 -0
  414. data/spec/views/leads/new.rjs_spec.rb +5 -0
  415. data/spec/views/leads/promote.rjs_spec.rb +5 -0
  416. data/spec/views/leads/reject.rjs_spec.rb +5 -0
  417. data/spec/views/leads/show.haml_spec.rb +5 -0
  418. data/spec/views/leads/update.rjs_spec.rb +5 -0
  419. data/spec/views/opportunities/_edit.haml_spec.rb +5 -0
  420. data/spec/views/opportunities/_new.haml_spec.rb +5 -0
  421. data/spec/views/opportunities/create.rjs_spec.rb +5 -0
  422. data/spec/views/opportunities/destroy.rjs_spec.rb +5 -0
  423. data/spec/views/opportunities/edit.rjs_spec.rb +5 -0
  424. data/spec/views/opportunities/index.haml_spec.rb +5 -0
  425. data/spec/views/opportunities/index.rjs_spec.rb +5 -0
  426. data/spec/views/opportunities/new.rjs_spec.rb +5 -0
  427. data/spec/views/opportunities/show.haml_spec.rb +5 -0
  428. data/spec/views/opportunities/update.rjs_spec.rb +5 -0
  429. data/spec/views/tasks/_edit.haml_spec.rb +5 -0
  430. data/spec/views/tasks/complete.rjs_spec.rb +5 -0
  431. data/spec/views/tasks/create.rjs_spec.rb +5 -0
  432. data/spec/views/tasks/destroy.rjs_spec.rb +5 -0
  433. data/spec/views/tasks/edit.rjs_spec.rb +5 -0
  434. data/spec/views/tasks/index.haml_spec.rb +5 -0
  435. data/spec/views/tasks/new.rjs_spec.rb +5 -0
  436. data/spec/views/tasks/update.rjs_spec.rb +5 -0
  437. data/spec/views/users/avatar.rjs_spec.rb +5 -0
  438. data/spec/views/users/change_password.rjs_spec.rb +5 -0
  439. data/spec/views/users/edit.rjs_spec.rb +5 -0
  440. data/spec/views/users/password.rjs_spec.rb +5 -0
  441. data/spec/views/users/update.rjs_spec.rb +5 -0
  442. data/spec/views/users/upload_avatar.rjs_spec.rb +5 -0
  443. metadata +45 -101
  444. data/LICENSE +0 -620
  445. data/app/inputs/datetimepair_input.rb +0 -37
  446. data/config/initializers/custom_fields.rb +0 -21
  447. data/lib/fat_free_crm/core_ext/array.rb +0 -75
  448. data/lib/fat_free_crm/syck_yaml.rb +0 -21
  449. data/spec/acceptance/acceptance_helper.rb +0 -8
  450. data/spec/acceptance/support/browser.rb +0 -13
  451. data/spec/acceptance/support/maintain_sessions.rb +0 -5
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  class Tag < ActsAsTaggableOn::Tag
19
7
  before_destroy :no_associated_field_groups
20
8
 
@@ -22,10 +10,12 @@ class Tag < ActsAsTaggableOn::Tag
22
10
  def no_associated_field_groups
23
11
  FieldGroup.find_all_by_tag_id(self).none?
24
12
  end
25
-
13
+
26
14
  # Returns a count of taggings per model klass
27
15
  # e.g. {"Contact" => 3, "Account" => 1}
28
16
  def model_tagging_counts
29
17
  Tagging.where(:tag_id => id).count(:group => :taggable_type)
30
18
  end
19
+
20
+ ActiveSupport.run_load_hooks(:fat_free_crm_tag, self)
31
21
  end
@@ -1,19 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  class Tagging < ActsAsTaggableOn::Tagging
7
+ ActiveSupport.run_load_hooks(:fat_free_crm_tagging, self)
19
8
  end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  # == Schema Information
19
7
  #
20
8
  # Table name: tasks
@@ -244,11 +232,13 @@ class Task < ActiveRecord::Base
244
232
  rescue ArgumentError
245
233
  errors.add(:calendar, :invalid_date)
246
234
  end
247
-
235
+
248
236
  #----------------------------------------------------------------------------
249
237
  def parse_calendar_date
250
238
  # always in 2012-10-28 06:28 format regardless of language
251
239
  Time.parse(self.calendar)
252
240
  end
253
241
 
242
+ ActiveSupport.run_load_hooks(:fat_free_crm_task, self)
243
+
254
244
  end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  # == Schema Information
19
7
  #
20
8
  # Table name: settings
@@ -114,6 +102,7 @@ class Setting < ActiveRecord::Base
114
102
  # Loads settings from YAML files
115
103
  def load_settings_from_yaml(file)
116
104
  begin
105
+ YAML::ENGINE.yamler = 'syck' # remove this when files are converted to Psych
117
106
  settings = YAML.load_file(file)
118
107
  # Merge settings into current settings hash (recursively)
119
108
  @@yaml_settings.deep_merge!(settings)
@@ -123,13 +112,6 @@ class Setting < ActiveRecord::Base
123
112
  yaml_settings
124
113
  end
125
114
  end
126
- end
127
-
128
115
 
129
- # Load default settings, then override with custom settings, if present.
130
- setting_files = [FatFreeCRM.root.join("config", "settings.default.yml")]
131
- # Don't override default settings in test environment
132
- setting_files << Rails.root.join("config", "settings.yml") unless Rails.env == 'test'
133
- setting_files.each do |settings_file|
134
- Setting.load_settings_from_yaml(settings_file) if File.exist?(settings_file)
116
+ ActiveSupport.run_load_hooks(:fat_free_crm_setting, self)
135
117
  end
@@ -1,3 +1,8 @@
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
2
+ #
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
+ #------------------------------------------------------------------------------
1
6
  # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
2
7
 
3
8
  class Ability
@@ -12,7 +17,7 @@ class Ability
12
17
  can :manage, entities, :access => 'Public'
13
18
  can :manage, entities + [Task], :user_id => user.id
14
19
  can :manage, entities + [Task], :assigned_to => user.id
15
-
20
+
16
21
  #
17
22
  # Due to an obscure bug (see https://github.com/ryanb/cancan/issues/213)
18
23
  # we must switch on user.admin? here to avoid the nil constraints which
@@ -35,7 +40,9 @@ class Ability
35
40
  end
36
41
  end
37
42
  end # if user.admin?
38
-
43
+
39
44
  end
40
45
  end
46
+
47
+ ActiveSupport.run_load_hooks(:fat_free_crm_ability, self)
41
48
  end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  class Authentication < Authlogic::Session::Base # NOTE: This is not ActiveRecord model.
19
7
  authenticate_with User
20
8
  after_save :check_if_suspended
@@ -60,5 +48,6 @@ class Authentication < Authlogic::Session::Base # NOTE: This is not ActiveRecord
60
48
  def check_if_suspended
61
49
  self.errors.add(:base, I18n.t(:msg_account_suspended)) if self.user.suspended?
62
50
  end
63
- end
64
51
 
52
+ ActiveSupport.run_load_hooks(:fat_free_crm_authentication, self)
53
+ end
@@ -1,3 +1,8 @@
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
2
+ #
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
+ #------------------------------------------------------------------------------
1
6
  class Group < ActiveRecord::Base
2
7
  has_and_belongs_to_many :users
3
8
  has_many :permissions
@@ -10,4 +15,6 @@ class Group < ActiveRecord::Base
10
15
  def user_ids=(value)
11
16
  super value.join.split(',')
12
17
  end
18
+
19
+ ActiveSupport.run_load_hooks(:fat_free_crm_group, self)
13
20
  end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  # == Schema Information
19
7
  #
20
8
  # Table name: permissions
@@ -34,5 +22,6 @@ class Permission < ActiveRecord::Base
34
22
 
35
23
  validates_presence_of :user_id, :unless => :group_id?
36
24
  validates_presence_of :group_id, :unless => :user_id?
37
- end
38
25
 
26
+ ActiveSupport.run_load_hooks(:fat_free_crm_permission, self)
27
+ end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  # == Schema Information
19
7
  #
20
8
  # Table name: preferences
@@ -58,4 +46,5 @@ class Preference < ActiveRecord::Base
58
46
  @cached_prefs ||= {}
59
47
  end
60
48
 
49
+ ActiveSupport.run_load_hooks(:fat_free_crm_preference, self)
61
50
  end
@@ -1,20 +1,8 @@
1
- # Fat Free CRM
2
- # Copyright (C) 2008-2011 by Michael Dvorkin
1
+ # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
3
2
  #
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/>.
3
+ # Fat Free CRM is freely distributable under the terms of MIT license.
4
+ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
16
5
  #------------------------------------------------------------------------------
17
-
18
6
  # == Schema Information
19
7
  #
20
8
  # Table name: users
@@ -59,7 +47,7 @@ class User < ActiveRecord::Base
59
47
 
60
48
  has_one :avatar, :as => :entity, :dependent => :destroy # Personal avatar.
61
49
  has_many :avatars # As owner who uploaded it, ex. Contact avatar.
62
- has_many :comments, :as => :commentable # As owner who crated a comment.
50
+ has_many :comments, :as => :commentable # As owner who created a comment.
63
51
  has_many :accounts
64
52
  has_many :campaigns
65
53
  has_many :leads
@@ -87,7 +75,8 @@ class User < ActiveRecord::Base
87
75
  }
88
76
 
89
77
  scope :have_assigned_opportunities, joins("INNER JOIN opportunities ON users.id = opportunities.assigned_to").
90
- where("opportunities.stage <> 'lost' AND opportunities.stage <> 'won'")
78
+ where("opportunities.stage <> 'lost' AND opportunities.stage <> 'won'").
79
+ select('DISTINCT(users.id), users.*')
91
80
 
92
81
  acts_as_authentic do |c|
93
82
  c.session_class = Authentication
@@ -150,7 +139,7 @@ class User < ActiveRecord::Base
150
139
  self.single_access_token ||= update_attribute(:single_access_token, Authlogic::Random.friendly_token)
151
140
  end
152
141
 
153
- # Massage value when using Chosen select box which gives values like ["", "1,2,3"]
142
+ # Massage value when using Chosen select box which gives values like ["", "1,2,3"]
154
143
  #----------------------------------------------------------------------------
155
144
  def group_ids=(value)
156
145
  value = value.join.split(',').map(&:to_i) if value.map{|v| v.to_s.include?(',')}.any?
@@ -191,5 +180,7 @@ class User < ActiveRecord::Base
191
180
  end
192
181
 
193
182
  end
194
-
183
+
184
+ ActiveSupport.run_load_hooks(:fat_free_crm_user, self)
185
+
195
186
  end
@@ -6,6 +6,8 @@
6
6
 
7
7
  .info= t(:admin_fields_info).html_safe
8
8
 
9
+ .info2= t(:admin_fields_info2)
10
+
9
11
  .inline_tabs
10
12
  %ul
11
13
  - list_of_entities.each do |entity|
@@ -2,7 +2,6 @@
2
2
  .comment{:style => "margin: 5px 0px 0px 0px"}
3
3
  = link_to avatar_for(current_user, :size => :small), user_path(current_user)
4
4
  = form_for(@comment, :remote => true) do |f|
5
- = hidden_field_tag "comment[user_id]", @comment.user_id || current_user.id
6
5
  = hidden_field_tag "comment[commentable_id]", commentable.id
7
6
  = hidden_field_tag "comment[commentable_type]", class_name.classify
8
7
  = f.text_area :comment, :id => dom_id(@comment, :text)
@@ -19,7 +19,6 @@
19
19
 
20
20
  %div{ {:id => "#{id_prefix}_post"}.merge(hidden_if(true))}
21
21
  = form_for(@comment, :remote => true, :html => {:id => "#{id_prefix}_new_comment"}) do |f|
22
- = hidden_field_tag "comment[user_id]", current_user.id, :id => "#{id_prefix}_comment_user_id"
23
22
  = hidden_field_tag "comment[commentable_id]", commentable.id, :id => "#{id_prefix}_comment_commentable_id"
24
23
  = hidden_field_tag "comment[commentable_type]", class_name.classify, :id => "#{id_prefix}_comment_commentable_type"
25
24
  = f.text_area :comment, :id => "#{id_prefix}_comment_comment"
@@ -1,7 +1,7 @@
1
1
 
2
2
  = section(object, :contacts)
3
3
  .list#contacts
4
- - contacts = object.contacts.paginate(:page => 1, :per_page => 20)
4
+ - contacts = object.contacts.order('updated_at desc').paginate(:page => 1, :per_page => 20)
5
5
  = render :partial => "contacts/contact", :collection => contacts
6
6
 
7
7
  = will_paginate contacts, :id => 'contacts_pagination', :params => {:action => :contacts}
@@ -20,6 +20,25 @@
20
20
 
21
21
  = web_presence_icons(@contact)
22
22
 
23
+ .caption #{t :contact_summary}
24
+ %li
25
+ %dt= @contact.assigned_to ? truncate(@contact.assignee.full_name, :length => 16) : nil
26
+ %tt #{t :assigned_to}:
27
+ %li
28
+ %dt
29
+ - if @contact.lead
30
+ = link_to(truncate(@contact.lead.name, :length => 16), @contact.lead, :title => @contact.lead.name)
31
+ - else
32
+ #{t :n_a}
33
+ %tt #{t :lead}:
34
+ %li
35
+ %dt
36
+ - if @contact.lead.try(:campaign)
37
+ = link_to(truncate(@contact.lead.campaign.name, :length => 16), @contact.lead.campaign, :title => @contact.lead.campaign.name)
38
+ - else
39
+ #{t :n_a}
40
+ %tt #{t :campaign}:
41
+
23
42
  - unless @contact.background_info.blank?
24
43
  .caption #{t :background_info}
25
44
  = auto_link(simple_format @contact.background_info).html_safe
@@ -1,13 +1,14 @@
1
+
1
2
  = hook(:contact_top_section, self, :f => f) do
2
3
  .section
3
4
  %table
4
5
  %tr
5
6
  %td
6
- .label.top.req #{t :first_name}:
7
+ .label.top.req{ :class => "#{Setting.require_first_names ? 'req' : nil}" } #{t :first_name}:
7
8
  = f.text_field :first_name
8
9
  %td= spacer
9
10
  %td
10
- .label.top{ :class => "#{Setting.require_last_names ? 'req' : ''}" } #{t :last_name}:
11
+ .label.top{ :class => "#{Setting.require_last_names ? 'req' : nil}" } #{t :last_name}:
11
12
  = f.text_field :last_name
12
13
  %tr
13
14
  %td
@@ -2,11 +2,12 @@
2
2
  .tabs
3
3
  %ul
4
4
  %li
5
- = link_to 'Basic Search', '#', :"data-search-form" => "basic_search", :class => (params[:q] ? "" : " active")
5
+ = link_to t('basic_search'), '#', :"data-search-form" => "basic_search", :class => (params[:q] ? "" : " active")
6
6
  %li
7
- = link_to 'Advanced Search', '#', :"data-search-form" => "advanced_search", :class => (!params[:q] ? "" : " active")
8
-
7
+ = link_to t('advanced_search'), '#', :"data-search-form" => "advanced_search", :class => (!params[:q] ? "" : " active")
8
+
9
9
  #search_results_count
10
+ = t('search_results_count', :count => @search_results_count)
10
11
 
11
12
  .search_form#basic_search{ :style => (params[:q] ? 'display: none;' : '') }
12
13
  = render "basic_search"
@@ -1,3 +1,3 @@
1
- contacts = entity.contacts.paginate(:page => params[:page], :per_page => 20)
1
+ contacts = entity.contacts.order('updated_at DESC').paginate(:page => params[:page], :per_page => 20)
2
2
  page['contacts'].replace_html :partial => 'contacts/contact', :collection => contacts
3
3
  page['contacts_pagination'].replace_html will_paginate(contacts, :container => false, :params => {:action => :contacts})