# -*- coding: utf-8 -*-
# Ruby 1.9 + tmail-1.2.7 環境での
#「Encoding::CompatibilityError (incompatible encoding regexp match (ASCII-8BIT regexp with ISO-2022-JP string))」
# エラー対策。
# Rails の場合 config/initializers/tmail_19_patch.rb などに配置する。
#
module TMail19Jp
def self.encoding_handler(text)
raise unless block_given?
enc = text.encoding
text.force_encoding(Encoding::ASCII_8BIT)
result = yield
text.force_encoding(enc)
result
end
end
module TMail
class Encoder
alias :phrase_org :phrase
# 本文用のパッチ
def phrase(str)
TMail19Jp::encoding_handler(str) do
phrase_org(str)
end
end
end
# Subject欄用のパッチ
class Unquoter
class << self
alias :unquote_and_convert_to_org :unquote_and_convert_to
def unquote_and_convert_to(text, to_charset, from_charset = "iso-8859-1", preserve_underscores=false)
TMail19Jp::encoding_handler(text) do
unquote_and_convert_to_org(text, to_charset, from_charset, preserve_underscores)
end
end
end
end
end
# 本文用のパッチ
class StringOutput
alias :push_org :<<
def <<(str)
TMail19Jp::encoding_handler(str) do
push_org(str)
end
end
end
# From欄用のパッチ
module ActionMailer
module Quoting
alias :quote_address_if_necessary_org :quote_address_if_necessary
def quote_address_if_necessary(address, charset)
TMail19Jp::encoding_handler(address) do
quote_address_if_necessary_org(address, charset)
end
end
end
end
function mypage_updateAccountAction_ajaxCity(res){
createCityOptions(res);
}
あとはこれを展開して市区町村セレクトボックスのリストの内容を書き換えればOKです。
function createCityOptions(res){
var city = document.getElementById("city");
// セレクトボックスを初期化
removeChildren(city);
city.options[0] = new Option("選択してください", null);
if (res != "") {
// カンマで分割し配列に格納
var resArray = res.split(", ");
for (var i = 0; i < resArray.length; i++) {
var detailArray = resArray[i].split("=");
var name = detailArray[0];
var id = detailArray[1];
city.options[i+1] = new Option(name, id);
}
}
}
function removeChildren(x) {
if (x.hasChildNodes()) {
while (x.childNodes.length > 0) {
x.removeChild(x.firstChild)
}
}
}
$ mysql -u root -p mysql —- ここから —- CREATE DATABASE testlink DEFAULT CHARACTER SET utf8; GRANT ALL PRIVILEGES ON testlink.* TO testlink@localhost IDENTIFIED BY ‘********’; FLUSH PRIVILEGES; \q —- ここまで —- ※「Query OK」と表示されればOK
$ cd /var/www/html/testlink/locale/ja_JP $ sudo cp -a strings.txt strings.txt,201211 $ sudo vi strings.txt —- ここから —- //### START 2012/11 ### //$TLS_scope = “適用範囲”; $TLS_scope = “概要”; //### END ### —- ここまで —-
●TestLink設定
http://mydomain.com/testlink/ [New installation] Acceptance of License ■I agree to the terms set out in this license. [Continue] Verification of System and configuration requirements [Continue] Definition of DB access Database name:testlink Database admin login:testlink Database admin password:******** TestLink DB login:testlink TestLink DB password:******** [Process TestLink Setup!] Installation was successful! ※「Failed! – Could not create user: ********!」と表示されるけどOK [Testlink] ログインしてください … ログイン名:admin パスワード:admin [ログイン] [My Settings] Email:admin@mydomain.com Locale:English(wide/UK) ->Japanese [Save] 旧パスワード:admin 新パスワード:******** 新パスワード(確認):******** [パスワード変更]