92 $result = $this->data->save();
94 if($result->isSuccess())
96 $agent = static::getAgentName($this->getId());
100 \CAgent::RemoveAgent($agent,
"main");
102 \CAgent::AddAgent($agent,
"main",
"N", $this->getCheckInterval()*60);
132 foreach($this->data->entity->getFields() as $fieldName => $field)
134 if(!isset($values[$fieldName]))
138 if($fieldName ==
"ID")
147 $value = $values[$fieldName];
150 $value = ($value ==
"Y");
152 $this->data->set($fieldName, $value);
163 if($this->data->state <> Objectify\State::RAW)
165 $this->data->removeAllActions();
167 foreach($values as $postAction)
169 if($postAction[
"ID"] > 0)
171 $action = Internal\LogNotificationActionTable::wakeUpObject($postAction[
"ID"]);
175 $action = Internal\LogNotificationActionTable::createObject();
177 $action->setNotificationType($postAction[
"NOTIFICATION_TYPE"]);
178 $action->setRecipient($postAction[
"RECIPIENT"]);
179 $action->setAdditionalText($postAction[
"ADDITIONAL_TEXT"]);
181 $this->data->addToActions($action);
251 $notification =
new static($id);
252 $notification->fill();
254 if($notification->getAuditTypeId() ==
'')
260 $interval = intval($notification->getCheckInterval());
262 $dateInterval->add(
"-T{$interval}M");
264 $notification->setDateChecked(
new Main\
Type\
DateTime());
265 $result = $notification->data->save();
266 if(!$result->isSuccess())
271 $filter = Query\Query::filter()
272 ->where(
"AUDIT_TYPE_ID", $notification->getAuditTypeId())
273 ->where(
"TIMESTAMP_X",
">", $dateInterval);
275 if($notification->getItemId() <>
'')
277 $filter->whereLike(
"ITEM_ID",
'%'.$notification->getItemId().
'%');
279 if($notification->getUserId() > 0)
281 $filter->where(
"USER_ID", $notification->getUserId());
283 if($notification->getRemoteAddr() <>
'')
285 $filter->whereLike(
"REMOTE_ADDR",
'%'.$notification->getRemoteAddr().
'%');
287 if($notification->getUserAgent() <>
'')
289 $filter->whereLike(
"USER_AGENT",
'%'.$notification->getUserAgent().
'%');
291 if($notification->getRequestUri() <>
'')
293 $filter->whereLike(
"REQUEST_URI",
'%'.$notification->getRequestUri().
'%');
301 if(
$eventCount[
"CNT"] >= $notification->getAlertCount())
305 $notification->send();
308 return static::getAgentName($id);