Ok so hereās where weāre at. Iāve tested ALL the functions in SugarFolders.php (did find some errors). However, for the most part itās working properly.
Iāve also tested most of the functions in EmailUIAjax.php that have to do with folder subscriptions and updates. So far most are working as Iād expect.
However,⦠when you fix the code in SugarFolders.php to actually mark Group Folders as is_group=1 then in the User popup to select folders (in user profile), it causes problems with the JS that creates the list of available and subscribed folders.
The list outputs first as JSON
{āuserFoldersā:⦠folder1, folder2, folder3}ā¦{āgroupFoldersā: folder1, folder2, folder3}
When group folders were incorrectly marked (before I fixed it), they end up in the userFolder array in JSON. Which gives everyone access to add them to their subscriptions. Now that that issue is fixed, the JS currently does not handle the second JSON array {āgroupFoldersā}.
So⦠problem #1
in EmailUI.js retreiveGroupFolderSubscriptions only puts out the ID. So Iāve modified that to put out an array to output the folder name along with the ID and this can be used to create the list.
This should be used in ajax.js in settingsFoldersRefresh: function (and probably more) to output BOTH the results of āuserFoldersā and āgroupFoldersā from the JSON.
Problem #2: The initial output to list doesnāt handle the {groupFolders} either. Need to find exactly where that is too.
So far Iāve also managed to get it to output to the list of folders to subscribe to when one clicks on --none-- to update the folder list.
So once I get them all in the list properly (Iām close), I have to troubleshoot the JS that grabs the selections from the list and does an ajax call to a PHP function in SugarFolders to update the subscribed_folders in the database.
Wow, thought this would be a good PHP project to learn, now Iām having to learn JS, Ajax calls, and JSON.
The thing making this slow is that I have to flush and rebuild all the JS files every time I make a change!! Is there some kind of trick (Iām new to this) to avoid that? Iāve already put SuiteCRM in developer mode.