Removed gettext and simplified_localization-plugin. L18n is now the appropriate module.

Upgraded to rails 2.2.2 and replaced complex foodsoft.rb-loader with simple
initializers/load_app_config.rb. Multiple foodcoops option is temporarly deactivated.
This commit is contained in:
Benjamin Meichsner 2009-01-06 15:45:19 +01:00
parent 5b9a7e05df
commit 9f8d0d28ac
121 changed files with 1197 additions and 15237 deletions

View file

@ -1,12 +1,7 @@
require 'user'
class ApplicationController < ActionController::Base
# Gettext For i18n
# locale is chosen through browser http request
init_gettext "foodsoft"
before_filter :select_foodcoop, :authenticate, :store_controller
# before_filter :ensureUTF8
#before_filter :select_foodcoop
before_filter :authenticate, :store_controller
after_filter :send_email_messages, :remove_controller
# sends a mail, when an error occurs
@ -56,12 +51,12 @@ class ApplicationController < ActionController::Base
private
# selects the foodcoop depending on the subdomain
def select_foodcoop
# get subdomain and set FoodSoft-class-variable (for later config-requests)
FoodSoft.subdomain = request.subdomains.first
# set database-connection
ActiveRecord::Base.establish_connection(FoodSoft.get_database)
end
# def select_foodcoop
# # get subdomain and set FoodSoft-class-variable (for later config-requests)
# FoodSoft.subdomain = request.subdomains.first
# # set database-connection
# ActiveRecord::Base.establish_connection(FoodSoft.get_database)
# end
# Ensures the HTTP content-type encoding is set to "UTF-8" for "text/html" contents.
def ensureUTF8

View file

@ -163,7 +163,7 @@ class FinanceController < ApplicationController
def createArticleResult
render :update do |page|
@article = OrderArticleResult.new(params[:order_article_result])
@article.fc_markup = FoodSoft::getPriceMarkup
@article.fc_markup = APP_CONFIG[:price_markup]
@article.make_gross if @article.tax && @article.deposit && @article.net_price
if @article.valid?
@article.save

View file

@ -118,7 +118,7 @@ class MessagesController < ApplicationController
@message = Message.new(
:recipient => message.sender,
:subject => "Re: #{message.subject}",
:body => "#{message.sender.nick} schrieb am #{FoodSoft::format_date(message.created_on)} um #{FoodSoft::format_time(message.created_on)}:\n"
:body => "#{message.sender.nick} schrieb am #{I18n.l(message.created_on.to_date)} um #{I18n.l(message.created_on, :format => :time)}:\n"
)
if (message.body)
message.body.each_line{|l| @message.body += "> #{l}"}

View file

@ -133,13 +133,13 @@ class OrdersController < ApplicationController
def text_fax_template
order = Order.find(params[:id])
supplier = order.supplier
contact = FoodSoft.getFoodcoopContact
text = _("Order for") + " #{FoodSoft.getFoodcoopName}"
contact = APP_CONFIG[:contact].symbolize_keys
text = _("Order for") + " #{APP_CONFIG[:name]}"
text += "\n" + _("Customer number") + ": #{supplier.customer_number}" unless supplier.customer_number.blank?
text += "\n" + _("Delivery date") + ": "
text += "\n\n#{supplier.name}\n#{supplier.address}\nFAX: #{supplier.fax}\n\n"
text += "****** " + _("Shipping address") + "\n\n"
text += "#{FoodSoft.getFoodcoopName}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
text += "#{APP_CONFIG[:name]}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
text += "****** " + _("Articles") + "\n\n"
text += _("Number") + " " + _("Quantity") + " " + _("Name") + "\n"
# now display all ordered articles