Hello.
When in Time Tracker the Top-Manager goes to Reports, there is a handy link to "select all" users for the reporting.
If the Top-Manager creates a "favorite report" with the "select all users" option, when later a new user is added to the Group, that new user is not auto-included in the already existing "favorite reports".
My boss (the Top-Manager) created a handful of highly customized favorite reports, and now he is complaining that he has to "check them all over again" so that some newly added users get included in them.
Is there a way to tell a "favorite report" to include all current and also future users of the Group? That would be extremely handy!
Top-manager, Reports and "Select all"
Re: Top-manager, Reports and "Select all"
Old code had this a while ago by treating a NULL value in the field with a special meaning of "all users". However, it was removed due to inconsistencies and some code maintenance difficulties.
Ask your boss if he is able to contribute to the project in any capability, if there is commitment and the need is serious, perhaps we could re-implement this in a more maintainable fashion, which will require some effort, if done properly.
Re: Top-manager, Reports and "Select all"
Thanks for the reply, admin.
My boss is not willing to make a donation to the project, as I suggested him - I think he is not really sure he will stick to using Anuko Time Tracker (but I keep telling him it is a great program, and at the same time simple enough to be easy to use). However, I am willing to contribute a full translation to Spanish, as I see the current one is very incomplete.
Anyway, I have devised a crude hack to make "Favorite Reports" report on all current and future users of a given Group. I modified the file "WEB-INF/lib/ttReportHelper.class.php" and changed this block of code:
...so that it now looks like this:
This way, if a Favorite Report is saved by the Top-Manager selecting "no users at all", such Favorite Report will report on all users in the Group, even on users added in the future to said Group without having to manually add them to that Favorite Report.
I am not really sure if this hack has bad consecuences in other areas of the program. I hope not. Could you validate whether this hack is harmless?
My boss is not willing to make a donation to the project, as I suggested him - I think he is not really sure he will stick to using Anuko Time Tracker (but I keep telling him it is a great program, and at the same time simple enough to be easy to use). However, I am willing to contribute a full translation to Spanish, as I see the current one is very incomplete.
Anyway, I have devised a crude hack to make "Favorite Reports" report on all current and future users of a given Group. I modified the file "WEB-INF/lib/ttReportHelper.class.php" and changed this block of code:
Code: Select all
// Prepare sql query part for user list.
$userlist = $options['users'] ? $options['users'] : '-1';
if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient())
$user_list_part = " and l.user_id in ($userlist)";
else
Code: Select all
// Prepare sql query part for user list.
$userlist = $options['users'] ? $options['users'] : '-1';
if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) {
// $user_list_part = " and l.user_id in ($userlist)";
if ($userlist == '-1')
$user_list_part = " ";
else
$user_list_part = " and l.user_id in ($userlist)";
} else
I am not really sure if this hack has bad consecuences in other areas of the program. I hope not. Could you validate whether this hack is harmless?
Re: Top-manager, Reports and "Select all"
Translation improvements are always welcome.
Design-wise, this does not look proper.Semper wrote: ↑Mon Jul 01, 2019 7:12 pmThis way, if a Favorite Report is saved by the Top-Manager selecting "no users at all", such Favorite Report will report on all users in the Group, even on users added in the future to said Group without having to manually add them to that Favorite Report.
I am not really sure if this hack has bad consecuences in other areas of the program. I hope not. Could you validate whether this hack is harmless?
How does one know not to select any users and yet expect all users to be included in a report? This is not obvious and is also not logical.
A better way:
- Upon creation a fav report, detect if all active or all inactive users are selected.
- If true, present a dialog asking whether or not they want to include "future users" in such categories, or keep only selected.
- Designate "active_users" and "inactive_users" strings as legit entries in users field in tt_fav_reports table that is saved in the database. Perhaps "all_users" too, but that could be an overkill. For example:
Code: Select all
3,4,5 // users having ids 3, 4, and 5
acrtive_users // all active users
inactive_users // all inactive users
active_users,inactive_users // active and inactive users
active_users,6,7 // active users and users with ids 6 and 7
Re: Top-manager, Reports and "Select all"
I agree with you there.Nik wrote: ↑Tue Jul 02, 2019 1:16 pmDesign-wise, this does not look proper.Semper wrote: ↑Mon Jul 01, 2019 7:12 pmThis way, if a Favorite Report is saved by the Top-Manager selecting "no users at all", such Favorite Report will report on all users in the Group, even on users added in the future to said Group without having to manually add them to that Favorite Report.
I am not really sure if this hack has bad consecuences in other areas of the program. I hope not. Could you validate whether this hack is harmless?
How does one know not to select any users and yet expect all users to be included in a report? This is not obvious and is also not logical.
However, in my use-case scenario I only have several Users and one Top-Manager, so the Top-Manager is a single human who I can train about this "peculiarity" of the program... That's not a solution, just an excuse, I know...
Too complicated IMHO, I think that solution goes against the ethos of simplicity of the program. ¿What about a "virtual user" next to his own checkmark, in the Reports page, called "Report on all current and future users", so that that checkmark is not automatically checked upon clicking on the "select all users link", but so that when that virtual user "Report on all current and future users" is manually checked, then my code change goes into effect?Nik wrote: ↑Tue Jul 02, 2019 1:16 pmA better way:
- Upon creation a fav report, detect if all active or all inactive users are selected.
- If true, present a dialog asking whether or not they want to include "future users" in such categories, or keep only selected.
- Designate "active_users" and "inactive_users" strings as legit entries in users field in tt_fav_reports table that is saved in the database. Perhaps "all_users" too, but that could be an overkill.
Re: Top-manager, Reports and "Select all"
How about an additional dropdown with "active" and "selected" options in the Users section. Active means all current active users in group, subject to access rights.