new method to get tasks by relevant criterias

This getItemsFromDB method allow us to build a query with JOIN statement from Tasks, TaskJobs and
TaskJobLogs with commonly used criterias.

For the moment, it's only used by Deploy Package to get running tasks but this method may be used in others
Tasks methods which need refactoring (ie. getTasksInerror, getTasksPlanned, getTaskRunning ...).
cleanup trailing spaces at eol