= 100 ? 'completed' : 'active'; if ($managerComment === '') { $managerComment = 'Approved and scored by ' . $user['role'] . '.'; } } elseif ($decision === 'reject') { $approvalState = 'rejected'; $status = 'needs_revision'; if ($managerComment === '') { $managerComment = 'Rejected with feedback from ' . $user['role'] . '.'; } } elseif ($managerComment === '') { $managerComment = 'Progress updated by ' . $user['role'] . '.'; } $sql = 'UPDATE okr_items SET current_value = :current_value, target_value = :target_value, score_percent = :score_percent, approval_state = :approval_state, status = :status, manager_comment = :manager_comment WHERE id = :id AND ' . $scopeClause; $stmt = db()->prepare($sql); $stmt->bindValue(':current_value', $currentValue); $stmt->bindValue(':target_value', $targetValue); $stmt->bindValue(':score_percent', $scorePercent); $stmt->bindValue(':approval_state', $approvalState); $stmt->bindValue(':status', $status); $stmt->bindValue(':manager_comment', $managerComment); $stmt->bindValue(':id', $id, PDO::PARAM_INT); foreach ($scopeParams as $key => $value) { $stmt->bindValue($key, $value); } $stmt->execute(); okr_flash('success', 'OKR updated successfully.'); header('Location: okr_detail.php?id=' . $id); exit; } catch (Throwable $exception) { okr_flash('danger', $exception->getMessage()); header('Location: okr_detail.php?id=' . $id); exit; } } $sql = 'SELECT * FROM okr_items WHERE id = :id AND ' . $scopeClause . ' LIMIT 1'; $stmt = db()->prepare($sql); $stmt->bindValue(':id', $id, PDO::PARAM_INT); foreach ($scopeParams as $key => $value) { $stmt->bindValue($key, $value); } $stmt->execute(); $item = $stmt->fetch(); if (!$item) { okr_flash('danger', 'That OKR could not be found in your current scope.'); header('Location: index.php'); exit; } $projectName = okr_app_name(); $projectDescription = okr_meta_description(); $projectImageUrl = env_value('PROJECT_IMAGE_URL'); $flash = okr_pull_flash(); $csrfToken = okr_csrf_token(); ?> <?= e($projectName) ?> · OKR detail

OKR detail

· ·

Key result

Owner: · ·

Current score
%
Current value
Target value
Progress to target %
Objective notes
Latest reviewer comment

Approval workflow

Review and score

>
>
% Recomputed live in the browser
You can view this record, but only leadership roles can change approval status in this first release.

Audit snapshot

  • Created: UTC
  • Updated: UTC
  • Status:
  • Approval: