Redmine开发帮助
Posted 百思
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redmine开发帮助相关的知识,希望对你有一定的参考价值。
这里先零星记录二次开发用得上的知识点:
1、获取自定义内容,参考此文:
Every customizable redmine object has
custom_field_values
field, that value is array ofCustomFieldValue
. CustomFieldValue contains current value, custom field description and customized object.Needed values i reads and alters by sort out. May be it‘s not best variant, but i acquainted with ruby language not so long ago.
Method for reading custom fields values:
def object_custom_field_value(object, field_name) object.custom_field_values.each do |field| if field.custom_field.name == field_name return field.value end end end
And for changing:
def object_custom_field_set_value(object, field_name, value) object.custom_field_values.each do |field| if field.custom_field.name == field_name field.value = value end end end
以上是关于Redmine开发帮助的主要内容,如果未能解决你的问题,请参考以下文章