diff --git a/actions.php b/actions.php index bce553bc1..5685c4b1c 100644 --- a/actions.php +++ b/actions.php @@ -174,7 +174,7 @@ elseif (filter('op') == 'toggle_check') { $check = Check::find($check_id); if (!empty($check) && $check->assignedUsers->pluck('id')->search($user->id) !== false) { - $check->toggleCheck(); + $check->toggleCheck($user); } else { flash()->error(tr('Impossibile cambiare lo stato del check!')); } diff --git a/modules/checklists/modutil.php b/modules/checklists/modutil.php index 120a0a5c4..46cff9732 100644 --- a/modules/checklists/modutil.php +++ b/modules/checklists/modutil.php @@ -10,7 +10,7 @@ function renderChecklist($check, $level = 0) checked_at) ? 'checked' : '').'> '.$check->content.' - '.(!empty($check->checked_at) ? timestampFormat($check->checked_at).' - '.$check->user->username : '').''; + '.(!empty($check->checked_at) ? timestampFormat($check->checked_at).' - '.$check->checkUser->username : '').''; if ($level == 0) { $result .= ' @@ -20,11 +20,14 @@ function renderChecklist($check, $level = 0) '; } - $result .= ' + if (empty($check->user) || $check->user->id == $user->id) { + $result .= '
-
- + '; + } + + $result .= '