id = called_from_landing_page? ? "edit_opportunity" : dom_id(@opportunity) if @opportunity.errors.empty? if called_from_landing_page? page.call "crm.flip_form", :edit_opportunity page.call "crm.set_title", :edit_opportunity, @opportunity.name page << refresh_sidebar(:show, :summary) else page[id].replace :partial => "opportunity", :collection => [ @opportunity ] page[id].visual_effect :highlight, :duration => 1.0 if called_from_index_page? page << refresh_sidebar(:index, :filters) elsif called_from_landing_page?(:accounts) page << refresh_sidebar_for(:accounts, :show, :summary) elsif called_from_landing_page?(:campaigns) page << refresh_sidebar_for(:campaigns, :show, :summary) else page[:recently].replace :partial => "shared/recently" end end else page[id].replace_html :partial => "edit" page.call "crm.create_or_select_account", request.referer =~ /\/accounts\// || @account.id.blank? page.call "crm.date_select_popup", "opportunity_closes_on" page[id].visual_effect :shake, :duration => 0.25, :distance => 6 page[:opportunity_name].focus end