RAZ-273 :: Option to copy a folder :: Updated getfoldersfortree() code used in RAZ-583.