N°2039 - Apply some suggestion from @Hipska

Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com> o
This commit is contained in:
Stephen Abello
2023-12-26 10:21:59 +01:00
parent 05db99aa69
commit 9af08fa693
2 changed files with 8 additions and 8 deletions

View File

@@ -133,7 +133,7 @@
</list>
</presentation>
<methods>
<method id="ComputePriority">
<method id="DoExecute">
<comment> /**
*
* Create EventiTopNotification for each recipient

View File

@@ -56,12 +56,12 @@ class iTopNewsroomController extends Controller
while($oMessage = $oSet->Fetch())
{
$sTitle = $oMessage->Get('title');
$Message = $oMessage->Get('message');
$sMessage = $oMessage->Get('message');
$sText = <<<HTML
**$sTitle**
$Message
$sMessage
HTML;
$sIcon = $oMessage->Get('icon') !== null ?
@@ -105,11 +105,11 @@ HTML;
$oSearch = DBObjectSearch::FromOQL('SELECT EventiTopNotification WHERE contact_id = :contact_id AND read = "no"');
$oSet = new DBObjectSet($oSearch, array(), array('contact_id' => $iContactId));
while($oMessage = $oSet->Fetch())
while($oEvent = $oSet->Fetch())
{
$oMessage->Set('read', 'yes');
$oMessage->Set('read_date', time());
$oMessage->DBWrite();
$oEvent->Set('read', 'yes');
$oEvent->SetCurrentDate('read_date');
$oEvent->DBWrite();
$iCount++;
}
}
@@ -134,7 +134,7 @@ HTML;
$oEvent = MetaModel::GetObject('EventiTopNotification', $sEventId);
if($oEvent !== null && $oEvent->Get('contact_id') === UserRights::GetContactId()){
$oEvent->Set('read', 'yes');
$oEvent->Set('read_date', time());
$oEvent->SetCurrentDate('read_date');
$oEvent->DBWrite();
$sUrl = $oEvent->Get('url');
header("Location: $sUrl");