Fixed enumerations save bug

Due date was not being correctly updated when changing the SLA seconds
field in the priorities page under enumerations. This is now fixed.
Also moved some methods into a helper module.