Skip to content

Commit

Permalink
Merge pull request #677 from Leantime/fixes
Browse files Browse the repository at this point in the history
fix comment and ticket timezone issues with NOW()
  • Loading branch information
marcelfolaron committed Apr 12, 2022
2 parents b819b98 + f2613cb commit 46ff3b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/domain/comments/repositories/class.comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function addComment($values, $module)

$sql = "INSERT INTO zp_comment (
text, userId, date, moduleId, module, commentParent
) VALUES (:text, :userId, NOW(), :moduleId, :module, :commentParent)";
) VALUES (:text, :userId, :date, :moduleId, :module, :commentParent)";

$stmn = $this->db->database->prepare($sql);

Expand All @@ -122,6 +122,7 @@ public function addComment($values, $module)
$stmn->bindValue(':commentParent', $values['commentParent'], PDO::PARAM_INT);
$stmn->bindValue(':text', $values['text'], PDO::PARAM_STR);
$stmn->bindValue(':module', $module, PDO::PARAM_STR);
$stmn->bindValue(':date', date("Y-m-d H:i:s"), PDO::PARAM_STR);

$result = $stmn->execute();
$stmn->closeCursor();
Expand Down
4 changes: 3 additions & 1 deletion src/domain/tickets/repositories/class.tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ public function addTicketChange($userId,$ticketId,$values)
$sql = "INSERT INTO zp_tickethistory (
userId, ticketId, changeType, changeValue, dateModified
) VALUES (
:userId, :ticketId, :changeType, :changeValue, NOW()
:userId, :ticketId, :changeType, :changeValue, :date
)";

$stmn = $this->db->database->prepare($sql);
Expand All @@ -1235,6 +1235,8 @@ public function addTicketChange($userId,$ticketId,$values)
$stmn->bindValue(':ticketId', $ticketId, PDO::PARAM_INT);
$stmn->bindValue(':changeType', $field, PDO::PARAM_STR);
$stmn->bindValue(':changeValue', $value, PDO::PARAM_STR);
$stmn->bindValue(':date', date("Y-m-d H:i:s"), PDO::PARAM_STR);

$stmn->execute();
}

Expand Down

0 comments on commit 46ff3b2

Please sign in to comment.