My custom edit for EspoCRM, feel free to use and adopt to it.
Hopefully it is not outdate, but I will add my modification here for EspoCRM.
You can use it as reference or guide or just download and extract the file. Hopefully it work for you.
I'm not a coder and have very basic understand and sometime I don't update it but it should work for v7+