Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account contacts are showed and refresh in send email, and now you ca…
…n send emails from other users emails
- Loading branch information
jgordor
committed
May 17, 2010
1 parent
b328017
commit 28e5651
Showing
13 changed files
with
92 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= select_tag 'sent_by_email', options_for_select(@users.map { |u| [u.email, u.email] }, @current_user.email), { :style => "width:220px" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
page.remove "add_email_recipient" | ||
if @recipient_number == 2 | ||
page.insert_html :after, 'recipients_1', :text => "<br> Se utilizarán los datos del primer contacto para personalizar las variables del Mensaje" | ||
end | ||
page.insert_html :bottom, "recipients", :partial => "account_recipients" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
page.replace_html "mailing_mail_info", :text => t(:missing_placeholders) | ||
page << "$('mailing_mail_submit').disabled = false" | ||
page.show "mailing_mail_submit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
page << "$('mailing_mail_subject').value = '#{@new_source.subject}'" | ||
page << "$('mailing_mail_body').value = '#{@new_source.body.gsub("\r\n","\\n").gsub("'", "")}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
= select_tag "recipients[#{@recipient_number}]", options_for_select(@mailing_mail.mailable.contacts.map { |c| ["#{c.name} - #{c.email}", c.email] }.insert(0, '').insert(0, ["#{t(:contact_email, @mailing_mail.mailable.name)} - #{@mailing_mail.mailable.email}", @mailing_mail.mailable.email])), { :style => "width:430px" } | ||
- options = options_for_select(@mailing_mail.mailable.contacts.map { |c| ["#{c.name} - #{c.email}", c.email] }.insert(0, '').insert(0, ["#{t(:contact_email, @mailing_mail.mailable.name)} - #{@mailing_mail.mailable.email}", @mailing_mail.mailable.email])) | ||
- onchange_function = @recipient_number == 1 ? remote_function(:url => refresh_with_recipient_mailing_mail_path(@mailing_mail), :method => :get, :with => "'email='+this.options[this.selectedIndex].value") : "" | ||
= t(:to) << ":" | ||
= select_tag "recipients[#{@recipient_number}]", options, { :style => "width:430px", :onchange => onchange_function } | ||
= link_to_remote(t(:add), {:url => add_recipient_mailing_mail_path(@mailing_mail), :method => :get, :with => "{ cancel: Element.visible('#{:recipients}'), related: '#{@recipient_number}' }"}, {:id => "add_email_recipient"}) | ||
%br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ActionController::Routing::Routes.draw do |map| | ||
map.resources :mailings, :has_many => :mailing_mails, :collection => { :search => :get, :auto_complete => :post, :options => :get, :options_mails => :get, :redraw => :post, :redraw_mails => :post }, :member => { :confirm => :get, :addmails => :get, :addtomailing => :get, :check => :get, :start => :get, :attachment => :get, :filter => :any } | ||
map.resources :mailing_mails, :collection => { :search => :get, :auto_complete => :post, :options => :get, :redraw => :post }, :member => { :confirm => :get, :add_recipient => :get } | ||
map.resources :mailing_mails, :collection => { :search => :get, :auto_complete => :post, :options => :get, :redraw => :post }, :member => { :confirm => :get, :add_recipient => :get, :refresh_with_recipient => :get } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddSentByToMailingMails < ActiveRecord::Migration | ||
def self.up | ||
add_column :mailing_mails, :sent_by, :integer | ||
add_column :mailing_mails, :sent_by_email, :string | ||
end | ||
|
||
def self.down | ||
remove_column :mailing_mails, :sent_by | ||
remove_column :mailing_mails, :sent_by_email | ||
end | ||
end |