Skip to content

Set Ticket modified field on create and update#3142

Merged
marcelfolaron merged 4 commits intoLeantime:masterfrom
ITK-Leantime:feature/ticket-modified
Oct 13, 2025
Merged

Set Ticket modified field on create and update#3142
marcelfolaron merged 4 commits intoLeantime:masterfrom
ITK-Leantime:feature/ticket-modified

Conversation

@tuj
Copy link
Contributor

@tuj tuj commented Oct 3, 2025

Description

  • Set Ticket modified field on create and update.
  • Called closeCursor before return.

Link to ticket

#3141

Type

  • Fix
  • Feature
  • Cleanup

@tuj tuj requested a review from a team as a code owner October 3, 2025 12:16
@tuj tuj requested review from broskees and removed request for a team October 3, 2025 12:16
@CLAassistant
Copy link

CLAassistant commented Oct 3, 2025

CLA assistant check
All committers have signed the CLA.

@tuj tuj changed the title Feature/ticket modified Set Ticket modified field on create and update Oct 3, 2025
Copy link
Contributor

@marcelfolaron marcelfolaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is helpful. Can you use the dtHelper() function though so we ensure the date stored in the db is based on the users date in UTC.

$stmn->bindValue(':editTo', $values['editTo'], PDO::PARAM_STR);
$stmn->bindValue(':sortIndex', $values['sortIndex'] ?? '', PDO::PARAM_STR);
$stmn->bindValue(':editorId', $values['editorId'], PDO::PARAM_STR);
$stmn->bindValue(':modified', date('Y-m-d H:i:s'), PDO::PARAM_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the dtHelper() function to set the date? That way we ensure the date in the db is set to utc since date() itself will default the server timezone.

so just use: dtHelper()->userNow()->formatDateTimeForDb()


$stmn = $this->db->database->prepare($sql);
$stmn->bindValue(':id', $id, PDO::PARAM_STR);
$stmn->bindValue(':modified', date('Y-m-d H:i:s'), PDO::PARAM_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtHelper()->userNow()->formatDateTimeForDb()

$stmn->bindValue(':id', $id, PDO::PARAM_STR);
$stmn->bindValue(':dependingTicketId', $values['dependingTicketId'], PDO::PARAM_STR);
$stmn->bindValue(':milestoneid', $values['milestoneid'], PDO::PARAM_STR);
$stmn->bindValue(':modified', date('Y-m-d H:i:s'), PDO::PARAM_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtHelper()->userNow()->formatDateTimeForDb()

$stmn->bindValue(':status', $status, PDO::PARAM_INT);
$stmn->bindValue(':sortIndex', $ticketSorting, PDO::PARAM_INT);
$stmn->bindValue(':ticketId', $ticketId, PDO::PARAM_INT);
$stmn->bindValue(':modified', date('Y-m-d H:i:s'), PDO::PARAM_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtHelper()->userNow()->formatDateTimeForDb()


$stmn = $this->db->database->prepare($query);
$stmn->bindValue(':id', $id, PDO::PARAM_STR);
$stmn->bindValue(':modified', date('Y-m-d H:i:s'), PDO::PARAM_STR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtHelper()->userNow()->formatDateTimeForDb()

@tuj tuj requested a review from marcelfolaron October 8, 2025 05:33
@marcelfolaron marcelfolaron merged commit b771400 into Leantime:master Oct 13, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants