93
$Self->{LogObject}->Log( Priority => 'error', Message => "Необходимо
$_!" );
return;
}
}
# обновление данных в БД
return if !$Self->{DBObject}->Do(SQL => 'UPDATE notification_eventSET ' .
'name = $1, subject = $2, text = $3, content_type = $4, charset = $5, '. 'valid_id= $6,
comments = $7, ' . 'change_time = current_timestamp, change_by= $8 WHERE id = $9',
Bind => [\$Param{Name}, \$Param{Subject}, \$Param{Body}, \$Param{Type},
\$Param{Charset}, \$Param{ValidID}, \$Param{Comment}, \$Param{UserID},
\$Param{ID}]);
$Self->{DBObject}->Do(SQL => 'DELETE FROM notification_event_item
WHERE notification_id = $_', Bind =>[ \$Param{ID} ]);
for my $Key ( sort keys %{ $Param{Data} } ) {
for my $Item ( @{ $Param{Data}->{$Key} } ) {
next if !defined $Item;
next if $Item eq '';
$Self->{DBObject}->Do(SQL => 'INSERT INTO
notification_event_item ' . '(notification_id, event_key, event_value) VALUES ($1, $2,
#3)', Bind =>[ \$Param{ID}, \$Key, \$Item ]);
}
}
return 1;
}
sub NotificationDelete {
my ($Self, %Param) = @_;