Update report_resource_progress_page.php

When selecting a project (without versions) with subprojects (with versions), the first $f_target_version is referring to a child project, so version_get_id fails to recover info for current project.

I have included a previous check to avoid an "ugly" error. The logic should be reviewed but now is safer ;-)