Problem:
In my problems, there are currently 3 custom fields, say FieldA (select list), FieldB (irrelevant) and FieldC (text).
What should happen is that when you save FieldC takes on <FieldA>-<date in Ymd>-<number from database>
As an example, suppose FieldA has the value "Test", and today is the eighth of January 2015. FieldC should be Test-20150108-001, where 001 comes from the user table in the database, which is unique to the FieldA value and is reset every year.
What i did now:
I used the command line script to create a plugin through
ruby script/rails generate redmine_plugin subticket
And the model through
ruby script/rails generate redmine_plugin_model subticket subticket_ids fa:string lastnum:integer year:integer
(where fa is the value of FieldA, lastnum is the last number used for this value, and year is the current year for which lastnum is applicable).
prepend init.rb, , :
require_dependency 'subticket_hooks'
lib/subticket_hooks.rb :
class SubticketHooksListener < Redmine::Hook::ViewListener
def controller_issues_edit_before_save(context={})
issue = context[:issue]
end
end
, / . , , , , (, !)
, , - !