freescout-help-desk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.95k stars 488 forks source link

Time Tracking module - allow any/all users to track time? #3769

Closed mrcave closed 7 months ago

mrcave commented 8 months ago

We typically have a single user assigned to a conversation who may loop in other developers for advice. I'd like to be able to capture any non-assigned users' time spent on a ticket as well, but the time tracker currently only allows for the assigned user to track time.

Is it possible to allow any user to track time on a ticket if they are not assigned?

Thanks!

mrcave commented 8 months ago

Testing this at the moment, but looks like commenting out checks for $conversation->user_id = current $user->id are at least allowing the timer to show up. Not sure if this has any implications on the way data is recorded if multiple users are tracking at one time.

In file /Modules/TimeTracking/Providers/TimeTrackingServiceProvider.php ...

Line 183 //$show_timer = false;:

           if ($conversation->user_id != $user->id
                || in_array($conversation->status, [Conversation::STATUS_CLOSED, Conversation::STATUS_SPAM])
            ) {
                //$show_timer = false;
            }

line 227 /*$conversation->user_id != $user->id ||*/:

            if (!count($timelogs) && 
                (/*$conversation->user_id != $user->id ||*/ in_array($conversation->status, [Conversation::STATUS_CLOSED, Conversation::STATUS_SPAM]))
            ) {
                return;
            }
mrcave commented 8 months ago

Update: those lines were not enough. Quite a few more instances of $conversation->user_id that needed to be commented out or adjusted. Seems to be working now but still testing to ensure no DB conflicts.