Refactor TasksController: reduce code duplication; behavior not changed.
Refactor TasksController: reduce code duplication; behavior not changed.

digitalnatives/jobsworth,digitalnatives/jobsworth,rafaspinola/jobsworth,arunagw/clockingit,evinoca/clockingit,evinoca/clockingit,ari/jobsworth,rafaspinola/jobsworth,webstream-io/jobsworth,xuewenfei/jobsworth,xuewenfei/jobsworth,xuewenfei/jobsworth,digitalnatives/jobsworth,ari/jobsworth,evinoca/clockingit,webstream-io/jobsworth,ari/jobsworth,arunagw/clockingit,arunagw/clockingit,evinoca/clockingit,digitalnatives/jobsworth,webstream-io/jobsworth,webstream-io/jobsworth,xuewenfei/jobsworth,rafaspinola/jobsworth,digitalnatives/jobsworth,ari/jobsworth,rafaspinola/jobsworth