The attached patch adds a "project" option for org-link-file-path-type. When this is set, links to files under the current project root will be relative, while links elsewhere are absolute. It relies on project.el, which appears to have been added in emacs 25. I used fboundp to check whether the functionality is available, and to silence compiler warnings. I'm not sure if this is the correct way to do it.