Sha256: dcf71942f79a91d4009ea80e1584705a9097a7f5c3a4802f7275522930ec43a5

Contents?: true

Size: 1.65 KB

Versions: 5

Compression:

Stored size: 1.65 KB

Contents

id = dom_id(@opportunity)

if params[:cancel].true?     # <----------------- Hide [Edit Opportunity]

  if called_from_landing_page?
    page.call "crm.flip_form", :edit_opportunity
    page.call "crm.set_title", :edit_opportunity, @opportunity.name
  else                                            # Called from opportunities list item...
    page[id].replace :partial => "opportunity", :collection => [ @opportunity ]
  end

else # <----------------------------------------- Show requested [Edit Opportunity] form.

  if params[:cancel].blank?                       # Called from opportunities list item...
    if @previous                                  # Hide open [Edit Opportunity] form if any.
      if @previous.is_a?(Opportunity)
        page[dom_id(@previous)].replace :partial => "opportunity", :collection => [ @previous ]
      else
        page.call "crm.flick", "opportunity_#{@previous}", :remove
      end
    end
    page.call "crm.highlight_off", id             # Disable onMouseOver for the list item.
    page.call "crm.hide_form", :create_opportunity# Hide [Create Opportunity] form if any.
    page[id].replace_html :partial => "edit"      # Show [Edit Opportunity] form.

  elsif params[:cancel].false?                    # Called from title of the opportunity landing page...
    page[:edit_opportunity].replace_html :partial => "edit"
    page.call "crm.flip_form", :edit_opportunity
    page.call "crm.set_title", :edit_opportunity, "#{t :edit} #{@opportunity.name}"
  end

  page.call "crm.create_or_select_account", request.referer =~ /\/accounts\// || @account.id.blank?
  page[:opportunity_name].focus

  hook(:edit_opportunity_rjs, self, :page => page)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 app/views/opportunities/edit.js.rjs
fat_free_crm-0.12.2 app/views/opportunities/edit.js.rjs
fat_free_crm-0.12.1 app/views/opportunities/edit.js.rjs
fat_free_crm-0.12.0 app/views/opportunities/edit.js.rjs
fat_free_crm-0.11.4 app/views/opportunities/edit.js.rjs