fat_free_crm 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +5 -13
- data/.travis.yml +3 -3
- data/Gemfile +5 -2
- data/Gemfile.lock +137 -119
- data/MIT-LICENSE +1 -1
- data/README.md +5 -3
- data/app/assets/javascripts/admin/fields.js.coffee +31 -8
- data/app/assets/javascripts/application.js.erb +6 -10
- data/app/assets/javascripts/crm.js.coffee +426 -0
- data/app/assets/javascripts/crm_chosen.js.coffee +19 -38
- data/app/assets/javascripts/crm_classes.js.coffee +215 -0
- data/app/assets/javascripts/crm_comments.js.coffee +20 -58
- data/app/assets/javascripts/crm_loginout.js.coffee +27 -0
- data/app/assets/javascripts/crm_select2.js.coffee +29 -0
- data/app/assets/javascripts/crm_sortable.js.coffee +32 -0
- data/app/assets/javascripts/crm_tags.js.coffee +22 -0
- data/app/assets/javascripts/crm_textarea_autocomplete.js.coffee +33 -0
- data/app/assets/javascripts/datepicker.js.coffee +2 -2
- data/app/assets/javascripts/format_buttons.js.coffee +23 -24
- data/app/assets/javascripts/lists.js.coffee +45 -76
- data/app/assets/javascripts/pagination.js.coffee +16 -0
- data/app/assets/javascripts/search.js.coffee +6 -22
- data/app/assets/javascripts/timeago.js.coffee +21 -0
- data/app/assets/stylesheets/application.css.erb +0 -1
- data/app/assets/stylesheets/common.scss +36 -29
- data/app/assets/stylesheets/lists.css.scss +17 -3
- data/app/controllers/admin/groups_controller.rb +2 -1
- data/app/controllers/application_controller.rb +5 -5
- data/app/controllers/entities/accounts_controller.rb +1 -1
- data/app/controllers/entities/campaigns_controller.rb +1 -1
- data/app/controllers/entities/contacts_controller.rb +1 -1
- data/app/controllers/entities/leads_controller.rb +1 -1
- data/app/controllers/entities/opportunities_controller.rb +1 -1
- data/app/controllers/home_controller.rb +10 -7
- data/app/controllers/tasks_controller.rb +15 -0
- data/app/controllers/users_controller.rb +6 -4
- data/app/helpers/accounts_helper.rb +8 -5
- data/app/helpers/application_helper.rb +53 -39
- data/app/helpers/campaigns_helper.rb +1 -0
- data/app/helpers/leads_helper.rb +3 -3
- data/app/helpers/opportunities_helper.rb +15 -0
- data/app/helpers/remote_link_pagination_helper.rb +8 -0
- data/app/helpers/tags_helper.rb +2 -2
- data/app/helpers/tasks_helper.rb +22 -15
- data/app/helpers/users_helper.rb +3 -2
- data/app/mailers/user_mailer.rb +9 -3
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/fields/custom_field.rb +1 -1
- data/app/models/list.rb +1 -0
- data/app/models/observers/entity_observer.rb +10 -1
- data/app/models/observers/lead_observer.rb +2 -0
- data/app/models/observers/opportunity_observer.rb +2 -0
- data/app/models/observers/task_observer.rb +2 -0
- data/app/models/polymorphic/avatar.rb +2 -0
- data/app/models/polymorphic/comment.rb +0 -1
- data/app/models/polymorphic/task.rb +41 -9
- data/app/models/users/ability.rb +1 -0
- data/app/models/users/group.rb +0 -5
- data/app/models/users/user.rb +0 -7
- data/app/views/accounts/_edit.html.haml +1 -0
- data/app/views/accounts/_index_brief.html.haml +2 -2
- data/app/views/accounts/_index_long.html.haml +2 -2
- data/app/views/accounts/_new.html.haml +1 -0
- data/app/views/accounts/_sidebar_index.html.haml +1 -1
- data/app/views/accounts/_sidebar_show.html.haml +1 -1
- data/app/views/accounts/_top_section.html.haml +1 -1
- data/app/views/accounts/create.js.haml +9 -9
- data/app/views/accounts/destroy.js.haml +2 -2
- data/app/views/accounts/edit.js.haml +5 -5
- data/app/views/accounts/index.js.haml +5 -5
- data/app/views/accounts/new.js.haml +1 -1
- data/app/views/accounts/show.html.haml +1 -1
- data/app/views/accounts/show.js.haml +1 -1
- data/app/views/accounts/update.js.haml +7 -5
- data/app/views/admin/field_groups/_field_group.html.haml +4 -5
- data/app/views/admin/field_groups/confirm.js.haml +2 -2
- data/app/views/admin/field_groups/create.js.haml +6 -12
- data/app/views/admin/field_groups/destroy.js.haml +3 -3
- data/app/views/admin/field_groups/edit.js.haml +1 -1
- data/app/views/admin/field_groups/new.js.haml +1 -1
- data/app/views/admin/field_groups/update.js.haml +2 -2
- data/app/views/admin/fields/_field.html.haml +1 -1
- data/app/views/admin/fields/_sort_by.html.haml +3 -3
- data/app/views/admin/fields/create.js.haml +9 -9
- data/app/views/admin/fields/destroy.js.haml +4 -4
- data/app/views/admin/fields/edit.js.haml +2 -2
- data/app/views/admin/fields/index.html.haml +1 -8
- data/app/views/admin/fields/show.html.haml +1 -1
- data/app/views/admin/fields/update.js.haml +8 -8
- data/app/views/admin/groups/_form.html.haml +1 -3
- data/app/views/admin/groups/create.js.haml +8 -8
- data/app/views/admin/groups/destroy.js.haml +3 -3
- data/app/views/admin/groups/edit.js.haml +3 -3
- data/app/views/admin/groups/index.js.haml +2 -2
- data/app/views/admin/groups/new.js.haml +2 -2
- data/app/views/admin/groups/update.js.haml +5 -5
- data/app/views/admin/tags/confirm.js.haml +2 -2
- data/app/views/admin/tags/create.js.haml +8 -8
- data/app/views/admin/tags/destroy.js.haml +3 -3
- data/app/views/admin/tags/edit.js.haml +4 -4
- data/app/views/admin/tags/new.js.haml +1 -1
- data/app/views/admin/tags/update.js.haml +5 -5
- data/app/views/admin/users/_profile.html.haml +3 -4
- data/app/views/admin/users/confirm.js.haml +2 -2
- data/app/views/admin/users/create.js.haml +8 -8
- data/app/views/admin/users/destroy.js.haml +3 -3
- data/app/views/admin/users/edit.js.haml +4 -4
- data/app/views/admin/users/index.js.haml +2 -2
- data/app/views/admin/users/new.js.haml +2 -2
- data/app/views/admin/users/reactivate.js.haml +2 -2
- data/app/views/admin/users/suspend.js.haml +2 -2
- data/app/views/admin/users/update.js.haml +5 -5
- data/app/views/campaigns/_edit.html.haml +1 -0
- data/app/views/campaigns/_index_brief.html.haml +1 -1
- data/app/views/campaigns/_index_long.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -0
- data/app/views/campaigns/_sidebar_index.html.haml +1 -1
- data/app/views/campaigns/_sidebar_show.html.haml +1 -1
- data/app/views/campaigns/_status.html.haml +1 -1
- data/app/views/campaigns/_top_section.html.haml +1 -1
- data/app/views/campaigns/create.js.haml +10 -10
- data/app/views/campaigns/destroy.js.haml +2 -2
- data/app/views/campaigns/edit.js.haml +6 -6
- data/app/views/campaigns/index.js.haml +5 -5
- data/app/views/campaigns/new.js.haml +1 -1
- data/app/views/campaigns/show.html.haml +1 -1
- data/app/views/campaigns/show.js.haml +1 -1
- data/app/views/campaigns/update.js.haml +8 -6
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +1 -1
- data/app/views/comments/create.js.haml +9 -9
- data/app/views/comments/destroy.js.haml +2 -2
- data/app/views/comments/edit.js.haml +3 -3
- data/app/views/comments/update.js.haml +5 -5
- data/app/views/contacts/_contacts.html.haml +1 -1
- data/app/views/contacts/_edit.html.haml +1 -0
- data/app/views/contacts/_index_brief.html.haml +2 -2
- data/app/views/contacts/_index_full.html.haml +2 -2
- data/app/views/contacts/_index_long.html.haml +2 -2
- data/app/views/contacts/_new.html.haml +1 -0
- data/app/views/contacts/_section_general.html.haml +4 -3
- data/app/views/contacts/_sidebar_show.html.haml +1 -1
- data/app/views/contacts/_top_section.html.haml +1 -1
- data/app/views/contacts/create.js.haml +10 -10
- data/app/views/contacts/destroy.js.haml +3 -3
- data/app/views/contacts/edit.js.haml +5 -5
- data/app/views/contacts/index.js.haml +5 -5
- data/app/views/contacts/new.js.haml +1 -1
- data/app/views/contacts/show.html.haml +1 -1
- data/app/views/contacts/show.js.haml +1 -1
- data/app/views/contacts/update.js.haml +8 -6
- data/app/views/emails/destroy.js.haml +2 -2
- data/app/views/entities/_basic_search.html.haml +15 -12
- data/app/views/entities/_permissions.html.haml +6 -11
- data/app/views/entities/attach.js.haml +3 -3
- data/app/views/entities/contacts.js.haml +2 -2
- data/app/views/entities/discard.js.haml +1 -1
- data/app/views/entities/leads.js.haml +2 -2
- data/app/views/entities/opportunities.js.haml +2 -2
- data/app/views/entities/subscription_update.js.haml +1 -1
- data/app/views/entities/versions.js.haml +2 -2
- data/app/views/fields/group.js.erb +1 -1
- data/app/views/home/_account.html.haml +2 -2
- data/app/views/home/_assets_menu.html.haml +3 -3
- data/app/views/home/_duration_menu.html.haml +3 -3
- data/app/views/home/_events_menu.html.haml +3 -3
- data/app/views/home/_opportunity.html.haml +2 -2
- data/app/views/home/_options.html.haml +0 -1
- data/app/views/home/_users_menu.html.haml +3 -3
- data/app/views/home/index.js.haml +4 -4
- data/app/views/home/options.js.haml +1 -1
- data/app/views/layouts/_about.html.haml +3 -3
- data/app/views/layouts/_footer.html.haml +1 -1
- data/app/views/layouts/_header.html.haml +1 -1
- data/app/views/layouts/_jumpbox.html.haml +23 -21
- data/app/views/layouts/_sidebar.html.haml +1 -2
- data/app/views/layouts/admin/application.html.haml +1 -1
- data/app/views/layouts/application.html.haml +3 -3
- data/app/views/leads/_convert.html.haml +1 -11
- data/app/views/leads/_convert_permissions.html.haml +4 -9
- data/app/views/leads/_edit.html.haml +1 -0
- data/app/views/leads/_index_brief.html.haml +1 -1
- data/app/views/leads/_index_long.html.haml +1 -1
- data/app/views/leads/_leads.html.haml +1 -1
- data/app/views/leads/_new.html.haml +1 -0
- data/app/views/leads/_sidebar_index.html.haml +1 -1
- data/app/views/leads/_sidebar_show.html.haml +1 -1
- data/app/views/leads/_top_section.html.haml +1 -1
- data/app/views/leads/convert.js.haml +5 -5
- data/app/views/leads/create.js.haml +9 -9
- data/app/views/leads/destroy.js.haml +2 -2
- data/app/views/leads/edit.js.haml +5 -5
- data/app/views/leads/index.js.haml +5 -5
- data/app/views/leads/new.js.haml +1 -1
- data/app/views/leads/promote.js.haml +7 -7
- data/app/views/leads/reject.js.haml +2 -2
- data/app/views/leads/show.html.haml +1 -1
- data/app/views/leads/show.js.haml +1 -1
- data/app/views/leads/update.js.haml +9 -7
- data/app/views/lists/_lists.html.haml +6 -0
- data/app/views/lists/_sidebar.html.haml +18 -17
- data/app/views/lists/create.js.haml +6 -7
- data/app/views/lists/destroy.js.haml +1 -1
- data/app/views/opportunities/_edit.html.haml +2 -1
- data/app/views/opportunities/_index_brief.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -1
- data/app/views/opportunities/_new.html.haml +2 -1
- data/app/views/opportunities/_opportunities.html.haml +1 -1
- data/app/views/opportunities/_sidebar_index.html.haml +1 -1
- data/app/views/opportunities/_sidebar_show.html.haml +1 -1
- data/app/views/opportunities/_top_section.html.haml +2 -2
- data/app/views/opportunities/contacts.js.haml +2 -2
- data/app/views/opportunities/create.js.haml +10 -10
- data/app/views/opportunities/destroy.js.haml +3 -3
- data/app/views/opportunities/edit.js.haml +5 -5
- data/app/views/opportunities/index.html.haml +1 -1
- data/app/views/opportunities/index.js.haml +5 -5
- data/app/views/opportunities/new.js.haml +1 -1
- data/app/views/opportunities/show.html.haml +1 -1
- data/app/views/opportunities/show.js.haml +1 -1
- data/app/views/opportunities/update.js.haml +8 -6
- data/app/views/shared/_address.html.haml +1 -1
- data/app/views/shared/_inline_styles.html.haml +1 -1
- data/app/views/shared/_naming.html.haml +3 -3
- data/app/views/shared/_paginate.haml +2 -1
- data/app/views/shared/_paginate_with_per_page.html.haml +10 -12
- data/app/views/shared/_search.html.haml +7 -3
- data/app/views/shared/_select_popup.html.haml +9 -11
- data/app/views/shared/_tags.html.haml +5 -4
- data/app/views/tasks/_completed.html.haml +3 -1
- data/app/views/tasks/_selector.html.haml +1 -1
- data/app/views/tasks/_top_section.html.haml +1 -1
- data/app/views/tasks/complete.js.haml +7 -7
- data/app/views/tasks/create.js.haml +17 -17
- data/app/views/tasks/destroy.js.haml +2 -2
- data/app/views/tasks/discard.js.haml +1 -1
- data/app/views/tasks/edit.js.haml +4 -4
- data/app/views/tasks/filter.js.haml +2 -2
- data/app/views/tasks/new.js.haml +1 -1
- data/app/views/tasks/uncomplete.js.haml +12 -0
- data/app/views/tasks/update.js.haml +4 -4
- data/app/views/users/_avatar.html.haml +1 -1
- data/app/views/users/_languages.html.haml +3 -3
- data/app/views/users/_profile.html.haml +1 -1
- data/app/views/users/avatar.js.haml +1 -1
- data/app/views/users/change_password.js.haml +5 -5
- data/app/views/users/edit.js.haml +1 -1
- data/app/views/users/password.js.haml +2 -2
- data/app/views/users/show.html.haml +1 -1
- data/app/views/users/update.js.haml +5 -5
- data/app/views/users/upload_avatar.js.haml +3 -3
- data/app/views/versions/_versions.html.haml +1 -1
- data/config/application.rb +3 -0
- data/config/environments/production.rb +1 -1
- data/config/environments/staging.rb +58 -13
- data/config/initializers/locale.rb +2 -0
- data/config/locales/cz_fat_free_crm.yml +1 -0
- data/config/locales/de_fat_free_crm.yml +1 -0
- data/config/locales/en-GB_fat_free_crm.yml +1 -0
- data/config/locales/en-US_fat_free_crm.yml +2 -0
- data/config/locales/es_fat_free_crm.yml +1 -0
- data/config/locales/fr-CA_fat_free_crm.yml +1 -0
- data/config/locales/fr_fat_free_crm.yml +1 -0
- data/config/locales/it_fat_free_crm.yml +1 -0
- data/config/locales/ja_fat_free_crm.yml +1 -0
- data/config/locales/pl_fat_free_crm.yml +1 -0
- data/config/locales/pt-BR_fat_free_crm.yml +1 -0
- data/config/locales/ru_fat_free_crm.yml +444 -61
- data/config/locales/sv-SE_fat_free_crm.yml +1 -0
- data/config/locales/th_fat_free_crm.yml +1 -0
- data/config/locales/zh-CN_fat_free_crm.yml +1 -0
- data/config/routes.rb +20 -19
- data/config/settings.default.yml +11 -10
- data/fat_free_crm.gemspec +5 -4
- data/lib/{plugins/country_select/lib/country_select.rb → country_select.rb} +0 -0
- data/lib/fat_free_crm.rb +3 -1
- data/lib/fat_free_crm/engine.rb +2 -4
- data/lib/fat_free_crm/gem_dependencies.rb +1 -1
- data/lib/fat_free_crm/gem_ext.rb +0 -2
- data/lib/fat_free_crm/permissions.rb +2 -3
- data/lib/fat_free_crm/version.rb +1 -1
- data/lib/{plugins/gravatar_image_tag/lib/gravatar_image_tag.rb → gravatar_image_tag.rb} +0 -0
- data/lib/tasks/ffcrm/settings.rake +4 -16
- data/public/favicon.ico +0 -0
- data/spec/controllers/entities/accounts_controller_spec.rb +5 -5
- data/spec/controllers/entities/campaigns_controller_spec.rb +5 -5
- data/spec/controllers/entities/contacts_controller_spec.rb +42 -5
- data/spec/controllers/entities/leads_controller_spec.rb +7 -7
- data/spec/controllers/entities/opportunities_controller_spec.rb +5 -5
- data/spec/controllers/home_controller_spec.rb +3 -3
- data/spec/controllers/tasks_controller_spec.rb +29 -0
- data/spec/factories/shared_factories.rb +1 -3
- data/spec/features/support/selector_helpers.rb +4 -4
- data/spec/helpers/tasks_helper_spec.rb +10 -5
- data/spec/lib/permissions_spec.rb +10 -22
- data/spec/mailers/user_mailer_spec.rb +5 -4
- data/spec/models/observers/entity_observer_spec.rb +13 -8
- data/spec/models/polymorphic/task_spec.rb +111 -32
- data/spec/routing/accounts_routing_spec.rb +1 -1
- data/spec/routing/campaigns_routing_spec.rb +1 -1
- data/spec/routing/contacts_routing_spec.rb +1 -1
- data/spec/routing/leads_routing_spec.rb +1 -1
- data/spec/routing/opportunities_routing_spec.rb +1 -1
- data/spec/shared/controllers.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/views/accounts/create.js.haml_spec.rb +3 -3
- data/spec/views/accounts/index.js.haml_spec.rb +4 -4
- data/spec/views/accounts/update.js.haml_spec.rb +5 -5
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/destroy.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/index.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/update.js.haml_spec.rb +3 -3
- data/spec/views/campaigns/create.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/index.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/new.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +7 -7
- data/spec/views/contacts/create.js.haml_spec.rb +4 -4
- data/spec/views/contacts/edit.js.haml_spec.rb +4 -4
- data/spec/views/contacts/index.js.html_spec.rb +2 -2
- data/spec/views/contacts/new.js.haml_spec.rb +2 -2
- data/spec/views/contacts/update.js.haml_spec.rb +11 -11
- data/spec/views/home/index.js.haml_spec.rb +1 -1
- data/spec/views/home/options.js.haml_spec.rb +3 -3
- data/spec/views/leads/convert.js.haml_spec.rb +3 -3
- data/spec/views/leads/create.js.haml_spec.rb +5 -5
- data/spec/views/leads/destroy.js.haml_spec.rb +1 -1
- data/spec/views/leads/edit.js.haml_spec.rb +4 -4
- data/spec/views/leads/index.js.haml_spec.rb +2 -2
- data/spec/views/leads/new.js.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +13 -13
- data/spec/views/leads/reject.js.haml_spec.rb +6 -6
- data/spec/views/leads/update.js.haml_spec.rb +11 -11
- data/spec/views/opportunities/create.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/destroy.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/edit.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/index.js.haml_spec.rb +2 -2
- data/spec/views/opportunities/update.js.haml_spec.rb +11 -11
- data/spec/views/tasks/complete.js.haml_spec.rb +5 -5
- data/spec/views/tasks/create.js.haml_spec.rb +13 -13
- data/spec/views/tasks/destroy.js.haml_spec.rb +3 -3
- data/spec/views/tasks/edit.js.haml_spec.rb +4 -4
- data/spec/views/tasks/new.js.haml_spec.rb +2 -2
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +44 -0
- data/spec/views/tasks/update.js.haml_spec.rb +17 -17
- data/spec/views/users/avatar.js.haml_spec.rb +1 -1
- data/spec/views/users/change_password.js.haml_spec.rb +4 -4
- data/spec/views/users/edit.js.haml_spec.rb +1 -1
- data/spec/views/users/password.js.haml_spec.rb +2 -2
- data/spec/views/users/update.js.haml_spec.rb +5 -5
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- data/vendor/assets/javascripts/ajax-chosen.jquery.coffee +166 -76
- data/vendor/assets/javascripts/chosen.jquery.coffee +2 -2
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-pt-BR.js +22 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/{jquery-ui-timepicker-sv.js → jquery-ui-timepicker-sv-SE.js} +0 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-th.js +19 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-fr-CA.js +21 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-pt.js +21 -0
- data/vendor/assets/javascripts/rating.js +2 -2
- metadata +101 -122
- data/app/assets/images/facebook-close.gif +0 -0
- data/app/assets/javascripts/crm.js +0 -495
- data/app/assets/javascripts/crm_classes.js +0 -218
- data/app/assets/javascripts/crm_fields.js +0 -34
- data/app/assets/javascripts/crm_loginout.js +0 -29
- data/app/assets/javascripts/crm_textarea_autocomplete.js +0 -32
- data/app/assets/javascripts/groups.js.coffee +0 -8
- data/app/assets/javascripts/jquery-noconflict.js +0 -6
- data/app/assets/javascripts/timeago.js +0 -17
- data/app/views/lists/_personal_sidebar.html.haml +0 -28
- data/lib/fat_free_crm/gem_ext/active_model/serializers/xml/serializer/attribute.rb +0 -17
- data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +0 -16
- data/lib/fat_free_crm/plugin_dependencies.rb +0 -12
- data/lib/plugins/country_select/MIT-LICENSE +0 -20
- data/lib/plugins/country_select/README +0 -14
- data/lib/plugins/country_select/init.rb +0 -1
- data/lib/plugins/country_select/install.rb +0 -2
- data/lib/plugins/country_select/uninstall.rb +0 -2
- data/lib/plugins/gravatar_image_tag/Gemfile +0 -8
- data/lib/plugins/gravatar_image_tag/README.textile +0 -108
- data/lib/plugins/gravatar_image_tag/ROADMAP.textile +0 -33
- data/lib/plugins/gravatar_image_tag/Rakefile +0 -50
- data/lib/plugins/gravatar_image_tag/VERSION +0 -1
- data/lib/plugins/gravatar_image_tag/gravatar_image_tag.gemspec +0 -45
- data/lib/plugins/gravatar_image_tag/init.rb +0 -2
- data/lib/plugins/gravatar_image_tag/spec/gravatar_image_tag_spec.rb +0 -83
- data/lib/plugins/gravatar_image_tag/spec/test_helper.rb +0 -12
- data/lib/tasks/db/migrate.rake +0 -66
- data/lib/tasks/db/schema.rake +0 -20
- data/vendor/assets/javascripts/ajax-chosen-prototype.js +0 -2
- data/vendor/assets/javascripts/ajax-chosen.proto.coffee +0 -98
- data/vendor/assets/javascripts/chosen-prototype.js +0 -3
- data/vendor/assets/javascripts/chosen.proto.coffee +0 -580
- data/vendor/assets/javascripts/event.simulate.js +0 -64
- data/vendor/assets/javascripts/facebooklist.js +0 -548
- data/vendor/assets/javascripts/facebooklist.simulate.js +0 -28
- data/vendor/assets/javascripts/modalbox.js +0 -506
- data/vendor/assets/stylesheets/facebooklist.css +0 -47
data/MIT-LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Fat Free CRM
|
2
|
-
Copyright (c) 2008-
|
2
|
+
Copyright (c) 2008-2014 Michael Dvorkin and contributors.
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -51,11 +51,13 @@ Pull requests and bug reports are always welcome!
|
|
51
51
|
|
52
52
|
Visit our website at http://www.fatfreecrm.com/
|
53
53
|
|
54
|
+
## Important security note
|
55
|
+
|
56
|
+
Please note that several severe vulnerabilities have been fixed recently. You should upgrade to versions 0.12.3 or 0.13.2 or higher. See the [**security vulnerabilities**](https://github.com/fatfreecrm/fat_free_crm/wiki/Security) page for more details.
|
54
57
|
|
55
58
|
## System Requirements
|
56
59
|
|
57
|
-
*
|
58
|
-
* Ruby v2.0.0 recommended (it's faster!)
|
60
|
+
* Ruby 2.1 (or 2.0) recommended (it's much faster!)
|
59
61
|
* Ruby 1.9.3 is also compatible
|
60
62
|
* Ruby 1.9.2 should be compatible but is not longer supported
|
61
63
|
* Ruby v1.8.7 was supported until v0.11.4 (see https://github.com/fatfreecrm/fat_free_crm/tree/ruby1.8)
|
@@ -129,7 +131,7 @@ See the [contributors graph](https://github.com/fatfreecrm/fat_free_crm/graphs/c
|
|
129
131
|
## License
|
130
132
|
|
131
133
|
Fat Free CRM
|
132
|
-
Copyright (c) 2008-
|
134
|
+
Copyright (c) 2008-2014 Michael Dvorkin and contributors.
|
133
135
|
|
134
136
|
Permission is hereby granted, free of charge, to any person obtaining
|
135
137
|
a copy of this software and associated documentation files (the
|
@@ -6,7 +6,25 @@
|
|
6
6
|
|
7
7
|
(($) ->
|
8
8
|
|
9
|
-
|
9
|
+
#----------------------------------------------------------------------------
|
10
|
+
# Custom field tabs switcher
|
11
|
+
$(document).on "click", "*[data-tab-class]", (event) ->
|
12
|
+
event.preventDefault()
|
13
|
+
$el = $(this)
|
14
|
+
|
15
|
+
$(".fields").each ->
|
16
|
+
$(this).hide()
|
17
|
+
|
18
|
+
$(".inline_tabs ul li").each ->
|
19
|
+
$(this).removeClass "selected"
|
20
|
+
|
21
|
+
klass = $el.data("tab-class")
|
22
|
+
$("#" + klass + "_section").show()
|
23
|
+
$el.addClass "selected"
|
24
|
+
|
25
|
+
#----------------------------------------------------------------------------
|
26
|
+
# Load custom field subform
|
27
|
+
$(document).on 'change', '.fields select[name="field[as]"]', ->
|
10
28
|
$.ajax(
|
11
29
|
url: '/admin/fields/subform?' + $(this).parents('form').serialize()
|
12
30
|
dataType: 'html'
|
@@ -16,7 +34,9 @@
|
|
16
34
|
$(this).find('input').first().focus()
|
17
35
|
)
|
18
36
|
|
19
|
-
|
37
|
+
#----------------------------------------------------------------------------
|
38
|
+
# Open new field form
|
39
|
+
$(document).on 'click', '.fields a.create', ->
|
20
40
|
$('.edit_field').hide()
|
21
41
|
field_group = $(this).closest('.field_group')
|
22
42
|
field_group.find('.empty').hide()
|
@@ -24,13 +44,16 @@
|
|
24
44
|
field_group.find('.create_field').slideDown().find('input[name="field[label]"]').focus()
|
25
45
|
false
|
26
46
|
|
27
|
-
|
47
|
+
#----------------------------------------------------------------------------
|
48
|
+
# Close new field form
|
49
|
+
$(document).on 'click', '.create_field a.close, .create_field a.cancel', ->
|
28
50
|
$(this).closest('.create_field').hide()
|
29
|
-
$(this).closest('.field_group').find('.empty').show()
|
30
51
|
$(this).closest('.field_group').find('.create .arrow').html(crm.COLLAPSED)
|
31
52
|
false
|
32
53
|
|
33
|
-
|
54
|
+
#----------------------------------------------------------------------------
|
55
|
+
# Edit an existing field
|
56
|
+
$(document).on 'click', '.fields a.edit', ->
|
34
57
|
$('.edit_field').hide()
|
35
58
|
$.ajax(
|
36
59
|
url: $(this).attr('href')
|
@@ -40,10 +63,10 @@
|
|
40
63
|
)
|
41
64
|
false
|
42
65
|
|
43
|
-
|
66
|
+
#----------------------------------------------------------------------------
|
67
|
+
# Close edit field form
|
68
|
+
$(document).on 'click', '.edit_field a.close, .edit_field a.cancel', ->
|
44
69
|
$(this).closest('.edit_field').hide()
|
45
70
|
false
|
46
71
|
|
47
|
-
false
|
48
|
-
|
49
72
|
) jQuery
|
@@ -5,24 +5,19 @@
|
|
5
5
|
//------------------------------------------------------------------------------
|
6
6
|
|
7
7
|
//= require jquery
|
8
|
+
//= require jquery_ujs
|
8
9
|
//= require jquery-ui
|
9
|
-
//= require jquery-noconflict
|
10
10
|
//= require select2
|
11
|
-
//= require prototype
|
12
|
-
//= require effects
|
13
|
-
//= require controls
|
14
|
-
//= require dragdrop
|
15
|
-
//= require prototype_ujs
|
16
|
-
//= require modalbox
|
17
11
|
//= require crm
|
18
12
|
//= require crm_classes
|
19
13
|
//= require crm_loginout
|
20
|
-
//= require
|
14
|
+
//= require crm_tags
|
15
|
+
//= require crm_sortable
|
21
16
|
//= require textarea_autocomplete
|
22
17
|
//= require crm_textarea_autocomplete
|
23
|
-
//= require
|
24
|
-
//= require ajax-chosen-prototype
|
18
|
+
//= require ajax-chosen-jquery
|
25
19
|
//= require crm_chosen
|
20
|
+
//= require crm_select2
|
26
21
|
//= require ransack_ui_jquery
|
27
22
|
//= require search
|
28
23
|
//= require lists
|
@@ -35,6 +30,7 @@
|
|
35
30
|
//= require crm_comments
|
36
31
|
//= require jquery_timeago
|
37
32
|
//= require timeago
|
33
|
+
//= require pagination
|
38
34
|
//= require_self
|
39
35
|
|
40
36
|
<%
|
@@ -0,0 +1,426 @@
|
|
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
|
+
#------------------------------------------------------------------------------
|
6
|
+
(($) ->
|
7
|
+
|
8
|
+
String::capitalize = ->
|
9
|
+
@[0].toUpperCase() + @.substring(1)
|
10
|
+
|
11
|
+
window.crm =
|
12
|
+
EXPANDED: "▼"
|
13
|
+
COLLAPSED: "►"
|
14
|
+
searchRequest: null
|
15
|
+
autocompleter: null
|
16
|
+
base_url: ""
|
17
|
+
language: "en-US"
|
18
|
+
|
19
|
+
#----------------------------------------------------------------------------
|
20
|
+
find_form: (class_name) ->
|
21
|
+
forms = $("form." + class_name)
|
22
|
+
(if forms.length > 0 then forms[0].id else null)
|
23
|
+
|
24
|
+
|
25
|
+
#----------------------------------------------------------------------------
|
26
|
+
search_tagged: (query, controller) ->
|
27
|
+
$("#query").val(query)
|
28
|
+
crm.search query, controller
|
29
|
+
|
30
|
+
#
|
31
|
+
# * remove any duplicate 'facebook-list' elements before running the 'BlindUp' effect.
|
32
|
+
# * (The disappearing facebook-list takes precedence over the newly created facebook-list
|
33
|
+
# * that is being AJAX loaded, and messes up the initialization.. )
|
34
|
+
#
|
35
|
+
hide_form: (id) ->
|
36
|
+
$("#facebook-list").remove()
|
37
|
+
arrow = $("#" + id + "_arrow")
|
38
|
+
arrow = $("#arrow") unless arrow.length
|
39
|
+
arrow.html(@COLLAPSED)
|
40
|
+
$("#" + id).hide().html("").css height: "auto"
|
41
|
+
|
42
|
+
|
43
|
+
#----------------------------------------------------------------------------
|
44
|
+
show_form: (id) ->
|
45
|
+
arrow = $("#" + id + "_arrow")
|
46
|
+
arrow = $("#arrow") unless arrow.length
|
47
|
+
arrow.html(@EXPANDED)
|
48
|
+
$("#" + id).slideDown(
|
49
|
+
250
|
50
|
+
->
|
51
|
+
$("#" + id).find(":input[type=text]:first").focus()
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
#----------------------------------------------------------------------------
|
56
|
+
flip_form: (id) ->
|
57
|
+
if $("#" + id + ":visible").length
|
58
|
+
@hide_form id
|
59
|
+
else
|
60
|
+
@show_form id
|
61
|
+
|
62
|
+
|
63
|
+
#----------------------------------------------------------------------------
|
64
|
+
set_title: (id, caption) ->
|
65
|
+
title = $("#" + id + "_title")
|
66
|
+
title = $("#title") unless title.length
|
67
|
+
if typeof (caption) is "undefined"
|
68
|
+
words = id.split("_")
|
69
|
+
if words.length is 1
|
70
|
+
caption = id.capitalize()
|
71
|
+
else
|
72
|
+
caption = words[0].capitalize() + " " + words[1].capitalize()
|
73
|
+
title.html caption
|
74
|
+
|
75
|
+
|
76
|
+
#----------------------------------------------------------------------------
|
77
|
+
highlight_off: (id) ->
|
78
|
+
el = $("#" + id)
|
79
|
+
el.onmouseover = el.onmouseout = null
|
80
|
+
el.css background: "white"
|
81
|
+
|
82
|
+
|
83
|
+
#----------------------------------------------------------------------------
|
84
|
+
focus_on_first_field: ->
|
85
|
+
first_element = $("form:input[type=text]:first")
|
86
|
+
if first_element.length
|
87
|
+
first_element.focus()
|
88
|
+
first_element.val first_element.val()
|
89
|
+
else $("#query").focus()
|
90
|
+
|
91
|
+
|
92
|
+
# Hide accounts dropdown and show create new account edit field instead.
|
93
|
+
#----------------------------------------------------------------------------
|
94
|
+
create_account: ->
|
95
|
+
crm.makeAjaxChosen()
|
96
|
+
$("#account_disabled_title").hide()
|
97
|
+
$("#account_select_title").hide()
|
98
|
+
$("#account_create_title").show()
|
99
|
+
$("#account_id_chzn").hide()
|
100
|
+
$("#account_id").prop('disabled', true)
|
101
|
+
$("#account_name").prop('disabled', false)
|
102
|
+
$("#account_name").html ""
|
103
|
+
$("#account_name").show()
|
104
|
+
|
105
|
+
|
106
|
+
# Hide create account edit field and show accounts dropdown instead.
|
107
|
+
#----------------------------------------------------------------------------
|
108
|
+
select_account: ->
|
109
|
+
crm.makeAjaxChosen()
|
110
|
+
$("#account_disabled_title").hide()
|
111
|
+
$("#account_create_title").hide()
|
112
|
+
$("#account_select_title").show()
|
113
|
+
$("#account_name").hide()
|
114
|
+
$("#account_name").prop('disabled', true)
|
115
|
+
$("#account_id").prop('disabled', false)
|
116
|
+
$("#account_id_chzn").show()
|
117
|
+
|
118
|
+
|
119
|
+
# Show accounts dropdown and disable it to prevent changing the account.
|
120
|
+
#----------------------------------------------------------------------------
|
121
|
+
select_existing_account: ->
|
122
|
+
crm.makeAjaxChosen()
|
123
|
+
$("#account_create_title").hide()
|
124
|
+
$("#account_select_title").hide()
|
125
|
+
$("#account_id").hide()
|
126
|
+
$("#account_disabled_title").show()
|
127
|
+
$("#account_name").hide()
|
128
|
+
$("#account_name").prop('disabled', true)
|
129
|
+
|
130
|
+
# Disable chosen account select
|
131
|
+
$("#account_id").prop('disabled', true)
|
132
|
+
$("#account_id").trigger "liszt:updated"
|
133
|
+
$("#account_id_chzn").show()
|
134
|
+
|
135
|
+
# Enable hidden account id select so that value is POSTed
|
136
|
+
$("#account_id").prop('disabled', false)
|
137
|
+
|
138
|
+
|
139
|
+
#----------------------------------------------------------------------------
|
140
|
+
create_or_select_account: (selector) ->
|
141
|
+
if selector isnt true and selector > 0
|
142
|
+
@select_existing_account() # disabled accounts dropdown
|
143
|
+
else if selector
|
144
|
+
@create_account() # create account edit field
|
145
|
+
else
|
146
|
+
@select_account() # accounts dropdown
|
147
|
+
|
148
|
+
|
149
|
+
#----------------------------------------------------------------------------
|
150
|
+
create_contact: ->
|
151
|
+
@clear_all_hints() if $("#contact_business_address_attributes_country")
|
152
|
+
$("#account_assigned_to").val $("contact_assigned_to").val()
|
153
|
+
$("#account_id").prop('disabled', false) if $("#account_id:visible").length
|
154
|
+
|
155
|
+
|
156
|
+
#----------------------------------------------------------------------------
|
157
|
+
save_contact: ->
|
158
|
+
@clear_all_hints() if $("#contact_business_address_attributes_country")
|
159
|
+
$("#account_assigned_to").val $("contact_assigned_to").val()
|
160
|
+
|
161
|
+
|
162
|
+
#----------------------------------------------------------------------------
|
163
|
+
flip_calendar: (value) ->
|
164
|
+
if value is "specific_time"
|
165
|
+
$("#task_bucket").toggle() # Hide dropdown.
|
166
|
+
$("#task_calendar").toggle() # Show editable date field.
|
167
|
+
$("#task_calendar").datepicker().focus() # Focus to invoke calendar popup.
|
168
|
+
|
169
|
+
|
170
|
+
#----------------------------------------------------------------------------
|
171
|
+
flip_campaign_permissions: (value) ->
|
172
|
+
if value
|
173
|
+
$("#lead_access_campaign").prop('disabled', false)
|
174
|
+
$("#lead_access_campaign").checked = 1
|
175
|
+
$("#copy_permissions").css color: "#3f3f3f"
|
176
|
+
else
|
177
|
+
$("#lead_access_campaign").prop('disabled', true)
|
178
|
+
$("#copy_permissions").css color: "grey"
|
179
|
+
$("#lead_access_private").checked = 1
|
180
|
+
|
181
|
+
|
182
|
+
#----------------------------------------------------------------------------
|
183
|
+
flip_subtitle: (el) ->
|
184
|
+
$el = $(el)
|
185
|
+
arrow = $el.find("small")
|
186
|
+
intro = $el.parent().next().children("small")
|
187
|
+
|
188
|
+
# Optionally, the intro might be next to the link.
|
189
|
+
intro = $el.next("small") unless intro.length
|
190
|
+
section = $el.parent().next().children("div")
|
191
|
+
section.slideToggle(
|
192
|
+
250
|
193
|
+
=>
|
194
|
+
arrow.html(if section.css('display') is 'none' then @COLLAPSED else @EXPANDED)
|
195
|
+
intro.toggle()
|
196
|
+
)
|
197
|
+
|
198
|
+
|
199
|
+
#----------------------------------------------------------------------------
|
200
|
+
flip_note_or_email: (link, more, less) ->
|
201
|
+
body = undefined
|
202
|
+
state = undefined
|
203
|
+
if link.innerHTML is more
|
204
|
+
body = $(link).parent().next()
|
205
|
+
body.hide()
|
206
|
+
$("#" + body.attr('id').replace("truncated", "formatted")).show() # expand
|
207
|
+
link.innerHTML = less
|
208
|
+
state = "Expanded"
|
209
|
+
else
|
210
|
+
body = $(link).parent().next().next()
|
211
|
+
body.hide()
|
212
|
+
$("#" + body.attr('id').replace("formatted", "truncated")).show() # collapse
|
213
|
+
link.innerHTML = more
|
214
|
+
state = "Collapsed"
|
215
|
+
|
216
|
+
# Ex: "formatted_email_42" => [ "formatted", "email", "42" ]
|
217
|
+
arr = body.attr('id').split("_")
|
218
|
+
$.get(@base_url + "/home/timeline", {
|
219
|
+
type: arr[1]
|
220
|
+
id: arr[2]
|
221
|
+
state: state
|
222
|
+
})
|
223
|
+
|
224
|
+
|
225
|
+
#----------------------------------------------------------------------------
|
226
|
+
flip_notes_and_emails: (state, more, less, el_prefix) ->
|
227
|
+
unless el_prefix
|
228
|
+
notes_field = "#shown_notes"
|
229
|
+
emails_field = "#shown_emails"
|
230
|
+
comment_new_field = "#comment_new"
|
231
|
+
else
|
232
|
+
notes_field = "#" + el_prefix + "_shown_notes"
|
233
|
+
emails_field = "#" + el_prefix + "_shown_emails"
|
234
|
+
comment_new_field = "#" + el_prefix + "_comment_new"
|
235
|
+
|
236
|
+
$(comment_new_field).siblings("li").each ->
|
237
|
+
$li = $(this)
|
238
|
+
$a = $li.find("tt a.toggle")
|
239
|
+
$dt = $li.find("dt")
|
240
|
+
if $a.length
|
241
|
+
if state is "Expanded"
|
242
|
+
$($dt[0]).hide()
|
243
|
+
$($dt[1]).show()
|
244
|
+
$a.html(less)
|
245
|
+
else
|
246
|
+
$($dt[0]).show()
|
247
|
+
$($dt[1]).hide()
|
248
|
+
$a.html(more)
|
249
|
+
|
250
|
+
notes = $(notes_field).val()
|
251
|
+
emails = $(emails_field).val()
|
252
|
+
if notes isnt "" or emails isnt ""
|
253
|
+
$.post(@base_url + "/home/timeline"
|
254
|
+
{
|
255
|
+
type: ""
|
256
|
+
id: notes + "+" + emails
|
257
|
+
state: state
|
258
|
+
}
|
259
|
+
)
|
260
|
+
|
261
|
+
|
262
|
+
#----------------------------------------------------------------------------
|
263
|
+
reschedule_task: (id, bucket) ->
|
264
|
+
$("#task_bucket").val bucket
|
265
|
+
$("#edit_task_" + id + " input[type=submit]")[0].click()
|
266
|
+
|
267
|
+
|
268
|
+
#----------------------------------------------------------------------------
|
269
|
+
flick: (id, action) ->
|
270
|
+
$el = $("#" + id)
|
271
|
+
if $el.length
|
272
|
+
switch action
|
273
|
+
when "show"
|
274
|
+
$el.show()
|
275
|
+
when "hide"
|
276
|
+
$el.hide()
|
277
|
+
when "clear"
|
278
|
+
$el.html ""
|
279
|
+
when "remove"
|
280
|
+
$el.remove()
|
281
|
+
when "toggle"
|
282
|
+
$el.toggle()
|
283
|
+
|
284
|
+
|
285
|
+
#----------------------------------------------------------------------------
|
286
|
+
flash: (type, sticky) ->
|
287
|
+
$el = $("#flash")
|
288
|
+
$el.hide()
|
289
|
+
if type is "warning" or type is "error"
|
290
|
+
$el.addClass "flash_warning"
|
291
|
+
else
|
292
|
+
$el.addClass "flash_notice"
|
293
|
+
$el.fadeIn 500
|
294
|
+
|
295
|
+
setTimeout (-> $el.fadeOut(500)), 3000 unless sticky
|
296
|
+
|
297
|
+
|
298
|
+
#----------------------------------------------------------------------------
|
299
|
+
# Will be deprecated soon: html5 placeholder replaced it on address fields
|
300
|
+
show_hint: (el, hint) ->
|
301
|
+
$el = $(el)
|
302
|
+
if $el.val() is ""
|
303
|
+
$el.val hint
|
304
|
+
$el.css color: "silver"
|
305
|
+
$el.attr "hint", true
|
306
|
+
|
307
|
+
|
308
|
+
#----------------------------------------------------------------------------
|
309
|
+
# Will be deprecated soon: html5 placeholder replaced it on address fields
|
310
|
+
hide_hint: (el, value) ->
|
311
|
+
$el = $(el)
|
312
|
+
if arguments.length is 2
|
313
|
+
$el.val value
|
314
|
+
else
|
315
|
+
$el.val("") if $el.attr("hint") is "true"
|
316
|
+
$el.css color: "black"
|
317
|
+
$el.attr "hint", false
|
318
|
+
|
319
|
+
|
320
|
+
#----------------------------------------------------------------------------
|
321
|
+
# Will be deprecated soon: html5 placeholder replaced it on address fields
|
322
|
+
clear_all_hints: ->
|
323
|
+
for field in $("input[hint=true]")
|
324
|
+
$(field).val ""
|
325
|
+
|
326
|
+
|
327
|
+
#----------------------------------------------------------------------------
|
328
|
+
copy_address: (from, to) ->
|
329
|
+
$("#" + from + "_attributes_full_address").val $("#" + to + "_attributes_full_address").val()
|
330
|
+
|
331
|
+
|
332
|
+
#----------------------------------------------------------------------------
|
333
|
+
copy_compound_address: (from, to) ->
|
334
|
+
for field in ["street1", "street2", "city", "state", "zipcode"]
|
335
|
+
source = $("#" + from + "_attributes_" + field)
|
336
|
+
destination = $("#" + to + "_attributes_" + field)
|
337
|
+
@hide_hint destination, source.val() unless source.attr("hint") is "true"
|
338
|
+
|
339
|
+
# Country dropdown needs special treatment ;-)
|
340
|
+
country = $("#" + from + "_attributes_country").select2("data")
|
341
|
+
$("#" + to + "_attributes_country").select2("data", country, true)
|
342
|
+
|
343
|
+
|
344
|
+
#----------------------------------------------------------------------------
|
345
|
+
search: (query, controller) ->
|
346
|
+
list = controller # ex. "users"
|
347
|
+
# ex. "admin/users"
|
348
|
+
list = list.split("/")[1] if list.indexOf("/") >= 0
|
349
|
+
$("#loading").show()
|
350
|
+
$list = $(list)
|
351
|
+
$list.css opacity: 0.4
|
352
|
+
@searchRequest.abort() if @searchRequest and @searchRequest.readyState isnt -4
|
353
|
+
@searchRequest = $.get(
|
354
|
+
@base_url + "/" + controller + ".js"
|
355
|
+
query: query
|
356
|
+
->
|
357
|
+
$("#loading").hide()
|
358
|
+
$list.css opacity: 1
|
359
|
+
@searchRequest = null
|
360
|
+
)
|
361
|
+
|
362
|
+
|
363
|
+
#----------------------------------------------------------------------------
|
364
|
+
jumper: (controller) ->
|
365
|
+
name = controller
|
366
|
+
$("#jumpbox_menu a").each ->
|
367
|
+
$(this).toggleClass("selected", $(this).attr('html-data') is name) #the internal controller name, so this can work with i18
|
368
|
+
|
369
|
+
@auto_complete controller, null, true
|
370
|
+
$("#auto_complete_query").focus()
|
371
|
+
|
372
|
+
|
373
|
+
#----------------------------------------------------------------------------
|
374
|
+
auto_complete: (controller, related, focus) ->
|
375
|
+
$("#auto_complete_query").autocomplete(
|
376
|
+
source: (request, response) =>
|
377
|
+
request = {auto_complete_query: request['term'], related: related}
|
378
|
+
$.get @base_url + "/" + controller + "/auto_complete.json", request, (data) ->
|
379
|
+
response $.map(data, (value, key) ->
|
380
|
+
label: value
|
381
|
+
value: key
|
382
|
+
)
|
383
|
+
|
384
|
+
# Attach to related asset.
|
385
|
+
# Quick Find: redirect to asset#show.
|
386
|
+
select: (event, ui) => # Binding for this.base_url.
|
387
|
+
event.preventDefault()
|
388
|
+
if ui.item
|
389
|
+
if related
|
390
|
+
$.ajax(@base_url + "/" + related + "/attach", type: 'PUT', data: {
|
391
|
+
assets: controller
|
392
|
+
asset_id: ui.item.value
|
393
|
+
}
|
394
|
+
).then ->
|
395
|
+
$("#auto_complete_query").val ""
|
396
|
+
else
|
397
|
+
window.location.href = @base_url + "/" + controller + "/" + ui.item.value
|
398
|
+
|
399
|
+
focus: (event, ui) =>
|
400
|
+
event.preventDefault()
|
401
|
+
$("#auto_complete_query").val(ui.item.label)
|
402
|
+
)
|
403
|
+
|
404
|
+
$.extend $.ui.autocomplete::,
|
405
|
+
_renderItem: (ul, item) ->
|
406
|
+
term = new RegExp( "(" + @element.val() + ")", "gi" )
|
407
|
+
html = item.label.replace(term, "<span class=\"jumpbox-highlight\">$1</span>")
|
408
|
+
$("<li></li>").data("item.autocomplete", item).append($("<a></a>").html(html)).appendTo ul
|
409
|
+
|
410
|
+
#----------------------------------------------------------------------------
|
411
|
+
# Define different icons for each entity type
|
412
|
+
get_icon: (listType) ->
|
413
|
+
switch (listType)
|
414
|
+
when "tasks" then "fa-check-square-o"
|
415
|
+
when "campaigns" then "fa-bar-chart-o"
|
416
|
+
when "leads" then "fa-tasks"
|
417
|
+
when "accounts" then "fa-users"
|
418
|
+
when "contacts" then "fa-user"
|
419
|
+
when "opportunities" then "fa-money"
|
420
|
+
when "team" then "fa-globe"
|
421
|
+
|
422
|
+
|
423
|
+
$ ->
|
424
|
+
crm.focus_on_first_field()
|
425
|
+
|
426
|
+
) jQuery
|