Skip to content

Commit

Permalink
[IssueTracker] Tracks "Others Watching" in issue history (#8875)
Browse files Browse the repository at this point in the history
Resolves #8874
  • Loading branch information
sanjay-thiyagarajan committed Sep 5, 2023
1 parent 0ae7a24 commit c7c0141
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ CREATE TABLE `issues_history` (
`issueHistoryID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`newValue` longtext NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID') NOT NULL DEFAULT 'comment',
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID','watching') NOT NULL DEFAULT 'comment',
`issueID` int(11) unsigned NOT NULL,
`addedBy` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`issueHistoryID`),
Expand Down
11 changes: 10 additions & 1 deletion modules/issue_tracker/php/edit.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,16 @@ class Edit extends \NDB_Page implements ETagCalculator
}

// Get changed values to save in history
$historyValues = $this->getChangedValues($issueValues, $issueID, $user);
$issueValuesWithWatching = $issueValues;
if (isset($values['othersWatching'])) {
$usersWatching = $values['othersWatching'];
$issueValuesWithWatching['watching'] = $usersWatching;
}
$historyValues = $this->getChangedValues(
$issueValuesWithWatching,
$issueID,
$user
);

if (!empty($issueID)) {
$db->update('issues', $issueValues, ['issueID' => $issueID]);
Expand Down

0 comments on commit c7c0141

Please # to comment.