artfully_ose 1.2.0 → 1.3.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/app/assets/images/actions/open.png +0 -0
- data/app/assets/images/actions/pledge.png +0 -0
- data/app/assets/images/actions/pledge.psd +0 -0
- data/app/assets/images/glyphish/gray/cancel.png +0 -0
- data/app/assets/images/loading_gray.gif +0 -0
- data/app/assets/javascripts/application.js +30 -4
- data/app/assets/javascripts/baseball_card.js.coffee +235 -0
- data/app/assets/javascripts/boxoffice.js +12 -49
- data/app/assets/javascripts/contributions.js +264 -0
- data/app/assets/javascripts/custom/advanced_searches.js +142 -0
- data/app/assets/javascripts/custom/endless-scroll.js +1 -1
- data/app/assets/javascripts/custom/job-monitor.js +73 -0
- data/app/assets/javascripts/custom/kits-config.js +0 -2
- data/app/assets/javascripts/custom/mailchimp.js +14 -0
- data/app/assets/javascripts/custom/people.js +31 -2
- data/app/assets/javascripts/custom/person-finder.js +34 -0
- data/app/assets/javascripts/custom/searches.js +12 -0
- data/app/assets/javascripts/custom/user-finder.js +111 -0
- data/app/assets/javascripts/households.js +12 -5
- data/app/assets/javascripts/ical.js +138 -0
- data/app/assets/javascripts/jquery-lib/jquery.timeago.js +221 -0
- data/app/assets/javascripts/locationselector.js +1 -1
- data/app/assets/javascripts/memberships.js +24 -0
- data/app/assets/javascripts/relationships.js +10 -0
- data/app/assets/javascripts/search.js +22 -0
- data/app/assets/javascripts/store/sliding-wizard.js +2 -2
- data/app/assets/javascripts/store/store.js +51 -6
- data/app/assets/javascripts/tags.js +44 -0
- data/app/assets/stylesheets/application.sass +331 -32
- data/app/assets/stylesheets/bootstrap-overrides.css +24 -9
- data/app/assets/stylesheets/boxoffice.css.scss +0 -4
- data/app/assets/stylesheets/sass/_campaigns.sass +43 -0
- data/app/assets/stylesheets/sass/_tags.sass +10 -1
- data/app/assets/stylesheets/sass/fa-color.css.scss +13 -0
- data/app/assets/stylesheets/sass/store.sass +7 -7
- data/app/concerns/cart_finder.rb +10 -0
- data/app/concerns/oh_noes.rb +1 -1
- data/app/controllers/actions_controller.rb +5 -5
- data/app/controllers/addresses_controller.rb +1 -1
- data/app/controllers/advanced_search_segments_controller.rb +97 -0
- data/app/controllers/advanced_searches_controller.rb +118 -0
- data/app/controllers/appeals_controller.rb +63 -0
- data/app/controllers/artfully_ose_controller.rb +20 -2
- data/app/controllers/campaigns_controller.rb +90 -0
- data/app/controllers/charts_controller.rb +8 -2
- data/app/controllers/console_sales_controller.rb +21 -23
- data/app/controllers/contributions_controller.rb +74 -43
- data/app/controllers/converts_controller.rb +21 -0
- data/app/controllers/delete_ticket_types_controller.rb +35 -0
- data/app/controllers/events_pass_types_controller.rb +10 -2
- data/app/controllers/export_controller.rb +4 -4
- data/app/controllers/households_controller.rb +63 -15
- data/app/controllers/imports_controller.rb +13 -10
- data/app/controllers/job_monitors_controller.rb +9 -0
- data/app/controllers/members/people_controller.rb +7 -5
- data/app/controllers/members/sessions_controller.rb +1 -0
- data/app/controllers/membership_comps_controller.rb +5 -20
- data/app/controllers/memberships_controller.rb +2 -2
- data/app/controllers/merges_controller.rb +7 -6
- data/app/controllers/mobile/users_controller.rb +18 -6
- data/app/controllers/notes_controller.rb +5 -1
- data/app/controllers/orders_controller.rb +30 -13
- data/app/controllers/organizations_controller.rb +8 -0
- data/app/controllers/passes_kits_controller.rb +2 -4
- data/app/controllers/people_controller.rb +105 -17
- data/app/controllers/pledges_controller.rb +64 -0
- data/app/controllers/preview_rows_controller.rb +29 -0
- data/app/controllers/regular_donation_kits_controller.rb +11 -6
- data/app/controllers/sales_controller.rb +72 -40
- data/app/controllers/searches_controller.rb +37 -6
- data/app/controllers/segments_controller.rb +33 -2
- data/app/controllers/settlements_controller.rb +13 -7
- data/app/controllers/shows_controller.rb +58 -24
- data/app/controllers/statements_controller.rb +2 -2
- data/app/controllers/store/checkouts_controller.rb +43 -26
- data/app/controllers/store/donations_controller.rb +27 -11
- data/app/controllers/store/memberships_controller.rb +37 -4
- data/app/controllers/store/orders_controller.rb +26 -10
- data/app/controllers/store/passes_controller.rb +30 -3
- data/app/controllers/tags_controller.rb +42 -0
- data/app/controllers/ticket_types_controller.rb +9 -2
- data/app/controllers/tickets_controller.rb +6 -4
- data/app/controllers/unacknowledged_gifts_controller.rb +45 -0
- data/app/controllers/user_memberships_controller.rb +47 -8
- data/app/helpers/advanced_searches_helper.rb +252 -0
- data/app/helpers/artfully_ose_helper.rb +33 -4
- data/app/helpers/checkouts_helper.rb +16 -0
- data/app/helpers/mailchimp_lists_for_search_helper.rb +21 -0
- data/app/helpers/orders_helper.rb +11 -0
- data/app/helpers/people_helper.rb +28 -1
- data/app/helpers/relationships_helper.rb +6 -0
- data/app/helpers/sales_helper.rb +3 -1
- data/app/helpers/searches_helper.rb +3 -1
- data/app/helpers/segments_helper.rb +3 -0
- data/app/mailers/order_mailer.rb +8 -1
- data/app/mailers/producer_mailer.rb +39 -0
- data/app/mailers/reports_mailer.rb +6 -1
- data/app/models/ability.rb +15 -8
- data/app/models/action.rb +33 -4
- data/app/models/actions/change_action.rb +3 -1
- data/app/models/actions/comp_action.rb +3 -1
- data/app/models/actions/convert_action.rb +19 -0
- data/app/models/actions/do_action.rb +3 -1
- data/app/models/actions/exchange_action.rb +3 -1
- data/app/models/actions/get_action.rb +3 -1
- data/app/models/actions/give_action.rb +8 -2
- data/app/models/actions/go_action.rb +3 -1
- data/app/models/actions/hear_action.rb +15 -1
- data/app/models/actions/join_action.rb +3 -1
- data/app/models/actions/mailchimp_hear_action.rb +17 -0
- data/app/models/actions/pledge_action.rb +19 -0
- data/app/models/actions/refund_action.rb +3 -1
- data/app/models/actions/say_action.rb +3 -1
- data/app/models/actions/system_action.rb +17 -0
- data/app/models/address.rb +76 -31
- data/app/models/advanced_search.rb +434 -0
- data/app/models/advanced_search_segment.rb +12 -0
- data/app/models/appeal.rb +106 -0
- data/app/models/box_office.rb +1 -1
- data/app/models/budget_restriction.rb +9 -0
- data/app/models/campaign.rb +141 -0
- data/app/models/cart.rb +39 -4
- data/app/models/chart.rb +2 -2
- data/app/models/checkout.rb +54 -10
- data/app/models/comp.rb +7 -5
- data/app/models/company.rb +2 -0
- data/app/models/console_sale.rb +26 -0
- data/app/models/contribution.rb +327 -62
- data/app/models/convert.rb +62 -0
- data/app/models/daily_membership_report.rb +1 -1
- data/app/models/database_views/item_view.rb +91 -49
- data/app/models/discount.rb +1 -1
- data/app/models/discounts/discount_type.rb +2 -1
- data/app/models/donation.rb +27 -2
- data/app/models/donation_search.rb +188 -10
- data/app/models/door_list.rb +39 -2
- data/app/models/event.rb +31 -15
- data/app/models/ext.rb +3 -3
- data/app/models/ext/delayed_indexing.rb +41 -1
- data/app/models/ext/integrations.rb +6 -0
- data/app/models/forwarding_job_monitor.rb +2 -0
- data/app/models/household.rb +1 -1
- data/app/models/import.rb +39 -8
- data/app/models/imports/donations_import.rb +110 -19
- data/app/models/imports/events_import.rb +3 -2
- data/app/models/imports/mappings.rb +991 -0
- data/app/models/imports/memberships_import.rb +218 -20
- data/app/models/imports/people_import.rb +9 -1
- data/app/models/imports/rollback.rb +9 -0
- data/app/models/imports/validations.rb +7 -0
- data/app/models/individual.rb +3 -1
- data/app/models/item.rb +55 -17
- data/app/models/job/acknowledge_job.rb +23 -0
- data/app/models/job/checkout_processor.rb +1 -1
- data/app/models/job/convert_order_processor.rb +14 -0
- data/app/models/job/daily_email_report_job.rb +1 -12
- data/app/models/job/destroy_show_job.rb +1 -6
- data/app/models/job/destroy_tag_job.rb +18 -0
- data/app/models/job/door_list_generator_job.rb +33 -0
- data/app/models/job/door_list_mailer_job.rb +15 -0
- data/app/models/job/email_organization_sales_report_job.rb +32 -0
- data/app/models/job/expire_ticket_job.rb +19 -2
- data/app/models/job/export_people_job.rb +47 -0
- data/app/models/job/export_settlements_job.rb +24 -0
- data/app/models/job/geocode_address_job.rb +2 -7
- data/app/models/job/mailchimp_sync_job.rb +61 -3
- data/app/models/job/merge_job.rb +19 -0
- data/app/models/job/order_export_job.rb +36 -0
- data/app/models/job/order_mailer_job.rb +1 -2
- data/app/models/job/order_processor.rb +17 -6
- data/app/models/job/person_lifetime_value_job.rb +1 -0
- data/app/models/job/search_export_job.rb +33 -0
- data/app/models/job/suggest_households_by_address_job.rb +29 -0
- data/app/models/job/suggest_households_by_spouse_job.rb +22 -0
- data/app/models/job_monitor.rb +14 -0
- data/app/models/kit.rb +35 -8
- data/app/models/kits/campaigns_kit.rb +27 -0
- data/app/models/kits/mailchimp_kit.rb +548 -124
- data/app/models/kits/membership_kit.rb +14 -6
- data/app/models/kits/passes_kit.rb +14 -6
- data/app/models/kits/regular_donation_kit.rb +29 -2
- data/app/models/{relationships_kit.rb → kits/relationships_kit.rb} +3 -7
- data/app/models/kits/scannable_tickets_kit.rb +0 -5
- data/app/models/kits/sponsored_donation_kit.rb +2 -12
- data/app/models/kits/ticketing_kit.rb +9 -1
- data/app/models/linking_job_monitor.rb +2 -0
- data/app/models/list_grouping.rb +10 -0
- data/app/models/member.rb +35 -23
- data/app/models/member_number_generator.rb +2 -0
- data/app/models/membership.rb +23 -14
- data/app/models/membership_change.rb +17 -1
- data/app/models/membership_comp.rb +48 -23
- data/app/models/membership_comp_job.rb +7 -0
- data/app/models/membership_type.rb +13 -7
- data/app/models/monitorable.rb +19 -0
- data/app/models/note.rb +10 -1
- data/app/models/order.rb +170 -21
- data/app/models/order_handler.rb +13 -2
- data/app/models/orders/convert_order.rb +11 -0
- data/app/models/organization.rb +87 -9
- data/app/models/parsed_row.rb +142 -67
- data/app/models/pass.rb +13 -7
- data/app/models/pass_type.rb +17 -4
- data/app/models/passes_report.rb +6 -3
- data/app/models/payment.rb +16 -6
- data/app/models/payments/cash_payment.rb +1 -0
- data/app/models/payments/check_payment.rb +1 -5
- data/app/models/payments/comp_payment.rb +0 -1
- data/app/models/payments/credit_card_payment.rb +2 -7
- data/app/models/permission.rb +28 -0
- data/app/models/person.rb +503 -94
- data/app/models/phone.rb +3 -0
- data/app/models/redis_manager.rb +39 -0
- data/app/models/relationship.rb +31 -4
- data/app/models/relationship_builder.rb +0 -3
- data/app/models/rolling_membership_type.rb +5 -1
- data/app/models/s3_coordinator.rb +21 -0
- data/app/models/sale.rb +7 -4
- data/app/models/scheduled_pledge_payment.rb +69 -0
- data/app/models/search.rb +236 -24
- data/app/models/section.rb +6 -4
- data/app/models/show.rb +21 -12
- data/app/models/show_validator.rb +45 -0
- data/app/models/soft_credit.rb +126 -0
- data/app/models/subscribed_list.rb +52 -0
- data/app/models/suggested_household.rb +8 -2
- data/app/models/ticket.rb +35 -10
- data/app/models/ticket/locker.rb +25 -0
- data/app/models/ticket_summary.rb +1 -1
- data/app/models/ticket_type.rb +14 -2
- data/app/models/user.rb +42 -3
- data/app/models/user_membership.rb +57 -3
- data/app/models/valuation/lifetime_donations.rb +2 -2
- data/app/models/valuation/lifetime_pledges.rb +35 -0
- data/app/models/valuation/lifetime_value.rb +5 -1
- data/app/models/valuation_query.rb +109 -0
- data/app/models/venue.rb +8 -0
- data/app/views/actions/_action.html.haml +1 -1
- data/app/views/actions/_form.html.haml +2 -2
- data/app/views/actions/give/_show.html.haml +1 -1
- data/app/views/actions/pledge/_show.html.haml +8 -0
- data/app/views/actions/shared/_show.html.haml +1 -1
- data/app/views/addresses/_address.html.haml +3 -1
- data/app/views/advanced_search_segments/_advanced_searches_results.html.haml +15 -0
- data/app/views/advanced_search_segments/index.html.haml +18 -0
- data/app/views/advanced_search_segments/show.html.haml +46 -0
- data/app/views/advanced_searches/_form.html.haml +61 -0
- data/app/views/advanced_searches/_hit.html.haml +10 -0
- data/app/views/advanced_searches/_household.html.haml +7 -0
- data/app/views/advanced_searches/_new_condition.html.haml +3 -0
- data/app/views/advanced_searches/_people_count.html.erb +3 -0
- data/app/views/advanced_searches/_people_list.html.haml +5 -0
- data/app/views/advanced_searches/filters/_action.html.haml +12 -0
- data/app/views/advanced_searches/filters/_birthday.html.haml +9 -0
- data/app/views/advanced_searches/filters/_discount_code.html.haml +7 -0
- data/app/views/advanced_searches/filters/_donated.html.haml +17 -0
- data/app/views/advanced_searches/filters/_email.html.haml +7 -0
- data/app/views/advanced_searches/filters/_has_purchased_for.html.haml +9 -0
- data/app/views/advanced_searches/filters/_keyword.html.haml +9 -0
- data/app/views/advanced_searches/filters/_lifetime_value.html.haml +13 -0
- data/app/views/advanced_searches/filters/_limit_results.html.haml +7 -0
- data/app/views/advanced_searches/filters/_location.html.haml +11 -0
- data/app/views/advanced_searches/filters/_mailchimp_group.html.haml +8 -0
- data/app/views/advanced_searches/filters/_mailchimp_list.html.haml +8 -0
- data/app/views/advanced_searches/filters/_membership_ended.html.haml +9 -0
- data/app/views/advanced_searches/filters/_membership_started.html.haml +9 -0
- data/app/views/advanced_searches/filters/_membership_status.html.haml +8 -0
- data/app/views/advanced_searches/filters/_membership_type.html.haml +8 -0
- data/app/views/advanced_searches/filters/_orders.html.haml +10 -0
- data/app/views/advanced_searches/filters/_pass_type.html.haml +9 -0
- data/app/views/advanced_searches/filters/_relationships.html.haml +8 -0
- data/app/views/advanced_searches/filters/_segment.html.haml +8 -0
- data/app/views/advanced_searches/filters/_tagging.html.haml +9 -0
- data/app/views/advanced_searches/new.html.haml +12 -0
- data/app/views/advanced_searches/show.html.haml +107 -0
- data/app/views/advanced_searches/shows_for_org.html.haml +1 -0
- data/app/views/advanced_searches/ticket_types_for_org.html.haml +1 -0
- data/app/views/advanced_searches/update.js.erb +9 -0
- data/app/views/appeals/_form.html.haml +113 -0
- data/app/views/appeals/_header.html.haml +6 -0
- data/app/views/appeals/_heard_action.html.haml +16 -0
- data/app/views/appeals/edit.html.haml +8 -0
- data/app/views/appeals/new.html.haml +6 -0
- data/app/views/campaigns/_campaign_donations.html.haml +19 -0
- data/app/views/campaigns/_campaign_stats.html.haml +28 -0
- data/app/views/campaigns/_form.html.haml +48 -0
- data/app/views/campaigns/_header.html.haml +6 -0
- data/app/views/campaigns/edit.html.haml +6 -0
- data/app/views/campaigns/index.html.haml +33 -0
- data/app/views/campaigns/new.html.haml +6 -0
- data/app/views/campaigns/show.html.haml +132 -0
- data/app/views/console_sales/_cart.html.haml +3 -2
- data/app/views/console_sales/_payment.html.haml +14 -1
- data/app/views/console_sales/new.html.haml +11 -6
- data/app/views/contributions/_form.html.haml +139 -37
- data/app/views/contributions/_header.html.haml +5 -0
- data/app/views/contributions/_match_eligible.html.haml +24 -0
- data/app/views/contributions/_pledge_payment.html.haml +22 -0
- data/app/views/contributions/_search.html.haml +30 -0
- data/app/views/contributions/_soft_credit.html.haml +25 -0
- data/app/views/contributions/edit.html.haml +5 -8
- data/app/views/contributions/find_person.html.haml +16 -15
- data/app/views/contributions/index.html.haml +61 -24
- data/app/views/contributions/new.html.haml +5 -5
- data/app/views/converts/_grouped_form.html.haml +11 -0
- data/app/views/converts/new.html.haml +35 -0
- data/app/views/delete_ticket_types/_cannot_destroy_modal.html.haml +11 -0
- data/app/views/delete_ticket_types/_cannot_destroy_modal.rb +0 -0
- data/app/views/delete_ticket_types/_confirm_destroy_modal.html.haml +13 -0
- data/app/views/delete_ticket_types/show.html.haml +4 -0
- data/app/views/discounts/_form.html.haml +1 -1
- data/app/views/events/_day_date_show.html.haml +4 -2
- data/app/views/events/_glance.html.haml +12 -12
- data/app/views/events/_header.html.haml +1 -1
- data/app/views/events/_list.html.haml +1 -1
- data/app/views/events/_menu.html.haml +26 -21
- data/app/views/events/_section_fields.html.haml +1 -1
- data/app/views/events/_tax_deductible_message.html.haml +3 -0
- data/app/views/events/_ticket_type_fields.html.haml +13 -3
- data/app/views/events/index.html.haml +2 -1
- data/app/views/events/messages.html.haml +12 -10
- data/app/views/events/show.html.haml +6 -6
- data/app/views/events/temp_discount_form.html.haml +1 -1
- data/app/views/events_pass_types/_form.html.haml +1 -1
- data/app/views/events_pass_types/new.html.haml +1 -2
- data/app/views/households/_edit_modal.html.haml +9 -4
- data/app/views/households/_form.html.haml +6 -1
- data/app/views/households/_header.html.haml +9 -18
- data/app/views/households/confirm.html.haml +43 -0
- data/app/views/households/new.html.haml +3 -1
- data/app/views/households/show.html.haml +2 -1
- data/app/views/households/suggested.html.haml +10 -27
- data/app/views/imports/_export_links.html.haml +2 -2
- data/app/views/imports/donations/_new.html.haml +49 -6
- data/app/views/imports/donations/_pending.html.haml +69 -22
- data/app/views/imports/donations/_preview.html.haml +23 -0
- data/app/views/imports/events/_new.html.haml +8 -8
- data/app/views/imports/index.html.haml +26 -21
- data/app/views/imports/memberships/_approved.html.haml +16 -0
- data/app/views/imports/memberships/_caching.html.haml +17 -0
- data/app/views/imports/memberships/_failed.html.haml +5 -0
- data/app/views/imports/memberships/_imported.html.haml +45 -0
- data/app/views/imports/memberships/_importing.html.haml +20 -0
- data/app/views/imports/memberships/_invalid.html.haml +5 -0
- data/app/views/imports/memberships/_new.html.haml +155 -0
- data/app/views/imports/memberships/_pending.html.haml +85 -0
- data/app/views/imports/memberships/_preview_rows.html.haml +38 -0
- data/app/views/imports/people/_new.html.haml +81 -15
- data/app/views/imports/shared/_inspect_modal.html.haml +10 -1
- data/app/views/imports/shared/_new_sidebar.html.haml +12 -0
- data/app/views/imports/show.html.haml +0 -3
- data/app/views/index/_action.html.haml +4 -3
- data/app/views/index/_recent_activity.html.haml +14 -7
- data/app/views/index/dashboard.html.haml +27 -14
- data/app/views/job_monitors/_job_monitor_show.html.haml +34 -0
- data/app/views/job_monitors/_linking_job_monitor_show.html.haml +31 -0
- data/app/views/job_monitors/show.html.haml +1 -0
- data/app/views/layouts/_google_analytics.html.haml +9 -11
- data/app/views/layouts/_menu.html.haml +5 -3
- data/app/views/layouts/application.html.haml +12 -4
- data/app/views/layouts/devise_layout.html.haml +1 -1
- data/app/views/layouts/storefront.html.haml +7 -10
- data/app/views/members/index/index.html.haml +82 -4
- data/app/views/members/mailer/_invitation_body.html.haml +2 -2
- data/app/views/members/passwords/new.html.haml +13 -0
- data/app/views/members/sessions/new.html.haml +1 -1
- data/app/views/membership_comps/confirm.html.haml +10 -8
- data/app/views/membership_comps/create.html.haml +1 -3
- data/app/views/membership_kits/edit.html.haml +6 -0
- data/app/views/membership_types/_form.html.haml +1 -1
- data/app/views/membership_types/index.html.haml +11 -3
- data/app/views/memberships/index.html.haml +122 -109
- data/app/views/merges/find_person.html.haml +5 -3
- data/app/views/merges/new.html.haml +13 -4
- data/app/views/notes/_note.html.haml +3 -3
- data/app/views/order_mailer/confirmation_for.html.haml +1 -0
- data/app/views/order_mailer/confirmation_for.text.haml +1 -0
- data/app/views/orders/_assignable_donations.html.haml +25 -0
- data/app/views/orders/_assignable_pledges.html.haml +26 -0
- data/app/views/orders/_item_table.haml +20 -8
- data/app/views/orders/_order_sidebar.html.haml +37 -7
- data/app/views/orders/membership.html.haml +2 -2
- data/app/views/orders/passes.html.haml +4 -4
- data/app/views/orders/sales.html.haml +5 -5
- data/app/views/orders/show.html.haml +26 -7
- data/app/views/organizations/_form.html.haml +0 -5
- data/app/views/pass_types/index.html.haml +13 -5
- data/app/views/passes/index.html.haml +50 -39
- data/app/views/passes_kits/edit.html.haml +6 -0
- data/app/views/passes_reports/index.html.haml +1 -1
- data/app/views/pdfs/member.html.haml +1 -1
- data/app/views/pdfs/member_card_generator/blanks_usa_idc6.html.haml +1 -1
- data/app/views/pdfs/order.html.haml +5 -3
- data/app/views/people/_address_fields.html.haml +40 -0
- data/app/views/people/_convert_to_company_modal.html.haml +3 -0
- data/app/views/people/_edit_modal.html.haml +121 -38
- data/app/views/people/_form.html.haml +8 -14
- data/app/views/people/_header.html.haml +11 -16
- data/app/views/people/_list.html.haml +3 -9
- data/app/views/people/_mailchimp_group.html.haml +3 -0
- data/app/views/people/_phone_fields.html.haml +1 -1
- data/app/views/people/_relationship_fields.html.haml +10 -5
- data/app/views/people/_work_with_menu.html.haml +14 -8
- data/app/views/people/index.html.haml +10 -9
- data/app/views/people/new.html.haml +18 -4
- data/app/views/people/pledges.html.haml +13 -0
- data/app/views/people/show.html.haml +96 -45
- data/app/views/pledges/_none_scheduled_payment_table.html.haml +17 -0
- data/app/views/pledges/_receive_pledge.html.haml +87 -0
- data/app/views/pledges/_scheduled_payments_table.html.haml +18 -0
- data/app/views/pledges/index.html.haml +47 -0
- data/app/views/preview_rows/index.html.haml +1 -0
- data/app/views/producer_mailer/donation_notification.html.haml +9 -0
- data/app/views/producer_mailer/donation_notification.text.erb +8 -0
- data/app/views/producer_mailer/door_list_notification.html.haml +10 -0
- data/app/views/producer_mailer/door_list_notification.text.erb +6 -0
- data/app/views/producer_mailer/mailchimp_kit_initial_sync_notification.html.haml +2 -2
- data/app/views/regular_donation_kits/edit.html.haml +29 -1
- data/app/views/relationships/index.html.haml +1 -1
- data/app/views/sales/_boxoffice.html.haml +15 -5
- data/app/views/sales/_doorlist.html.haml +2 -2
- data/app/views/sales/new.html.haml +2 -2
- data/app/views/searches/_company.html.haml +7 -0
- data/app/views/searches/_form.html.haml +75 -8
- data/app/views/searches/_household.html.haml +2 -2
- data/app/views/searches/_individual.html.haml +7 -0
- data/app/views/searches/show.html.haml +59 -23
- data/app/views/segments/index.html.haml +1 -1
- data/app/views/segments/show.html.haml +36 -1
- data/app/views/shared/_baseball_card.html.haml +40 -0
- data/app/views/shared/_tags.html.haml +10 -8
- data/app/views/shows/_empty_ticket_table.html.haml +12 -0
- data/app/views/shows/_sections_table.html.haml +78 -69
- data/app/views/shows/_ticket_table.html.haml +10 -7
- data/app/views/shows/index.html.haml +95 -85
- data/app/views/statements/_shows.html.haml +1 -1
- data/app/views/store/checkouts/_event_information.html.haml +89 -0
- data/app/views/store/checkouts/_shopping_cart_display.haml +8 -0
- data/app/views/store/checkouts/_thanks.html.haml +40 -0
- data/app/views/store/checkouts/create.html.haml +1 -0
- data/app/views/store/checkouts/shopping_cart_display/_discounts.haml +8 -0
- data/app/views/store/checkouts/shopping_cart_display/_donations.haml +15 -0
- data/app/views/store/checkouts/{_membership_info.html.haml → shopping_cart_display/_membership_info.html.haml} +0 -0
- data/app/views/store/checkouts/shopping_cart_display/_memberships.haml +8 -0
- data/app/views/store/checkouts/shopping_cart_display/_passes.haml +9 -0
- data/app/views/store/checkouts/shopping_cart_display/_tickets.haml +10 -0
- data/app/views/store/checkouts/shopping_cart_display/_total.haml +10 -0
- data/app/views/store/donations/index.html.haml +4 -0
- data/app/views/store/events/_contact_info.html.haml +8 -0
- data/app/views/store/events/_venue.html.haml +14 -7
- data/app/views/store/events/calendar.html.haml +2 -9
- data/app/views/store/events/show.html.haml +2 -9
- data/app/views/store/events/single_show.html.haml +3 -3
- data/app/views/store/memberships/index.html.haml +3 -3
- data/app/views/store/orders/blank.html.erb +34 -0
- data/app/views/store/orders/show.html.haml +15 -6
- data/app/views/store/passes/index.html.haml +3 -3
- data/app/views/store/shared/_small_donate_form.html.haml +21 -18
- data/app/views/tags/_edit_modal.html.haml +16 -0
- data/app/views/tags/index.html.haml +23 -0
- data/app/views/unacknowledged_gifts/_heard_action.html.haml +10 -0
- data/app/views/unacknowledged_gifts/index.html.haml +76 -0
- data/app/views/user_memberships/_list.html.haml +147 -24
- data/config/initializers/delayed_job_config.rb +10 -1
- data/config/routes.rb +85 -9
- data/db/migrate/20140422193345_add_email_copy_to_pass_type.rb +1 -1
- data/db/migrate/20140616045851_add_birthdate_to_search.rb +7 -0
- data/db/migrate/20140623131025_create_campaigns.rb +27 -0
- data/db/migrate/20140627120214_create_appeals.rb +28 -0
- data/db/migrate/20140630151406_add_deleted_at_to_campaigns.rb +9 -0
- data/db/migrate/20140701124100_add_segment_id_and_notes_to_appeals.rb +12 -0
- data/db/migrate/20140702115815_add_campaign_id_and_appeal_id_to_donations.rb +14 -0
- data/db/migrate/20140702121928_add_materials_to_appeals.rb +11 -0
- data/db/migrate/20140702150521_add_deleted_at_to_appeals.rb +9 -0
- data/db/migrate/20140709151816_add_campaign_id_and_appeal_id_to_orders.rb +14 -0
- data/db/migrate/20140723133850_remove_campaign_id_and_apeal_id_from_orders.rb +11 -0
- data/db/migrate/20140723134923_add_commitment_date_to_donations.rb +6 -0
- data/db/migrate/20140730141515_add_match_eligible_to_donations.rb +15 -0
- data/db/migrate/20140818141140_create_soft_credits.rb +12 -0
- data/db/migrate/20140903140113_add_pledge_to_donations.rb +9 -0
- data/db/migrate/20140904183953_add_destroyed_at_to_relationships.rb +7 -0
- data/db/migrate/20140905080503_create_scheduled_pledge_payments.rb +16 -0
- data/db/migrate/20140909150251_add_org_to_suggested_household.rb +7 -0
- data/db/migrate/20141007114614_add_order_id_to_donations.rb +15 -0
- data/db/migrate/20141021134013_add_lifetime_pledges_to_people.rb +5 -0
- data/db/migrate/20141027191307_default_overwrite_member_addresses_to_false.rb +5 -0
- data/db/migrate/20141031193839_update_relations.rb +9 -0
- data/db/migrate/20141126183258_add_mailchimp_status_fields_to_people.rb +6 -0
- data/db/migrate/20141126184811_add_processing_at_to_ticket.rb +5 -0
- data/db/migrate/20141127135743_add_import_to_campaigns.rb +6 -0
- data/db/migrate/20141128143944_add_fiscal_year_to_donations.rb +5 -0
- data/db/migrate/20141128151407_remove_fiscal_year_from_scheduled_pledge_payments.rb +3 -0
- data/db/migrate/20141204164400_add_more_indexes_to_actions.rb +7 -0
- data/db/migrate/20141204171612_add_indexes_to_charts.rb +12 -0
- data/db/migrate/20141204172658_add_hide_on_recent_activity_to_actions.rb +5 -0
- data/db/migrate/20141204173004_add_indexes_to_ept.rb +9 -0
- data/db/migrate/20141204211933_remove_membership_counts_from_members.rb +13 -0
- data/db/migrate/20141205202030_create_subscribed_lists.rb +19 -0
- data/db/migrate/20141208225228_add_mailchimp_lists_to_searches.rb +5 -0
- data/db/migrate/20141210162329_add_bounced_to_subscribed_lists.rb +5 -0
- data/db/migrate/20141211165307_add_external_reference_to_actions.rb +5 -0
- data/db/migrate/20141212172119_add_not_mailchimp_lists_to_searches.rb +5 -0
- data/db/migrate/20141229204605_normalize_states_in_addresses.rb +11 -0
- data/db/migrate/20150113091344_add_fiscal_to_organizations.rb +11 -0
- data/db/migrate/20150113091434_create_budget_restrictions.rb +14 -0
- data/db/migrate/20150113091503_add_budget_restriction_to_campaigns.rb +14 -0
- data/db/migrate/20150129091354_add_campaign_to_searches.rb +13 -0
- data/db/migrate/20150203174456_create_list_groupings.rb +12 -0
- data/db/migrate/20150203222451_add_groupings_to_searches.rb +6 -0
- data/db/migrate/20150219153827_add_roles_to_user_memberships.rb +13 -0
- data/db/migrate/20150223145657_add_daily_sales_to_user_membership.rb +13 -0
- data/db/migrate/20150318171857_create_advanced_searches.rb +16 -0
- data/db/migrate/20150319185940_add_org_id_index_to_orders.rb +5 -0
- data/db/migrate/20150325085516_add_received_amount_to_donations.rb +16 -0
- data/db/migrate/20150325173053_add_pass_index_to_tickets.rb +5 -0
- data/db/migrate/20150331084817_add_creator_id_to_orders.rb +11 -0
- data/db/migrate/20150406162656_index_tickets_on_action_id.rb +5 -0
- data/db/migrate/20150408123349_add_donor_instructions_to_orders.rb +9 -0
- data/db/migrate/20150408125600_add_index_to_imports.rb +5 -0
- data/db/migrate/20150414193419_add_index_to_phone.rb +5 -0
- data/db/migrate/20150414193646_add_index_to_taggings.rb +5 -0
- data/db/migrate/20150415113013_add_nickname_to_people.rb +11 -0
- data/db/migrate/20150420143707_add_indexes_to_donations.rb +7 -0
- data/db/migrate/20150421092302_add_kind_to_addresses.rb +11 -0
- data/db/migrate/20150513154513_add_name_to_advanced_search.rb +5 -0
- data/db/migrate/20150518131946_add_receive_donation_notification_to_user_memberships.rb +9 -0
- data/db/migrate/20150520182350_remove_name_from_advanced_search.rb +9 -0
- data/db/migrate/20150520202900_create_advanced_search_segments.rb +9 -0
- data/db/migrate/20150520210658_add_advanced_search_id_to_advanced_search_segment.rb +5 -0
- data/db/migrate/20150521183507_add_organization_id_to_advanced_search_segment.rb +5 -0
- data/db/migrate/20150602204548_add_index_on_deleted_at.rb +5 -0
- data/db/migrate/20150711143014_add_receive_door_list_to_user_memberships.rb +10 -0
- data/db/migrate/20150716000301_create_job_monitors_table.rb +12 -0
- data/db/migrate/20150807005404_re_refresh_show_stats.rb +8 -0
- data/db/migrate/20150810133417_convert_business_to_work.rb +5 -0
- data/db/migrate/20150812135205_update_notes_nulls.rb +9 -0
- data/db/migrate/20150813202745_index_household_id.rb +6 -0
- data/db/migrate/20150814075653_add_maiden_name_to_people.rb +9 -0
- data/db/migrate/20150911203530_normalize_countries_in_addresses.rb +11 -0
- data/db/migrate/20150922155253_add_advanced_search_segment_id_to_membership_types.rb +5 -0
- data/db/migrate/20150922155308_add_advanced_search_segment_id_to_pass_types.rb +5 -0
- data/db/migrate/20151006180702_add_deleted_at_to_ticket_types.rb +5 -0
- data/db/migrate/20151009175206_add_receipt_details_to_ticket_types.rb +5 -0
- data/db/migrate/20151112174723_index_list_groupings.rb +5 -0
- data/lib/artfully_ose/common_abilities.rb +80 -57
- data/lib/artfully_ose/version.rb +1 -1
- data/lib/tasks/artfully_ose.rake +46 -4
- data/spec/factories/action_factories.rb +2 -0
- data/spec/factories/address_factories.rb +2 -2
- data/spec/factories/advanced_search_factories.rb +45 -0
- data/spec/factories/advanced_search_segment_factories.rb +6 -0
- data/spec/factories/advanced_segment_factories.rb +6 -0
- data/spec/factories/campaign_factories.rb +20 -0
- data/spec/factories/cart_factories.rb +24 -0
- data/spec/factories/chart_factories.rb +4 -0
- data/spec/factories/event_factories.rb +6 -0
- data/spec/factories/item_factories.rb +23 -1
- data/spec/factories/kit_factories.rb +27 -3
- data/spec/factories/member_factories.rb +8 -1
- data/spec/factories/membership_factories.rb +12 -0
- data/spec/factories/membership_type_factories.rb +18 -0
- data/spec/factories/note_factories.rb +7 -0
- data/spec/factories/order_factories.rb +7 -0
- data/spec/factories/pass_factories.rb +6 -0
- data/spec/factories/payments_factories.rb +1 -1
- data/spec/factories/person_factories.rb +46 -4
- data/spec/factories/scheduled_pledge_payment_factories.rb +10 -0
- data/spec/factories/show_factories.rb +8 -3
- data/spec/factories/soft_credit_factories.rb +8 -0
- data/spec/factories/ticket_factories.rb +22 -9
- data/spec/factories/user_factories.rb +16 -8
- metadata +342 -59
- data/app/controllers/comps_controller.rb +0 -47
- data/app/models/household_suggester.rb +0 -58
- data/app/views/searches/_person.html.haml +0 -10
- data/app/views/store/checkouts/thanks.html.haml +0 -134
@@ -1,4 +1,10 @@
|
|
1
|
-
class Store::MembershipsController < Store::StoreController
|
1
|
+
class Store::MembershipsController < Store::StoreController
|
2
|
+
rescue_from ActiveRecord::RecordNotFound do
|
3
|
+
render :text => File.read("#{Rails.root}/public/404.html"),
|
4
|
+
:content_type => Mime::HTML,
|
5
|
+
:status => :not_found
|
6
|
+
end
|
7
|
+
|
2
8
|
def show
|
3
9
|
membership_type = MembershipType.sales_valid.find(params[:id])
|
4
10
|
@membership_types = [membership_type]
|
@@ -9,8 +15,35 @@ class Store::MembershipsController < Store::StoreController
|
|
9
15
|
end
|
10
16
|
|
11
17
|
def index
|
12
|
-
|
13
|
-
|
14
|
-
|
18
|
+
bonk if no_kit
|
19
|
+
bonk if storefront_off && !producer_logged_in?
|
20
|
+
add_preview_text if storefront_off && producer_logged_in?
|
21
|
+
load_types_and_kit
|
15
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def load_types_and_kit
|
26
|
+
@membership_types = store_organization.membership_types.storefront.sales_valid.order('price desc')
|
27
|
+
@membership_kit = MembershipKit.where(:organization_id => store_organization.id).first
|
28
|
+
end
|
29
|
+
|
30
|
+
def bonk
|
31
|
+
raise ActionController::RoutingError.new('Not Found')
|
32
|
+
end
|
33
|
+
|
34
|
+
def no_kit
|
35
|
+
!@store_organization.has_kit?(:membership)
|
36
|
+
end
|
37
|
+
|
38
|
+
def storefront_off
|
39
|
+
!@store_organization.has_active_membership_storefront?
|
40
|
+
end
|
41
|
+
|
42
|
+
def producer_logged_in?
|
43
|
+
current_user && current_user.current_organization == @store_organization
|
44
|
+
end
|
45
|
+
|
46
|
+
def add_preview_text
|
47
|
+
flash[:notice] = "You are seeing a preview of your membership storefront. To make this page visible to the general public, go to your Membership Kit configuration and check \"Display Membership Storefront\""
|
48
|
+
end
|
16
49
|
end
|
@@ -27,16 +27,7 @@ class Store::OrdersController < Store::StoreController
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def show
|
30
|
-
|
31
|
-
@special_instructions_hash = {}
|
32
|
-
current_cart.tickets.each do |ticket|
|
33
|
-
event = ticket.event
|
34
|
-
if event.show_special_instructions?
|
35
|
-
@special_instructions_hash[event.id] = event.special_instructions_caption
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
person = current_member.try(:person) || current_cart.applied_pass.try(:person)
|
30
|
+
person = current_member.try(:person) || current_cart.applied_pass.try(:person)
|
40
31
|
if person.present?
|
41
32
|
params[:first_name] ||= person.first_name
|
42
33
|
params[:last_name] ||= person.last_name
|
@@ -51,7 +42,9 @@ class Store::OrdersController < Store::StoreController
|
|
51
42
|
params[:address][:zip] = person.address.try(:zip)
|
52
43
|
end
|
53
44
|
|
45
|
+
@widget_return_url = params[:return_url]
|
54
46
|
@enter_code_string = (store_organization.can?(:access, :passes) ? "Use Discount or Pass Code" : "Use Discount Code")
|
47
|
+
@special_instructions_hash = special_instructions
|
55
48
|
end
|
56
49
|
|
57
50
|
def destroy
|
@@ -60,7 +53,30 @@ class Store::OrdersController < Store::StoreController
|
|
60
53
|
redirect_to (session[:last_event_id].blank? ? store_order_path : store_old_storefront_event_url(session[:last_event_id]))
|
61
54
|
end
|
62
55
|
|
56
|
+
def blank
|
57
|
+
render :layout => false
|
58
|
+
end
|
59
|
+
|
63
60
|
private
|
61
|
+
def special_instructions
|
62
|
+
special_instructions_hash = {}
|
63
|
+
regular_donation_kit = @store_organization.kit(:regular_donation)
|
64
|
+
unless regular_donation_kit.nil? || current_cart.donations.empty?
|
65
|
+
special_instructions_hash[0] = regular_donation_kit.donation_instructions_text.present? ?
|
66
|
+
regular_donation_kit.donation_instructions_text :
|
67
|
+
"Thank you for your donation. Do you have any special instructions for this gift?"
|
68
|
+
end
|
69
|
+
|
70
|
+
current_cart.tickets.each do |ticket|
|
71
|
+
event = ticket.event
|
72
|
+
if event.show_special_instructions?
|
73
|
+
special_instructions_hash[event.id] = event.special_instructions_caption
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
special_instructions_hash
|
78
|
+
end
|
79
|
+
|
64
80
|
def event
|
65
81
|
current_cart.tickets.first.event
|
66
82
|
end
|
@@ -6,8 +6,35 @@ class Store::PassesController < Store::StoreController
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def index
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
bonk if no_kit
|
10
|
+
bonk if storefront_off && !producer_logged_in?
|
11
|
+
add_preview_text if storefront_off && producer_logged_in?
|
12
|
+
load_types_and_kit
|
12
13
|
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def load_types_and_kit
|
17
|
+
@pass_types = store_organization.pass_types.storefront.order('price desc')
|
18
|
+
@passes_kit = PassesKit.where(:organization_id => store_organization.id).first
|
19
|
+
end
|
20
|
+
|
21
|
+
def bonk
|
22
|
+
raise ActionController::RoutingError.new('Not Found')
|
23
|
+
end
|
24
|
+
|
25
|
+
def no_kit
|
26
|
+
!@store_organization.has_kit?(:passes)
|
27
|
+
end
|
28
|
+
|
29
|
+
def storefront_off
|
30
|
+
!@store_organization.has_active_passes_storefront?
|
31
|
+
end
|
32
|
+
|
33
|
+
def producer_logged_in?
|
34
|
+
current_user && current_user.current_organization == @store_organization
|
35
|
+
end
|
36
|
+
|
37
|
+
def add_preview_text
|
38
|
+
flash[:notice] = "You are seeing a preview of your passes storefront. To make this page visible to the general public, go to your Passes Kit configuration and check \"Display Passes Storefront\""
|
39
|
+
end
|
13
40
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class TagsController < ApplicationController
|
2
|
+
before_filter :organization_tags, :only => [:index]
|
3
|
+
|
4
|
+
def index
|
5
|
+
authorize! :view, Person
|
6
|
+
@tags = @tags.paginate(:page => params[:page], :per_page => 20).order('name ASC').uniq
|
7
|
+
end
|
8
|
+
|
9
|
+
def update_tag
|
10
|
+
authorize! :manage, Person
|
11
|
+
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
|
12
|
+
if valid?(params[:name])
|
13
|
+
@tag.update_attributes(name: params[:name])
|
14
|
+
flash[:notice] = "Successfully updated tag."
|
15
|
+
redirect_to tags_path
|
16
|
+
else
|
17
|
+
flash[:error] = "Only letters, numbers, or dashes allowed in tags"
|
18
|
+
redirect_to tags_path
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def destroy
|
23
|
+
authorize! :manage, Person
|
24
|
+
#
|
25
|
+
# DestroyTagJob is super fast and runs in (effectively) constant time. No need to run asynchrnously.
|
26
|
+
#
|
27
|
+
DestroyTagJob.new(current_user.current_organization, params[:id]).perform
|
28
|
+
flash[:notice] = "That tag has been deleted."
|
29
|
+
redirect_to tags_path
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def valid?(name)
|
35
|
+
valid_name = name =~ /^[0-9a-zA-Z-]+$/
|
36
|
+
valid_name.nil? ? false : true
|
37
|
+
end
|
38
|
+
|
39
|
+
def organization_tags
|
40
|
+
@tags = current_user.current_organization.tags_for(:people)
|
41
|
+
end
|
42
|
+
end
|
@@ -11,9 +11,13 @@ class TicketTypesController < ArtfullyOseController
|
|
11
11
|
@ticket_type = @section.ticket_types.build(params[:ticket_type].except!("section_id"))
|
12
12
|
@ticket_type.show = @section.chart.show
|
13
13
|
if @ticket_type.save
|
14
|
-
flash[:notice] = "Your ticket type has been saved"
|
14
|
+
flash[:notice] = "Your ticket type has been saved."
|
15
15
|
else
|
16
|
-
|
16
|
+
if @section.errors.present?
|
17
|
+
flash[:error] = "We couldn't save your ticket type because " + @section.errors.full_messages.to_sentence
|
18
|
+
else
|
19
|
+
flash[:error] = "Please name all of your ticket types."
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
23
|
redirect_to event_show_path(@section.chart.show.event, @section.chart.show)
|
@@ -30,6 +34,9 @@ class TicketTypesController < ArtfullyOseController
|
|
30
34
|
authorize! :manage, @show
|
31
35
|
params[:ticket_type][:price] = TicketType.price_to_cents(params[:ticket_type][:price])
|
32
36
|
@ticket_type.update_attributes(params[:ticket_type])
|
37
|
+
if !@ticket_type.update_attributes(params[:ticket_type])
|
38
|
+
flash[:error] = "Please name all of your ticket types."
|
39
|
+
end
|
33
40
|
redirect_to event_show_path(@show.event, @show)
|
34
41
|
end
|
35
42
|
|
@@ -14,16 +14,18 @@ class TicketsController < ArtfullyOseController
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def validated
|
17
|
-
|
18
|
-
Ticket
|
17
|
+
@ticket = Ticket.find(params[:id])
|
18
|
+
authorize! :check_in, Ticket
|
19
|
+
@ticket.validate_ticket!(current_user)
|
19
20
|
respond_to do |format|
|
20
21
|
format.json { head :ok }
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
25
|
def unvalidated
|
25
|
-
|
26
|
-
Ticket
|
26
|
+
@ticket = Ticket.find(params[:id])
|
27
|
+
authorize! :check_in, Ticket
|
28
|
+
@ticket.unvalidate_ticket!
|
27
29
|
respond_to do |format|
|
28
30
|
format.json { head :ok }
|
29
31
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class UnacknowledgedGiftsController < ArtfullyOseController
|
2
|
+
requires_kit :campaigns
|
3
|
+
|
4
|
+
before_filter :set_campaigns_and_appeals, :only => [:index]
|
5
|
+
|
6
|
+
def index
|
7
|
+
request.format = :csv if params[:commit] == 'Download'
|
8
|
+
@report = DonationSearch.new(current_organization, params.merge(:only_unacknowledged => true).merge(:has_default_range => true))
|
9
|
+
@rows = @report.rows.paginate(:page => params[:page], :per_page => 20)
|
10
|
+
|
11
|
+
respond_to do |format|
|
12
|
+
format.html
|
13
|
+
|
14
|
+
format.csv do
|
15
|
+
filename = "Artfully-Unacknowledged-Gifts-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
|
16
|
+
send_data @report.rows.to_comma, :filename => filename, :type => "text/csv", :disposition => "attachment"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def bulk_acknowledge
|
22
|
+
order_ids = params[:order_ids]
|
23
|
+
if order_ids.present?
|
24
|
+
hear_action = build_ack_action(params[:occurred_at], params[:subtype], params[:details])
|
25
|
+
Donation.where(order_id: order_ids).update_all(ack_sent_date: hear_action.occurred_at)
|
26
|
+
Delayed::Job.enqueue(AcknowledgeJob.new(hear_action, order_ids))
|
27
|
+
flash[:notice] = "We're setting actions on all those people and will be done in just a few minutes."
|
28
|
+
else
|
29
|
+
flash[:alert] = "Please select orders to acknowledge! "
|
30
|
+
end
|
31
|
+
redirect_to :back
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def build_ack_action(occurred_at, subtype, details)
|
36
|
+
action = HearAction.for_organization(current_organization)
|
37
|
+
|
38
|
+
action.occurred_at = ActiveSupport::TimeZone.create(current_organization.time_zone).parse(occurred_at)
|
39
|
+
action.subtype = subtype
|
40
|
+
action.details = details
|
41
|
+
action.creator_id = current_user.id
|
42
|
+
|
43
|
+
action
|
44
|
+
end
|
45
|
+
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
class UserMembershipsController < ActionController::Base
|
2
|
+
|
2
3
|
def new
|
3
4
|
@organization = Organization.find(params[:organization_id])
|
4
5
|
end
|
5
6
|
|
6
7
|
def create
|
7
|
-
|
8
|
-
@organization = Organization.find(params[:organization_id])
|
9
|
-
authorize! :manage, @organization
|
8
|
+
@organization = current_user.current_organization
|
10
9
|
|
11
10
|
with_user do |user|
|
12
|
-
build_membership(user, @organization) or build_errors(user, @organization)
|
11
|
+
build_membership(user, clean_permission, @organization) or build_errors(user, @organization)
|
13
12
|
end
|
14
13
|
|
15
|
-
|
14
|
+
|
15
|
+
|
16
|
+
redirect_to organization_url(@organization, :active_tab=>"users") and return
|
16
17
|
end
|
17
18
|
|
18
19
|
def destroy
|
@@ -20,16 +21,46 @@ class UserMembershipsController < ActionController::Base
|
|
20
21
|
@mship = UserMembership.find(params[:id])
|
21
22
|
authorize! :manage, @organization
|
22
23
|
@mship.destroy
|
23
|
-
redirect_to organization_url(@organization), :notice => "
|
24
|
+
redirect_to organization_url(@organization, :active_tab=>"users"), :notice => "#{@mship.user.email} has been removed from #{@organization.name}" and return
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@organization = Organization.find(params[:organization_id])
|
29
|
+
@mship = UserMembership.find(params[:id])
|
30
|
+
authorize! :manage, @organization
|
31
|
+
|
32
|
+
if(setting_admin_role? && @organization.admin_limit_reached?)
|
33
|
+
flash[:error] = "Sorry, you cannot have more than one administrator."
|
34
|
+
redirect_to organization_url(@organization, :active_tab=>"users") and return
|
35
|
+
end
|
36
|
+
|
37
|
+
@user = @mship.user
|
38
|
+
|
39
|
+
#
|
40
|
+
# Users cannot change their own permissions
|
41
|
+
#
|
42
|
+
if (current_user.id != @mship.user_id)
|
43
|
+
@mship.set_role!(clean_permission)
|
44
|
+
end
|
45
|
+
|
46
|
+
@mship.receive_daily_sales_report = params[:receive_daily_sales_report]
|
47
|
+
@mship.receive_donation_notification = params[:receive_donation_notification]
|
48
|
+
@mship.receive_door_list = params[:receive_door_list]
|
49
|
+
@mship.save
|
50
|
+
|
51
|
+
redirect_to organization_url(@organization, :active_tab=>"users"), :notice => "Great! We saved the changes to #{@mship.user.email}" and return
|
24
52
|
end
|
25
53
|
|
26
54
|
private
|
27
55
|
|
28
|
-
def build_membership(user, organization)
|
56
|
+
def build_membership(user, role, organization)
|
29
57
|
membership = UserMembership.find_by_user_id_and_organization_id(user.id, organization.id)
|
30
58
|
return false unless membership.nil? and !user.user_memberships.any?
|
31
59
|
|
32
|
-
@membership = organization.user_memberships.build(:user => user)
|
60
|
+
@membership = organization.user_memberships.build(:user => user, Permission.database_column_for(role) => true)
|
61
|
+
@membership.receive_daily_sales_report = params[:receive_daily_sales_report]
|
62
|
+
@membership.receive_donation_notification = params[:receive_donation_notification]
|
63
|
+
@membership.receive_door_list = params[:receive_door_list]
|
33
64
|
if @membership.save
|
34
65
|
flash[:notice] = "#{user.email} has been added successfully."
|
35
66
|
else
|
@@ -54,4 +85,12 @@ class UserMembershipsController < ActionController::Base
|
|
54
85
|
block.call(user) if user.valid?
|
55
86
|
end
|
56
87
|
|
88
|
+
def clean_permission
|
89
|
+
Permission.for(params[:permission])
|
90
|
+
end
|
91
|
+
|
92
|
+
def setting_admin_role?
|
93
|
+
Permission::ORGANIZATION_ADMINISTRATOR == clean_permission
|
94
|
+
end
|
95
|
+
|
57
96
|
end
|
@@ -0,0 +1,252 @@
|
|
1
|
+
module AdvancedSearchesHelper
|
2
|
+
include Imports::Mappings
|
3
|
+
|
4
|
+
def search_membership_type_options(membership_types, selected=nil)
|
5
|
+
options = [
|
6
|
+
['All Membership Types', -1]
|
7
|
+
]
|
8
|
+
|
9
|
+
membership_types.each do |type|
|
10
|
+
options << [type.name, type.id]
|
11
|
+
end
|
12
|
+
|
13
|
+
options_for_select(options, selected)
|
14
|
+
end
|
15
|
+
|
16
|
+
def search_pass_type_options(pass_types, selected=nil)
|
17
|
+
options = [
|
18
|
+
['Any Pass Type', -1]
|
19
|
+
]
|
20
|
+
|
21
|
+
pass_types.each do |type|
|
22
|
+
options << [type.name, type.id]
|
23
|
+
end
|
24
|
+
|
25
|
+
options_for_select(options, selected)
|
26
|
+
end
|
27
|
+
|
28
|
+
def search_segments(segments, selected=nil)
|
29
|
+
options = [
|
30
|
+
['All Segments', -1]
|
31
|
+
]
|
32
|
+
|
33
|
+
segments.each do |segment|
|
34
|
+
options << [segment.name, segment.id]
|
35
|
+
end
|
36
|
+
|
37
|
+
options_for_select(options, selected)
|
38
|
+
end
|
39
|
+
|
40
|
+
def advanced_search_filter_options
|
41
|
+
advanced_search_filters = {
|
42
|
+
'Birthday' => [
|
43
|
+
['By Birthday', 'birthday']
|
44
|
+
],
|
45
|
+
'Donations' => [
|
46
|
+
['Amount/Date', 'donated']
|
47
|
+
],
|
48
|
+
'Contact Info' => [
|
49
|
+
['Email', 'email']
|
50
|
+
],
|
51
|
+
'Events' => [
|
52
|
+
['Purchased Tickets', 'has_purchased_for']
|
53
|
+
],
|
54
|
+
'Value' => [
|
55
|
+
['Total Revenue Value', 'lifetime_value']
|
56
|
+
],
|
57
|
+
'Location' => [
|
58
|
+
['Location', 'location']
|
59
|
+
],
|
60
|
+
'Orders' => [
|
61
|
+
['Discounts', 'discount_code'],
|
62
|
+
['Orders', 'orders']
|
63
|
+
],
|
64
|
+
'Tags' => [
|
65
|
+
['Tags', 'tagging']
|
66
|
+
],
|
67
|
+
'Record' => [
|
68
|
+
['Record Type', 'limit_results']
|
69
|
+
],
|
70
|
+
'Segment' => [
|
71
|
+
['Segment', 'segment']
|
72
|
+
],
|
73
|
+
'Keyword' => [
|
74
|
+
['Keyword', 'keyword']
|
75
|
+
],
|
76
|
+
'Action' => [
|
77
|
+
['Action', 'action']
|
78
|
+
]
|
79
|
+
}
|
80
|
+
|
81
|
+
with_kit(:membership) do
|
82
|
+
advanced_search_filters['Membership'] = [
|
83
|
+
['Start Date', 'membership_started'],
|
84
|
+
['End Date', 'membership_ended'],
|
85
|
+
['Status', 'membership_status'],
|
86
|
+
['Type', 'membership_type']
|
87
|
+
]
|
88
|
+
end
|
89
|
+
|
90
|
+
with_kit(:passes) do
|
91
|
+
advanced_search_filters['Passes'] = [
|
92
|
+
['Type', 'pass_type']
|
93
|
+
]
|
94
|
+
end
|
95
|
+
|
96
|
+
with_kit(:relationships) do
|
97
|
+
advanced_search_filters['Relationships'] = [
|
98
|
+
['Relationships', 'relationships']
|
99
|
+
]
|
100
|
+
end
|
101
|
+
|
102
|
+
with_kit(:mailchimp) do
|
103
|
+
advanced_search_filters['MailChimp'] = [
|
104
|
+
['List', 'mailchimp_list'],
|
105
|
+
['Group', 'mailchimp_group']
|
106
|
+
]
|
107
|
+
end
|
108
|
+
|
109
|
+
advanced_search_filters
|
110
|
+
end
|
111
|
+
|
112
|
+
def search_limit_results_options
|
113
|
+
options = [['All Records', ''], ['Individuals', 'individual'], ['Companies (All)', 'company'], ['Companies (Business)', 'business'], ['Companies (Foundation)', 'foundation'], ['Companies (Government)', 'government'], ['Companies (Nonprofit)', 'nonprofit'], ['Companies (Other)', 'other']]
|
114
|
+
|
115
|
+
with_kit(:relationships) do
|
116
|
+
options.insert(2, ['Households', 'households'])
|
117
|
+
end
|
118
|
+
|
119
|
+
options
|
120
|
+
end
|
121
|
+
|
122
|
+
def discount_code_options(discount_codes)
|
123
|
+
options = discount_codes.map {|discount| [discount.code, discount.id] }
|
124
|
+
options.insert(0, ["Any Discount Code", Discount::ALL_DISCOUNTS_STRING])
|
125
|
+
options
|
126
|
+
end
|
127
|
+
|
128
|
+
def mailchimp_list_options_for_current_org
|
129
|
+
current_user.current_organization.kits.mailchimp.attached_lists.map do |list|
|
130
|
+
[list[:list_name], list[:list_id]]
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def mailchimp_group_options_for_current_org
|
135
|
+
grouped_options = {}
|
136
|
+
current_user.current_organization.kits.mailchimp.attached_lists.each do |list|
|
137
|
+
list.fetch(:groups, []).each do |grouping|
|
138
|
+
option = grouped_options[grouping['name']] = []
|
139
|
+
grouping["groups"].each do |group|
|
140
|
+
option << [group['name'], "#{grouping['id']}|#{group['name']}"]
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
grouped_options
|
145
|
+
end
|
146
|
+
|
147
|
+
def event_options_for_current_org
|
148
|
+
options = Event.options_for_select_by_organization(current_user.current_organization)
|
149
|
+
options.unshift(["Any Event", AdvancedSearch::ANY_EVENT])
|
150
|
+
options
|
151
|
+
end
|
152
|
+
|
153
|
+
def show_options_for_event_id(event_id)
|
154
|
+
return [] if event_id.nil? || event_id == AdvancedSearch::ANY_EVENT
|
155
|
+
event = current_user.current_organization.events.where(id: event_id).includes(:shows).first
|
156
|
+
shows = event.shows
|
157
|
+
show_options = shows.map {|show| [show.to_s, show.id] }
|
158
|
+
show_options.unshift(['Any Show', AdvancedSearch::ANY_SHOW])
|
159
|
+
show_options
|
160
|
+
end
|
161
|
+
|
162
|
+
def ticket_type_options_for_show_id(show_id)
|
163
|
+
return [] if show_id.nil? || show_id == AdvancedSearch::ANY_SHOW
|
164
|
+
show = current_user.current_organization.shows.where(id: show_id).includes(:ticket_types).first
|
165
|
+
ticket_types = show.chart.sections.first.ticket_types_for(nil)
|
166
|
+
ticket_type_options = ticket_types.map {|ticket_type| [ticket_type.name, ticket_type.id] }
|
167
|
+
ticket_type_options.unshift(['Any Ticket Type', AdvancedSearch::ANY_TICKET_TYPE])
|
168
|
+
ticket_type_options
|
169
|
+
end
|
170
|
+
|
171
|
+
# Negation options should contain the positive and negative English phrases for the negation operand
|
172
|
+
# The positive term should be the first element
|
173
|
+
def negation_search_filter(negation_options=['with', 'without'], selected=nil)
|
174
|
+
# Assign a '0' value to the positive value and a '1' to the negative value
|
175
|
+
negation_options = negation_options.map.with_index {|option, index| [option, index] }
|
176
|
+
|
177
|
+
select_tag "search[negation-filter]", options_for_select(negation_options, selected: selected), include_blank: false, class: 'negation-filter', id: nil
|
178
|
+
end
|
179
|
+
|
180
|
+
def search_filter_text_block(text_block)
|
181
|
+
content_tag :span, text_block, class: 'search-filter-text-block'
|
182
|
+
end
|
183
|
+
|
184
|
+
def remove_search_filter_button
|
185
|
+
link_to content_tag(:i, '', class: 'fa fa-minus-circle'), '#', class: 'remove-search-filter'
|
186
|
+
end
|
187
|
+
|
188
|
+
def birth_months
|
189
|
+
[["Any month", ''], ["January", 1], ["February", 2], ["March", 3], ["April", 4], ["May", 5], ["June", 6], ["July", 7], ["August", 8], ["September", 9], ["October", 10], ["November", 11], ["December", 12]]
|
190
|
+
end
|
191
|
+
|
192
|
+
def birth_days
|
193
|
+
(1..31).to_a.insert(0, ["Any day", ""])
|
194
|
+
end
|
195
|
+
|
196
|
+
def birth_years
|
197
|
+
(1915..2005).to_a.insert(0, ["Any year", ""])
|
198
|
+
end
|
199
|
+
|
200
|
+
def total_people(people, organization)
|
201
|
+
if people.present?
|
202
|
+
content_tag :h3 do
|
203
|
+
"#{people.total_count} out of #{organization.people.size} match your search."
|
204
|
+
end
|
205
|
+
else
|
206
|
+
content_tag :h3 do
|
207
|
+
"No results."
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def display_any_or_all_of(search_junction)
|
213
|
+
search_junction == 'any' ? 'any' : 'all'
|
214
|
+
end
|
215
|
+
|
216
|
+
def keyword_selections
|
217
|
+
[["Action Feed", "Action"], ["Addresses", "Address"], ["Notes", "Note"]]
|
218
|
+
end
|
219
|
+
|
220
|
+
def action_type_selections
|
221
|
+
[['Heard', 'HearAction'], ['Said', 'SayAction'], ['Went', 'GoAction'], ['Helped', 'DoAction'], ['Gave', 'GiveAction'], ['Bought', 'GetAction']]
|
222
|
+
end
|
223
|
+
|
224
|
+
def country_select
|
225
|
+
valid_countries.insert(0, ["Any country", ""])
|
226
|
+
end
|
227
|
+
|
228
|
+
def render_linked_name_for_hit(hit)
|
229
|
+
content = ''
|
230
|
+
|
231
|
+
if hit.stored(:type) == 'Individual'
|
232
|
+
content += content_tag(:i, nil, class: 'fa fa-user')
|
233
|
+
content += ' '
|
234
|
+
content += strip_tags("#{hit.stored(:first_name)} #{hit.stored(:last_name)}")
|
235
|
+
elsif hit.stored(:type) == 'Company'
|
236
|
+
content += content_tag(:i, nil, class: 'fa fa-briefcase')
|
237
|
+
content += ' '
|
238
|
+
content += strip_tags(hit.stored(:company_name))
|
239
|
+
end
|
240
|
+
|
241
|
+
content.html_safe
|
242
|
+
end
|
243
|
+
|
244
|
+
def render_advanced_search_hit_title(hit)
|
245
|
+
if hit.stored(:type) == 'Individual'
|
246
|
+
link_to render_linked_name_for_hit(hit), individual_path(hit.stored(:id))
|
247
|
+
elsif hit.stored(:type) == 'Company'
|
248
|
+
link_to render_linked_name_for_hit(hit), company_path(hit.stored(:id))
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|