redmineで新しいチケットを作成する際の「説明」欄に入力雛形を表示させる方法
http://groups.google.com/group/redmine-users-ja/browse_thread/thread/392053708613bf5b/8c3d26822fd29a59?lnk=gst&q=%E9%9B%9B%E5%9E%8B
・プロジェクトのカスタムフィールドに長いテキストで「Template」を作成する。
・プロジェクトのカスタムフィールドに長いテキストで「Template2」を作成する。
・プロジェクトのカスタムフィールドにテキストで「Template2_subject」を作成する。
・/app/models/project.rbに次を追加する。
def template
if cv = custom_values.find(:first, :include =>:custom_field, :conditions => ["custom_fields.name = ?","Template"])
cv.value
end
end
def template2
if cv = custom_values.find(:first, :include =>:custom_field, :conditions => ["custom_fields.name = ?","Template2"])
cv.value
end
end
def template2_subject
if cv = custom_values.find(:first, :include =>:custom_field, :conditions => ["custom_fields.name = ?","Template2_subject"])
cv.value
end
end
・ /app/controllers/issues_controller.rbのdef new内
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)).uniq
と
if request.get? || request.xhr?
の間に下記を記述する。
if (@project.template)
local_temp = @project.template.gsub(/\r\n|\r|\n/, "
")
end
if (@project.template2)
local_temp2 = @project.template2.gsub(/\r\n|\r|\n/, "
")
end
if (@issue.description)
local_description = @issue.description.gsub(/\r\n|\r|\n/, "
")
end
if [10,21].include?(@issue.tracker.id)
@issue.description = @project.template if (@issue.description.blank? || local_description == local_temp2 )
@issue.subject = "" if @issue.subject == @project.template2_subject
elsif [23].include?(@issue.tracker.id)
@issue.description = @project.template2 if (@issue.description.blank? || local_description == @project.template.gsub(/\r\n|\r|\n/, "
"))
@issue.subject = @project.template2_subject if @issue.subject.blank?
elsif (local_description == local_temp || local_description == local_temp2 || @issue.subject == @project.template2_subject )
@issue.subject = "" if @issue.subject == @project.template2_subject
@issue.description = "" if (local_description == local_temp || local_description == local_temp2 )
end
このブログを検索
ページ
ブログ アーカイブ
ラベル
-
秀丸エディタによるバイナリエディタ 「その他」→「コマンド一覧」→「ファイル系」→「バイナリモード」
-
redmineで新しいチケットを作成する際の「説明」欄に入力雛形を表示させる方法 http://groups.google.com/group/redmine-users-ja/browse_thread/thread/392053708613bf5b/8c3d26822fd29...
-
projectsテーブルでidを割り出す。 wikisテーブルでプロジェクトごとのwikiトップidを割り出し。 project_idとwikiのidの割り当て(wiki_id)が完了。 wiki_pagesテーブルでwiki_idを移動したいidへ変更する。
ChatGPTで遊んでみた
https://chat.openai.com/chat 上のサイトで利用できます。 今気になっている商品を調べたいときにも使えます。 例えば 「SwitchBot スマートロックについて教えて」 って聞くと 製品概要を教えてくれます。 「SwitchBot スマートロッ...