CS-4863: Makes issue repository function more generic

The getLatestByPublication was too specific and also didn't take languages
into account. Now it's more generic and accepts an array as parameters,
where keys should be fields.
Merge pull request #450 from m038/CS-4863

CS-4863: Makes issue repository function more generic