The same function is used to get the webapp version, via helpers.
The sandbox panel and the job panel need the sorted list of webapp versions.
They used 2 little different quite complexe syntaxes.
Here those lines are moved to the helpers file with some tiny syntax changes which aims to make them easier to read.
Note : The function return the list of WebappVersion object. It does not change the behaviours, though it has to be mentionned.