mtierltd / timetracker

GNU Affero General Public License v3.0
82 stars 27 forks source link

Don't rename activity on stopping the timer #213

Open kralan opened 1 year ago

kralan commented 1 year ago

Currently, whenever a timer is stopped, all running activities are renamed to the contents of the what have you done field. This also happens to activities which already have a name. For me, this is not an expected behavior and not being aware of this can have the side effect of losing track of what you have actually done.

While I don't really see the point of naming an activity when the timer is stopped, I would definitely not change an already existing name.

Therefore, I propose changing the function stopTimer in AjaxController.php to omit

if ($name != 'no description')
    $r->setName($name);

If there is a reason why you need to name an activity when stopping a timer, please do so only if there is not already a name to that activity, changing the statement to something like

if ($name != 'no description' && empty($r->getName()))
    $r->setName($name);