devel
This commit is contained in:
parent
cf56c7555a
commit
0ec83db287
|
@ -6,55 +6,55 @@ require 'ezcrypto'
|
||||||
|
|
||||||
class WebmailController < ApplicationController
|
class WebmailController < ApplicationController
|
||||||
include ImapUtils
|
include ImapUtils
|
||||||
|
|
||||||
# Administrative functions
|
# Administrative functions
|
||||||
before_filter :login_required
|
before_filter :login_required
|
||||||
before_filter :obtain_cookies_for_search_and_nav, :only=>[:messages]
|
before_filter :obtain_cookies_for_search_and_nav, :only=>[:messages]
|
||||||
before_filter :load_imap_session
|
before_filter :load_imap_session
|
||||||
after_filter :close_imap_session
|
after_filter :close_imap_session
|
||||||
|
|
||||||
layout "public", :except => [:view_source, :download]
|
layout "public", :except => [:view_source, :download]
|
||||||
|
|
||||||
# model :filter, :expression, :mail_pref, :customer
|
# model :filter, :expression, :mail_pref, :customer
|
||||||
|
|
||||||
BOOL_ON = "on"
|
BOOL_ON = "on"
|
||||||
|
|
||||||
def index
|
def index
|
||||||
redirect_to(:action=>"messages")
|
redirect_to(:action=>"messages")
|
||||||
end
|
end
|
||||||
|
|
||||||
def error_connection
|
def error_connection
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh
|
def refresh
|
||||||
@mailbox.reload
|
@mailbox.reload
|
||||||
@folders = @mailbox.folders
|
@folders = @mailbox.folders
|
||||||
redirect_to(:action=>'messages')
|
redirect_to(:action=>'messages')
|
||||||
end
|
end
|
||||||
|
|
||||||
def messages
|
def messages
|
||||||
session["return_to"] = nil
|
session["return_to"] = nil
|
||||||
@search_field = params['search_field']
|
@search_field = params['search_field']
|
||||||
@search_value = params['search_value']
|
@search_value = params['search_value']
|
||||||
|
|
||||||
# handle sorting - tsort session field contains last reverse or no for field
|
# handle sorting - tsort session field contains last reverse or no for field
|
||||||
# and lsort - last sort field
|
# and lsort - last sort field
|
||||||
if session['tsort'].nil? or session['lsort'].nil?
|
if session['tsort'].nil? or session['lsort'].nil?
|
||||||
session['lsort'] = "DATE"
|
session['lsort'] = "DATE"
|
||||||
session['tsort'] = {"DATE" => true, "FROM" => true, "SUBJECT" => true, "TO" => false}
|
session['tsort'] = {"DATE" => true, "FROM" => true, "SUBJECT" => true, "TO" => false}
|
||||||
end
|
end
|
||||||
|
|
||||||
case operation_param
|
case operation_param
|
||||||
when t(:copy) # copy
|
when t(:copy) # copy
|
||||||
msg_ids = []
|
msg_ids = []
|
||||||
messages_param.each { |msg_id, bool|
|
messages_param.each { |msg_id, bool|
|
||||||
msg_ids << msg_id.to_i if bool == BOOL_ON and dst_folder != @folder_name } if messages_param
|
msg_ids << msg_id.to_i if bool == BOOL_ON and dst_folder != @folder_name } if messages_param
|
||||||
folder.copy_multiple(msg_ids, dst_folder) if msg_ids.size > 0
|
folder.copy_multiple(msg_ids, dst_folder) if msg_ids.size > 0
|
||||||
when t(:move) # move
|
when t(:move) # move
|
||||||
msg_ids = []
|
msg_ids = []
|
||||||
messages_param.each { |msg_id, bool|
|
messages_param.each { |msg_id, bool|
|
||||||
msg_ids << msg_id.to_i if bool == BOOL_ON and dst_folder != @folder_name } if messages_param
|
msg_ids << msg_id.to_i if bool == BOOL_ON and dst_folder != @folder_name } if messages_param
|
||||||
folder.move_multiple(msg_ids, dst_folder) if msg_ids.size > 0
|
folder.move_multiple(msg_ids, dst_folder) if msg_ids.size > 0
|
||||||
when t(:delete) # delete
|
when t(:delete) # delete
|
||||||
msg_ids = []
|
msg_ids = []
|
||||||
messages_param.each { |msg_id, bool| msg_ids << msg_id.to_i if bool == BOOL_ON } if messages_param
|
messages_param.each { |msg_id, bool| msg_ids << msg_id.to_i if bool == BOOL_ON } if messages_param
|
||||||
|
@ -67,10 +67,10 @@ class WebmailController < ApplicationController
|
||||||
session['lsort'] = sort_query = params["scc"]
|
session['lsort'] = sort_query = params["scc"]
|
||||||
session['tsort'][sort_query] = (session['tsort'][sort_query]? false : true)
|
session['tsort'][sort_query] = (session['tsort'][sort_query]? false : true)
|
||||||
@search_field, @search_value = session['search_field'], session['search_value']
|
@search_field, @search_value = session['search_field'], session['search_value']
|
||||||
when t(:search) # search
|
when t(:search) # search
|
||||||
session['search_field'] = @search_field
|
session['search_field'] = @search_field
|
||||||
session['search_value'] = @search_value
|
session['search_value'] = @search_value
|
||||||
when t(:show_all) # search
|
when t(:show_all) # search
|
||||||
session['search_field'] = @search_field = nil
|
session['search_field'] = @search_field = nil
|
||||||
session['search_value'] = @search_value = nil
|
session['search_value'] = @search_value = nil
|
||||||
else
|
else
|
||||||
|
@ -78,7 +78,7 @@ class WebmailController < ApplicationController
|
||||||
@search_field = session['search_field']
|
@search_field = session['search_field']
|
||||||
@search_value = session['search_value']
|
@search_value = session['search_value']
|
||||||
end
|
end
|
||||||
|
|
||||||
sort_query = session['lsort']
|
sort_query = session['lsort']
|
||||||
reverse_sort = session['tsort'][sort_query]
|
reverse_sort = session['tsort'][sort_query]
|
||||||
query = ["ALL"]
|
query = ["ALL"]
|
||||||
|
@ -89,50 +89,42 @@ class WebmailController < ApplicationController
|
||||||
@pages = Paginator.new self, 0, get_mail_prefs.wm_rows, @page
|
@pages = Paginator.new self, 0, get_mail_prefs.wm_rows, @page
|
||||||
@messages = folder.messages_search([@search_field, @search_value], sort_query + (reverse_sort ? ' desc' : ' asc'))
|
@messages = folder.messages_search([@search_field, @search_value], sort_query + (reverse_sort ? ' desc' : ' asc'))
|
||||||
else
|
else
|
||||||
|
|
||||||
logger.info "total #{folder.total}"
|
|
||||||
logger.info "prews #{get_mail_prefs.wm_rows}"
|
|
||||||
logger.info "@page #{@page.inspect}"
|
|
||||||
logger.info "========================folder #{folder.messages.count}"
|
|
||||||
|
|
||||||
@pages = Paginator.new self, folder.total, get_mail_prefs.wm_rows, @page
|
@pages = Paginator.new self, folder.total, get_mail_prefs.wm_rows, @page
|
||||||
@messages = folder.messages(@pages.current.first_item - 1, get_mail_prefs.wm_rows, sort_query + (reverse_sort ? ' desc' : ' asc'))
|
@messages = folder.messages(@pages.current.first_item - 1, get_mail_prefs.wm_rows, sort_query + (reverse_sort ? ' desc' : ' asc'))
|
||||||
logger.info "========================folder after #{folder.messages.count}"
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
@msg_id = msg_id_param.to_i
|
@msg_id = msg_id_param.to_i
|
||||||
folder.delete(@msg_id)
|
folder.delete(@msg_id)
|
||||||
redirect_to(:action=>"messages")
|
redirect_to(:action=>"messages")
|
||||||
end
|
end
|
||||||
|
|
||||||
def reply # not ready at all
|
def reply # not ready at all
|
||||||
@msg_id = msg_id_param.to_i
|
@msg_id = msg_id_param.to_i
|
||||||
@imapmail = folder.message(@msg_id)
|
@imapmail = folder.message(@msg_id)
|
||||||
fb = @imapmail.full_body
|
fb = @imapmail.full_body
|
||||||
@tmail = TMail::Mail.parse(fb)
|
@tmail = TMail::Mail.parse(fb)
|
||||||
|
|
||||||
@mail = prepare_mail
|
@mail = prepare_mail
|
||||||
@mail.reply(@tmail, fb, get_mail_prefs.mail_type)
|
@mail.reply(@tmail, fb, get_mail_prefs.mail_type)
|
||||||
|
|
||||||
render :action => 'compose'
|
render :action => 'compose'
|
||||||
end
|
end
|
||||||
|
|
||||||
def forward
|
def forward
|
||||||
@msg_id = msg_id_param.to_i
|
@msg_id = msg_id_param.to_i
|
||||||
@imapmail = folder.message(@msg_id)
|
@imapmail = folder.message(@msg_id)
|
||||||
fb = @imapmail.full_body
|
fb = @imapmail.full_body
|
||||||
@tmail = TMail::Mail.parse(fb)
|
@tmail = TMail::Mail.parse(fb)
|
||||||
|
|
||||||
@mail = prepare_mail
|
@mail = prepare_mail
|
||||||
@mail.forward(@tmail, fb)
|
@mail.forward(@tmail, fb)
|
||||||
|
|
||||||
render :action => 'compose'
|
render :action => 'compose'
|
||||||
end
|
end
|
||||||
|
|
||||||
def compose
|
def compose
|
||||||
if @mail.nil?
|
if @mail.nil?
|
||||||
operation = operation_param
|
operation = operation_param
|
||||||
|
@ -141,13 +133,13 @@ class WebmailController < ApplicationController
|
||||||
encmail = @mail.send_mail
|
encmail = @mail.send_mail
|
||||||
get_imap_session
|
get_imap_session
|
||||||
@mailbox.message_sent(encmail)
|
@mailbox.message_sent(encmail)
|
||||||
|
|
||||||
# delete temporary files (attachments)
|
# delete temporary files (attachments)
|
||||||
@mail.delete_attachments()
|
@mail.delete_attachments()
|
||||||
render :action => :mailsent
|
render :action => :mailsent
|
||||||
elsif operation == t(:add)
|
elsif operation == t(:add)
|
||||||
@mail = create_mail
|
@mail = create_mail
|
||||||
if params['attachment']
|
if params['attachment']
|
||||||
attachment = CDF::Attachment.new(@mail)
|
attachment = CDF::Attachment.new(@mail)
|
||||||
attachment.file = params['attachment']
|
attachment.file = params['attachment']
|
||||||
end
|
end
|
||||||
|
@ -157,7 +149,7 @@ class WebmailController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty # empty trash folder (works for any one else :-))
|
def empty # empty trash folder (works for any one else :-))
|
||||||
folder.messages(0, -1).each{ |message|
|
folder.messages(0, -1).each{ |message|
|
||||||
folder.delete(message)
|
folder.delete(message)
|
||||||
|
@ -165,50 +157,50 @@ class WebmailController < ApplicationController
|
||||||
folder.expunge
|
folder.expunge
|
||||||
redirect_to(:action=>"messages")
|
redirect_to(:action=>"messages")
|
||||||
end
|
end
|
||||||
|
|
||||||
def message
|
def message
|
||||||
@msg_id = msg_id_param
|
@msg_id = msg_id_param
|
||||||
@imapmail = folder.message(@msg_id)
|
@imapmail = folder.message(@msg_id)
|
||||||
folder.mark_read(@imapmail.uid) if @imapmail.unread
|
folder.mark_read(@imapmail.uid) if @imapmail.unread
|
||||||
@mail = TMail::Mail.parse(@imapmail.full_body)
|
@mail = TMail::Mail.parse(@imapmail.full_body)
|
||||||
end
|
end
|
||||||
|
|
||||||
def download
|
def download
|
||||||
msg_id = msg_id_param
|
msg_id = msg_id_param
|
||||||
imapmail = folder.message(msg_id)
|
imapmail = folder.message(msg_id)
|
||||||
mail = TMail::Mail.parse(imapmail.full_body)
|
mail = TMail::Mail.parse(imapmail.full_body)
|
||||||
|
|
||||||
if mail.multipart?
|
if mail.multipart?
|
||||||
get_parts(mail).each { |part|
|
get_parts(mail).each { |part|
|
||||||
return send_part(part) if part.header and part.header['content-type']['name'] == params['ctype']
|
return send_part(part) if part.header and part.header['content-type']['name'] == params['ctype']
|
||||||
}
|
}
|
||||||
render("webmail/noattachment")
|
render("webmail/noattachment")
|
||||||
else
|
else
|
||||||
render("webmail/noattachment")
|
render("webmail/noattachment")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def prefs
|
def prefs
|
||||||
@customer = Customer.find(logged_customer)
|
@customer = Customer.find(logged_customer)
|
||||||
@mailpref = MailPref.find_or_create_by_customer_id logged_customer
|
@mailpref = MailPref.find_or_create_by_customer_id logged_customer
|
||||||
|
|
||||||
if params['op'] == _('Save')
|
if params['op'] == _('Save')
|
||||||
if params['customer']
|
if params['customer']
|
||||||
@customer.fname = params['customer']['fname']
|
@customer.fname = params['customer']['fname']
|
||||||
@customer.lname = params['customer']['lname']
|
@customer.lname = params['customer']['lname']
|
||||||
@customer.save
|
@customer.save
|
||||||
end
|
end
|
||||||
@mailpref.attributes = params["mailpref"]
|
@mailpref.attributes = params["mailpref"]
|
||||||
@mailpref.save
|
@mailpref.save
|
||||||
session["wmimapseskey"] = nil
|
session["wmimapseskey"] = nil
|
||||||
redirect_to(:action=>"messages")
|
redirect_to(:action=>"messages")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Message filters management
|
# Message filters management
|
||||||
def filters
|
def filters
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter
|
def filter
|
||||||
if params['op']
|
if params['op']
|
||||||
@filter = Filter.new(params['filter'])
|
@filter = Filter.new(params['filter'])
|
||||||
|
@ -217,7 +209,7 @@ class WebmailController < ApplicationController
|
||||||
case params['op']
|
case params['op']
|
||||||
when _('Add')
|
when _('Add')
|
||||||
@filter.expressions << Expression.new
|
@filter.expressions << Expression.new
|
||||||
when _('Save')
|
when _('Save')
|
||||||
if params['filter']['id'] and params['filter']['id'] != ""
|
if params['filter']['id'] and params['filter']['id'] != ""
|
||||||
@sf = Filter.find(params['filter']['id'])
|
@sf = Filter.find(params['filter']['id'])
|
||||||
@sf.name, @sf.destination_folder = @filter.name, @filter.destination_folder
|
@sf.name, @sf.destination_folder = @filter.name, @filter.destination_folder
|
||||||
|
@ -236,11 +228,11 @@ class WebmailController < ApplicationController
|
||||||
@expressions = @filter.expressions
|
@expressions = @filter.expressions
|
||||||
else
|
else
|
||||||
@filter = Filter.find(params["id"]) if params["id"]
|
@filter = Filter.find(params["id"]) if params["id"]
|
||||||
@expressions = @filter.expressions
|
@expressions = @filter.expressions
|
||||||
end
|
end
|
||||||
@destfolders = get_to_folders
|
@destfolders = get_to_folders
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_delete
|
def filter_delete
|
||||||
Filter.delete(params["id"])
|
Filter.delete(params["id"])
|
||||||
# reindex other filters
|
# reindex other filters
|
||||||
|
@ -254,7 +246,7 @@ class WebmailController < ApplicationController
|
||||||
@user.serialize_to_file
|
@user.serialize_to_file
|
||||||
redirect_to :action=>"filters"
|
redirect_to :action=>"filters"
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_up
|
def filter_up
|
||||||
filt = @user.filters.find(params['id'])
|
filt = @user.filters.find(params['id'])
|
||||||
ufilt = @user.filters.find_all("order_num = #{filt.order_num - 1}").first
|
ufilt = @user.filters.find_all("order_num = #{filt.order_num - 1}").first
|
||||||
|
@ -265,7 +257,7 @@ class WebmailController < ApplicationController
|
||||||
@user.serialize_to_file
|
@user.serialize_to_file
|
||||||
redirect_to :action=>"filters"
|
redirect_to :action=>"filters"
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_down
|
def filter_down
|
||||||
filt = Filter.find(params["id"])
|
filt = Filter.find(params["id"])
|
||||||
dfilt = @user.filters[filt.order_num]
|
dfilt = @user.filters[filt.order_num]
|
||||||
|
@ -276,7 +268,7 @@ class WebmailController < ApplicationController
|
||||||
@user.serialize_to_file
|
@user.serialize_to_file
|
||||||
redirect_to :action=>"filters"
|
redirect_to :action=>"filters"
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_add
|
def filter_add
|
||||||
@filter = Filter.new
|
@filter = Filter.new
|
||||||
@filter.expressions << Expression.new
|
@filter.expressions << Expression.new
|
||||||
|
@ -285,58 +277,58 @@ class WebmailController < ApplicationController
|
||||||
render "filter"
|
render "filter"
|
||||||
end
|
end
|
||||||
# end of filters
|
# end of filters
|
||||||
|
|
||||||
def view_source
|
def view_source
|
||||||
@msg_id = msg_id_param.to_i
|
@msg_id = msg_id_param.to_i
|
||||||
@imapmail = folder.message(@msg_id)
|
@imapmail = folder.message(@msg_id)
|
||||||
@msg_source = CGI.escapeHTML(@imapmail.full_body).gsub("\n", "<br/>")
|
@msg_source = CGI.escapeHTML(@imapmail.full_body).gsub("\n", "<br/>")
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_complete_for_mail_to
|
def auto_complete_for_mail_to
|
||||||
auto_complete_responder_for_contacts params[:mail][:to]
|
auto_complete_responder_for_contacts params[:mail][:to]
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_complete_for_mail_cc
|
def auto_complete_for_mail_cc
|
||||||
auto_complete_responder_for_contacts params[:mail][:cc]
|
auto_complete_responder_for_contacts params[:mail][:cc]
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_complete_for_mail_bcc
|
def auto_complete_for_mail_bcc
|
||||||
auto_complete_responder_for_contacts params[:mail][:bcc]
|
auto_complete_responder_for_contacts params[:mail][:bcc]
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def auto_complete_responder_for_contacts(value)
|
def auto_complete_responder_for_contacts(value)
|
||||||
# first split by "," and take last name
|
# first split by "," and take last name
|
||||||
searchName = value.split(',').last.strip
|
searchName = value.split(',').last.strip
|
||||||
|
|
||||||
# if there are 2 names search by them
|
# if there are 2 names search by them
|
||||||
if searchName.split.size > 1
|
if searchName.split.size > 1
|
||||||
fname, lname = searchName.split.first, searchName.split.last
|
fname, lname = searchName.split.first, searchName.split.last
|
||||||
conditions = ['customer_id = ? and LOWER(fname) LIKE ? and LOWER(lname) like ?', logged_customer, fname.downcase + '%', lname.downcase + '%']
|
conditions = ['customer_id = ? and LOWER(fname) LIKE ? and LOWER(lname) like ?', logged_customer, fname.downcase + '%', lname.downcase + '%']
|
||||||
else
|
else
|
||||||
conditions = ['customer_id = ? and LOWER(fname) LIKE ?', logged_customer, searchName.downcase + '%']
|
conditions = ['customer_id = ? and LOWER(fname) LIKE ?', logged_customer, searchName.downcase + '%']
|
||||||
end
|
end
|
||||||
@contacts = Contact.find(:all, :conditions => conditions, :order => 'fname ASC',:limit => 8)
|
@contacts = Contact.find(:all, :conditions => conditions, :order => 'fname ASC',:limit => 8)
|
||||||
render :partial => 'contacts'
|
render :partial => 'contacts'
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def additional_scripts()
|
def additional_scripts()
|
||||||
@additional_css = ["webmail/webmail"]
|
@additional_css = ["webmail/webmail"]
|
||||||
@additional_js = ["webmail"]
|
@additional_js = ["webmail"]
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def get_to_folders
|
def get_to_folders
|
||||||
res = Array.new
|
res = Array.new
|
||||||
@folders.each{|f| res << f unless f.name == CDF::CONFIG[:mail_sent] or f.name == CDF::CONFIG[:mail_inbox] }
|
@folders.each{|f| res << f unless f.name == CDF::CONFIG[:mail_sent] or f.name == CDF::CONFIG[:mail_inbox] }
|
||||||
res
|
res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def create_mail
|
def create_mail
|
||||||
m = CDF::Mail.new(user.mail_temporary_path)
|
m = CDF::Mail.new(user.mail_temporary_path)
|
||||||
if params["mail"]
|
if params["mail"]
|
||||||
|
@ -351,24 +343,24 @@ class WebmailController < ApplicationController
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
m.from, m.content_type = user.friendlly_local_email, get_mail_prefs.mail_type
|
m.from, m.content_type = user.friendlly_local_email, get_mail_prefs.mail_type
|
||||||
end
|
end
|
||||||
m.customer_id = logged_customer
|
m.customer_id = logged_customer
|
||||||
m
|
m
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_mail
|
def prepare_mail
|
||||||
m = CDF::Mail.new(user.mail_temporary_path)
|
m = CDF::Mail.new(user.mail_temporary_path)
|
||||||
m.from, m.content_type = user.friendlly_local_email, get_mail_prefs.mail_type
|
m.from, m.content_type = user.friendlly_local_email, get_mail_prefs.mail_type
|
||||||
m
|
m
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def send_part(part)
|
def send_part(part)
|
||||||
if part.content_type == "text/html"
|
if part.content_type == "text/html"
|
||||||
disposition = "inline"
|
disposition = "inline"
|
||||||
elsif part.content_type.include?("image/")
|
elsif part.content_type.include?("image/")
|
||||||
disposition = "inline"
|
disposition = "inline"
|
||||||
else
|
else
|
||||||
disposition = "attachment"
|
disposition = "attachment"
|
||||||
end
|
end
|
||||||
headers['Content-Length'] = part.body.size
|
headers['Content-Length'] = part.body.size
|
||||||
|
@ -377,48 +369,48 @@ class WebmailController < ApplicationController
|
||||||
headers['Content-Disposition'] = disposition << %(; filename="#{part.header['content-type']['name']}")
|
headers['Content-Disposition'] = disposition << %(; filename="#{part.header['content-type']['name']}")
|
||||||
render :text => part.body
|
render :text => part.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_parts(mail)
|
def get_parts(mail)
|
||||||
parts = Array.new
|
parts = Array.new
|
||||||
parts << mail
|
parts << mail
|
||||||
mail.parts.each { |part|
|
mail.parts.each { |part|
|
||||||
if part.multipart?
|
if part.multipart?
|
||||||
parts = parts.concat(get_parts(part))
|
parts = parts.concat(get_parts(part))
|
||||||
elsif part.content_type and part.content_type.include?("rfc822")
|
elsif part.content_type and part.content_type.include?("rfc822")
|
||||||
parts = parts.concat(get_parts(TMail::Mail.parse(part.body))) << part
|
parts = parts.concat(get_parts(TMail::Mail.parse(part.body))) << part
|
||||||
else
|
else
|
||||||
parts << part
|
parts << part
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
parts
|
parts
|
||||||
end
|
end
|
||||||
|
|
||||||
def obtain_cookies_for_search_and_nav
|
def obtain_cookies_for_search_and_nav
|
||||||
@srch_class = ((cookies['_wmlms'] and cookies['_wmlms'] == 'closed') ? 'closed' : 'open')
|
@srch_class = ((cookies['_wmlms'] and cookies['_wmlms'] == 'closed') ? 'closed' : 'open')
|
||||||
@srch_img_src = ((cookies['_wmlms'] and cookies['_wmlms'] == 'closed') ? 'closed' : 'opened')
|
@srch_img_src = ((cookies['_wmlms'] and cookies['_wmlms'] == 'closed') ? 'closed' : 'opened')
|
||||||
@ops_class = ((cookies['_wmlmo'] and cookies['_wmlmo'] == 'closed') ? 'closed' : 'open')
|
@ops_class = ((cookies['_wmlmo'] and cookies['_wmlmo'] == 'closed') ? 'closed' : 'open')
|
||||||
@ops_img_src = ((cookies['_wmlmo'] and cookies['_wmlmo'] == 'closed') ? 'closed' : 'opened')
|
@ops_img_src = ((cookies['_wmlmo'] and cookies['_wmlmo'] == 'closed') ? 'closed' : 'opened')
|
||||||
end
|
end
|
||||||
|
|
||||||
###################################################################
|
###################################################################
|
||||||
### Some fixed parameters and session variables
|
### Some fixed parameters and session variables
|
||||||
###################################################################
|
###################################################################
|
||||||
def folder
|
def folder
|
||||||
@folders[@folder_name]
|
@folders[@folder_name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def msg_id_param
|
def msg_id_param
|
||||||
params["msg_id"]
|
params["msg_id"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def messages_param
|
def messages_param
|
||||||
params["messages"]
|
params["messages"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def dst_folder
|
def dst_folder
|
||||||
params["cpdest"]
|
params["cpdest"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def operation_param
|
def operation_param
|
||||||
params["op"]
|
params["op"]
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
# Uncomment below to force Rails into production mode
|
# Uncomment below to force Rails into production mode
|
||||||
# (Use only when you can't set environment variables through your web/app server)
|
# (Use only when you can't set environment variables through your web/app server)
|
||||||
|
# ENV['RAILS_ENV'] = 'production'
|
||||||
|
|
||||||
ENV['RAILS_ENV'] = 'production'
|
#RAILS_GEM_VERSION = '2.3.3' unless defined? RAILS_GEM_VERSION
|
||||||
|
|
||||||
#RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
|
|
||||||
|
|
||||||
# Bootstrap the Rails environment, frameworks, and default configuration
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
||||||
require File.join(File.dirname(__FILE__), 'boot')
|
require File.join(File.dirname(__FILE__), 'boot')
|
||||||
|
@ -35,7 +34,7 @@ Rails::Initializer.run do |config|
|
||||||
# Make Active Record use UTC-base instead of local time
|
# Make Active Record use UTC-base instead of local time
|
||||||
config.active_record.default_timezone = :utc
|
config.active_record.default_timezone = :utc
|
||||||
|
|
||||||
#config.i18n.default_locale = "en"
|
config.i18n.default_locale = "en"
|
||||||
|
|
||||||
# Use Active Record's schema dumper instead of SQL when creating the test database
|
# Use Active Record's schema dumper instead of SQL when creating the test database
|
||||||
# (enables use of different database adapters for development and test environments)
|
# (enables use of different database adapters for development and test environments)
|
||||||
|
|
|
@ -45,7 +45,7 @@ pl-PL:
|
||||||
add_filter: Dodaj filtr
|
add_filter: Dodaj filtr
|
||||||
cc: Cc
|
cc: Cc
|
||||||
bcc: Bcc
|
bcc: Bcc
|
||||||
send: Wyslij
|
send: Wyślij
|
||||||
choose_address: Wybierz adres z kontaktów
|
choose_address: Wybierz adres z kontaktów
|
||||||
compose_txt: Utwórz nową wiadomość
|
compose_txt: Utwórz nową wiadomość
|
||||||
attachment: Załącznik
|
attachment: Załącznik
|
||||||
|
|
Loading…
Reference in a new issue