目錄
- 一.插件來(lái)源
- 二.插件測(cè)試人員
- 三.實(shí)測(cè)環(huán)境
- 四.插件概述
- 五.安裝和卸載
- 六.配置和使用
- 七.插件限制
- 八.注意事項(xiàng)
- 九.許可和版權(quán)
- 十.更新日志
- 十一.參考資料
一.插件來(lái)源
插件名稱:Redmine Computed Custom Field (Redmine自定義計(jì)算字段插件)
插件作者: Yakov Annikov
官方站點(diǎn): https://github.com/annikoff/redmine_plugin_computed_custom_field
代碼源: https://github.com/annikoff/redmine_plugin_computed_custom_field
注冊(cè)日期: 2015-09-20 (將近 3 年 ago)
當(dāng)前版本: 1.0.6
適合版本: Redmine 3.4.x
標(biāo)簽: redmine自定義計(jì)算字段插件 redmine_Preview_Office

自定義計(jì)算字段
二.插件測(cè)試人員
- 水士白 WaterWhite
三.實(shí)測(cè)環(huán)境
- Ubuntu 14.04
- Mysql 5.5
- Redmine 3.4.5.stable
- Ruby version 2.1.5-p273 (2014-11-13) [x86_64-linux]
- Rails version 4.2.8
- Environment production
- Database adapter Mysql2
- Git 1.9.1
四.插件概述
- 此插件提供了創(chuàng)建計(jì)算自定義字段的可能性。 計(jì)算字段的值可以通過(guò)公式設(shè)置。 在公式結(jié)構(gòu)中,如cfs [cf_id]被自定義字段的ID替換。 有效公式是在更新自定義對(duì)象時(shí)執(zhí)行的有效Ruby代碼。 要在公式中輸入字段ID,請(qǐng)雙擊可用字段列表中的項(xiàng)目。
五.安裝和卸載
- 從GitHub上克隆插件
$ git clone https://github.com/annikoff/redmine_plugin_computed_custom_field.git computed_custom_field plugins/computed_custom_field
- 運(yùn)行遷移
$ rake redmine:plugins:migrate
- 重啟Redmine服務(wù)
六.配置和使用
- 該插件無(wú)需配置。
- 使用
Examples:
cfs[1]*2+cfs[2]
# means
# custom_field_value(1) * 2 + custom_field_value(2)
(cfs[1]/3.14).round(2)
if cfs[1].zero?
cfs[2]/2
else
cfs[3]/2
end
# For IssueCustomField
(self.estimated_hours || 0) * 2
# For ProjectCustomField
self.parent_id == 2
# If format of Custom Field is Link
"/projects/#{self.project_id.to_s}/issues/new?issue[subject]=Review+request+[##{self.id.to_s} #{self.subject}]&issue[tracker_id]=3"
要編寫(xiě)公式,此文檔可能會(huì)有所幫助:
- Issue
- Project
- User
- TimeEntry
- Version
- Group
- Document
- TimeEntryActivity, IssuePriority, DocumentCategory
七.插件限制
- 無(wú)
八.注意事項(xiàng)
- 這是該插件的新版本。 從版本1.0.0開(kāi)始,它與以前的版本不兼容。 不再支持公式%{cf_id}中的以下結(jié)構(gòu)。 而是使用cfs [cf_id]。 如果您需要從舊版本升級(jí),請(qǐng)查看遷移部分。
cfs [cf_id] - 必須是現(xiàn)有自定義字段的ID。
小心公式中的代碼,如果錯(cuò)誤,您的應(yīng)用程序可能會(huì)崩潰。
如果在創(chuàng)建自定義對(duì)象后創(chuàng)建了計(jì)算自定義字段,則需要重新保存對(duì)象以評(píng)估計(jì)算。
更新公式后,應(yīng)重新保存自定義對(duì)象。
九.許可和版權(quán)
- 無(wú)