diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 63b8784c6..3924228e1 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -4730,7 +4730,7 @@ abstract class DBObject implements iDisplay } } $oDate->modify($sModifier); - $this->Set($sAttCode, $oDate->format('Y-m-d H:i:s')); + $this->Set($sAttCode, $oDate->getTimestamp()); } /** diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index bf59af435..8168e7274 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -340,11 +340,9 @@ $(function() this._markOneMessageAsRead(idxProvider, msgId); // ... and open it as intended - if ($(oElem).attr('target') !== 'undefined') { - window.open($(oElem).attr('href'), $(oElem).attr('target')); - } else { - window.location.href = $(oElem).attr('href'); - } + // Note: Default behavior is to open the news on a new tab unless it is specified otherwise + const urlTarget = $(oElem).attr('target') !== 'undefined' ? $(oElem).attr('target') : '_blank'; + window.open($(oElem).attr('href'), urlTarget); // Finally refresh messages $(this.element).popover_menu("togglePopup"); diff --git a/sources/Controller/Newsroom/iTopNewsroomController.php b/sources/Controller/Newsroom/iTopNewsroomController.php index c187782e0..fac160da6 100644 --- a/sources/Controller/Newsroom/iTopNewsroomController.php +++ b/sources/Controller/Newsroom/iTopNewsroomController.php @@ -83,6 +83,7 @@ HTML; 'id' => $oMessage->GetKey(), 'text' => $sText, 'url' => Router::GetInstance()->GenerateUrl(self::ROUTE_NAMESPACE.'.view_event', ['event_id' => $oMessage->GetKey()]), + 'target' => '_self', 'start_date' => $oMessage->Get('date'), 'priority' => $oMessage->Get('priority'), 'image' => $sIcon,